.game-page main {
  color: var(--ink);
  background: var(--paper);
  --paper: #faf4e8;
  --cream: #fffbf3;
  --ink: #291f1b;
  --muted: #66574e;
  --rule: #dac9b6;
  --red: #ef6353;
  --red-ink: #ad372a;
  --pink: #f9dfd5;
  --gold: #ffd16a;
  --gold-pale: #fff0c2;
  --green: #dbe7c7;
  --heading: Georgia, "Times New Roman", serif;
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }
:where(.game-page button, .game-page select) { color: inherit; font: inherit; }
.game-page button, .game-page select, .game-page summary { -webkit-tap-highlight-color: transparent; }
.game-page button:not(:disabled), .game-page select:not(:disabled), .game-page summary { cursor: pointer; }
.game-page .crumbs { padding-top: 15px; margin-block: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell { width: min(100% - 48px, 1080px); margin-inline: auto; }
.hero { position: relative; display: grid; place-items: center; min-height: 249px; padding: 31px 140px 34px; text-align: center; isolation: isolate; }
.hero-art {
  position: absolute;
  z-index: -1;
  aspect-ratio: 1;
  width: clamp(102px, 16vw, 169px);
  pointer-events: none;
}
.hero-art.star { left: 0; bottom: 28px; transform: rotate(-6deg); }
.hero-art.die { right: 0; bottom: 31px; transform: rotate(7deg); }
.hero h1 { font: 700 clamp(3.05rem, 6.25vw, 6rem)/.98 var(--heading); letter-spacing: -.076em; text-wrap: balance; }
.hero h1 em { color: var(--red-ink); font-weight: inherit; }
.hero p { max-width: 510px; margin: 18px auto 0; color: var(--muted); font-size: 1.08rem; text-wrap: balance; }
.play-grid { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 22px; align-items: stretch; scroll-margin-top: 20px; }
.panel { background: var(--cream); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 5px 0 var(--ink); }
.setup { padding: 19px 19px 20px; }
.setup:not([open]) { align-self: start; }
.panel-title { font: 700 1.48rem/1.1 var(--heading); letter-spacing: -.035em; }
.setup-title { display: block; padding: 0; }
.setup-title::after { content: none; }
.setup-heading { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.setup[open] .setup-title { padding-bottom: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--rule); }
.setup-icon { width: 35px; height: 35px; display: grid; flex: 0 0 auto; place-items: center; background: var(--pink); border: 1px solid var(--rule); border-radius: 9px; }
.setup-icon .icon { width: 19px; height: 19px; }
.setup-chevron { margin-inline-start: auto; width: 18px; height: 18px; }
.setup[open] .setup-chevron { transform: rotate(180deg); }
fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.options { display: grid; gap: 15px; }
.control-label { display: block; padding: 0; margin-bottom: 6px; font-size: .75rem; line-height: 1.25; letter-spacing: .095em; text-transform: uppercase; font-weight: 800; }
.mode-options { display: grid; gap: 6px; }
.mode-option, .segment { position: relative; min-width: 0; cursor: pointer; }
.mode-choice {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 6px 9px;
  background: var(--cream);
  border: 1.5px solid var(--rule);
  border-radius: 9px;
}
.mode-choice .icon { width: 20px; height: 20px; }
.mode-choice strong, .mode-choice small { display: block; line-height: 1.21; }
.mode-choice strong { font-size: .89rem; }
.mode-choice small { margin-top: 2px; font-size: .75rem; color: var(--muted); }
.mode-choice::after { content: ""; width: 12px; height: 12px; border: 1.5px solid #917a6e; border-radius: 50%; }
.mode-option input:checked + .mode-choice { background: var(--pink); border-color: var(--ink); }
.mode-option input:checked + .mode-choice::after { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--pink); }
.mode-option:hover .mode-choice, .segment:hover span { border-color: var(--ink); }
.mode-option input:focus-visible + .mode-choice, .segment input:focus-visible + span { outline: 3px solid #375d92; outline-offset: 2px; }
.select-wrap { position: relative; }
.select-wrap .icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
select { width: 100%; min-height: 42px; padding: 7px 30px 7px 11px; appearance: none; background: var(--cream); border: 1.5px solid var(--rule); border-radius: 8px; font-size: .875rem; font-weight: 700; }
select:not(:disabled):hover { border-color: var(--ink); }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.segment span { display: grid; min-height: 38px; padding: 4px 1px; place-items: center; background: var(--cream); border: 1.5px solid var(--rule); border-radius: 7px; font-size: .82rem; font-weight: 700; }
.segment input:checked + span { background: var(--gold); border-color: var(--ink); }
.options:disabled { opacity: .68; }
.options:disabled label { cursor: default; }
.options:disabled label:hover .mode-choice, .options:disabled label:hover span { border-color: var(--rule); }
.options:disabled label:hover input:checked + span, .options:disabled label:hover input:checked + .mode-choice { border-color: var(--ink); }

.board { display: flex; flex-direction: column; min-width: 0; padding: 18px; }
.board-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 1px 14px; }
.board-header h2 { flex: 0 0 auto; }
.round-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 7px; }
.score, .timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 5px 9px;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 800;
  white-space: nowrap;
}
.score { background: var(--gold-pale); }
.timer { background: var(--cream); min-width: 75px; }
.timer time { font-variant-numeric: tabular-nums; }
.timer.urgent { border-color: var(--red-ink); color: var(--red-ink); background: #fce0d7; }
.timer .icon { width: 16px; height: 16px; }
.timer-toggle { min-height: 39px; padding: 5px 10px; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; font-size: .84rem; font-weight: 800; white-space: nowrap; }
.timer-toggle:not(:disabled):hover { background: var(--gold-pale); }
.timer-toggle:disabled { opacity: .5; }

.stage {
  display: grid;
  flex: 1 1 auto;
  min-height: 284px;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: radial-gradient(circle, #d9b99c 0.85px, transparent 1.15px) 0 0 / 13px 13px, #f8e8d6;
}
.card-stack { position: relative; isolation: isolate; width: min(100% - 30px, 440px); margin: 10px 0; }
.card-stack::before, .card-stack::after { content: ""; position: absolute; z-index: -1; inset: 4px 0 1px; border: 1.5px solid var(--ink); border-radius: 16px; }
.card-stack::before { background: var(--red); transform: rotate(-4deg) translate(-3px, 1px); }
.card-stack::after { background: var(--gold); transform: rotate(4deg) translate(3px, 2px); }
.prompt-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 208px;
  padding: 21px 26px 15px;
  text-align: center;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  box-shadow: 3px 4px 0 var(--ink);
}
.prompt-card::before, .prompt-card::after {
  content: "✦";
  position: absolute;
  color: var(--red-ink);
  font-size: .96rem;
  line-height: 1;
}
.prompt-card::before { top: 12px; left: 13px; }
.prompt-card::after { bottom: 12px; right: 13px; }
.card-face { display: grid; align-content: center; justify-items: center; gap: 8px; min-width: 0; }
.card-kind {
  font-size: .72rem;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--red-ink);
}
.prompt-mark { width: 38px; height: 38px; color: var(--red-ink); fill: var(--pink); }
.prompt { font: 700 clamp(2rem, 4vw, 3.65rem)/1.01 var(--heading); letter-spacing: -.055em; text-wrap: balance; overflow-wrap: anywhere; }
.prompt.long { font-size: clamp(1.55rem, 3.12vw, 2.7rem); }
.card-note { width: fit-content; max-width: 100%; justify-self: center; margin-top: 12px; color: var(--muted); font-size: .85rem; line-height: 1.3; text-wrap: balance; }
.prompt-card.dealt { animation: deal .25s ease-out both; }
@keyframes deal { from { transform: translateY(5px) rotate(-1.5deg); opacity: .72; } to { transform: none; opacity: 1; } }
.actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(94px, 26%); gap: 11px; margin-top: 15px; }
.action {
  display: inline-flex;
  min-height: 49px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 3px 0 var(--ink);
  font-size: 1rem;
  font-weight: 800;
}
.action.primary { background: var(--red); }
.action.primary[data-action="correct"] { background: var(--green); }
.action.secondary { background: var(--cream); }
.action:not(:disabled):hover { filter: brightness(.97); transform: translateY(-1px); }
.action:not(:disabled):active { transform: translate(2px, 3px); box-shadow: none; }
.action:disabled { background: #f3ebdf; border-color: #c7b5a3; color: #716358; box-shadow: none; }
.board-note { min-height: 19px; margin-top: 10px; text-align: center; color: var(--muted); font-size: .8rem; }
kbd { font: .75rem/1.1 var(--body); padding: 1px 4px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); }

.game-page .guide { margin-top: 48px; padding: 43px 0 46px; background: #f5e8d3; border-block: 1px solid var(--rule); scroll-margin-top: 0; }
.section-title { font: 700 clamp(2.1rem, 4vw, 3.35rem)/1.02 var(--heading); letter-spacing: -.06em; }
.guide-intro { margin-top: 10px; color: var(--muted); }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.rule-card { padding: 20px; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 12px; }
.rule-card h3 { display: flex; gap: 9px; align-items: center; font: 700 1.4rem/1.1 var(--heading); letter-spacing: -.035em; }
.rule-card h3 .icon { width: 21px; height: 21px; }
.rule-card p { margin-top: 8px; color: var(--muted); }
.faq { padding-block: 44px 49px; }
.faq .section-title { margin-bottom: 19px; }
details { border-top: 1px solid var(--rule); }
details:last-child { border-bottom: 1px solid var(--rule); }
summary { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 13px 2px; font-weight: 800; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--red-ink); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { max-width: 70ch; padding: 0 2px 15px; color: var(--muted); }
@media (max-width: 950px) {
  .hero { padding-inline: 125px; min-height: 226px; }
  .play-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 17px; }
  .setup, .board { padding-inline: 14px; }
}
@media (max-width: 750px) {
  .shell { width: min(100% - 32px, 600px); }
  .hero { min-height: 207px; padding-inline: 68px; padding-bottom: 25px; }
  .hero-art { width: 92px; }
  .hero-art.star { left: -10px; bottom: 29px; }
  .hero-art.die { right: -10px; bottom: 29px; }
  .hero p { font-size: 1rem; }
  .play-grid { grid-template-columns: minmax(0, 1fr); gap: 19px; }
  .setup, .board { padding-inline: 16px; }
  .options { grid-template-columns: 1fr 1fr; gap: 12px; }
  .control-mode, .control-category { grid-column: 1 / -1; }
  .mode-options { grid-template-columns: 1fr 1fr; }
  .stage { min-height: 260px; }
  .game-page .guide { margin-top: 37px; padding-block: 33px; }
  .faq { padding-block: 33px 38px; }
}
@media (max-width: 450px) {
  .hero { min-height: 156px; padding: 16px 45px 15px; }
  .hero-art { width: 62px; }
  .hero-art.star { left: -8px; bottom: 27px; }
  .hero-art.die { right: -8px; bottom: 27px; }
  .hero h1 { font-size: clamp(2.5rem, 10vw, 3.15rem); line-height: .93; }
  .hero p { margin-top: 10px; font-size: .91rem; line-height: 1.42; }
  .play-grid { gap: 15px; }
  .panel { border-radius: 14px; box-shadow: 3px 4px 0 var(--ink); }
  .setup, .board { padding: 12px; }
  .setup { padding-block: 5px; }
  .setup[open] { padding-bottom: 12px; }
  .setup[open] .setup-title { padding-bottom: 4px; margin-bottom: 8px; }
  .setup-icon { width: 30px; height: 30px; }
  .panel-title { font-size: 1.28rem; }
  .mode-choice { grid-template-columns: minmax(0, 1fr) 11px; gap: 4px; padding: 5px 6px; }
  .mode-choice > .icon { display: none; }
  .mode-choice strong { font-size: .82rem; }
  .mode-choice small { font-size: .7rem; }
  .options { grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); gap: 10px 7px; }
  .segments { gap: 3px; }
  .difficulty .segments { grid-template-columns: 1fr .85fr 1.24fr .9fr; }
  .segment span { font-size: .72rem; }
  .board-header { flex-wrap: wrap; padding-bottom: 10px; }
  .board-header h2 { flex: 1 1 auto; }
  .round-controls { flex: 0 0 auto; max-inline-size: 100%; gap: 5px; margin-inline-start: auto; }
  .score, .timer, .timer-toggle { min-height: 35px; gap: 4px; padding-inline: 5px; font-size: .77rem; }
  .timer { min-width: 53px; }
  .timer .icon { width: 13px; height: 13px; }
  .stage { min-height: 183px; padding: 6px 10px; }
  .card-stack { width: calc(100% - 24px); }
  .prompt-card { min-height: 153px; padding: 14px 14px 11px; }
  .prompt { font-size: clamp(1.75rem, 8vw, 2.6rem); }
  .prompt.long { font-size: clamp(1.34rem, 6.4vw, 2.2rem); }
  .card-note { font-size: .77rem; }
  .prompt-mark { width: 30px; height: 30px; }
  .actions { margin-top: 12px; }
  .rule-grid { grid-template-columns: 1fr; gap: 12px; }
  .rule-card { padding: 16px; }
}
@media (max-width: 360px) {
  .options { grid-template-columns: 1fr; }
  .difficulty .segments { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .segment span { font-size: .8rem; }
}
@media (hover: none) { .keyboard-note { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .prompt-card.dealt { animation: none; }
}

.game-page.kids main {
  --paper: #fff8e7;
  --cream: #fffdf6;
  --muted: #55566a;
  --rule: #d1cce0;
  --red: #ed7565;
  --red-ink: #574179;
  --pink: #e9ddfa;
  --gold: #ffd475;
  --gold-pale: #fff0bf;
  --green: #d5efdf;
  --lilac: #c7b3ef;
}

.kids .hero { padding-block: 25px 28px; }
.kids .hero h1 { font-size: clamp(2.85rem, 5.9vw, 5.8rem); line-height: .9; }
.kids .hero h1 em { display: block; margin-top: .12em; font-size: .82em; letter-spacing: -.06em; }
.kids .hero p { margin-top: 14px; }
.kids .mode-choice::after { border-color: #786e88; }
.kids .timer.urgent { border-color: #ab3e31; color: #ab3e31; }
.kids .stage { background: radial-gradient(circle, #bcabdc .85px, transparent 1.15px) 0 0 / 13px 13px, #f0e7fb; }
.kids .action.primary:not([data-action="correct"]) { background: var(--lilac); }
.kids .action:disabled { background: #f2edf7; border-color: #c5bad4; color: #62576e; }
.game-page.kids .guide { background: #f2e9fa; }
.kids .difficulty .segments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 361px) and (max-width: 450px) {
  .kids .options { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
@media (max-width: 450px) {
  .kids .hero { min-height: 156px; padding: 17px 39px; }
  .kids .hero h1 { font-size: clamp(1.75rem, 7.4vw, 2.45rem); line-height: .95; }
  .kids .hero p { margin-top: 10px; }
}

@media (max-width: 450px) and (max-height: 650px) {
  .game-page .crumbs { padding-top: 8px; }
  .hero, .kids .hero { min-height: 0; padding: 8px 38px; }
  .kids .hero { padding-inline: 12px; }
  .hero h1, .kids .hero h1 { font-size: clamp(1.65rem, 7vw, 2rem); }
  .hero p, .kids .hero p { margin-top: 7px; font-size: .85rem; }
  .kids .hero p { padding-inline: 26px; }
  .hero-art { width: 48px; }
  .hero-art.star, .hero-art.die { bottom: 14px; }
  .play-grid { gap: 11px; }
  .board { padding-block: 10px; }
  .board-header { justify-content: flex-end; padding-bottom: 7px; }
  .board-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stage { min-height: 135px; }
  .prompt-card { min-height: 112px; padding-block: 10px 8px; }
  .prompt-mark { width: 22px; height: 22px; }
  .card-note { margin-top: 7px; }
  .actions { grid-template-columns: minmax(0, 1fr) minmax(76px, 26%); gap: 8px; margin-top: 9px; }
}
