@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext-800.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/baloo2-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/baloo2-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f3eee4;
  --paper-deep: #e6dfd2;
  --card: #fffcf7;
  --ink: #1c2430;
  --ink-soft: #3d4a5e;
  --line: #1c2430;
  --coral: #be342c;
  --ocean: #1d4ed8;
  --gold: #e6a317;
  --leaf: #1f7a4d;
  --shadow: 4px 4px 0 var(--line);
  --radius: 18px;
  --font: "Nunito", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --display: "Baloo 2", "Nunito", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, #ffd9a8 0 18rem, transparent 19rem),
    radial-gradient(circle at 110% 8%, #c9e7ff 0 16rem, transparent 17rem),
    var(--paper);
}

img { max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--ocean); }

a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid var(--ocean);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.6rem 1rem;
  z-index: 5;
}

.skip:focus { top: 0.75rem; }

.wrap {
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
}

.site-header, .site-footer {
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.brand img { width: 52px; height: 52px; }

.site-footer {
  padding: 2rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.site-footer p { margin: 0.2rem 0; }

.about-line {
  border-top: 2px dashed var(--ink);
  padding-top: 0.8rem;
  margin-top: 0.8rem;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; margin: 0; }

.hero { padding: 1.2rem 0 0.5rem; display: grid; gap: 1.2rem; }

.eyebrow {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--gold);
  font-size: 0.85rem;
}

.hero h1 { font-size: clamp(2.6rem, 8vw, 5.2rem); max-width: 11ch; }

.lede { font-size: 1.2rem; max-width: 38rem; }

.byline { color: var(--ink-soft); }

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3.1rem;
  padding: 0.65rem 1.1rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

.btn:hover { transform: translate(-1px, -1px); }

.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }

.btn-primary { background: var(--coral); color: white; }

.btn-ocean { background: var(--ocean); color: white; }

button:disabled,
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.section-title { margin: 1.6rem 0 0.8rem; font-size: clamp(1.8rem, 3vw, 2.4rem); }

.game-layout { display: grid; gap: 0.8rem; }

.card {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.2rem;
}

.card h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 0.4rem; }

.card ul { padding-left: 1.1rem; margin: 0.6rem 0 1rem; }

.soon { display: grid; gap: 0.55rem; }

.soon li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 2px dashed var(--ink-soft);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  margin: 0;
  color: var(--ink-soft);
  background: transparent;
}

.soon { padding: 0; }

.tag {
  font-size: 0.8rem;
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

body[data-view="play"] .site-header,
body[data-view="play"] .site-footer,
body[data-view="end"] .site-header,
body[data-view="end"] .site-footer { display: none; }

.view { padding-bottom: 2rem; }

.view h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0.4rem 0 0.8rem; }

.setup-grid, .editor-grid { display: grid; gap: 0.9rem; }

label, .field-label { display: block; font-weight: 800; margin-bottom: 0.35rem; }

.field { margin-bottom: 0.9rem; }

input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  min-height: 3rem;
  padding: 0.55rem 0.7rem;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: white;
}

textarea { min-height: 16rem; resize: vertical; }

.help { color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.35rem; }

.choice-row, .inline-options, .team-colors { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip, .color-dot {
  min-height: 2.8rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: white;
  cursor: pointer;
}

.chip[aria-pressed="true"], .set-btn[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}

.color-dot { width: 2.6rem; padding: 0; border-radius: 50%; }

.color-dot[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }

.team-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.set-group { margin-bottom: 1rem; }

.set-group h2 { font-size: 1.25rem; margin-bottom: 0.45rem; }

.set-picks { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.set-btn {
  text-align: left;
  border: 3px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
  max-width: 100%;
}

.set-btn small { display: block; font-weight: 600; color: var(--ink-soft); }

.set-btn[aria-pressed="true"] small { color: #f3eee4; }

.callout {
  border: 3px solid var(--line);
  background: #fff4cc;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  margin: 0.6rem 0 1rem;
}

.stepper { display: flex; align-items: center; gap: 0.5rem; }

.stepper strong { min-width: 2ch; text-align: center; font-size: 1.4rem; }

.play-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.6rem;
  padding: 0.7rem 0 0.8rem;
}

.scoreboard {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.score-pill {
  flex: 1 0 auto;
  min-width: 6.5rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 0.35rem 0.55rem 0.45rem;
  background: white;
}

.score-pill b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1; }

.score-pill.turn { outline: 4px solid var(--ink); outline-offset: 1px; }

.play-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; justify-content: space-between; }

.tool-cluster { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.timer {
  font-family: var(--display);
  font-size: 1.8rem;
  min-width: 3.2rem;
  text-align: center;
}

.timer.low { color: var(--coral); }

.question-panel {
  display: grid;
  align-content: center;
  gap: 0.7rem;
}

.emoji { font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; margin: 0; }

.sentence, .passage {
  margin: 0;
  background: white;
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.passage { white-space: pre-wrap; max-height: 28dvh; overflow: auto; }

.prompt {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1.12;
  text-wrap: balance;
}

.choices { display: grid; gap: 0.55rem; }

.choice {
  text-align: left;
  min-height: 3.6rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 0.7rem 0.9rem;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
}

.choice.picked { outline: 3px solid var(--ocean); outline-offset: 2px; }

.choice.correct {
  background: #d9f5e5;
  box-shadow: 3px 3px 0 var(--leaf);
}

.choice.dim { opacity: 0.55; }

.award-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.award {
  flex: 1 1 8rem;
  min-height: 3.6rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--line);
}

.progress { font-weight: 800; }

.icon-btn { min-width: 3rem; padding-inline: 0.7rem; }

.end-screen { text-align: center; padding-top: 4dvh; position: relative; }

.end-screen h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }

.final-scores { display: grid; gap: 0.5rem; margin: 1rem auto; max-width: 28rem; }

.final-score {
  display: flex;
  justify-content: space-between;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  font-size: 1.3rem;
  background: white;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

dialog {
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  max-width: min(32rem, calc(100% - 1.5rem));
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(28, 36, 48, 0.45); }

.keys { padding-left: 1.1rem; }

.keys kbd {
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 0 0.3rem;
  background: var(--paper);
}

.preview-list { display: grid; gap: 0.4rem; max-height: 22rem; overflow: auto; padding: 0; margin: 0.4rem 0 0; }

.preview-list li { list-style: none; background: white; border: 2px solid var(--line); border-radius: 10px; padding: 0.45rem 0.6rem; }

.error-list { color: var(--coral); padding-left: 1.1rem; }

.saved { display: grid; gap: 0.4rem; margin-top: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 800px) {
  .hero { grid-template-columns: 1.3fr 0.9fr; align-items: end; }
  .game-layout { grid-template-columns: 1.4fr 0.8fr; align-items: stretch; }
  .choices { grid-template-columns: 1fr 1fr; }
  .editor-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
  .setup-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}

@media (min-width: 1100px) {
  body { font-size: 1.15rem; }
  .play-shell { width: min(1200px, calc(100% - 2rem)); margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
