:root {
  --bg: #f7f5ef;
  --paper: #fffdf7;
  --ink: #1d2433;
  --muted: #687085;
  --line: #dfd8c8;
  --red: #df4b38;
  --blue: #2877b9;
  --green: #258b62;
  --gold: #c88b19;
  --rose: #b9476a;
  --shadow: 0 18px 50px rgba(29, 36, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.88), rgba(247, 245, 239, 0.96)),
    repeating-linear-gradient(90deg, rgba(40, 119, 185, 0.06) 0 1px, transparent 1px 44px),
    var(--bg);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(255, 253, 247, 0.92);
  border-bottom: 1px solid rgba(223, 216, 200, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  background: linear-gradient(135deg, #ffcf5d, #f06745 52%, #2877b9);
  color: #fff;
  font-weight: 900;
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.nav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  background: #efe9db;
}

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 48px 0 56px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  word-break: keep-all;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: #3e4658;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

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

.button.primary {
  color: #fff;
  background: var(--ink);
}

.button.secondary {
  background: #ffcf5d;
}

.button.full {
  width: 100%;
}

.hero-panel {
  display: flex;
  justify-content: center;
}

.mini-window {
  width: min(100%, 520px);
  padding: 18px;
  background: #fffaf0;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 16px 16px 0 rgba(29, 36, 51, 0.92);
}

.window-bar {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
}

.window-bar span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.window-bar span:nth-child(1) { background: var(--red); }
.window-bar span:nth-child(2) { background: var(--gold); }
.window-bar span:nth-child(3) { background: var(--green); }

.score-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}

.score-strip span {
  color: #ffcf5d;
  font-size: 13px;
  font-weight: 900;
}

.tile-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  color: #fff;
  font-size: clamp(18px, 4vw, 34px);
  font-weight: 1000;
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
}

.tile.hot { background: var(--red); }
.tile.cool { background: var(--blue); }
.tile.sun { background: var(--gold); }
.tile.ink { background: var(--ink); }
.tile.leaf { background: var(--green); }
.tile.rose { background: var(--rose); }
.tile.sky { background: #50a2d8; }
.tile.gold { background: #e1ad2c; }

.section {
  padding: 56px 0;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats-band div {
  padding: 18px;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-band strong,
.stats-band span {
  display: block;
}

.stats-band strong {
  font-size: 28px;
  line-height: 1.1;
}

.stats-band span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 26px;
}

.section-heading p:last-child,
.page-title p {
  color: var(--muted);
  font-size: 17px;
}

.play-grid,
.cards,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.game-box,
.card,
.game-card {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.game-box {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.game-box p,
.card p,
.game-card p {
  color: var(--muted);
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
}

.game-stats span {
  min-width: 0;
  padding: 9px 8px;
  text-align: center;
  background: #f3efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.game-stats b,
.game-stats small {
  display: block;
  overflow-wrap: anywhere;
}

.game-stats b {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.15;
}

.game-stats small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
}

.tag.red { background: var(--red); }
.tag.blue { background: var(--blue); }
.tag.green { background: var(--green); }
.tag.gold { background: var(--gold); }

.reaction-stage {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 170px;
  margin: auto 0 16px;
  padding: 18px;
  text-align: center;
  border: 2px dashed #c9c0ad;
  border-radius: 8px;
  background: #f3efe5;
  cursor: pointer;
}

.reaction-stage strong {
  font-size: 22px;
}

.reaction-stage span {
  color: var(--muted);
}

.reaction-stage[data-state="waiting"] {
  background: #f9dfd7;
  border-color: var(--red);
}

.reaction-stage[data-state="ready"] {
  background: #dff3e8;
  border-color: var(--green);
}

.reaction-stage[data-state="early"] {
  background: #fff0c7;
  border-color: var(--gold);
}

.reaction-stage[data-state="done"] {
  background: #e8eef8;
  border-color: var(--blue);
}

.number-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: auto 0 14px;
}

.vault-visual {
  position: relative;
  min-height: 44px;
  overflow: hidden;
  background: #efe9db;
  border: 2px solid var(--ink);
  border-radius: 8px;
}

.vault-visual::before {
  position: absolute;
  inset: 50% 10px auto;
  height: 4px;
  content: "";
  background: rgba(29, 36, 51, 0.22);
  border-radius: 999px;
  transform: translateY(-50%);
}

.vault-visual span {
  position: absolute;
  top: 10px;
  bottom: 10px;
  min-width: 8px;
  background: rgba(37, 139, 98, 0.28);
  border: 1px solid rgba(37, 139, 98, 0.56);
  border-radius: 999px;
  transition: left 180ms ease, width 180ms ease, background 180ms ease;
}

.vault-visual span.solved {
  background: rgba(255, 207, 93, 0.76);
  border-color: var(--gold);
}

.vault-visual i {
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--red);
  border-radius: 999px;
  transform: translateX(-50%);
  transition: left 180ms ease;
}

.vault-visual i.ping {
  animation: meter-ping 420ms ease;
}

.input-shake {
  animation: input-shake 180ms ease;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(40, 119, 185, 0.45);
  outline-offset: 3px;
}

.guess-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0 0 12px;
}

.guess-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink);
  background: #efe9db;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.guess-chip.high {
  color: #fff;
  background: var(--blue);
}

.guess-chip.low {
  color: #fff;
  background: var(--red);
}

.guess-chip.correct {
  color: #fff;
  background: var(--green);
}

.result-line {
  min-height: 28px;
  margin: 0 0 14px;
  color: var(--ink) !important;
  font-weight: 900;
}

.text-button,
.inline-link {
  color: var(--blue);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.link-row.compact {
  gap: 14px;
  margin-top: 12px;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: auto 0 14px;
}

.memory-card {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: transparent;
  font-size: 24px;
  font-weight: 1000;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.memory-card:hover:not(:disabled) {
  transform: translateY(-1px);
}

.memory-card span {
  opacity: 0;
  pointer-events: none;
}

.memory-card.revealed,
.memory-card.matched {
  background: #ffcf5d;
  color: var(--ink);
}

.memory-card.revealed span,
.memory-card.matched span {
  opacity: 1;
}

.memory-card.matched {
  background: #dff3e8;
  cursor: default;
}

.editorial {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  padding: 34px;
  margin-bottom: 56px;
  background: #222b3a;
  color: #fff;
  border-radius: 12px;
}

.editorial h2 {
  color: #fff;
}

.editorial p {
  color: #d8dfec;
}

.editorial .eyebrow,
.editorial .inline-link {
  color: #ffcf5d;
}

.subpage {
  padding: 48px 0 74px;
}

.page-title {
  max-width: 850px;
  margin-bottom: 28px;
}

.page-title h1 {
  font-size: clamp(38px, 6vw, 72px);
}

.filter-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: #efe9db;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.filter.active {
  color: #fff;
  background: var(--ink);
}

.game-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.game-list[data-arcade-list] {
  grid-template-columns: repeat(3, 1fr);
}

.game-card h2 {
  margin-top: 12px;
  font-size: 25px;
}

.play-page {
  max-width: 1280px;
}

.arcade-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.arcade-sidebar,
.arcade-stage {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.arcade-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 112px);
  padding: 14px;
  overflow: auto;
}

.arcade-picker {
  display: grid;
  gap: 8px;
}

.picker-item {
  display: grid;
  gap: 1px;
  min-height: 46px;
  padding: 7px 10px;
  color: var(--muted);
  text-align: left;
  background: #f3efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.picker-item strong,
.picker-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.picker-item small {
  font-size: 11px;
  color: inherit;
  opacity: 0.78;
}

.picker-item.active,
.picker-item:hover {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.arcade-stage {
  min-height: 620px;
  padding: 22px;
}

.stage-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.play-surface {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 380px;
  padding: 18px;
  background: #fffaf0;
  border: 2px solid var(--ink);
  border-radius: 8px;
  touch-action: manipulation;
}

.play-surface canvas {
  touch-action: none;
}

.play-guidance {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  color: #3e4658;
  background: #f3efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.play-guidance p {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr;
  gap: 10px;
  margin: 0;
}

.play-guidance strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 1000;
}

.play-guidance span {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}

.policy-note {
  border-color: rgba(200, 139, 25, 0.42);
  background: #fff7dd;
}

.live-motion {
  position: relative;
  min-height: 62px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 253, 247, 0.9), rgba(243, 239, 229, 0.82)),
    repeating-linear-gradient(90deg, rgba(29, 36, 51, 0.1) 0 1px, transparent 1px 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.live-motion::before,
.live-motion::after {
  position: absolute;
  inset: 12px auto 12px 14px;
  width: 38%;
  content: "";
  border-radius: 999px;
}

.live-motion::before {
  background: rgba(40, 119, 185, 0.18);
  animation: live-scan 3.8s linear infinite;
}

.live-motion::after {
  width: 16px;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(223, 75, 56, 0.16);
  animation: live-runner 2.6s ease-in-out infinite;
}

.live-motion-puzzle::after { background: var(--blue); }
.live-motion-brain::after { background: var(--green); }
.live-motion-board::after { background: var(--gold); }
.live-motion-test::after { background: var(--rose); }

.live-dot {
  position: absolute;
  top: calc(12px + (var(--dot-index) % 3) * 14px);
  left: calc(22px + var(--dot-index) * 12%);
  width: 9px;
  height: 9px;
  background: var(--ink);
  border-radius: 50%;
  opacity: 0.38;
  animation: live-dot 1.9s ease-in-out infinite;
  animation-delay: var(--dot-delay);
}

.live-rail {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 13px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(29, 36, 51, 0.38), transparent);
}

.mini-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.mini-score {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.mini-score span {
  padding: 10px;
  text-align: center;
  background: #f3efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-score b,
.mini-score small {
  display: block;
}

.mini-score b {
  font-size: 22px;
  line-height: 1.1;
}

.mini-score small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mini-grid,
.connect-grid,
.match-grid,
.snake-grid {
  display: grid;
  gap: 8px;
}

.mini-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.connect-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.match-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.snake-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.mines-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.mini-cell,
.mini-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  color: var(--ink);
  background: #efe9db;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
}

.mini-cell.active,
.mini-button.active {
  color: #fff;
  background: var(--red);
}

.mini-cell.done {
  color: var(--ink);
  background: #dff3e8;
  cursor: default;
}

.mini-cell.danger {
  color: #fff;
  background: var(--red);
}

.mini-cell.flagged {
  color: #fff;
  background: var(--gold);
}

.mini-cell:disabled {
  opacity: 0.82;
  cursor: default;
}

.target-grid .mini-cell.active,
.mole-grid .mini-cell.active,
.garden-grid .mini-cell.active {
  color: #fff;
  background: var(--green);
}

.memory-mini .mini-cell.open {
  background: #ffcf5d;
}

.arcade-canvas {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  background: #fffaf0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(29, 36, 51, 0.14);
}

.arcade-canvas.tall-canvas {
  max-width: 320px;
}

.arcade-canvas.wide-canvas {
  max-width: 640px;
}

.signal-pad,
.mega-button {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 240px;
  padding: 22px;
  color: var(--ink);
  background: #f3efe5;
  border: 3px solid var(--ink);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.signal-pad strong,
.mega-button {
  font-size: clamp(28px, 6vw, 64px);
  font-weight: 1000;
}

.signal-pad[data-state="wait"] {
  background: #f9dfd7;
}

.signal-pad[data-state="ready"] {
  background: #dff3e8;
}

.signal-pad[data-state="early"] {
  background: #fff0c7;
}

.signal-pad[data-state="done"] {
  background: #e8eef8;
}

.mini-controls,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pad-controls {
  align-items: center;
  justify-content: center;
}

.button.active,
.button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.tictactoe-page,
.tic-game {
  --tic-text-primary: #ffffff;
  --tic-text-secondary: #ffe500;
  --tic-text-muted: #ececec;
  --tic-text-dark: #222222;
  --tic-surface-base: #000000;
  --tic-surface-muted: #12121a;
  --tic-surface-raised: #0a0a0a;
  --tic-line: rgba(255, 229, 0, 0.34);
  --tic-blue: #5ec8ff;
  --tic-orange: #ffb45e;
  --tic-shadow-blue: 0 6px 22px rgba(94, 200, 255, 0.3);
  --tic-shadow-orange: 0 4px 16px rgba(255, 180, 94, 0.2);
  --tic-shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.tictactoe-page .page-title {
  max-width: none;
  padding: 26px;
  color: var(--tic-text-primary);
  background: var(--tic-surface-base);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
  box-shadow: var(--tic-shadow-soft);
}

.tictactoe-page .page-title h1,
.tictactoe-page .page-title p {
  color: var(--tic-text-primary);
}

.tictactoe-page .page-title .eyebrow,
.tictactoe-page .toc-list a {
  color: var(--tic-text-secondary);
}

.tictactoe-page .article,
.tictactoe-page .inline-game-stage {
  color: var(--tic-text-primary);
  background: var(--tic-surface-muted);
  border-color: var(--tic-line);
  box-shadow: var(--tic-shadow-soft);
}

.tictactoe-page .play-surface,
.tictactoe-page .play-guidance {
  color: var(--tic-text-primary);
  background: var(--tic-surface-base);
  border-color: var(--tic-line);
}

.tictactoe-page .play-guidance strong,
.tictactoe-page .play-guidance span {
  color: var(--tic-text-primary);
}

.tictactoe-page .play-guidance strong {
  color: var(--tic-text-secondary);
}

.tictactoe-page .article h2,
.tictactoe-page .article h3,
.tictactoe-page .inline-game-stage h2 {
  color: var(--tic-text-primary);
}

.tictactoe-page .article p,
.tictactoe-page .article ul,
.tictactoe-page .article li,
.tictactoe-page .site-note {
  color: var(--tic-text-muted);
}

.tictactoe-page .article a {
  color: var(--tic-text-secondary);
  font-weight: 900;
}

.tictactoe-page .result-line {
  color: var(--tic-text-secondary) !important;
}

.tic-feature-grid,
.tic-rule-list,
.tic-history {
  display: grid;
  gap: 10px;
}

.tic-feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 0;
}

.tic-feature-card,
.tic-history-item {
  padding: 16px;
  background: var(--tic-surface-raised);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
}

.tic-feature-card strong,
.tic-history-item strong {
  display: block;
  color: var(--tic-text-secondary);
}

.tic-game {
  display: grid;
  gap: 14px;
}

.tic-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tic-scoreboard span {
  display: grid;
  gap: 2px;
  min-height: 66px;
  padding: 10px;
  background: var(--tic-surface-raised);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
}

.tic-scoreboard b {
  color: var(--tic-text-secondary);
  font-size: 24px;
  line-height: 1;
}

.tic-scoreboard small {
  color: var(--tic-text-muted);
  font-size: 13px;
  font-weight: 900;
}

.tic-control-panel {
  display: grid;
  gap: 10px;
}

.tic-control-group {
  display: grid;
  gap: 6px;
}

.tic-control-label {
  color: var(--tic-text-muted);
  font-size: 13px;
  font-weight: 900;
}

.tic-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tic-segment-button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--tic-text-muted);
  background: var(--tic-surface-raised);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.tic-segment-button:hover:not(:disabled),
.tic-segment-button.active {
  color: var(--tic-text-dark);
  background: var(--tic-text-secondary);
  border-color: var(--tic-text-secondary);
}

.tic-segment-button:active:not(:disabled) {
  transform: translateY(1px);
}

.tic-segment-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.tic-board-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--tic-surface-base);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
}

.tic-board {
  display: grid;
  width: min(100%, 390px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tic-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 86px;
  color: var(--tic-text-primary);
  background: var(--tic-surface-muted);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  font: inherit;
  font-size: clamp(42px, 10vw, 72px);
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.tic-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--tic-text-secondary);
  box-shadow: var(--tic-shadow-blue);
}

.tic-cell:active:not(:disabled) {
  transform: translateY(1px);
}

.tic-cell:disabled {
  cursor: default;
  opacity: 1;
}

.tic-cell[data-mark="X"] {
  color: var(--tic-blue);
  border-color: rgba(94, 200, 255, 0.48);
  box-shadow: var(--tic-shadow-blue);
}

.tic-cell[data-mark="O"] {
  color: var(--tic-orange);
  border-color: rgba(255, 180, 94, 0.52);
  box-shadow: var(--tic-shadow-orange);
}

.tic-cell.winning {
  color: var(--tic-text-dark);
  background: var(--tic-text-secondary);
  border-color: var(--tic-text-secondary);
}

.tic-game[aria-busy="true"] .tic-board {
  opacity: 0.78;
}

.tic-status,
.tic-insight {
  margin: 0;
  padding: 12px 14px;
  color: var(--tic-text-primary);
  background: var(--tic-surface-raised);
  border: 1px solid var(--tic-line);
  border-radius: 14px;
}

.tic-insight {
  color: var(--tic-text-secondary);
  font-size: 14px;
  font-weight: 900;
}

.tic-actions {
  justify-content: center;
}

.tic-note {
  color: var(--tic-text-muted);
}

.board-2048 .mini-cell {
  min-height: clamp(58px, 9vw, 96px);
  font-size: clamp(18px, 4vw, 34px);
  transition: transform 0.12s ease, background 0.12s ease;
}

.board-2048 .mini-cell:not([data-value="0"]) {
  transform: scale(0.98);
}

.board-2048 .mini-cell[data-value="2"] { background: #efe9db; }
.board-2048 .mini-cell[data-value="4"] { background: #e4d8bf; }
.board-2048 .mini-cell[data-value="8"] { color: #fff; background: #df8b38; }
.board-2048 .mini-cell[data-value="16"] { color: #fff; background: #df6b38; }
.board-2048 .mini-cell[data-value="32"] { color: #fff; background: #df4b38; }
.board-2048 .mini-cell[data-value="64"] { color: #fff; background: #b9476a; }
.board-2048 .mini-cell[data-value="128"],
.board-2048 .mini-cell[data-value="256"],
.board-2048 .mini-cell[data-value="512"],
.board-2048 .mini-cell[data-value="1024"],
.board-2048 .mini-cell[data-value="2048"] {
  color: #fff;
  background: var(--blue);
}

.snake-grid .mini-cell {
  min-height: 38px;
  font-size: 16px;
}

.snake-grid .snake-head {
  color: #fff;
  background: var(--red);
}

.snake-grid .snake-body {
  color: #fff;
  background: var(--green);
}

.snake-grid .snake-food {
  color: #fff;
  background: var(--gold);
}

.snake-grid .snake-rock {
  color: #fff;
  background: var(--ink);
}

.match-grid .mini-cell {
  min-height: 54px;
  font-size: 28px;
  transition: transform 0.12s ease, background 0.12s ease;
}

.match-grid .mini-cell.active {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px rgba(40, 119, 185, 0.22);
}

.rail-route {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.station-pill {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px;
  text-align: center;
  background: #efe9db;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 1000;
}

.station-pill.active {
  color: #fff;
  background: var(--blue);
}

.station-pill.done {
  color: #fff;
  background: var(--green);
}

.typing-panel {
  display: grid;
  gap: 10px;
}

.typing-panel input.typing-error {
  color: #fff;
  background: var(--red);
}

.perfume-rack {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.perfume-bottle {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  min-height: 210px;
  padding: 10px;
  background: rgba(255, 253, 247, 0.72);
  border: 3px solid var(--ink);
  border-radius: 8px 8px 22px 22px;
  cursor: pointer;
}

.perfume-bottle.selected {
  transform: translateY(-8px);
  box-shadow: 0 0 0 4px rgba(40, 119, 185, 0.22);
}

.perfume-bottle.complete {
  border-color: var(--green);
}

.scent-segment {
  display: grid;
  place-items: center;
  min-height: 32px;
  color: #fff;
  border: 1px solid rgba(29, 36, 51, 0.45);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 1000;
}

.scent-empty {
  background: rgba(223, 216, 200, 0.42);
}

.lane-road,
.slot-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.lane-road span,
.slot-row span,
.dice-face,
.color-card,
.hint-box,
.word-display {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 14px;
  text-align: center;
  background: #f3efe5;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 1000;
}

.lane-road span {
  min-height: 120px;
}

.lane-road .player {
  color: #fff;
  background: var(--blue);
}

.lane-road .danger {
  color: #fff;
  background: var(--red);
}

.slot-row span,
.dice-face {
  font-size: 48px;
}

.slot-row span.spinning,
.dice-face.rolling {
  color: #fff;
  background: var(--ink);
  animation: reel-spin 160ms linear infinite;
}

.slot-row.jackpot span {
  color: var(--ink);
  background: #ffcf5d;
  animation: jackpot-pop 720ms ease;
}

.dice-face.success-pop,
.slot-row span.success-pop {
  animation: success-pop 420ms ease;
}

.dice-face.danger-pop {
  color: #fff;
  background: var(--red);
  animation: danger-pop 420ms ease;
}

.dice-progress {
  height: 12px;
  overflow: hidden;
  background: #efe9db;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.dice-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width 180ms ease;
}

.simon-pad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simon-pad .button {
  min-height: 88px;
  box-shadow: none;
}

.simon-pad .button[data-color="빨강"] { background: #f9dfd7; }
.simon-pad .button[data-color="파랑"] { background: #dbe9f7; }
.simon-pad .button[data-color="초록"] { background: #dff3e8; }
.simon-pad .button[data-color="노랑"] { background: #fff0c7; }

.simon-pad .button.simon-flash {
  color: #fff;
  background: var(--ink);
  animation: simon-flash 520ms ease;
}

.color-card {
  min-height: 150px;
  font-size: 44px;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
}

.sudoku-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sudoku-grid.size-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sudoku-input {
  min-height: 58px;
  text-align: center;
  font-weight: 1000;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf7;
}

.sudoku-input.error {
  color: #fff;
  background: var(--red);
}

.sudoku-input.hinted {
  background: #fff0c7;
}

.sudoku-input.solved {
  color: var(--ink);
  background: #dff3e8;
}

.card-table {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #1f6f52;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px rgba(255, 253, 247, 0.18);
}

.table-row {
  display: grid;
  grid-template-columns: minmax(74px, auto) 1fr auto;
  gap: 12px;
  align-items: center;
  color: #fff;
}

.table-row small {
  min-width: 72px;
  font-weight: 900;
  text-align: right;
}

.card-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playing-card {
  display: grid;
  place-items: center;
  width: 48px;
  min-height: 66px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 1000;
  box-shadow: 3px 3px 0 rgba(29, 36, 51, 0.22);
}

.playing-card.red-card {
  color: var(--red);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.article-page {
  max-width: 930px;
}

.game-detail-page {
  max-width: 1100px;
}

.game-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.inline-game-stage {
  position: sticky;
  top: 92px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inline-game-stage .play-surface {
  min-height: 300px;
}

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

.toc-list a {
  display: inline-flex;
  font-weight: 900;
}

.article {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article h2 {
  margin-top: 34px;
  font-size: 28px;
}

.article h2:first-child {
  margin-top: 0;
}

.article p {
  color: #4d566b;
}

.article ul {
  margin: 14px 0 0;
  padding-left: 22px;
  color: #4d566b;
}

.article li + li {
  margin-top: 8px;
}

.featured-article .detail-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 6px;
}

.featured-article .detail-snapshot div {
  min-width: 0;
  padding: 14px;
  background: #f3efe5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.featured-article .detail-snapshot strong,
.featured-article .detail-snapshot span {
  display: block;
}

.featured-article .detail-snapshot strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 1000;
}

.featured-article .detail-snapshot span {
  color: #4d566b;
  font-size: 14px;
  line-height: 1.55;
}

.detail-list,
.strategy-list,
.mistake-list {
  display: grid;
  gap: 9px;
  padding-left: 0 !important;
  list-style: none;
}

.detail-list li,
.strategy-list li,
.mistake-list li {
  margin-top: 0 !important;
  padding: 12px 14px;
  background: rgba(243, 239, 229, 0.72);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
}

.strategy-list li {
  border-left-color: var(--green);
}

.mistake-list li {
  border-left-color: var(--red);
}

.site-note {
  padding: 14px 16px;
  background: #fff0c7;
  border: 1px solid rgba(200, 139, 25, 0.36);
  border-radius: 8px;
}

.featured-games {
  margin: 24px 0 22px;
}

.featured-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.featured-link {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.featured-link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.featured-link strong,
.featured-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.featured-link strong {
  font-size: 18px;
  line-height: 1.25;
}

.featured-link span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.faq-list h3,
.timeline h3 {
  margin-top: 22px;
  font-size: 21px;
}

.timeline h2 + h3 {
  margin-top: 12px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 34px clamp(18px, 5vw, 72px);
  color: #d6deec;
  background: #1d2433;
}

.site-footer p {
  margin: 4px 0 0;
  color: #aeb9cc;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.site-footer a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.copyright {
  grid-column: 1 / -1;
  font-size: 13px;
}

@keyframes live-scan {
  0% { transform: translateX(-60%); opacity: 0.38; }
  50% { opacity: 0.72; }
  100% { transform: translateX(250%); opacity: 0.38; }
}

@keyframes live-runner {
  0%, 100% { transform: translateX(0) scale(0.9); }
  50% { transform: translateX(calc(100vw - 220px)) scale(1.08); }
}

@keyframes live-dot {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-8px); opacity: 0.72; }
}

@keyframes meter-ping {
  0% { box-shadow: 0 0 0 0 rgba(223, 75, 56, 0.38); }
  100% { box-shadow: 0 0 0 16px rgba(223, 75, 56, 0); }
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes reel-spin {
  0% { transform: translateY(-2px) scale(0.98); }
  50% { transform: translateY(2px) scale(1.02); }
  100% { transform: translateY(-2px) scale(0.98); }
}

@keyframes success-pop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes danger-pop {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-4deg) scale(1.04); }
  75% { transform: rotate(4deg) scale(1.04); }
}

@keyframes jackpot-pop {
  0% { transform: scale(0.94); box-shadow: 0 0 0 rgba(255, 207, 93, 0); }
  60% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(255, 207, 93, 0.24); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 207, 93, 0); }
}

@keyframes simon-flash {
  0% { transform: scale(0.98); }
  45% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(40, 119, 185, 0.2); }
  100% { transform: scale(1); }
}

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

@media (max-width: 900px) {
  .site-header,
  .hero,
  .editorial,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .hero {
    min-height: auto;
  }

  .play-grid,
  .cards,
  .contact-grid,
  .game-list,
  .game-list[data-arcade-list],
  .featured-link-grid,
  .stats-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .arcade-shell {
    grid-template-columns: 1fr;
  }

  .game-detail-grid {
    grid-template-columns: 1fr;
  }

  .inline-game-stage {
    position: static;
  }

  .tic-feature-grid {
    grid-template-columns: 1fr;
  }

  .arcade-sidebar {
    position: static;
    max-height: none;
  }

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

@media (max-width: 620px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    padding: 14px;
  }

  .nav a {
    padding: 8px 10px;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 16px;
  }

  .play-grid,
  .cards,
  .contact-grid,
  .game-list,
  .game-list[data-arcade-list],
  .featured-link-grid,
  .stats-band {
    grid-template-columns: 1fr;
  }

  .featured-article .detail-snapshot {
    grid-template-columns: 1fr;
  }

  .stage-head {
    display: grid;
  }

  .stage-actions {
    justify-content: flex-start;
  }

  .play-surface {
    padding: 12px;
  }

  .play-guidance p {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row small {
    text-align: left;
  }

  .mines-grid,
  .sudoku-grid.size-6 {
    gap: 6px;
  }

  .sudoku-input,
  .mines-grid .mini-cell,
  .match-grid .mini-cell {
    min-height: 42px;
  }

  .perfume-rack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .perfume-bottle {
    min-height: 160px;
    padding: 7px;
  }

  .station-pill {
    min-height: 38px;
  }

  .tic-scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tic-cell {
    min-height: 76px;
  }

  .tic-board-wrap {
    padding: 10px;
  }

  .mini-window {
    box-shadow: 8px 8px 0 rgba(29, 36, 51, 0.92);
  }

  .tile-board {
    gap: 8px;
  }

  .number-row {
    grid-template-columns: 1fr;
  }

  .editorial,
  .article {
    padding: 22px;
  }
}
