:root {
  --bg: #120d12;
  --bg-soft: #1a1320;
  --card: rgba(28, 20, 33, 0.92);
  --card-strong: rgba(35, 25, 42, 0.98);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f6eef7;
  --muted: #c9bacd;
  --primary: #ff7a45;
  --primary-strong: #ff9b52;
  --accent: #8f7cfb;
  --exact: #ffad5a;
  --warm: #7cc8ff;
  --ash: #514757;
  --success: #ffe8cf;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 16px;
  --shell: min(1160px, calc(100vw - 32px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 122, 69, 0.18), transparent 28%),
    linear-gradient(180deg, #140d16 0%, #0f0b12 100%);
  color: var(--text);
}

a { color: inherit; }
main { min-height: 100vh; }
.shell { width: var(--shell); margin: 0 auto; }
.hero, .section, .footer { padding: 28px 0; }
.hero { padding-top: 48px; }
.hero-grid, .game-layout, .three-up, .footer-row, .cta-row, .hud-grid, .summary-grid, .play-actions, .board-meta, .status-bar, .input-panel, .history-row, .history-top, .history-clues, .tile-pad, .mosaic-preview, .summary-list, .legend-list, .board-deck { display: flex; gap: 16px; }
.hero-grid, .game-layout { align-items: stretch; }
.hero-grid { grid-template-columns: 1.4fr 0.9fr; display: grid; }
.game-layout { display: grid; grid-template-columns: 1fr 1.3fr 0.72fr; }
.three-up { display: grid; grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(16px);
}
.hero-card, .info-card, .selector-card { align-self: start; }
.game-card { background: var(--card-strong); min-height: 760px; }
.prose-card { max-width: 860px; margin: 0 auto; }
.eyebrow, .mini-label, .small-note, .status-copy, .hud-card span, .summary-stat span { color: var(--muted); }
.eyebrow, .mini-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
}
.eyebrow { color: var(--primary-strong); }
.lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #f2e7f2;
}
.small-note { line-height: 1.6; font-size: 0.94rem; }
.no-top { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 14px; }
h1 { font-size: clamp(2.3rem, 4vw, 4.4rem); }
h2 { font-size: clamp(1.5rem, 2.2vw, 2.15rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 16px; line-height: 1.68; }
ul { margin: 0; padding-left: 20px; }
.bullet-list.compact li, .legend-list li { margin-bottom: 12px; line-height: 1.55; }
.legend-list { flex-direction: column; padding-left: 0; list-style: none; }
.clue-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
.clue-dot.exact { background: linear-gradient(135deg, #ffd384, var(--exact)); }
.clue-dot.warm { background: linear-gradient(135deg, #d2f2ff, var(--warm)); }
.clue-dot.ash { background: var(--ash); }
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #1a0b07;
}
.btn-secondary {
  background: rgba(255,255,255,0.05);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.08);
  color: var(--muted);
}
.cta-row { flex-wrap: wrap; align-items: center; }
.cta-row.left { justify-content: flex-start; }
.status-bar, .board-meta, .history-top { justify-content: space-between; align-items: center; }
.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}
.status-pill.accent, .tag { background: rgba(255, 122, 69, 0.14); color: var(--primary-strong); }
.tag.ghost { background: rgba(255,255,255,0.04); color: var(--muted); }
.board-deck { flex-direction: column; }
.board-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  padding: 16px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.board-card.is-active { border-color: rgba(255, 122, 69, 0.55); box-shadow: 0 0 0 1px rgba(255, 122, 69, 0.25) inset; }
.board-card p { margin-bottom: 10px; }
.board-meta { font-size: 0.92rem; color: var(--muted); }
.screen[hidden] { display: none; }
.screen.active, .screen { display: block; }
.hud-grid, .summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.hud-card, .summary-stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
}
.hud-card strong, .summary-stat strong { display: block; font-size: 1.14rem; margin-top: 6px; }
.signal-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255,255,255,0.03);
}
.mosaic-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 18px 0;
}
.guess-slot, .tile-chip, .clue-chip {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
}
.guess-slot {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  gap: 6px;
  text-align: center;
}
.guess-slot.empty { color: var(--muted); border-style: dashed; }
.tile-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
  min-height: 72px;
  gap: 6px;
  font-weight: 700;
}
.tile-chip small, .guess-slot small { font-size: 0.8rem; opacity: 0.88; }
.tile-chip.tile-1, .guess-slot.tile-1 { background: linear-gradient(135deg, #ffb274, #f66a3a); color: #2b120a; }
.tile-chip.tile-2, .guess-slot.tile-2 { background: linear-gradient(135deg, #99e4ff, #5fbfff); color: #091924; }
.tile-chip.tile-3, .guess-slot.tile-3 { background: linear-gradient(135deg, #c4f0a3, #79c95b); color: #0d1d0b; }
.tile-chip.tile-4, .guess-slot.tile-4 { background: linear-gradient(135deg, #f9d58e, #d4a241); color: #261b07; }
.tile-chip.tile-5, .guess-slot.tile-5 { background: linear-gradient(135deg, #efb7ff, #b478ff); color: #200927; }
.tile-chip.tile-6, .guess-slot.tile-6 { background: linear-gradient(135deg, #f5f3ee, #cfc9c2); color: #1d1915; }
.tile-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}
.tile-button {
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.tile-button .tile-chip { min-height: 92px; }
.tile-button:disabled { opacity: 0.45; cursor: not-allowed; }
.play-actions.wrap { flex-wrap: wrap; }
.history-section { margin-top: 24px; }
.history-heading { margin-bottom: 14px; }
.history-rows { display: flex; flex-direction: column; gap: 12px; }
.history-row {
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255,255,255,0.025);
}
.history-clues { flex-wrap: wrap; }
.clue-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}
.clue-chip.exact { background: rgba(255, 173, 90, 0.18); color: #ffd9a3; }
.clue-chip.warm { background: rgba(124, 200, 255, 0.16); color: #d9f2ff; }
.clue-chip.ash { background: rgba(81, 71, 87, 0.52); color: #e2d9e8; }
.summary-list { flex-direction: column; margin: 18px 0; }
.summary-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
}
.footer-row {
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.muted { padding-top: 8px; }

@media (max-width: 1040px) {
  .game-layout { grid-template-columns: 1fr; }
  .hero-grid, .three-up { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero, .section, .footer { padding: 20px 0; }
  .card, .signal-card { padding: 18px; }
  .hud-grid, .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .tile-pad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mosaic-preview { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .guess-slot, .tile-chip { min-height: 68px; }
}
