/* 규칙 찾기 — 위에서부터 증거판(맞음/아님) → 상태 → 카드 제작기 → 버튼.
   증거가 쌓이는 곳이 위, 손이 닿아야 하는 조작은 아래. */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #0a0a0a; color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
main {
  height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 9px;
  padding: max(60px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
}
.score-bar { display: flex; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.score-box {
  flex: 1; background: #161616; border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 6px 4px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-width: 0;
}
.score-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #a0a0a0; }
.score-val, .best-val, .time-val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.new-btn {
  flex: 0 0 auto; font: inherit; color: #0a0a0a; background: #4f9eff; border: none;
  border-radius: 12px; padding: 0 13px; min-height: 56px; cursor: pointer;
  font-weight: 700; font-size: 14px;
}
.new-btn:active { background: #3d8ae8; }

/* ── 증거판 ─────────────────────────────────────────────────────────────── */
.evidence { flex: 1 1 auto; min-height: 0; display: flex; gap: 8px; }
.ev-col {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  border-radius: 14px; padding: 8px 7px; overflow-y: auto;
}
.ev-yes { background: rgba(46,168,92,0.10); border: 1px solid rgba(46,168,92,0.34); }
.ev-no  { background: rgba(224,72,58,0.10); border: 1px solid rgba(224,72,58,0.34); }
.ev-head { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.ev-yes .ev-head { color: #6fd897; }
.ev-no  .ev-head { color: #ff9187; }
.ev-cards { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }

/* ── 카드 ───────────────────────────────────────────────────────────────── */
.rcard {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f4f1e8; border: 1px solid #cdc7b6; border-radius: 7px; padding: 1px;
}
.rcard.sm svg { width: 46px; height: 32px; }

.status { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #a0a0a0; min-height: 19px; flex: 0 0 auto; }
.status.ok { color: #52d97f; }
.status.bad { color: #ff8a8a; }

/* ── 카드 제작기 ────────────────────────────────────────────────────────── */
.build { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }
.build[hidden] { display: none; }
.build-top { display: flex; gap: 10px; align-items: center; }
.preview {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  background: #f4f1e8; border: 2px solid #4f9eff; border-radius: 10px; padding: 3px;
}
.opts { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.opt-row { display: flex; gap: 5px; }
.opt {
  flex: 1; min-width: 0; min-height: 34px; padding: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e9e5da; border: 2px solid transparent; border-radius: 8px; cursor: pointer;
}
.opt.on { border-color: #4f9eff; background: #f6f3ea; }

.act-row { display: flex; gap: 7px; }
.act-btn {
  flex: 1; font: inherit; font-weight: 800; font-size: 15px;
  color: #0a0a0a; background: #4f9eff; border: none; border-radius: 12px;
  min-height: 50px; cursor: pointer;
}
.act-btn:active { background: #3d8ae8; }
.act-btn:disabled { background: #3a4048; color: #8b939c; cursor: default; }
.sure-btn { background: #ffc24d; }
.sure-btn:active { background: #e8ad3d; }

.tests-row { display: flex; justify-content: center; gap: 7px; align-items: baseline; }
.tests-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #8f8f8f; }
.tests-val { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── 마지막 확인 ────────────────────────────────────────────────────────── */
.check { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; }
.check[hidden] { display: none; }
.check-cards { display: flex; flex-direction: column; gap: 7px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row .rcard { flex: 0 0 auto; }
.mark-btn {
  flex: 1; font: inherit; font-weight: 800; font-size: 19px;
  border-radius: 10px; min-height: 46px; cursor: pointer;
  background: #23262b; border: 2px solid #33373e; color: #b9c0c8;
}
.m-yes.on { background: #2fa85c; border-color: #2fa85c; color: #0a0a0a; }
.m-no.on  { background: #e0483a; border-color: #e0483a; color: #0a0a0a; }

.home-link, .hof-link {
  position: fixed; top: max(12px, env(safe-area-inset-top)); z-index: 10;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: rgba(0,0,0,0.35); color: #fff; text-decoration: none;
  font-size: 20px; font-weight: 600; line-height: 1; border: none; cursor: pointer;
  font-family: inherit; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.home-link { left: max(12px, env(safe-area-inset-left)); }
.hof-link { right: max(12px, env(safe-area-inset-right)); }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex;
  align-items: center; justify-content: center; z-index: 20; padding: 20px;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: #161616; border: 1px solid #2a2a2a; border-radius: 18px; padding: 24px 22px;
  display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center;
  min-width: 240px; max-width: 320px; width: 100%;
}
.overlay-card h2 { margin: 0; font-size: 22px; font-weight: 800; }
.overlay-score { margin: 0; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.overlay-sub { margin: -4px 0 0; font-size: 14px; font-weight: 600; color: #a0a0a0; }
.overlay-card button {
  font: inherit; color: #fff; background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 12px 20px;
  min-height: 44px; cursor: pointer; font-weight: 600; font-size: 14px; width: 100%;
}
.overlay-card button:active { background: rgba(255,255,255,0.18); }
.overlay-card .save-btn { background: #4f9eff; border-color: #4f9eff; color: #0a0a0a; }
