:root {
  color-scheme: light;
  --ink: #20241f;
  --muted: #667064;
  --paper: #f7f1e2;
  --paper-2: #fffaf0;
  --page: #ebe5d5;
  --line: #d8cfba;
  --moss: #687b5c;
  --moss-dark: #344331;
  --moss-pale: #dfe5d8;
  --coral: #e15c49;
  --coral-dark: #b94134;
  --coral-pale: #f5d4cd;
  --gold: #e9a62f;
  --gold-dark: #9b6913;
  --gold-pale: #f7e5b9;
  --block: #1e251d;
  --right: #2f7d50;
  --wrong: #b63c34;
  --shadow: 0 22px 55px rgba(46, 52, 42, .15);
  --radius: 24px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f0e6;
  --muted: #afb8a9;
  --paper: #242a22;
  --paper-2: #2c3329;
  --page: #151a15;
  --line: #414b3e;
  --moss: #93a884;
  --moss-dark: #c6d6bb;
  --moss-pale: #344032;
  --coral: #ef725d;
  --coral-dark: #ff9a87;
  --coral-pale: #5b302b;
  --gold: #f0b84b;
  --gold-dark: #ffd67d;
  --gold-pale: #514426;
  --block: #0d110d;
  --right: #70c58f;
  --wrong: #ff8e82;
  --shadow: 0 22px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.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; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.product-bar {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 64px);
  background: #151915;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  font-size: 22px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.14);
}
.build-badge {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #cbd2c7;
  font-size: 12px;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.4vw, 36px);
  margin-left: auto;
}
.nav-links a {
  color: #e8ece5;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.nav-links .nav-play {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
}
.theme-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

main { overflow: clip; }
.hero {
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(440px, 1.05fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
  padding: 78px clamp(24px, 5vw, 82px) 92px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.12), transparent 25%),
    linear-gradient(135deg, #6c8061, #52664c 58%, #43573f);
  color: #fff;
}
.hero-copy { max-width: 700px; }
.eyebrow, .section-kicker, .turn-label {
  display: block;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 680px;
  margin: 22px 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(52px, 6.1vw, 92px);
  line-height: .94;
  letter-spacing: -.055em;
}
.hero-copy > p {
  max-width: 650px;
  margin: 0;
  color: #edf2e9;
  font-size: clamp(17px, 1.55vw, 23px);
  line-height: 1.55;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 34px 0 40px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
}
.button.primary, button.primary { border-color: var(--coral); background: var(--coral); color: #fff; }
.button.secondary { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-facts span {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #ecf2e9;
  font-size: 12px;
  font-weight: 750;
}

.hero-board-card {
  width: min(100%, 720px);
  justify-self: center;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 34px;
  background: rgba(25, 33, 24, .78);
  box-shadow: 0 34px 80px rgba(18, 29, 17, .32);
  transform: rotate(1.2deg);
}
.preview-topline, .preview-score {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #dfe8da;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin: 20px 0;
  padding: 18px;
  border-radius: 20px;
  background: #303b2d;
}
.preview-cell { aspect-ratio: 1; border-radius: 6px; background: #f2eee1; }
.preview-cell.block { background: #151b14; }
.preview-cell.initial { background: var(--coral); }
.preview-cell.final { background: var(--gold); }
.preview-score strong { color: #fff; }

.setup {
  display: grid;
  grid-template-columns: minmax(220px, .38fr) minmax(0, 1.62fr);
  gap: 42px;
  padding: 48px clamp(24px, 5vw, 82px);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.setup h2, .game-heading h2, .how-section h2, .trust-section h2, .scoring-section h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 3.2vw, 50px);
  line-height: 1.04;
}
.section-kicker { color: var(--coral-dark); }
.setup-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.choice {
  width: 100%;
  min-height: 46px;
  margin: 4px 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
}
.choice.selected { border-color: var(--moss); background: var(--moss-pale); font-weight: 800; }
.choice small { float: right; color: var(--muted); }
.choice:disabled { opacity: .58; }
.preference-select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 780;
}
.preference-note { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.experience-toggles { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.experience-toggles label, .youtube-enable { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.experience-toggles input, .youtube-enable input { width: 18px; height: 18px; accent-color: var(--coral); }

.game-section { padding: 72px clamp(18px, 4vw, 64px) 88px; background: var(--page); }
.endgame-study-note {
  max-width: 1480px;
  display: flex;
  gap: 9px 18px;
  flex-wrap: wrap;
  margin: 0 auto 20px;
  padding: 12px 15px;
  border-left: 4px solid var(--coral);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
}
.endgame-study-note b { color: var(--ink); }
.game-heading {
  max-width: 1480px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin: 0 auto 24px;
}
.game-heading p { margin: 8px 0 0; color: var(--muted); }
.puzzle-actions { display: grid; grid-template-columns: auto auto; gap: 7px; align-items: center; }
.puzzle-actions button, .finish-actions button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}
.puzzle-actions button:disabled, .finish-actions button:disabled { opacity: .45; cursor: default; }
.puzzle-actions small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; text-align: center; }
.score-card {
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  text-align: right;
  box-shadow: 0 10px 24px rgba(31, 39, 29, .06);
}
.score-card > span { display: block; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.score-card strong { display: block; font-size: 30px; line-height: 1.1; }
.score-card small { color: var(--muted); font-size: 15px; }
.score-card em { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-style: normal; }
.endgame-banner {
  --endgame-colour: var(--gold-dark);
  max-width: 1480px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0 auto 18px;
  padding: 12px 15px;
  border: 1px solid var(--endgame-colour);
  border-radius: 15px;
  background: color-mix(in srgb, var(--endgame-colour) 11%, var(--paper-2));
}
.endgame-banner[data-phase="imminent"] { --endgame-colour: var(--coral); }
.endgame-banner[data-phase="terminal"] { --endgame-colour: var(--right); }
.endgame-mark { display: grid; place-items: center; flex: none; width: 25px; height: 25px; border: 2px solid currentColor; border-radius: 50%; color: var(--endgame-colour); font-weight: 950; }
.endgame-banner strong, .endgame-banner small { display: block; }
.endgame-banner strong { font-size: 14px; }
.endgame-banner small { margin-top: 2px; color: var(--muted); }

.game-layout {
  max-width: 1480px;
  display: grid;
  grid-template-columns: minmax(500px, 720px) minmax(360px, 1fr);
  align-items: start;
  gap: clamp(22px, 3vw, 42px);
  margin: 0 auto;
}
.board-column, .clue-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.board-column { padding: clamp(14px, 2vw, 24px); }
.board-toolbar {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.board-toolbar strong { display: block; margin-top: 2px; font-size: 16px; }
.turn-label { color: var(--muted); font-size: 10px; }
.entry-navigation { display: flex; gap: 7px; }
.entry-navigation button, .cell-actions button, .theme-button {
  cursor: pointer;
}
.entry-navigation button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-weight: 900;
}

.crossword-frame {
  padding: clamp(9px, 1.4vw, 15px);
  border-radius: 20px;
  background: var(--moss-dark);
}
@keyframes puzzle-endgame-approaching {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 0%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--gold) 30%, transparent); }
}
@keyframes puzzle-endgame-imminent {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--coral) 16%, transparent); }
  50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--coral) 40%, transparent); }
}
.game-section[data-endgame-phase="approaching"] .crossword-frame { animation: puzzle-endgame-approaching 5.6s ease-in-out infinite; }
.game-section[data-endgame-phase="imminent"] .crossword-frame { animation: puzzle-endgame-imminent 3.8s ease-in-out infinite; }
.game-section[data-endgame-phase="terminal"] .crossword-frame { box-shadow: 0 0 0 6px color-mix(in srgb, var(--right) 34%, transparent); }
.game-section[data-endgame-static="true"][data-endgame-phase="approaching"] .crossword-frame { animation: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 30%, transparent); }
.game-section[data-endgame-static="true"][data-endgame-phase="imminent"] .crossword-frame { animation: none; box-shadow: 0 0 0 7px color-mix(in srgb, var(--coral) 38%, transparent); }
.crossword-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  user-select: none;
}
.grid-block, .grid-cell { aspect-ratio: 1; min-width: 0; }
.grid-block { border-radius: 4px; background: var(--block); }
.grid-cell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cec5ae;
  border-radius: 6px;
  background: #fffaf0;
  color: #25271f;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(123, 97, 47, .13);
}
.grid-cell.blank-initial { background: color-mix(in srgb, var(--coral-pale) 42%, #fffaf0); }
.grid-cell.blank-final { background: color-mix(in srgb, var(--gold-pale) 46%, #fffaf0); }
.grid-cell.in-entry { box-shadow: inset 0 0 0 3px rgba(103, 125, 88, .32); }
.grid-cell.crossing::after {
  content: "+";
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #718165;
  font-size: clamp(8px, 1vw, 12px);
  font-weight: 900;
}
.grid-cell.crossing.right::after, .grid-cell.crossing.wrong::after { display: none; }
.grid-cell.active {
  z-index: 2;
  outline: 4px solid #fff;
  box-shadow: 0 0 0 7px var(--moss), inset 0 -2px 0 rgba(0,0,0,.12);
}
.grid-cell.placed-initial { border-color: #b54034; background: var(--coral); color: #fff; }
.grid-cell.placed-final { border-color: #b77a13; background: var(--gold); color: #262217; }
.grid-cell.hinted { background-image: repeating-linear-gradient(135deg, transparent, transparent 5px, rgba(255,255,255,.24) 5px, rgba(255,255,255,.24) 8px); }
.grid-cell.right { box-shadow: inset 0 0 0 4px var(--right); }
.grid-cell.wrong { box-shadow: inset 0 0 0 4px var(--wrong); }
.grid-cell.wrong .cell-mark, .grid-cell.right .cell-mark { display: grid; }
.cell-number {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: clamp(7px, .9vw, 11px);
  font-weight: 900;
  line-height: 1;
}
.cell-kind {
  color: #8b8e80;
  font-size: clamp(9px, 1.25vw, 14px);
  font-weight: 900;
}
.cell-face {
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 2.35vw, 27px);
  font-weight: 800;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.cell-face.long { font-size: clamp(10px, 1.85vw, 21px); }
.cell-points {
  position: absolute;
  right: 4px;
  top: 2px;
  font-size: clamp(7px, .8vw, 10px);
  font-weight: 900;
}
.cell-mark {
  position: absolute;
  right: 2px;
  bottom: 1px;
  width: 15px;
  height: 15px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 10px;
  font-weight: 950;
}

.function-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 2px 4px;
  color: var(--muted);
  font-size: 11px;
}
.function-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 13px; height: 13px; border-radius: 4px; }
.legend-swatch.initial { background: var(--coral); }
.legend-swatch.final { background: var(--gold); }
.legend-swatch.block { background: var(--block); }
.legend-crossing { color: var(--moss); font-style: normal; font-weight: 950; }

.tile-tray-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.tray-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.tray-heading h3 { margin: 3px 0 0; font-size: 18px; }
.tray-help { max-width: 270px; color: var(--muted); font-size: 11px; text-align: right; }
.tile-tray { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 16px 0; }
.tray-empty { color: var(--muted); font-size: 13px; }
.tray-tile {
  position: relative;
  min-width: 58px;
  height: 58px;
  padding: 0 13px;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 11px;
  color: #28251e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(126, 84, 26, .22);
}
.tray-tile.initial { background: var(--coral); color: #fff; }
.tray-tile.final { background: var(--gold); }
.tray-tile.selected { outline: 3px solid var(--moss); outline-offset: 2px; }
.tray-tile small { position: absolute; right: 5px; top: 3px; font: 800 9px/1 Inter, sans-serif; }
.cell-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cell-actions button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  font-weight: 800;
}
.cell-actions button:disabled { opacity: .45; cursor: default; }
.game-status { min-height: 24px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.game-status.success { color: var(--right); font-weight: 800; }
.game-status.error { color: var(--wrong); font-weight: 800; }

.clue-panel { padding: clamp(18px, 2.4vw, 30px); }
.clue-panel-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 20px; }
.clue-panel h3 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 32px; }
.novice-help { max-width: 180px; color: var(--muted); font-size: 11px; text-align: right; }
.clue-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.clue-columns h4 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--moss); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.clue-list { margin: 0; padding: 0; list-style: none; }
.clue-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  margin: 0 0 5px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.clue-button:hover { background: var(--paper); }
.clue-button.active { border-color: var(--moss); background: var(--moss-pale); }
.clue-button.filled .clue-number::after { content: "✓"; display: block; color: var(--right); font-size: 9px; }
.clue-number { font-weight: 950; }
.clue-copy strong { display: block; font-size: 13px; line-height: 1.3; }
.clue-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.clue-copy .clue-mastery { display: inline-flex; margin-top: 5px; padding: 2px 6px; border-radius: 999px; background: var(--paper); color: var(--moss-dark); font-weight: 850; }

.load-error { max-width: 900px; margin: 20px auto 0; padding: 22px; border: 1px solid var(--wrong); border-radius: 16px; background: var(--paper-2); }
.load-error h3 { margin: 0; }

.learning-dashboard {
  max-width: 1480px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 24px 42px;
  margin: 34px auto 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.learning-dashboard h3, .finish-panel h3 { margin: 5px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; }
.learning-dashboard p { margin: 0; color: var(--muted); }
.mastery-meter-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.mastery-meter-copy strong { font-size: 30px; }
.mastery-meter-copy span { color: var(--muted); font-size: 12px; }
.mastery-meter progress { width: 100%; height: 14px; margin: 12px 0 7px; accent-color: var(--coral); }
.mastery-thresholds { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; }
.mastery-states { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0; }
.mastery-states div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.mastery-states dt { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.mastery-states dd { margin: 3px 0 0; font-size: 22px; font-weight: 900; }
.class-curation { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); }
.class-curation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.class-curation-heading h3 { margin-top: 5px; }
.class-curation-heading button, .setlist-workflow button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 850; cursor: pointer; }
.class-curation-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 18px 0 14px; padding: 0; list-style: none; }
.class-curation-words li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.class-curation-words input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--coral); }
.class-curation-words li > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: baseline; }
.class-curation-words strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.class-curation-words span { min-width: 0; overflow-wrap: anywhere; font-weight: 750; }
.class-curation-words small { grid-column: 1 / -1; color: var(--moss-dark); font-size: 10px; font-weight: 800; }
.class-curation-words .empty-curation { display: block; grid-column: 1 / -1; color: var(--muted); text-align: center; }
.setlist-workflow { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px 18px; align-items: end; padding: 17px; border: 1px solid var(--line-strong); border-radius: 15px; background: color-mix(in srgb, var(--paper) 82%, var(--gold) 18%); }
.setlist-workflow label { display: block; margin: 5px 0 7px; font-size: 11px; font-weight: 850; }
.setlist-workflow select, .new-setlist-form input { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); }
.setlist-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.setlist-workflow button.primary:disabled { opacity: .5; cursor: not-allowed; }
.new-setlist-form { grid-column: 1 / -1; }
.new-setlist-form > div { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.setlist-workflow > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
.saved-setlists { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.saved-setlists li { display: inline-flex; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 10px; }
.saved-setlists span { color: var(--muted); }
.setlist-rule { margin-bottom: 0; font-size: 11px; }
.finish-panel {
  max-width: 1480px;
  margin: 18px auto 0;
  padding: 28px;
  border: 2px solid var(--right);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.finish-panel p { color: var(--muted); }
.finish-actions { display: flex; align-items: center; gap: 16px; }
.finish-actions a { color: var(--coral-dark); font-weight: 850; }
.finish-family-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.finish-family-links a { display: inline-flex; flex-direction: column; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-decoration: none; font-size: 12px; font-weight: 800; }
.finish-family-links small { color: var(--muted); font-size: 9px; font-weight: 600; }
.endgame-study-survey { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.endgame-study-survey > h3 { margin-top: 7px; }
.endgame-study-survey fieldset { margin-top: 20px; }
.endgame-study-survey legend { color: var(--ink); font-size: 14px; letter-spacing: 0; text-transform: none; }
.study-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.study-options label { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; }
.study-options input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--coral); }
.study-comments { display: grid; gap: 7px; margin-top: 20px; font-size: 13px; font-weight: 850; }
.study-comments textarea { min-height: 84px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); font: inherit; }
.study-submit { min-height: 44px; margin-top: 18px; padding: 0 16px; border: 0; border-radius: 11px; font-weight: 850; cursor: pointer; }
.study-status { min-height: 20px; margin: 9px 0 0; font-size: 12px; }

.youtube-section {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 50px;
  padding: 82px clamp(24px, 5vw, 82px);
  background: #181c18;
  color: #f3f0e7;
}
.youtube-section h2, .family-section h2 { margin: 7px 0 15px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 3.5vw, 54px); line-height: 1.04; }
.youtube-section > div > p { color: #b9c2b5; }
.youtube-enable { margin-top: 16px; color: #e2e8df; }
.youtube-player-card { padding: 24px; border: 1px solid #394038; border-radius: 20px; background: #222822; }
.youtube-player-card > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 850; }
.youtube-url-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.youtube-url-row input { min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid #4c554a; border-radius: 10px; background: #131713; color: #fff; }
.youtube-url-row button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--coral); color: #fff; font-weight: 850; cursor: pointer; }
.youtube-status { min-height: 20px; color: #aeb9aa; font-size: 11px; }
.youtube-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; margin-top: 14px; border-radius: 14px; background: #000; }
.youtube-frame iframe { width: 100%; height: 100%; border: 0; }
.sync-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.sync-callouts article { padding: 14px; border: 1px solid #3f483d; border-radius: 12px; }
.sync-callouts strong, .sync-callouts span { display: block; }
.sync-callouts span { margin-top: 4px; color: #aeb9aa; font-size: 11px; }

.how-section {
  display: grid;
  grid-template-columns: .65fr 1.35fr;
  gap: 50px;
  padding: 86px clamp(24px, 5vw, 82px);
  background: var(--paper-2);
}
.how-intro > p { max-width: 540px; color: var(--muted); font-size: 17px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.steps article { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.steps article > b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--moss); color: #fff; }
.steps h3 { margin: 18px 0 7px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }

.trust-section, .scoring-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 82px clamp(24px, 5vw, 82px);
}
.trust-section { background: var(--moss-dark); color: var(--paper-2); }
.trust-section .section-kicker { color: #f4b3a7; }
.trust-section p, .scoring-section p { max-width: 700px; font-size: 17px; }
.trust-section dl { margin: 0; }
.trust-section dl div { display: grid; grid-template-columns: 130px 1fr; gap: 15px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.trust-section dt { color: #cfdbca; font-size: 12px; font-weight: 850; text-transform: uppercase; }
.trust-section dd { margin: 0; }
.scoring-section { background: var(--paper); }
.scoring-section p { color: var(--muted); }

.family-section { display: grid; grid-template-columns: .65fr 1.35fr; gap: 52px; padding: 86px clamp(24px, 5vw, 82px); background: var(--paper-2); }
.family-intro p { color: var(--muted); }
.family-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.family-grid a { display: flex; flex-direction: column; min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); text-decoration: none; }
.family-grid a:hover, .family-grid a:focus-visible { border-color: var(--moss); transform: translateY(-2px); }
.family-grid span { color: var(--coral-dark); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.family-grid strong { margin-top: auto; font-size: 19px; }
.family-grid small { margin-top: 4px; color: var(--muted); }

.celebration {
  position: fixed;
  z-index: 90;
  right: 20px;
  bottom: 20px;
  width: min(390px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: #1c251b;
  color: #fff;
  box-shadow: 0 22px 52px rgba(0,0,0,.3);
  animation: celebrate-in .38s ease-out both;
}
.celebration[hidden] { display: none; }
.celebration > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #222; font-size: 24px; font-weight: 950; }
.celebration strong, .celebration p { display: block; }
.celebration p { margin: 3px 0 0; color: #bdc8b9; font-size: 12px; }
.celebration.reduced { animation: none; }
@keyframes celebrate-in { from { opacity: 0; transform: translateY(18px) scale(.96); } }

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 34px clamp(24px, 5vw, 82px);
  background: #141814;
  color: #dce3d8;
}
footer div { display: flex; flex-direction: column; }
footer span, footer a, footer p { color: #9fab9a; font-size: 12px; }
footer p { max-width: 720px; margin: 0; text-align: right; }

@media (max-width: 1120px) {
  .hero { min-height: auto; grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: clamp(46px, 6vw, 70px); }
  .game-layout { grid-template-columns: minmax(460px, 650px) minmax(300px, 1fr); }
  .clue-columns { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .product-bar { gap: 12px; }
  .nav-links a:not(.nav-play), .build-badge { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 58px; }
  .hero-board-card { width: min(100%, 620px); }
  .setup, .how-section, .trust-section, .scoring-section, .youtube-section, .family-section { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .clue-columns { grid-template-columns: 1fr 1fr; }
  .game-heading { flex-wrap: wrap; }
  .game-heading > div:first-child { flex: 1 1 100%; }
}

@media (max-width: 620px) {
  .product-bar { min-height: 62px; padding-inline: 12px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand { font-size: 14px; }
  .nav-play { display: none; }
  .theme-button { margin-left: auto; padding-inline: 10px; }
  .hero { padding: 48px 18px 60px; }
  .hero h1 { font-size: 48px; }
  .hero-copy > p { font-size: 16px; }
  .hero-board-card { padding: 16px; border-radius: 22px; }
  .preview-grid { gap: 2px; padding: 10px; }
  .preview-cell { border-radius: 3px; }
  .setup { padding: 36px 18px; }
  .setup-groups { grid-template-columns: 1fr; }
  .game-section { padding: 54px 8px 68px; }
  .game-heading { padding-inline: 10px; align-items: start; }
  .endgame-study-note, .endgame-banner { margin-inline: 10px; }
  .game-heading h2 { font-size: 34px; }
  .score-card { min-width: 132px; padding: 12px; }
  .puzzle-actions { flex: 1; }
  .board-column, .clue-panel { border-radius: 16px; }
  .board-column { padding: 8px; }
  .crossword-frame { padding: 5px; border-radius: 12px; }
  .crossword-grid { gap: 2px; }
  .grid-cell, .grid-block { border-radius: 3px; }
  .grid-cell.active { outline-width: 2px; box-shadow: 0 0 0 4px var(--moss); }
  .cell-number { top: 1px; left: 2px; }
  .function-legend { padding-inline: 5px; }
  .tile-tray-panel { padding: 13px; }
  .tray-heading { align-items: start; }
  .tray-help { display: none; }
  .tray-tile { min-width: 50px; height: 52px; font-size: 21px; }
  .cell-actions button { flex: 1 1 calc(50% - 8px); }
  .clue-columns { grid-template-columns: 1fr; }
  .learning-dashboard { grid-template-columns: 1fr; margin-inline: 8px; }
  .mastery-meter, .mastery-states { grid-column: 1; }
  .mastery-states { grid-template-columns: repeat(2, 1fr); }
  .study-options { grid-template-columns: 1fr; }
  .class-curation-heading { display: grid; }
  .class-curation-heading button { justify-self: start; }
  .class-curation-words, .setlist-workflow { grid-template-columns: 1fr; }
  .setlist-actions, .new-setlist-form, .setlist-workflow > p, .saved-setlists { grid-column: 1; }
  .new-setlist-form > div { grid-template-columns: 1fr; }
  .how-section, .trust-section, .scoring-section, .youtube-section, .family-section { padding: 62px 20px; }
  .steps { grid-template-columns: 1fr; }
  .youtube-url-row, .sync-callouts, .family-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  footer p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
