:root{
  /* 홈페이지와 같은 색: 남색 글씨, 파랑 강조, 노랑 포인트 */
  --bg:#f4f6fa; --card:#fff; --ink:#131a2b; --sub:#56607a; --line:#d9deea;
  --accent:#2b5cff; --accent-soft:#e9eeff; --yellow:#ffd43b; --ok:#19a974; --bad:#c2302a; --warn-bg:#fff4d6;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--bg); color:var(--ink); line-height:1.5;
  font-family:"Pretendard","Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",-apple-system,sans-serif;
  padding:env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 24px);
}
.wrap{max-width:560px; margin:0 auto; padding:16px}
.wrap.wide{max-width:1040px}
header.top{display:flex; align-items:center; justify-content:space-between; gap:12px; margin:4px 0 16px}
header.top h1{font-size:24px; font-weight:900; margin:0; letter-spacing:-.03em; display:flex; align-items:center; gap:10px}
header.top h1 a{color:inherit; text-decoration:none; display:flex; align-items:center; gap:8px; font-size:inherit; font-weight:inherit}
header.top h1 i{width:13px; height:13px; border-radius:50%; background:var(--yellow); box-shadow:0 0 0 3px var(--ink); margin-left:3px}
header.top h1 small{font-size:17px; font-weight:700; color:var(--sub); letter-spacing:-.01em}
header.top a{font-size:15px; color:var(--ink); font-weight:700; text-decoration:none}
header.top nav{display:flex; gap:18px}
.panel{background:var(--card); border:2.5px solid var(--ink); border-radius:18px; padding:16px; margin-bottom:14px}
.muted{color:var(--sub); font-size:14px}
.notice{background:var(--warn-bg); border-radius:10px; padding:10px 12px; font-size:14px; margin-bottom:14px}
.notice.bad{background:#fde8e6; color:var(--bad)}
[hidden]{display:none !important}

/* 코드 */
.codebox{display:flex; align-items:center; justify-content:space-between; gap:12px}
.code{font-size:30px; font-weight:800; letter-spacing:.08em; font-variant-numeric:tabular-nums}
.linkbtn{background:none; border:0; color:var(--accent); font-weight:600; font-size:14px; padding:8px 4px; font-family:inherit; cursor:pointer}

/* 버튼 */
.btn{
  display:flex; align-items:center; justify-content:center; min-height:52px; padding:0 16px;
  border-radius:14px; border:2.5px solid var(--ink); background:var(--ink); color:#fff;
  font-size:17px; font-weight:800; font-family:inherit; cursor:pointer; width:100%; text-align:center;
}
.btn.ghost{background:#fff; color:var(--ink)}
.btn.go{background:var(--accent); border-color:var(--accent)}
.btn.small{min-height:42px; font-size:14px; width:auto; padding:0 14px; border-radius:11px; border-width:2px}
.btn.danger{border-color:var(--bad); color:var(--bad); background:#fff}
.btn[disabled]{opacity:.4; pointer-events:none}
.two{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.stack{display:grid; gap:10px}
/* iOS 사파리: display:none 대신 보이지 않게만 */
.file-hidden{position:absolute; width:1px; height:1px; opacity:0; overflow:hidden}
:focus-visible{outline:3px solid var(--accent); outline-offset:2px}

/* 진행 요약 */
.summary{display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin-bottom:8px}
.summary b{font-size:17px}
.bar{height:10px; background:#e6ebf5; border-radius:5px; overflow:hidden}
.bar i{display:block; height:100%; width:0; background:var(--accent); transition:width .2s}

/* 사진 타일 */
.grid{display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:12px}
.tile{position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden; background:#e6ebf5}
.tile img{width:100%; height:100%; object-fit:cover; display:block}
.tile .num{position:absolute; left:4px; top:4px; background:rgba(0,0,0,.6); color:#fff; font-size:11px; padding:1px 6px; border-radius:8px}
.tile .x{position:absolute; right:2px; top:2px; width:30px; height:30px; border:0; border-radius:15px; background:rgba(0,0,0,.6); color:#fff; font-size:16px; line-height:1; cursor:pointer}
.tile .state{position:absolute; inset:auto 0 0 0; padding:3px 4px; font-size:12px; font-weight:700; text-align:center; color:#fff; background:rgba(0,0,0,.55)}
.tile.up .state{background:rgba(43,92,255,.92)}
.tile.done .state{background:var(--ok)}
.tile.fail .state{background:var(--bad)}
.tile.done img{opacity:.75}
.tile .fill{position:absolute; left:0; bottom:0; height:4px; background:var(--yellow); width:0; transition:width .15s}
.tile.fail{cursor:pointer}
.tile.gone{opacity:0; transform:scale(.85); transition:opacity .35s, transform .35s}

/* 완료 안내 */
.done-box{background:#fff; border:2.5px solid var(--ok); border-radius:14px; padding:14px 16px; font-size:15px}
.done-box b{font-size:17px}
.url{word-break:break-all; font-weight:700}

/* 가리기 화면 */
.editor{position:fixed; inset:0; z-index:20; background:#0d1218; display:flex; flex-direction:column; padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
.ed-top{color:#fff; text-align:center; font-size:15px; font-weight:700; padding:12px 16px}
.ed-stage{flex:1; min-height:0; display:flex; align-items:center; justify-content:center; padding:0 8px}
.ed-stage canvas{max-width:100%; max-height:100%; touch-action:none; background:#222; border-radius:4px}
.ed-bar{display:grid; grid-template-columns:1fr .8fr .8fr 1.5fr; gap:6px; padding:12px}
.ed-bar button{min-height:50px; border-radius:12px; border:1.5px solid #5b6675; background:transparent; color:#fff; font-size:15px; font-weight:700; font-family:inherit; cursor:pointer; padding:0 4px; white-space:nowrap}
.ed-bar button.main{background:var(--accent); border-color:var(--accent)}
.ed-bar button[disabled]{opacity:.4}
.tile.ready{cursor:pointer}
.tile .mask{position:absolute; left:4px; bottom:22px; background:#111; color:#fff; font-size:10px; font-weight:700; padding:1px 6px; border-radius:8px}

/* 알림창 */
.overlay{position:fixed; inset:0; background:rgba(15,25,35,.55); display:flex; align-items:center; justify-content:center; padding:20px; z-index:10}
.dialog{background:#fff; border-radius:18px; padding:24px 20px 20px; width:100%; max-width:360px; text-align:center}
.dialog .check{width:56px; height:56px; border-radius:28px; background:var(--ok); color:#fff; font-size:30px; line-height:56px; margin:0 auto 12px}
.dialog .check.warn{background:var(--bad)}
.dialog > b{font-size:19px; display:block}
.dialog p{margin:10px 0 0; font-size:15px; color:var(--sub)}
.dialog p b{color:var(--ink); letter-spacing:.06em}
.dialog .btn{margin-top:18px}

/* PC 화면 */
.code-form{display:flex; gap:10px; flex-wrap:wrap}
.code-form input{
  flex:1 1 220px; min-height:52px; font-size:24px; font-weight:800; letter-spacing:.1em; text-transform:uppercase;
  padding:0 14px; border:2.5px solid var(--ink); border-radius:14px; font-family:inherit; color:var(--ink); background:#fff;
}
.code-form .btn{width:auto; flex:0 0 auto; padding:0 28px}
.toolbar{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:12px}
.toolbar .grow{flex:1}
.cards{display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px}
.card{background:#fff; border:2px solid var(--ink); border-radius:14px; overflow:hidden; display:flex; flex-direction:column}
.card.sel{border-color:var(--accent); box-shadow:0 0 0 3px var(--accent)}
.card .pic{position:relative; aspect-ratio:4/3; background:#e6ebf5; cursor:pointer}
.card .pic img{width:100%; height:100%; object-fit:cover; display:block}
.card .pic input{position:absolute; left:8px; top:8px; width:22px; height:22px}
.card .info{padding:8px 10px; font-size:13px}
.card .info .nm{font-weight:700; word-break:break-all}
.card .info .mt{color:var(--sub)}
.card .info .bad{color:var(--bad); font-weight:700}
.card button{border:0; border-top:1px solid var(--line); background:#fff; color:var(--accent); font-weight:700; padding:10px; font-family:inherit; font-size:14px; cursor:pointer; margin-top:auto}
.empty{text-align:center; color:var(--sub); padding:36px 0}
@media (prefers-reduced-motion:reduce){ .bar i,.tile .fill,.tile.gone{transition:none} }
