:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --fg: #151511;
  --muted: #5f615b;
  --border: #151511;
  --accent: #ef3f2f;
  --acid: #b4f73b;
  --cyan: #40c7f4;
  --gold: #ffd64f;
  --violet: #ad63f7;
  --success: #1f9d5a;
  --danger: #ef3f2f;
  --font-display: "Times New Roman", "Iowan Old Style", Georgia, serif;
  --font-body: ui-monospace, "IBM Plex Mono", "JetBrains Mono", Menlo, monospace;
  --edge: 2px solid var(--border);
  --radius: 2px;
  --max: 1480px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    repeating-linear-gradient(90deg, rgba(21, 21, 17, 0.08) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(21, 21, 17, 0.08) 0 1px, transparent 1px 72px),
    var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

::selection {
  background: var(--acid);
  color: var(--fg);
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: var(--edge);
  background: rgba(247, 247, 242, 0.95);
  backdrop-filter: blur(10px);
}

.brand,
.nav-links a,
.day-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 12px;
  padding: 10px 18px;
  border-right: var(--edge);
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 6px;
  border: var(--edge);
  background: var(--surface);
}

.brand-mark span {
  border-radius: 50%;
  background: var(--fg);
}

.brand-mark span:nth-child(1) {
  background: var(--cyan);
}

.brand-mark span:nth-child(2) {
  background: var(--acid);
}

.brand-mark span:nth-child(3) {
  background: var(--accent);
}

.brand-mark span:nth-child(4) {
  background: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.nav-links a,
.day-pill {
  padding: 10px 16px;
  border-left: var(--edge);
  color: var(--fg);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--fg);
  color: var(--surface);
}

.day-pill {
  background: var(--acid);
}

main {
  min-height: 100vh;
}

.play-surface,
.info-band,
.faq-section,
.site-footer {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding-inline: 20px;
}

.play-surface {
  padding-top: 28px;
  padding-bottom: 52px;
}

.info-band,
.faq-section {
  padding-bottom: 52px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding-bottom: 34px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  max-width: 80ch;
}

.site-footer a,
.inline-link {
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(420px, 1.28fr) minmax(260px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.intro-rail,
.game-panel,
.side-panel,
.info-card,
.faq-section,
.not-found-panel {
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}

.intro-rail {
  min-height: 720px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.intro-top,
.game-panel,
.panel-block,
.info-card,
.faq-section,
.not-found-panel {
  padding: 18px;
}

.eyebrow,
.small-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
  border: var(--edge);
  background: var(--accent);
  color: white;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 4vw, 4.2rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 span {
  display: block;
  overflow-wrap: normal;
  word-break: keep-all;
}

h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

p {
  margin: 10px 0 0;
}

.lede {
  max-width: 34ch;
  color: var(--muted);
  font-weight: 700;
}

.quick-rules {
  display: grid;
  gap: 0;
  border-top: var(--edge);
}

.quick-rules div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 94px;
  border-bottom: var(--edge);
}

.quick-rules b {
  display: grid;
  place-items: center;
  border-right: var(--edge);
  background: var(--gold);
  font-size: 1rem;
}

.quick-rules span {
  display: flex;
  align-items: center;
  padding: 14px;
  font-size: 0.85rem;
  font-weight: 800;
}

.challenge-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 120px;
}

.challenge-strip span {
  border-right: var(--edge);
}

.challenge-strip span:nth-child(1) {
  background: var(--accent);
}

.challenge-strip span:nth-child(2) {
  background: var(--cyan);
}

.challenge-strip span:nth-child(3) {
  background: var(--acid);
}

.challenge-strip span:nth-child(4) {
  border-right: 0;
  background: var(--violet);
}

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

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

.metric {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border: var(--edge);
  background: #fdfdf8;
}

.metric strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.9;
  text-transform: uppercase;
}

.prompt-stage {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr);
  min-height: 250px;
  border: var(--edge);
}

.number-token {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border-right: var(--edge);
  background:
    linear-gradient(135deg, rgba(180, 247, 59, 0.8), rgba(64, 199, 244, 0.7)),
    var(--surface);
}

.number-token span {
  width: min(76%, 220px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: var(--edge);
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 900;
  line-height: 1;
}

.number-token small {
  padding: 5px 8px;
  border: var(--edge);
  background: var(--fg);
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prompt-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}

.prompt-copy h2 {
  max-width: 20ch;
  font-size: clamp(2rem, 4.2vw, 3.7rem);
  line-height: 0.9;
  overflow-wrap: normal;
  word-break: normal;
}

.prompt-copy p:not(.small-label) {
  max-width: 52ch;
  color: var(--muted);
  font-weight: 800;
}

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

.hint-card {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: var(--edge);
  border-radius: 0;
  background: #fdfdf8;
  color: var(--fg);
  text-align: left;
}

.hint-card:hover,
.hint-card[aria-expanded="true"] {
  background: var(--acid);
}

.hint-card strong {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 0.88;
  text-transform: uppercase;
}

.hint-copy {
  min-height: 42px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.hint-card[aria-expanded="true"] .hint-copy {
  color: var(--fg);
}

.spoiler-card {
  background: var(--gold);
}

.guess-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: var(--edge);
  background: #fdfdf8;
}

.guess-form label {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.guess-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.guess-row input {
  min-width: 0;
  min-height: 54px;
  padding: 12px;
  border: var(--edge);
  border-radius: 0;
  background: var(--surface);
  color: var(--fg);
  font-size: 1rem;
  font-weight: 900;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button {
  min-height: 46px;
  border: var(--edge);
  border-radius: 0;
  color: var(--fg);
  font-weight: 900;
  text-transform: uppercase;
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--fg);
}

.secondary-button,
.ghost-button {
  width: 100%;
  padding: 0 12px;
  background: var(--surface);
}

.secondary-button:hover,
.ghost-button:hover,
.text-button:hover {
  background: var(--fg);
  color: var(--surface);
}

.ghost-button {
  background: var(--bg);
}

.text-button {
  min-height: 36px;
  padding: 0 10px;
  background: var(--gold);
  font-size: 0.72rem;
}

.game-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: var(--edge);
  background: var(--fg);
  color: var(--surface);
}

.feedback-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.feedback-copy p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
}

.footer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 170px;
}

.footer-actions .secondary-button,
.footer-actions .ghost-button {
  background: var(--surface);
}

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

.guess-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: var(--edge);
  background: #fdfdf8;
  font-weight: 900;
}

.guess-rank {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: var(--edge);
  background: var(--surface);
}

.guess-value,
.guess-temp,
.guess-direction {
  min-width: 0;
}

.guess-meter {
  grid-column: 2 / -1;
  height: 8px;
  border: var(--edge);
  background: var(--surface);
}

.guess-meter span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.guess-item.perfect .guess-meter span,
.guess-item.burning .guess-meter span {
  background: var(--success);
}

.guess-item.hot .guess-meter span {
  background: var(--gold);
}

.guess-item.freezing .guess-meter span {
  background: var(--cyan);
}

.side-panel {
  display: grid;
  align-content: start;
}

.panel-block {
  border-bottom: var(--edge);
}

.panel-block:last-child {
  border-bottom: 0;
}

.panel-block p:not(.small-label) {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.answer-block {
  background: var(--acid);
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 10px;
  border: var(--edge);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-link:hover {
  background: var(--fg);
  color: var(--surface);
}

.update-note {
  font-size: 0.78rem !important;
}

.block-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.practice-answer {
  margin-top: 12px;
  padding: 12px;
  border: var(--edge);
  background: var(--gold);
  font-weight: 900;
}

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

.info-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 800;
}

.faq-section {
  margin-bottom: 52px;
}

.faq-section h2 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 6vw, 5rem);
}

details {
  border-top: var(--edge);
}

details:last-child {
  border-bottom: var(--edge);
}

summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

details p {
  max-width: 74ch;
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 800;
}

.not-found-panel {
  width: min(92vw, 760px);
  margin: 80px auto;
}

.not-found-panel h1 {
  font-size: clamp(3.5rem, 12vw, 8rem);
}

.not-found-panel a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 18px;
  padding: 0 14px;
  border: var(--edge);
  background: var(--acid);
  font-weight: 900;
  text-transform: uppercase;
}

.page-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.55fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.page-hero-main,
.page-hero-side,
.resource-card,
.archive-card,
.practice-lab {
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.page-hero-main {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-hero-main h1 {
  max-width: 12ch;
  font-size: clamp(3.4rem, 8vw, 7rem);
}

.page-hero-main .lede {
  max-width: 58ch;
}

.page-hero-side {
  display: grid;
  align-content: space-between;
  gap: 18px;
  background: var(--acid);
}

.page-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: var(--edge);
  background: var(--surface);
}

.page-stat strong {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 0.9;
  text-transform: uppercase;
}

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

.content-grid.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.resource-card {
  min-height: 250px;
}

.resource-card p:not(.eyebrow):not(.small-label),
.archive-card p:not(.eyebrow):not(.small-label),
.practice-lab p:not(.eyebrow):not(.small-label) {
  color: var(--muted);
  font-weight: 800;
}

.resource-card ul,
.resource-card ol {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 800;
}

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

.inline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.inline-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: var(--edge);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.inline-nav a:hover {
  background: var(--fg);
  color: var(--surface);
}

.archive-card {
  margin-bottom: 18px;
  overflow-x: auto;
}

.archive-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.84rem;
}

.archive-table th,
.archive-table td {
  padding: 12px;
  border: var(--edge);
  text-align: left;
  vertical-align: top;
}

.archive-table th {
  background: var(--gold);
  text-transform: uppercase;
}

.archive-table td {
  background: #fdfdf8;
  font-weight: 800;
}

.archive-table a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.practice-lab {
  display: grid;
  gap: 14px;
}

.practice-lab .guess-form {
  padding: 0;
  border: 0;
  background: transparent;
}

.practice-prompt {
  padding: 18px;
  border: var(--edge);
  background: var(--acid);
}

.practice-prompt strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.practice-result {
  min-height: 74px;
  padding: 14px;
  border: var(--edge);
  background: var(--fg);
  color: var(--surface);
  font-weight: 900;
}

.practice-result p {
  color: rgba(255, 255, 255, 0.78) !important;
}

@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro-rail {
    min-height: auto;
  }

  .challenge-strip {
    min-height: 70px;
  }

  .side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: var(--edge);
  }

  .panel-block {
    border-right: var(--edge);
    border-bottom: 0;
  }

  .panel-block:last-child {
    border-right: 0;
  }

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

  .page-hero,
  .content-grid,
  .content-grid.two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .brand {
    border-right: 0;
    border-bottom: var(--edge);
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .nav-links a:first-child {
    border-left: 0;
  }

  .play-surface,
  .info-band,
  .faq-section,
  .site-footer {
    padding-inline: 12px;
  }

  .play-surface {
    padding-top: 12px;
  }

  .hero-grid {
    gap: 12px;
  }

  .game-panel {
    order: 1;
  }

  .intro-rail {
    order: 2;
  }

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

  .panel-block {
    border-right: 0;
    border-bottom: var(--edge);
  }

  .panel-block:last-child {
    border-bottom: 0;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .game-topline,
  .hint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-stage {
    grid-template-columns: 1fr;
  }

  .number-token {
    min-height: 200px;
    border-right: 0;
    border-bottom: var(--edge);
  }

  .prompt-copy h2 {
    max-width: none;
  }

  .guess-row,
  .game-footer {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    min-width: 0;
  }

  .site-footer {
    display: block;
  }

  .footer-links {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .page-shell {
    padding: 12px 12px 42px;
  }

  .page-hero-main {
    min-height: 300px;
  }

  .page-hero-main h1 {
    max-width: none;
    font-size: clamp(3rem, 15vw, 5.4rem);
  }
}

@media (max-width: 470px) {
  .game-topline,
  .hint-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 72px;
  }

  .guess-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .guess-temp,
  .guess-direction {
    grid-column: 2;
  }

  .guess-meter {
    grid-column: 1 / -1;
  }
}
