/* Human vs AI — Clock Challenge */

:root {
  --bg: #0a0c11;
  --bg-soft: #10131b;
  --panel: #151926;
  --panel-2: #1b2030;
  --line: #262c3d;
  --line-soft: #1e2434;
  --ink: #eef1f7;
  --ink-2: #b9c0d0;
  --dim: #7d879c;
  --accent: #ffc94a;
  --accent-dim: #7a6224;
  --human: #4ade80;
  --you: #60a5fa;
  --ai: #f87171;
  --ok: #34d399;
  --bad: #fb7185;
  --radius: 16px;
  --maxw: 720px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Segoe UI', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.025em; margin: 0; }
p { margin: 0 0 1em; }
button { font-family: inherit; font-size: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 12, 17, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; display: block; }
.brand em { font-style: normal; color: var(--accent); }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a {
  color: var(--dim); font-size: 14px; font-weight: 600;
  padding: 6px 11px; border-radius: 9px;
}
.topbar nav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }

/* ---------- 히어로 ---------- */
.hero { padding: 56px 0 8px; text-align: center; }
.hero .eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 999px; padding: 4px 12px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 7.4vw, 46px); font-weight: 800; margin-bottom: 16px; }
.hero h1 .vs { color: var(--dim); font-weight: 700; }
.hero h1 .hi { color: var(--accent); }
.hero .sub { color: var(--ink-2); font-size: 17px; max-width: 30em; margin: 0 auto 28px; }

.statline {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; margin: 28px 0 8px;
}
.statline div { background: var(--bg-soft); padding: 16px 8px; text-align: center; }
.statline b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.statline span { font-size: 12px; color: var(--dim); }
.statline .h b { color: var(--human); }
.statline .a b { color: var(--ai); }

/* ---------- 카드 ---------- */
.cards { display: grid; gap: 14px; margin: 34px 0; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; color: var(--ink);
  transition: border-color .15s, transform .15s, background .15s;
}
.card:hover { border-color: var(--accent-dim); background: var(--panel-2); text-decoration: none; transform: translateY(-2px); }
.card .tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
}
.card.primary { border-color: var(--accent-dim); }
.card.primary .tag { color: var(--accent); }
.card h3 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.card p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.card .meta { margin-top: 12px; font-size: 13px; color: var(--dim); display: flex; gap: 14px; flex-wrap: wrap; }
.card .meta b { color: var(--ink-2); font-weight: 600; }

/* ---------- 섹션 ---------- */
section.block { padding: 30px 0; border-top: 1px solid var(--line-soft); }
section.block > h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
section.block > .lead { color: var(--dim); font-size: 14px; margin-bottom: 18px; }

/* ---------- 막대 비교 ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 138px) 1fr 52px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-row .who { color: var(--ink-2); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { display: block; height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 999px; background: var(--dim); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.bar-row.human .fill { background: var(--human); }
.bar-row.human .who, .bar-row.human .val { color: var(--human); }
.bar-row.you .fill { background: var(--accent); }
.bar-row.you .who, .bar-row.you .val { color: var(--accent); }
.bar-row.you .who::after { content: ' ←'; }
.bar-row.ai .fill { background: #46506a; }
.bar-row.top .fill { background: var(--ai); }

/* ---------- 문제 화면 ---------- */
.quiz { padding: 20px 0 40px; }
.qbar { display: flex; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 10px; }
.qbar .lv { font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.qbar .kind { color: var(--dim); }
.qbar .count { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }

.clockbox {
  position: relative; width: min(100%, 380px); margin: 0 auto 20px;
  aspect-ratio: 1 / 1; background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 14px; display: flex; align-items: center; justify-content: center;
}
.clockbox svg, .clockbox img { width: 100%; height: 100%; display: block; border-radius: 10px; }
.clockbox img { object-fit: contain; background: #fff; }
.zoomhint { text-align: center; font-size: 12px; color: var(--dim); margin: -10px 0 18px; }

.qtext { font-size: 19px; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: -0.02em; }
.qnote { font-size: 13px; color: var(--dim); text-align: center; margin-bottom: 20px; }
.qnote code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.choice {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 10px; border: 1.5px solid var(--line); border-radius: 13px;
  background: var(--panel); color: var(--ink-2); font-weight: 700; font-size: 15px;
  cursor: pointer; user-select: none; transition: .12s;
}
.choice:hover { border-color: var(--dim); color: var(--ink); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: rgba(255,201,74,.10); color: var(--accent); }
.choice.disabled { pointer-events: none; opacity: .55; }

.timeinput { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 20px; }
.timeinput input {
  width: 78px; padding: 14px 6px; text-align: center;
  font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: .02em;
  background: var(--panel); color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 13px; outline: none; -moz-appearance: textfield;
}
.timeinput input::-webkit-outer-spin-button,
.timeinput input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.timeinput input:focus { border-color: var(--accent); }
.timeinput input::placeholder { color: #39405a; }
.timeinput .sep { font-size: 24px; color: var(--dim); font-weight: 700; }
.timeinput .unit { font-size: 11px; color: var(--dim); }
.timeinput .cell { display: grid; justify-items: center; gap: 4px; }

.btn {
  display: block; width: 100%; padding: 15px; border: 0; border-radius: 13px;
  background: var(--accent); color: #211a00; font-weight: 800; font-size: 16px;
  cursor: pointer; letter-spacing: -0.02em; transition: .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { background: var(--line); color: var(--dim); cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--dim); color: var(--ink); filter: none; }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.feedback { border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; border: 1px solid; }
.feedback.ok { background: rgba(52,211,153,.09); border-color: rgba(52,211,153,.35); }
.feedback.bad { background: rgba(251,113,133,.08); border-color: rgba(251,113,133,.32); }
.feedback .verdict { font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.feedback.ok .verdict { color: var(--ok); }
.feedback.bad .verdict { color: var(--bad); }
.feedback dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: 14px; }
.feedback dt { color: var(--dim); }
.feedback dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.feedback .why { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ---------- 결과 ---------- */
.score { text-align: center; padding: 26px 0 10px; }
.score .ring { width: 176px; height: 176px; margin: 0 auto 14px; position: relative; }
.score .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score .ring .mid {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.score .ring .pct { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.score .ring .raw { font-size: 13px; color: var(--dim); margin-top: 4px; }
.score h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.score .verdictline { color: var(--ink-2); font-size: 15px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tbl th { color: var(--dim); font-weight: 600; font-size: 12px; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tbl td.num.good { color: var(--ok); }
.tbl td.num.mid { color: var(--accent); }
.tbl td.num.poor { color: var(--bad); }

.sharebox { display: grid; gap: 10px; margin-top: 8px; }
.sharegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sharegrid .btn { padding: 12px 6px; font-size: 14px; }
#sharecard { width: 100%; border-radius: 14px; border: 1px solid var(--line); display: block; }

.note { font-size: 13px; color: var(--dim); background: var(--bg-soft);
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }
.note b { color: var(--ink-2); }

.faq details { border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '＋ '; color: var(--accent); }
.faq details[open] summary::before { content: '－ '; }
.faq p { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

footer.site { border-top: 1px solid var(--line-soft); padding: 26px 0 40px; color: var(--dim); font-size: 13px; }
footer.site p { margin: 0 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 90;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 620px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card.primary { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .timeinput input { width: 64px; font-size: 22px; padding: 12px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
