:root {
  color-scheme: light;
  --paper: #f7f1e8;
  --paper-strong: #fffaf2;
  --ink: #19130f;
  --muted: #76695d;
  --muted-2: #9a8c7d;
  --rule: rgba(49, 35, 23, 0.13);
  --tile: #fffdf8;
  --tile-strong: #19130f;
  --accent: #9f5a27;
  --accent-2: #dc8f3e;
  --green: #3d8b5f;
  --blue: #376b9e;
  --danger: #b54d3b;
  --shadow: 0 24px 70px rgba(72, 45, 21, 0.12);
  --radius: 22px;
  --mono: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, monospace;
  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171412;
  --paper-strong: #211b17;
  --ink: #fff7eb;
  --muted: #c7b8a5;
  --muted-2: #978573;
  --rule: rgba(255, 244, 227, 0.13);
  --tile: #2a231d;
  --tile-strong: #fff7eb;
  --accent: #f0a64f;
  --accent-2: #f1c06f;
  --green: #6ac18d;
  --blue: #7fb2ef;
  --danger: #ff8d7c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  background:
    linear-gradient(90deg, rgba(25, 19, 15, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(25, 19, 15, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(220, 143, 62, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(61, 139, 95, 0.10), transparent 30rem),
    var(--paper);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(20px);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--paper-strong);
  box-shadow: inset 0 -10px 20px rgba(159, 90, 39, 0.08);
  font-family: var(--serif);
  font-size: 22px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a,
.theme-toggle {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
}

.nav-links a:hover,
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--rule);
  background: color-mix(in srgb, var(--paper-strong) 76%, transparent);
}

.primary-link {
  color: var(--paper-strong) !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 22px 70px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.6fr);
  gap: 22px;
  align-items: start;
}

.hero-grid > *,
.two-column > * {
  min-width: 0;
}

.headline {
  margin: 0 0 14px;
  max-width: 820px;
  font-family: var(--serif);
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.subhead {
  margin: 0 0 24px;
  max-width: 670px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.panel,
.game-card,
.side-card,
.content-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-strong) 86%, transparent);
  box-shadow: var(--shadow);
}

.game-card {
  overflow: hidden;
}

.game-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 12px;
  border-bottom: 1px solid var(--rule);
}

.game-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-title {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stat-pill,
.small-pill {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.game-body {
  padding: 22px;
}

.route-board {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.word-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 9px;
}

.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--tile);
  color: var(--tile-strong);
  font-family: var(--mono);
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: inset 0 -10px 18px rgba(25, 19, 15, 0.04);
}

.tile.match {
  border-color: color-mix(in srgb, var(--green) 52%, var(--rule));
  color: color-mix(in srgb, var(--green) 84%, var(--ink));
  background: color-mix(in srgb, var(--green) 13%, var(--tile));
}

.tile.target {
  border-color: var(--ink);
  color: var(--paper-strong);
  background: var(--ink);
}

.tile.empty {
  color: var(--muted-2);
  background: color-mix(in srgb, var(--paper) 62%, transparent);
}

.input-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 16px;
}

.word-input,
.solver-input {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--paper-strong);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  outline: none;
}

.word-input:focus,
.solver-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.button,
.ghost-button,
.danger-button {
  min-height: 46px;
  border: 1px solid var(--ink);
  border-radius: 15px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 900;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.button {
  color: var(--paper-strong);
  background: var(--ink);
}

.ghost-button {
  color: var(--ink);
  border-color: var(--rule);
  background: color-mix(in srgb, var(--paper-strong) 72%, transparent);
}

.danger-button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--rule));
  background: transparent;
}

.button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.keyboard {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.key {
  min-width: 31px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-strong) 78%, transparent);
  font-size: 13px;
  font-weight: 900;
}

.key.wide {
  min-width: 56px;
  font-size: 12px;
}

.feedback {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 750;
}

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

.feedback.bad {
  color: var(--danger);
}

.mode-tabs,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.side-card,
.content-card {
  padding: 20px;
}

.side-card h2,
.content-card h2,
.content-card h3,
.feature h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.side-card p,
.content-card p,
.feature p {
  margin: 0 0 14px;
  color: var(--muted);
}

.answer-list,
.archive-list {
  display: grid;
  gap: 8px;
}

.path-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.feature {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-strong) 74%, transparent);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent);
}

.section {
  margin-top: 42px;
}

.section-header {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.two-column {
  min-height: 82vh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.archive-hero {
  min-height: 82vh;
}

.solver-form {
  display: grid;
  gap: 12px;
}

.solver-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mini-label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-box {
  min-height: 74px;
  margin-top: 16px;
  padding: 15px;
  border: 1px dashed var(--rule);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 62%, transparent);
}

.share-card {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 13px;
}

.share-card.show {
  display: block;
}

.footer {
  border-top: 1px solid var(--rule);
  padding: 28px 22px 42px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero-grid,
  .two-column,
  .features {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .game-top,
  .input-line,
  .solver-row {
    grid-template-columns: 1fr;
  }

  .game-top {
    display: grid;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 26px 14px 52px;
  }

  .headline {
    font-size: 52px;
  }

  .game-body,
  .game-top,
  .side-card,
  .content-card,
  .feature {
    padding: 16px;
  }

  .word-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .tile {
    border-radius: 12px;
  }

  .key {
    min-width: 27px;
    height: 36px;
  }
}

/* Refined product pass: compact playable board, richer content, stronger brand. */
:root {
  --paper: #fbf2df;
  --paper-strong: #fffaf1;
  --ink: #1f1712;
  --muted: #6f6255;
  --muted-2: #a28f7d;
  --rule: rgba(44, 31, 20, 0.14);
  --tile: #fffdf7;
  --tile-strong: #201712;
  --accent: #c46524;
  --accent-2: #f3ad4f;
  --green: #2f8a57;
  --blue: #376b9e;
  --danger: #b64833;
  --shadow: 0 18px 54px rgba(87, 55, 25, 0.15);
}

[data-theme="dark"] {
  --paper: #17130f;
  --paper-strong: #211a15;
  --ink: #fff5e8;
  --muted: #d0c0ad;
  --muted-2: #a9937d;
  --rule: rgba(255, 244, 227, 0.13);
  --tile: #2b211a;
  --tile-strong: #fff5e8;
  --accent: #f19a3f;
  --accent-2: #ffd07b;
  --green: #78c897;
  --blue: #8fbee8;
  --danger: #ff8e76;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

body {
  background:
    radial-gradient(circle at 8% 8%, rgba(244, 161, 68, 0.18), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(62, 127, 96, 0.12), transparent 26rem),
    linear-gradient(90deg, rgba(34, 24, 16, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(34, 24, 16, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 36px 36px, 36px 36px, auto;
}

.site-header {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
}

.nav {
  max-width: 1280px;
  padding: 12px 22px;
}

.brand {
  font-size: 18px;
}

.brand-mark {
  width: 48px;
  height: 38px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(196, 101, 36, 0.16);
}

.brand-mark span {
  display: grid;
  place-items: center;
  min-width: 0;
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper-strong);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
}

.page {
  max-width: 1280px;
  padding-top: 24px;
}

.home-hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(650px, 1fr);
  gap: 18px;
  align-items: start;
}

.home-hero > * {
  min-width: 0;
}

.intro-panel {
  padding: 26px 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--rule));
  border-radius: 999px;
  padding: 0 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.headline,
.section-header h2,
.game-title,
.side-card h2,
.content-card h2,
.content-card h3,
.feature h2 {
  letter-spacing: 0;
}

.headline {
  font-size: clamp(46px, 6vw, 78px);
  line-height: 0.98;
}

.subhead {
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.rule-ribbon {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.rule-ribbon span {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper-strong) 76%, transparent);
  font-weight: 850;
}

.game-column {
  display: grid;
  gap: 14px;
  padding-top: 4px;
  min-width: 0;
}

.challenge-spotlight,
.player-name-card {
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 42%),
    color-mix(in srgb, var(--paper-strong) 90%, transparent);
  box-shadow: var(--shadow);
}

.challenge-spotlight h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.challenge-spotlight p {
  margin: 0 0 12px;
  color: var(--muted);
}

.player-name-card,
.player-name-strip,
.inline-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.player-name-card {
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 0.72fr);
  margin: 14px 0;
}

.player-name-strip {
  grid-template-columns: minmax(220px, 1fr) auto minmax(160px, 0.64fr);
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 12px;
  background: color-mix(in srgb, var(--paper-strong) 84%, transparent);
  box-shadow: 0 12px 34px rgba(87, 55, 25, 0.08);
}

.player-name-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  font: 850 15px var(--sans);
}

.name-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-game {
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper-strong) 92%, transparent);
}

.compact-game .game-top {
  padding: 14px 16px 12px;
}

.compact-game .game-title {
  font-size: 25px;
}

.compact-game .stat-row {
  margin-top: 9px;
}

.compact-game .stat-pill {
  padding: 5px 8px;
  font-size: 11px;
}

.compact-game .game-body {
  padding: 14px 16px 16px;
}

.play-surface {
  display: grid;
  grid-template-columns: 246px minmax(342px, 1fr);
  gap: 14px;
  align-items: start;
}

.route-board {
  justify-content: start;
  gap: 6px;
  margin: 0;
}

.word-row {
  grid-template-columns: repeat(4, 54px);
  gap: 6px;
}

.tile {
  width: 54px;
  height: 54px;
  aspect-ratio: auto;
  border-radius: 13px;
  font-size: 24px;
}

.play-controls {
  min-width: 0;
}

.input-line {
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  margin-top: 0;
}

.word-input {
  min-height: 44px;
  border-radius: 13px;
  font-size: 21px;
}

.input-line .button {
  min-height: 44px;
  padding: 0 10px;
}

.keyboard {
  gap: 5px;
  margin-top: 9px;
  overflow: visible;
}

.keyboard-row {
  gap: 4px;
  min-width: max-content;
}

.key {
  min-width: 24px;
  height: 31px;
  border-radius: 8px;
  font-size: 10px;
}

.key.wide {
  min-width: 43px;
  font-size: 10px;
}

.feedback {
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
}

.mode-tabs {
  gap: 6px;
  margin-top: 8px;
}

.mode-tabs .ghost-button,
.mode-tabs .danger-button {
  min-height: 34px;
  border-radius: 11px;
  padding: 0 9px;
  font-size: 12px;
}

.answer-box {
  min-height: 0;
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
}

.answer-list {
  display: flex;
  flex-wrap: wrap;
}

.path-chip {
  padding: 5px 8px;
  font-size: 11px;
}

.hint-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.side-card,
.content-card,
.feature {
  background: color-mix(in srgb, var(--paper-strong) 88%, transparent);
}

.tool-strip {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.home-hero .side-stack {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.features,
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.content-grid .section-header {
  grid-column: 1 / -1;
}

.visual-card {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 24px;
  overflow: hidden;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.visual-card img {
  display: block;
  width: 100%;
  height: auto;
}

.visual-card figcaption {
  padding: 12px 16px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.content-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 24px;
}

.archive-intro {
  margin-bottom: 14px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--paper-strong) 86%, transparent);
}

.faq-item summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.link-card {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--paper-strong) 84%, transparent);
  font-weight: 900;
}

.link-card span {
  color: var(--accent);
  font-size: 12px;
}

.board-section,
.result-wall {
  scroll-margin-top: 90px;
}

.leaderboard-card,
.result-preview {
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper-strong) 86%, transparent);
  box-shadow: var(--shadow);
}

.leaderboard-card {
  overflow: hidden;
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 100px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}

.leaderboard-head {
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row span:first-child {
  min-width: 0;
}

.leaderboard-row em {
  display: inline-flex;
  margin-left: 8px;
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.page {
  max-width: 1460px;
}

.nav {
  max-width: 1460px;
}

.home-hero {
  grid-template-columns: minmax(320px, 0.38fr) minmax(830px, 1.16fr);
  gap: 28px;
}

.home-support {
  margin-top: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-column {
  min-height: 0;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.44fr);
  gap: 24px;
}

.archive-hero {
  min-height: 0;
}

.compact-game .game-top {
  padding: 18px 20px 14px;
}

.compact-game .game-title {
  font-size: 32px;
}

.compact-game .game-body {
  padding: 18px 20px 20px;
}

.play-surface {
  grid-template-columns: 326px minmax(480px, 1fr);
  gap: 20px;
}

.route-board {
  gap: 8px;
}

.word-row {
  grid-template-columns: repeat(4, 72px);
  gap: 8px;
}

.tile {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  font-size: 32px;
}

.input-line {
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.word-input {
  min-height: 54px;
  font-size: 26px;
}

.input-line .button {
  min-height: 54px;
}

.keyboard {
  gap: 7px;
  margin-top: 11px;
}

.keyboard-row {
  gap: 6px;
}

.key {
  min-width: 38px;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
}

.key.wide {
  min-width: 72px;
  font-size: 12px;
}

.mode-tabs .ghost-button,
.mode-tabs .danger-button {
  min-height: 38px;
  font-size: 13px;
}

.share-actions {
  margin-top: 12px;
}

.post-solve-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.post-solve-actions .button,
.post-solve-actions .ghost-button {
  justify-content: center;
  text-align: center;
}

.next-play-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.share-toggle {
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.share-glyph {
  position: relative;
  width: 22px;
  height: 16px;
  display: inline-block;
}

.share-glyph span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.share-glyph span:nth-child(1) {
  left: 0;
  top: 4px;
}

.share-glyph span:nth-child(2) {
  right: 0;
  top: 0;
}

.share-glyph span:nth-child(3) {
  right: 0;
  bottom: 0;
}

.share-glyph::before,
.share-glyph::after {
  content: "";
  position: absolute;
  left: 6px;
  width: 12px;
  height: 1px;
  background: currentColor;
  transform-origin: left center;
}

.share-glyph::before {
  top: 7px;
  transform: rotate(-24deg);
}

.share-glyph::after {
  bottom: 7px;
  transform: rotate(24deg);
}

.share-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.share-panel[hidden] {
  display: none;
}

.leaderboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.leaderboard-metrics span {
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper-strong) 82%, transparent);
  font-weight: 800;
}

.leaderboard-metrics strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.72fr);
  gap: 14px;
  align-items: stretch;
}

.leaderboard-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--rule);
}

.leaderboard-title strong {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}

.recent-card {
  display: flex;
  flex-direction: column;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}

.recent-row:last-child {
  border-bottom: 0;
}

.recent-row span {
  min-width: 0;
}

.recent-row strong,
.recent-row small {
  display: block;
}

.recent-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.recent-row em {
  align-self: start;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--rule));
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.answer-route-card {
  display: grid;
  gap: 18px;
}

.answer-path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.answer-step {
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 12px;
  background: color-mix(in srgb, var(--paper) 66%, transparent);
}

.answer-step span,
.answer-step small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.answer-step strong {
  display: block;
  margin: 4px 0;
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.12em;
}

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

.answer-insight-grid > div {
  border: 1px dashed var(--rule);
  border-radius: 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--paper) 52%, transparent);
}

.archive-list-hero {
  margin-top: 20px;
}

.result-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.typo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.typo-card {
  display: block;
  min-height: 210px;
}

.typo-card:hover {
  transform: translateY(-2px);
}

.result-preview {
  min-height: 260px;
  padding: 18px;
}

.result-preview h3 {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
}

.result-preview p {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.result-preview pre {
  margin: 0 0 14px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.35;
  overflow: hidden;
}

@media (max-width: 1160px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero .side-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .intro-panel {
    padding-top: 0;
  }

  .tool-strip,
  .link-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .typo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .home-hero,
  .home-hero .side-stack,
  .home-support,
  .tool-strip,
  .features,
  .content-grid,
  .link-grid,
  .typo-grid,
  .result-card-grid,
  .leaderboard-grid,
  .answer-insight-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .two-column,
  .archive-hero {
    min-height: 0;
  }

  .intro-panel {
    padding-top: 0;
  }

  .play-surface {
    grid-template-columns: 1fr;
  }

  .route-board {
    justify-content: center;
  }
}

@media (max-width: 700px) {
  .leaderboard-metrics {
    grid-template-columns: 1fr;
  }

  .player-name-card,
  .player-name-strip,
  .inline-name-form,
  .share-panel,
  .post-solve-actions {
    grid-template-columns: 1fr;
  }

  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: minmax(0, 1fr) 64px 76px;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .nav {
    padding: 10px 14px;
  }

  .nav-links {
    gap: 0;
    font-size: 12px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a,
  .theme-toggle {
    padding: 7px 8px;
    white-space: nowrap;
  }

  .brand-mark {
    width: 44px;
    height: 36px;
  }

  .headline {
    margin-bottom: 8px;
    font-size: 36px;
  }

  .subhead {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .eyebrow,
  .hero-actions {
    display: none;
  }

  .rule-ribbon {
    display: none;
  }

  .compact-game .game-body,
  .compact-game .game-top {
    padding: 10px;
  }

  .compact-game .game-title {
    font-size: 21px;
  }

  .word-row {
    grid-template-columns: repeat(4, 42px);
    gap: 5px;
  }

  .tile {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .route-board {
    gap: 5px;
  }

  .word-input,
  .input-line .button {
    min-height: 40px;
  }

  .key {
    min-width: 22px;
    height: 29px;
  }

  .mode-tabs .ghost-button,
  .mode-tabs .danger-button {
    flex: 1 1 74px;
  }
}

@media (max-width: 900px) {
  .page {
    width: 100%;
    max-width: none;
    padding-inline: 14px;
  }

  .two-column,
  .archive-hero,
  .variant-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    min-height: 0;
  }

  .two-column > div,
  .two-column > aside,
  .archive-hero > div,
  .archive-hero > aside,
  .variant-page > div,
  .variant-page > aside {
    min-width: 0;
    width: 100%;
  }

  .two-column > aside,
  .archive-hero > aside,
  .variant-page > aside {
    order: 2;
  }

  .two-column .section-header,
  .archive-hero .section-header,
  .variant-page .section-header {
    max-width: none;
    margin-bottom: 14px;
  }

  .two-column .headline,
  .archive-hero .headline,
  .variant-page .headline {
    max-width: 100%;
    font-size: clamp(42px, 15vw, 58px);
    line-height: 0.95;
  }

  .two-column .section-header p,
  .archive-hero .section-header p,
  .variant-page .section-header p {
    max-width: none;
    font-size: 16px;
    line-height: 1.55;
  }

  .side-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .solver-row .button,
  .solver-row .ghost-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .page {
    padding: 18px 12px 48px;
  }

  .two-column .headline,
  .archive-hero .headline,
  .variant-page .headline {
    font-size: 44px;
  }

  .side-card,
  .content-card {
    border-radius: 20px;
    padding: 16px;
  }

  .side-card h2,
  .content-card h2,
  .content-card h3 {
    font-size: 28px;
  }
}
