/* Podium — 디자인 방향
 *
 * 경쟁작 실사(2026-09-18)에서 나온 판정: 이 장르의 기준선은 NYT(Wordle/Connections)다.
 * 밝은 배경 · 세리프 헤드라인 · 강조색 최소. 몰입형 테마(MapTap 의 우주, 82-0 의
 * 경기장)는 각자의 소재가 근거인데 우리 소재는 활자와 논리라 흉내 낼 이유가 없다.
 * 이 제품의 콘텐츠는 실제 사실이고 신뢰가 자산이라, 형광색은 신뢰를 깎는다.
 *
 * iOS(SF Pro·블러)나 Material 3(동적 색·리플)를 웹에 옮기지 않는다 —
 * 플랫폼 관용구를 옮기면 어느 쪽 사용자에게도 낯설다. 앱은 앱의 문법을 쓴다.
 */

:root {
  --bg: #faf9f7;
  --panel: #ffffff;
  --ink: #16150f;
  --muted: #6b675d;
  --line: #e0ddd4;        /* 장식용 구분선 */
  --edge: #8d8878;        /* 상호작용 경계 — 3:1 이상이어야 한다 */
  --accent: #2f7d4f;        /* 정답에만. 절제된 잉크 그린 */
  --near: #8a7340;
  --radius: 10px;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  --maxw: 640px;
}

/* 다크는 네온이 아니라 잉크 계열로 — 밤에 읽는 신문에 가깝게 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --panel: #1d1c17;
    --ink: #f2efe6;
    --muted: #9c978a;
    --line: #322f27;
    --edge: #7b7565;
    --accent: #6aa87f;
    --near: #b39a6b;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --panel: #1d1c17; --ink: #f2efe6;
  --muted: #9c978a; --line: #322f27; --edge: #7b7565;
  --accent: #6aa87f; --near: #b39a6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0 16px;                 /* 폰 폭 가장자리 여백 */
}

header, main, footer { width: 100%; max-width: var(--maxw); margin-inline: auto; }

header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 28px 0 16px; border-bottom: 1px solid var(--line);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

h2 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; margin: 26px 0 10px;
}

.meta { display: flex; gap: 8px; flex-shrink: 0; }
.pill {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--muted);
}

main { flex: 1; padding: 28px 0 40px; }
.hint { color: var(--muted); font-size: 14px; }
.err { color: var(--near); }

/* 문제 */
.brief { margin: 0 0 20px; font-size: 18px; }
.brief .dir { color: var(--muted); font-size: 15px; }
.clues { margin: 0 0 24px; padding: 0; list-style: none; }
.clues li {
  padding: 9px 0 9px 26px; position: relative; border-bottom: 1px solid var(--line);
}
.clues li::before {
  content: "→"; position: absolute; left: 0; color: var(--muted);
}
.cities { color: var(--muted); }

/* 조각과 자리 */
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; min-height: 42px; }
.chip {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.chip:hover { border-color: var(--ink); }
.chip:active { transform: translateY(1px); }

.slots { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.slot {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; width: 100%;
  border: 1px dashed var(--edge); border-radius: var(--radius); min-height: 52px;
  background: transparent; font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.slot.filled { border-style: solid; border-color: var(--edge); background: var(--panel); }
.slot.picked, .chip.picked {
  border-color: var(--ink); border-style: solid;
  box-shadow: inset 0 0 0 1px var(--ink);
}
.slot:focus-visible, .chip:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.slot .rank {
  color: var(--muted); font-variant-numeric: tabular-nums; width: 26px;
  font-family: var(--font-display);
}
.slot .name { font-weight: 600; }

/* 조작 */
.actions { display: flex; align-items: center; gap: 10px; justify-content: center; }
button {
  font: inherit; border-radius: 999px; border: 1px solid var(--ink);
  background: transparent; color: var(--ink); padding: 11px 22px; cursor: pointer;
}
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button:disabled { opacity: .35; cursor: default; }

input[type="text"] {
  font: inherit; width: 100%; padding: 12px;
  border-radius: var(--radius); border: 1px solid var(--edge);
  background: var(--panel); color: var(--ink);
}

/* 결과 */
.card { width: 100%; max-width: 360px; aspect-ratio: 1; border-radius: var(--radius); display: block; margin: 0 auto 18px; }
.fallback {
  width: 100%; margin-top: 12px; min-height: 90px; background: var(--panel);
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
}

.solution ol, .learn ol { margin: 8px 0 0; padding-left: 20px; }
.solution h2, .learn h2 { font-size: 17px; color: var(--ink); }
.learn ol { list-style: none; padding: 0; }
.learn li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.learn li b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 아카이브 */
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
footer a, .hint a { color: var(--muted); }
.archive { list-style: none; padding: 0; margin: 20px 0 0; }
.archive li { border-bottom: 1px solid var(--line); }
.archive a {
  display: block; padding: 14px 2px; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.archive a:hover { background: var(--panel); }
.archive a .d { font-weight: 600; }
.archive a .a { color: var(--accent); font-size: 13px; margin-left: 8px; }
.archive a .c { color: var(--muted); font-size: 14px; display: block; margin-top: 2px; }

/* 참조 페이지 */
table.rank { width: 100%; border-collapse: collapse; margin: 18px 0; font-variant-numeric: tabular-nums; }
table.rank th, table.rank td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.rank th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
table.rank td.num { text-align: right; }
table.rank td.name { font-weight: 600; }

footer {
  padding: 18px 0 32px; color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
