:root {
  color-scheme: light;
  --ink: #121213;
  --muted: #6a6a6c;
  --page: #ffffff;
  --line: #d3d6da;
  --line-dark: #878a8c;
  --tile: #ffffff;
  --green: #6aaa64;
  --green-dark: #538d4e;
  --wrong: #787c7e;
  --yellow: #c9b458;
  --soft: #f1f2f3;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f5f2;
  color: var(--ink);
  font-family: "Noto Sans KR", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 22px 28px;
}

.topbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-ball {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
}

.round-counter {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a,
footer a {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
footer a:hover,
footer a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.article-grid article,
.player-notes article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.article-grid h3,
.player-notes h2 {
  margin-top: 0;
}

.article-grid p,
.player-notes p {
  color: var(--muted);
  line-height: 1.85;
}

.source-note {
  border-left: 5px solid var(--green);
}

.wide-content {
  max-width: 1080px;
}

.notice-box {
  margin: 28px 0;
  padding: 20px 22px;
  border-left: 5px solid var(--yellow);
  background: #fff;
}

.notice-box p {
  margin-bottom: 0;
}

.player-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 48px;
}

.player-tag {
  display: block;
  margin-bottom: 9px;
  color: var(--green-dark);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.source-line {
  margin: 32px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

@media (max-width: 760px) {
  .article-grid,
  .player-notes {
    grid-template-columns: 1fr;
  }
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 0 26px;
  text-align: left;
}

.kicker {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
}

h1 span {
  color: var(--green-dark);
}

.intro {
  max-width: 460px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.game-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.game-card {
  width: 100%;
  padding: 28px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(18, 18, 19, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.player-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.card-header h2 {
  margin: 3px 0 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.04em;
}

.mystery-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  place-items: center;
  border: 2px solid var(--line-dark);
  background: var(--soft);
  font-size: 1rem;
  vertical-align: 3px;
}

.english-name {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.difficulty {
  flex: none;
  padding: 6px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 900;
}

.guess-board {
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.board-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.board-labels,
.guess-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.35fr 0.75fr 0.75fr;
  gap: 8px;
  min-width: 720px;
}

.board-labels {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-align: center;
}

.guess-history {
  display: grid;
  gap: 6px;
}

.guess-cell {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(0.65rem, 1.8vw, 0.8rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
  animation: flip-in 360ms ease both;
}

.guess-cell::before {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  content: "";
}

.guess-cell.correct {
  border-color: var(--green);
  background: #f0f8ef;
}

.guess-cell.wrong {
  border-color: #b7b9bb;
  background: #f3f4f4;
}

.guess-cell.correct::before {
  background: var(--green);
}

.guess-cell.wrong::before {
  background: var(--wrong);
}

.height-arrow {
  flex: none;
  color: var(--wrong);
  font-size: 1rem;
}

@keyframes flip-in {
  0% {
    transform: rotateX(80deg);
  }
  100% {
    transform: rotateX(0);
  }
}

.hint-box {
  margin: 4px 0 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.hint-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hint-eyebrow {
  display: block;
  color: var(--green-dark);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hint-heading h3 {
  margin: 1px 0 0;
  font-size: 1rem;
}

.hint-button {
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: var(--yellow);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.hint-button:disabled {
  cursor: default;
  background: var(--line-dark);
}

.hint-progress {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.66rem;
}

.hint-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.hint-list:empty {
  display: none;
}

.hint-list li {
  padding: 8px 10px;
  border-left: 4px solid var(--yellow);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  animation: hint-in 180ms ease both;
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.clue-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 3px 1px 10px;
}

.clue {
  position: relative;
  min-width: 142px;
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tile);
  transition: border-color 150ms ease, background 150ms ease;
}

.clue::after {
  position: absolute;
  right: 8px;
  top: 6px;
  color: #ececec;
  font-size: 1.6rem;
  font-weight: 900;
  content: attr(data-number);
}

.clue-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
}

.clue-label span {
  color: var(--green-dark);
}

.clue-input {
  position: relative;
  z-index: 2;
  width: calc(100% - 32px);
  min-width: 0;
  padding: 7px 3px;
  border: 0;
  border-bottom: 2px solid var(--line-dark);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(0.86rem, 2vw, 1rem);
  font-weight: 800;
}

.clue-input option {
  background: #fff;
  color: var(--ink);
}

.clue-input:focus {
  border-color: var(--ink);
}

.clue-input:disabled {
  cursor: default;
  opacity: 1;
}

.result-icon {
  position: absolute;
  z-index: 3;
  right: 12px;
  top: 42px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 900;
}

.clue.is-correct {
  border-color: var(--green);
  background: #edf7ec;
  box-shadow: inset 0 0 0 1px var(--green);
}

.clue.is-correct .clue-input {
  border-color: var(--green);
  color: #315c2d;
}

.clue.is-correct .result-icon {
  background: var(--green);
  color: #fff;
}

.clue.is-wrong {
  border-color: var(--wrong);
  background: #f0f1f2;
  box-shadow: inset 0 0 0 1px var(--wrong);
}

.clue.is-wrong .clue-input {
  border-color: var(--wrong);
}

.clue.is-wrong .result-icon {
  background: var(--wrong);
  color: #fff;
}

.answer-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.primary-button,
.next-button {
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-button {
  padding: 12px 18px;
}

.primary-button:hover,
.next-button:hover {
  opacity: 0.84;
}

.attempt-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.feedback {
  min-height: 23px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.feedback.correct {
  color: var(--green-dark);
}

.feedback.wrong {
  color: var(--wrong);
}

.side-panel {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr auto;
  gap: 10px;
}

.editorial-section {
  margin-top: 34px;
  padding: 34px;
  border-radius: 14px;
  background: #fff;
}

.editorial-section h2 {
  margin: 5px 0 12px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  letter-spacing: -0.04em;
}

.editorial-section > p:not(.section-kicker) {
  max-width: 850px;
  margin: 0;
  color: #4f4f51;
  line-height: 1.85;
}

.section-kicker {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.info-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.info-grid article > span {
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 900;
}

.info-grid h3 {
  margin: 7px 0 6px;
  font-size: 1rem;
}

.info-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.methodology {
  background: #eef4ed;
}

.text-link,
.primary-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.primary-link {
  padding: 12px 18px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}

.content-page {
  max-width: 820px;
  min-height: 62vh;
  margin: 48px auto;
  padding: clamp(24px, 5vw, 52px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(18, 18, 19, 0.06);
}

.content-page h1 {
  margin: 7px 0 16px;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  letter-spacing: -0.05em;
}

.content-page .lead {
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.content-page h2 {
  margin: 34px 0 9px;
  font-size: 1.25rem;
}

.content-page p,
.content-page li {
  color: #464648;
  font-size: 0.9rem;
  line-height: 1.9;
}

.content-page a:not(.primary-link) {
  color: #376f35;
  font-weight: 700;
}

.content-page li + li {
  margin-top: 6px;
}

.updated {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted) !important;
  font-size: 0.74rem !important;
}

.contact-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form .primary-button {
  justify-self: start;
}

.score-card,
.tip-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  padding: 13px;
}

.score-title {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.score-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.score-main strong {
  font-size: 2rem;
  line-height: 1;
}

.score-main span {
  color: var(--muted);
  font-size: 0.65rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
}

.tip-card {
  padding: 13px;
}

.tip-card strong {
  color: var(--green-dark);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.tip-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

.next-button {
  min-width: 126px;
  padding: 0 16px;
}

.next-button[hidden] {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.primary-button:focus-visible,
.next-button:focus-visible,
.hint-button:focus-visible,
.clue-input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

@media (max-width: 660px) {
  .shell {
    padding-inline: 12px;
  }

  .hero {
    display: block;
  }

  .intro {
    margin-top: 14px;
  }

  .game-card {
    padding: 18px 14px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .editorial-section {
    padding: 24px 18px;
  }

  .next-button {
    min-height: 46px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 24px 0 18px;
  }

  .board-labels,
  .guess-row {
    grid-template-columns: 1fr 0.8fr 1.35fr 0.75fr 0.75fr;
    gap: 6px;
  }

  .guess-cell {
    min-height: 42px;
    padding-inline: 2px;
    font-size: 0.58rem;
  }

  .hint-heading {
    align-items: flex-end;
  }

  .hint-button {
    padding-inline: 9px;
  }

  .answer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  footer {
    flex-direction: column;
  }

  footer nav {
    justify-content: flex-start;
  }
}

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