.home-scenes {
  --hud-gold: #ffc85f;
  --hud-cream: #fff1d6;
  --hud-border: #8aabd79e;
  --hud-gutter: clamp(14px, 3vw, 44px);
  --hud-mono: ui-monospace, "SF Mono", Consolas, monospace;
}

.home-scenes .studio :focus-visible { outline-color: #ffdc83; }

.home-scenes .studio {
  --console: #121f33;
  --console-raised: #22354d;
  --console-well: #0b172a;
  --console-light: #cfdef5;
  --forest-accent: #c8f2ad;
  --forest-travel: 0;
  --forest-photo: url("./firefly-hollow.webp");
  --forest-width: max(100%, 178svh);
  --forest-pan: 50%;
  --stage-bottom: 16px;
  --skiff-width: clamp(148px, min(27vw, 29svh), 274px);
  --skiff-bottom: clamp(32px, 13svh, 136px);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template:
    "art" minmax(240px, 1fr)
    "console" auto
    / minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 0 var(--hud-gutter) var(--stage-bottom);
  border-radius: 0;
  background: #0e2030 var(--forest-photo) var(--forest-pan) top / var(--forest-width) auto no-repeat;
}

.game-console {
  --panel-inset: clamp(12px, 2.5vw, 20px);
  --panel-line-gap: 10px;
  --panel-section-gap: 18px;
  grid-area: console;
  position: relative;
  z-index: 1;
  width: min(100%, 650px);
  min-width: 0;
  border: 2px solid #627f9c;
  background: var(--console);
  box-shadow: 0 0 0 3px #091526, 5px 7px 0 3px #071222, inset 2px 2px #b7e0e522;
}
.game-console::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -2px 12px auto;
  height: 2px;
  background: repeating-linear-gradient(90deg, #a4d6de 0 6px, #627f9c 6px 10px);
  opacity: .55;
  pointer-events: none;
}
.console-head {
  padding: 8px var(--panel-inset);
  border-bottom: 1px solid #93b8dc55;
  background: linear-gradient(#2a455c, #1a3047);
}
.home-scenes .hero {
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  text-align: left;
}
.studio:has(.mode-picker:not([hidden])) .console-head,
.home-scenes .game form > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stage-modes {
  position: absolute;
  z-index: 4;
  top: clamp(12px, 2.2svh, 22px);
  right: var(--hud-gutter);
  width: min(456px, calc(58% - 2 * var(--hud-gutter)));
}
.stage-modes:has(.mode-picker[hidden]) { display: none; }
.mode-toggle { display: none; }
.home-scenes .mode-picker {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.home-scenes :is(.mode-picker, .result-mode-links) a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid #7798b48a;
  border-radius: 7px;
  background: #112035;
  color: var(--hud-cream);
  box-shadow: 0 3px #091725, inset 0 1px #c4dcf014;
  text-decoration: none;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.mode-picker [data-mode="daily"] { --mode-accent: #ffdb92; --mode-tile: #473923; --mode-selected: #344135; }
:is(.mode-picker, .result-mode-links) [data-mode="classic"] { --mode-accent: #a5dff8; --mode-tile: #233f59; --mode-selected: #263f55; }
:is(.mode-picker, .result-mode-links) [data-mode="endless"] { --mode-accent: #f8b2ce; --mode-tile: #472c4c; --mode-selected: #423049; }
.mode-icon {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #edebdc30;
  border-radius: 5px;
  background: var(--mode-tile);
  color: var(--mode-accent);
}
.mode-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
}
[data-mode="daily"] .mode-icon::before {
  clip-path: polygon(31% 0, 69% 0, 69% 19%, 81% 19%, 81% 31%, 88% 31%, 88% 81%, 74% 81%, 74% 100%, 26% 100%, 26% 81%, 12% 81%, 12% 31%, 19% 31%, 19% 19%, 31% 19%);
}
[data-mode="daily"] .mode-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 6px;
  margin-top: 3px;
  background: #9f6d35;
}
[data-mode="classic"] .mode-icon::before {
  width: 10px;
  height: 12px;
  border-radius: 1px;
  transform: translate(2px, 1px);
  box-shadow: -3px -3px #5988a7, -6px -6px #406280;
}
[data-mode="classic"] .mode-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  transform: translate(2px, 0);
  background: #4a799a;
  box-shadow: 0 2px #4a799a;
}
[data-mode="endless"] .mode-icon::before {
  clip-path: polygon(12% 7%, 39% 7%, 39% 19%, 61% 19%, 61% 7%, 88% 7%, 88% 19%, 100% 19%, 100% 52%, 88% 52%, 88% 64%, 76% 64%, 76% 76%, 64% 76%, 64% 88%, 36% 88%, 36% 76%, 24% 76%, 24% 64%, 12% 64%, 12% 52%, 0 52%, 0 19%, 12% 19%);
}
.mode-copy { display: grid; gap: 3px; min-width: 0; }
.mode-name { font: 800 .94rem/1.08 var(--body-font); }
.mode-detail { color: var(--console-light); font: 650 .72rem/1.18 var(--body-font); }
.home-scenes .mode-picker a[aria-current] {
  border-color: var(--mode-accent);
  background: var(--mode-selected);
  color: var(--hud-cream);
  box-shadow: 0 3px #091725, inset 0 0 0 1px #f6e8ba20;
}
.mode-picker a[aria-current]::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 4px;
  height: 4px;
  background: var(--mode-accent);
  box-shadow: 0 0 6px var(--mode-accent);
}
.home-scenes .mode-picker a:active {
  box-shadow: 0 1px #091725, inset 0 0 0 1px var(--mode-accent);
}
@media (hover: hover) {
  .home-scenes .mode-picker a:hover:not([aria-current]) {
    border-color: var(--mode-accent);
    background: var(--mode-selected);
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-scenes .mode-picker a { transition: none; }
}
.home-scenes .hero h1 {
  color: var(--hud-cream);
  font: 800 clamp(1rem, 3vw, 1.25rem)/1.15 var(--body-font);
  letter-spacing: -.02em;
  text-shadow: none;
}
.home-scenes .hero-summary {
  margin: 4px 0 0;
  padding: 0;
  background: transparent;
  color: var(--console-light);
  font-size: .82rem;
}
.home-scenes .hero #return-game { margin-top: 10px; }
.home-scenes .studio:has(.play-area[hidden]) {
  grid-template: "console" auto / minmax(0, 1fr);
  align-content: start;
  padding-top: clamp(32px, 9svh, 96px);
}
.home-scenes .studio:has(.play-area[hidden]) :is(.scene-art, .forest-art, .forest-water) { display: none; }
.game-console:has(.play-area[hidden]) .console-head { padding-block: 16px; border-radius: 11px; border-bottom: 0; }
.game-console:has(.play-area[hidden]) .hero h1 { font-size: clamp(1.35rem, 4vw, 2rem); }
.game-console:has(.play-area[hidden], #result:not([hidden])) .score-badge { display: none; }

.forest-motion {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}
.forest-motion::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#0c1028dc, transparent 95px),
    linear-gradient(0deg, #0d1528ed 0%, #0d152833 38%, transparent 63%);
}
.forest-texture {
  position: absolute;
  top: 0;
  left: var(--forest-pan);
  width: var(--forest-width);
  aspect-ratio: 1672 / 941;
  transform: translateX(calc(0% - var(--forest-pan)));
}
.forest-patch, .forest-patch::before {
  position: absolute;
  inset: 0;
}
.forest-patch {
  mask-image: radial-gradient(ellipse var(--patch-size) at var(--patch-center), #000 26%, transparent 96%);
}
.forest-patch::before {
  content: "";
  background: var(--forest-photo) center / 100% 100% no-repeat;
}
.studio:not([data-scene-visible]) .forest-patch::before { animation-play-state: paused; }
.forest-leaves::before {
  transform-origin: var(--branch-pivot);
  animation: forest-sway var(--sway-period, 7s) ease-in-out var(--sway-delay, 0s) infinite alternate;
}
.forest-leaves-left {
  --patch-size: 11% 15%;
  --patch-center: 5% 33%;
  --branch-pivot: 1% 26%;
}
.forest-leaves-vines {
  --patch-size: 13% 19%;
  --patch-center: 43% 19%;
  --branch-pivot: 43% 6%;
  --sway-period: 6s;
  --sway-delay: -2s;
}
.forest-leaves-right {
  --patch-size: 13% 12%;
  --patch-center: 64% 17%;
  --branch-pivot: 61% 9%;
  --sway-period: 8s;
  --sway-delay: -4s;
}
.forest-current::before {
  animation: forest-current 5.8s ease-in-out var(--current-delay, -2s) infinite alternate;
}
.forest-current-moon { --patch-size: 13% 20%; --patch-center: 75% 64%; }
.forest-current-river { --patch-size: 33% 21%; --patch-center: 38% 73%; --current-delay: -4s; }
@keyframes forest-sway {
  from { transform: rotate(-2deg); }
  to { transform: rotate(2deg); }
}
@keyframes forest-current {
  0% { transform: translate(-9px, 1px); }
  54% { transform: translate(6px, -2px); }
  100% { transform: translate(11px, 1px); }
}

.scene-art {
  grid-area: art;
  align-self: stretch;
  position: relative;
  z-index: 0;
  width: min(100%, 1000px);
  container-type: size;
  pointer-events: none;
}
.forest-art {
  --skiff-overlap: clamp(18px, var(--skiff-width) / 6, 44px);
  --skiff-drift: 18px;
  --skiff-position: calc(max(var(--skiff-width) / 2 + 5px, var(--panel-left) - var(--skiff-width) * .16) + var(--forest-travel) * var(--skiff-drift));
  --skiff-foot: calc(var(--panel-bottom) + var(--skiff-width) / 2 - var(--skiff-overlap));
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}
.forest-art:has(.forest-boat[data-placed]) { z-index: 5; }
.forest-art::before {
  content: "";
  position: absolute;
  left: var(--skiff-position);
  top: calc(var(--skiff-foot) - 20px);
  width: clamp(142px, 23vw, 310px);
  height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 64% 30%, #ffc88a52, transparent 37%),
    radial-gradient(ellipse at 50% 56%, #69dce744, transparent 67%);
  pointer-events: none;
  transition: left .85s cubic-bezier(.16, .78, .28, 1), transform .42s cubic-bezier(.22, .72, .25, 1);
}
.forest-art:has(.forest-boat[data-placed])::before {
  left: var(--placed-x);
  top: calc(var(--placed-y) - 16px);
  transition: none;
}
.forest-distance {
  position: absolute;
  top: 36%;
  right: 5%;
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #b2c2f5a1;
  border-right: 4px solid var(--forest-accent);
  border-radius: 3px;
  background: #101b31;
  box-shadow: 3px 4px #080c19a8;
}
#forest-distance { color: var(--forest-accent); font: 800 1.33rem/1 var(--hud-mono); }
.distance-label { font: 700 .7rem/1 var(--hud-mono); letter-spacing: .13em; text-transform: uppercase; }
.forest-boat {
  position: absolute;
  z-index: 1;
  left: var(--skiff-position);
  top: var(--skiff-foot);
  width: var(--skiff-width);
  transform: translate(-50%, -100%);
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: left .85s cubic-bezier(.16, .78, .28, 1), transform .42s cubic-bezier(.22, .72, .25, 1);
}
.forest-boat[data-placed] {
  left: var(--placed-x);
  top: var(--placed-y);
  transition: none;
}
.forest-boat[data-dragging] { cursor: grabbing; }
.forest-boat[data-dragging] img { animation-play-state: paused; }
.forest-ripples {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  overflow: clip;
}
.forest-ripples i {
  position: absolute;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 1px solid #aaf5f0c4;
  border-radius: 50%;
  box-shadow: 0 0 5px #6ed6d7, inset 0 0 4px #6ed6d7;
}
.forest-boat img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 9px 6px #07172391);
  image-rendering: pixelated;
  animation: forest-bob 4s ease-in-out infinite;
}
.forest-boat:hover img { filter: drop-shadow(0 6px 9px #a6f7c857); }
.forest-boat::after {
  content: "";
  position: absolute;
  top: 59%;
  left: 84%;
  width: 39%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffd07465, transparent 66%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: forest-lantern 3.7s ease-in-out infinite alternate;
}
.forest-wake {
  position: absolute;
  inset: auto 0 1% -9%;
  height: 24%;
  opacity: 0;
  border: 2px solid #c8ffdb;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #80dccc67, inset 0 0 0 4px #cafde045;
}
.forest-burst {
  position: absolute;
  z-index: 2;
  top: 73%;
  left: 62%;
  pointer-events: none;
}
.forest-burst i {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #ffe4a3;
  box-shadow: 0 0 6px #ffc15e;
  animation: forest-spark-trail 720ms cubic-bezier(.16, .7, .34, 1) var(--spark-delay) both;
}
.forest-burst i:nth-child(2n) {
  width: 3px;
  height: 3px;
  background: #adffe8;
  box-shadow: 0 0 6px #57d5d1;
}
.forest-burst i:nth-child(5n) { background: #eee0ff; box-shadow: 0 0 7px #ba8cf0; }
.forest-atmosphere {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.studio:has(.play-area[hidden]) .forest-atmosphere { display: none; }
.forest-water {
  position: absolute;
  inset: 82% 0 auto;
  height: clamp(43px, 14svh, 128px);
  overflow: hidden;
  pointer-events: none;
}
.forest-water::before {
  content: "";
  position: absolute;
  inset: 59% 0 0;
  opacity: .3;
  background: radial-gradient(ellipse at 55% 62%, #acdbcc80 0%, transparent 64%);
  animation: forest-haze 12s ease-in-out infinite alternate;
}
@keyframes forest-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}
@keyframes forest-haze {
  to { transform: translateX(8%); opacity: .65; }
}
@keyframes forest-lantern {
  from { opacity: .32; }
  to { opacity: .8; }
}
@keyframes forest-spark-trail {
  0% { transform: translate(0, 0) scale(.55); opacity: 0; }
  28% {
    transform: translate(calc(var(--spark-x) * .45), calc(var(--spark-y) * .45)) scale(1);
    opacity: 1;
  }
  100% { transform: translate(var(--spark-x), var(--spark-y)) scale(.24); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .forest-boat, .forest-art::before { transition: none; }
  .forest-patch, .forest-ripples, .forest-burst { display: none; }
  .forest-art :is(img, i), .forest-water::before, .forest-boat::after { animation: none; }
}

.home-scenes .play-area { width: 100%; min-height: 0; margin: 0; }
.home-scenes .game {
  color: var(--hud-cream);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.home-scenes .game-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 38px;
  padding: 5px var(--panel-inset);
  border-bottom: 2px solid #36516c;
  background: #152840;
  color: var(--console-light);
}
.home-scenes .round-progress {
  gap: 11px;
  font: 720 .81rem/1.2 var(--hud-mono);
}
.round-status {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}
.question-prompt {
  --timer-width: clamp(110px, 13vw, 148px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
#round:has(#guess:not([hidden])) .question-prompt {
  grid-template-columns: minmax(0, 1fr) var(--timer-width);
  column-gap: clamp(12px, 2.8vw, 30px);
}
.question-timer {
  align-self: center;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 13px 11px;
  border: 2px solid #82cedcaf;
  background: #143748;
  color: #c7f5ff;
  box-shadow: 0 0 14px #76d4e430;
  font: 760 1rem/1 var(--hud-mono);
  font-variant-numeric: tabular-nums;
}
.timer-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}
#time-left { font-size: clamp(2.5rem, 4.2vw, 3.2rem); }
.timer-track {
  height: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: #090f1bb3;
}
.timer-track::before {
  content: "";
  display: block;
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 8px);
  transform: scaleX(var(--time-ratio, 1));
  transform-origin: left;
  transition: transform .25s linear;
}
.question-timer[data-urgent] {
  border-color: #ffb2a1;
  background: #4a2730;
  color: #ffd1c0;
  box-shadow: 0 0 14px #ff9e8b38;
}
@media (prefers-reduced-motion: reduce) {
  .timer-track::before { transition: none; }
}
.home-scenes .marks { gap: 6px; }
.home-scenes .marks i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid #ffeabd56;
  background: #100b1754;
}
.home-scenes .marks i.done { border-color: #8de4ab; background: #67b98a; }
.home-scenes .marks i.current { border-color: #e7ffd2; background: #a8db9d; box-shadow: 0 0 10px #b1eb9f55; }
.home-scenes .score-badge {
  min-width: 64px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid #ac8658a1;
  border-radius: 5px;
  background: var(--console-well);
  color: var(--hud-gold);
  font-family: var(--hud-mono);
  line-height: 1.15;
}
.home-scenes .score-badge output { font-size: 1.18rem; }
.home-scenes .score-badge span { font-size: .73rem; }
.home-scenes .game-inner { padding: var(--panel-section-gap) var(--panel-inset); }
.home-scenes .game h2 {
  max-width: 100%;
  margin: 0 0 12px;
  color: var(--hud-cream);
  font: 800 clamp(1.26rem, 2.5vw, 1.7rem)/1.22 var(--body-font);
  letter-spacing: -.026em;
  text-align: left;
  overflow-wrap: anywhere;
}
.home-scenes #round { background: radial-gradient(ellipse at 10% 0%, #1b344d, transparent 72%); }
.home-scenes #question {
  margin-bottom: var(--panel-section-gap);
  font-size: clamp(1.38rem, 3vw, 2rem);
  line-height: 1.24;
}
.question-instructions {
  margin: 0 0 var(--panel-line-gap);
  color: var(--console-light);
  font-size: .83rem;
  line-height: 1.35;
}
#round:has(#feedback:not([hidden])) .question-instructions { display: none; }
.home-scenes #round:has(#feedback:not([hidden])) #question {
  font-size: clamp(1.16rem, 2.5vw, 1.65rem);
  text-wrap: wrap;
}
.home-scenes .game .topic { margin-bottom: var(--panel-line-gap); color: var(--hud-gold); font-size: .75rem; }
.home-scenes .round-number { margin: 0; color: var(--console-light); font-size: .75rem; }
.home-scenes .round-number:empty { display: none; }
.home-scenes .form-controls input, .home-scenes :is(#share-round-text, #question-share-value) {
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid #667b91;
  background: var(--console-well);
  color: var(--hud-cream);
  font-size: 1rem;
  box-shadow: inset 0 2px #0004;
}
.home-scenes .form-controls input::placeholder { color: #ddc6b5; }
.home-scenes .game .primary {
  min-height: 44px;
  border: 2px solid #f0bc61;
  border-radius: 0;
  background: #ffd77e;
  color: #302218;
  box-shadow: inset 2px 2px #fff1bd, inset -2px -3px #d79943, 2px 3px #080f1f;
  white-space: normal;
}
.home-scenes .game .primary:hover { background: #ffe199; }
.home-scenes .game .primary:active { transform: translateY(1px); }
.home-scenes .game .primary [aria-hidden] { color: inherit; }
.home-scenes .form-controls .primary { min-width: max-content; justify-content: center; }
.home-scenes .form-controls .primary [aria-hidden] { display: none; }
.home-scenes .pass {
  min-height: 44px;
  margin-top: calc(var(--panel-line-gap) / 2);
  color: var(--console-light);
  font-size: .8125rem;
  text-underline-offset: .2em;
}
.home-scenes .pass:hover { color: #fff4ce; }
.home-scenes .game .error { color: #ffb4a9; }
.home-scenes .covered { display: none; }
.home-scenes #answer-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--panel-line-gap);
  padding: 0;
  margin-bottom: var(--panel-section-gap);
  border: 0;
  background: none;
}
.home-scenes #answer-board li {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  grid-template-areas: "rank points" "answer answer";
  justify-items: start;
  align-items: start;
  align-content: start;
  gap: 6px;
  min-height: 54px;
  padding: 10px 8px;
  text-align: start;
  border: 2px solid #4e6b87;
  border-radius: 0;
  box-shadow: inset 0 -3px #060e1e;
  background: var(--console-well);
  color: var(--hud-cream);
  animation: none;
}
.home-scenes #answer-board li.match {
  border-color: var(--forest-accent);
  outline: 0;
  background: #263f45;
  color: #e4ffcf;
}
.home-scenes #answer-board li.match strong::before { content: none; }
.home-scenes #answer-board li.match span::after {
  content: " ✓";
  color: var(--forest-accent);
}
.home-scenes #answer-board li::before {
  grid-area: rank;
  color: var(--console-light);
  font: 750 .73rem/1.2 var(--hud-mono);
  white-space: nowrap;
}
.home-scenes #answer-board li span {
  grid-area: answer;
  font: 740 .88rem/1.3 var(--body-font);
}
.home-scenes #answer-board strong {
  grid-area: points;
  justify-self: end;
  color: var(--hud-gold);
  font: 750 .73rem/1.2 var(--hud-mono);
  white-space: nowrap;
}
.feedback-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px var(--panel-line-gap);
  margin-bottom: var(--panel-section-gap);
}
.home-scenes .feedback-verdict h3 {
  margin: 0;
  color: var(--hud-gold);
  font: 800 1rem/1.3 var(--body-font);
}
.home-scenes .feedback-verdict p {
  margin: 0;
  color: var(--console-light);
  font-size: .84rem;
  line-height: 1.4;
}
.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--panel-line-gap);
}
.home-scenes .game .question-share {
  border-color: var(--hud-border);
  background: var(--console-well);
  color: var(--hud-cream);
  box-shadow: none;
  font-size: .875rem;
}
.home-scenes .game .question-share:hover { background: var(--console-raised); }
.question-share-fallback {
  margin-top: var(--panel-section-gap);
  padding-top: var(--panel-line-gap);
  border-top: 1px solid var(--hud-border);
}
#question-share-status:empty { display: none; }
.home-scenes #question-share-value {
  display: block;
  width: 100%;
  min-height: 0;
  margin-bottom: var(--panel-line-gap);
  padding: 9px 10px;
  overflow: hidden;
  resize: none;
  font: .92rem/1.4 var(--body-font);
  overflow-wrap: anywhere;
}
.home-scenes .result-total strong, .home-scenes .result .comparison { color: var(--hud-gold); }
.home-scenes .result :is(.result-total span, .share-note) { color: var(--console-light); }
.home-scenes .result .recap li { color: var(--hud-cream); border-color: var(--hud-border); background: var(--console-well); }
.home-scenes .game #return-game { color: var(--hud-cream); }
.archive-result { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; }
.archive-result .help-link { color: var(--hud-cream); }

.scene-dock {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-inline: var(--panel-inset);
  border-top: 2px solid #36516c;
  background: var(--console-well);
}
.scene-guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 8px;
  color: var(--console-light);
  font-size: .81rem;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.scene-guide-link:hover {
  color: var(--hud-cream);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.scene-guide-link:focus-visible { outline-offset: -3px; }

.home-scenes .game-guide.shell { width: min(1020px, calc(100% - 48px)); margin-block: clamp(32px, 5vw, 58px); }
.home-overview {
  display: grid;
  justify-items: start;
  row-gap: clamp(10px, 1.4vw, 14px);
}
.home-scenes .home-overview h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 2.45rem);
  text-wrap: initial;
}
.overview-copy { max-width: 65ch; }
.overview-copy p + p { color: var(--muted); }
.overview-play { gap: 6px; }
.friend-copy-status:empty { display: none; }
.friend-share-text {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 7px 10px;
  overflow: hidden;
  overflow-wrap: anywhere;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--green);
  font: .92rem/1.28 var(--body-font);
}
.home-scenes .guide-topics { padding-inline: 0; }
.home-scenes .mode-list dd { max-width: 66ch; }
.game-question-group { margin-top: clamp(20px, 4vw, 32px); }
.game-question-group h3 {
  margin: 0 0 8px;
  color: var(--green);
  font: 700 1.3rem/1.2 var(--title-font);
}
.game-question-grid { display: grid; column-gap: clamp(24px, 5vw, 56px); }
.game-question-grid > div { padding-block: 13px; border-top: 1px solid var(--line); }
.game-question-grid h4 { margin: 0 0 5px; color: var(--green); font-size: 1rem; line-height: 1.3; }
.game-question-grid p { color: var(--muted); }
.game-question-grid a { font-weight: 700; text-underline-offset: .2em; }
@media (min-width: 761px) {
  .home-scenes .rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-scenes .sample { border-top: 0; border-left: 1px solid var(--line); border-radius: 0 14px 14px 0; }
  .game-question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 841px) and (max-width: 1390px) and (min-height: 481px) {
  .studio:has(.mode-picker:not([hidden])) .journey-lights {
    left: 0;
    width: min(380px, calc(100% - 460px));
    transform: none;
  }
}

@media (max-width: 840px), (max-height: 480px) {
  .stage-modes { width: auto; }
  .mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 119px;
    min-height: 44px;
    padding: 5px 9px;
    border: 1px solid #89a9c9ad;
    border-radius: 7px;
    background: var(--console-well);
    color: var(--hud-cream);
    box-shadow: 0 3px #081322;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .mode-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    margin: -3px 1px 0 2px;
    border-right: 2px solid var(--hud-gold);
    border-bottom: 2px solid var(--hud-gold);
    transform: rotate(45deg);
  }
  .mode-toggle[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(225deg); }
  .stage-modes .mode-picker {
    grid-template-columns: minmax(0, 1fr);
    width: min(245px, calc(100vw - 2 * var(--hud-gutter)));
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--hud-border);
    border-radius: 9px;
    background: #0c192a;
    box-shadow: 0 5px 21px #061322b3;
  }
  .stage-modes .mode-toggle:not([hidden]) + .mode-picker {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
  }
  .stage-modes .mode-toggle:not([hidden])[aria-expanded="false"] + .mode-picker { display: none; }
  .studio:has(.mode-picker:not([hidden])) .journey-lights {
    left: 0;
    width: min(380px, calc(100% - 140px));
    transform: none;
  }
  .studio:has(.mode-picker:not([hidden])) .forest-distance { top: max(46px, 22%); }
}

@media (max-width: 840px) {
  .home-scenes .studio {
    --stage-bottom: 10px;
    --forest-pan: 72%;
    --skiff-width: clamp(107px, min(38vw, 25svh), 188px);
    --skiff-bottom: clamp(10px, calc(6svh - 8px), 50px);
  }
  .scene-art { width: min(100%, 580px); }
  .forest-art { --skiff-overlap: 16px; }
  .forest-distance { right: 0; top: 22%; padding: 6px 8px; }
  .distance-label { font-size: .625rem; }
  #forest-distance { font-size: 1.04rem; }
}
@media (max-width: 520px) {
  .home-scenes .studio {
    --skiff-width: clamp(88px, min(34vw, 25svh), 188px);
    gap: 7px;
  }
  .forest-art { --skiff-drift: 8px; }
  .console-head { padding-block: 6px; }
  .home-scenes .round-progress { font-size: clamp(.72rem, 3.35vw, .81rem); }
  .round-status { gap: 7px; }
  .question-prompt { --timer-width: clamp(72px, 20vw, 92px); }
  #round:has(#guess:not([hidden])) .question-prompt { column-gap: 10px; }
  .question-timer { gap: 5px; padding: 7px 8px 8px; font-size: .82rem; }
  #time-left { font-size: 2rem; }
  .timer-track { height: 4px; }
  .home-scenes .round-number { font-size: .7rem; }
  .home-scenes #answer-board li::before,
  .home-scenes #answer-board strong { font-size: .68rem; }
  .home-scenes .score-badge { min-width: 0; padding: 4px 6px; }
  .home-scenes .score-badge output { font-size: 1rem; }
  .game-console { --panel-line-gap: 8px; --panel-section-gap: 14px; }
  .home-scenes .form-controls { flex-direction: row; gap: 6px; }
  .home-scenes .form-controls .primary { padding-inline: 8px; font-size: .875rem; }
  .home-scenes .form-controls input { padding-inline: 8px; }
  .home-scenes .game h2 { margin-bottom: 10px; }
  .home-scenes #question { font-size: clamp(1.31rem, 5.9vw, 1.54rem); }
  .question-instructions { font-size: .76rem; }
  .home-scenes .game-guide.shell { width: calc(100% - 32px); }
}

.home-scenes .studio:has(.play-area:not([hidden])) {
  --panel-top: clamp(100px, 22svh, 220px);
  min-height: max(100svh, 400px);
  /* The skiff image is twice as wide as it is tall. */
  padding-bottom: calc(var(--stage-bottom) + var(--skiff-bottom) + var(--skiff-width) / 2);
  grid-template-rows: var(--panel-top) auto;
  align-content: start;
  overflow-anchor: none;
}
.home-scenes .studio:has(.play-area:not([hidden])) .scene-art {
  position: absolute;
  inset: 20px 0 0;
  width: min(100%, 1000px);
  margin-inline: auto;
}
.home-scenes .game {
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.home-scenes .game-bar { flex: none; }
.home-scenes .game-bar .marks { display: none; }
.home-scenes :is(#question, #feedback-title, #result-title) { scroll-margin: 0; }
.home-scenes .feedback .card-rack.revealed { perspective: none; }
.journey-recap {
  border: 2px solid #405d77;
  background: var(--console-well);
}
.journey-recap:has(.recap[hidden]) { display: none; }
.journey-recap summary {
  min-height: 38px;
  padding: 8px 10px;
  color: var(--console-light);
  font: 720 .8rem/1.3 var(--hud-mono);
  cursor: pointer;
}
.journey-recap[open] summary { border-bottom: 1px solid #405d77; }
.home-scenes .result .recap { gap: var(--panel-line-gap); margin: 0; padding: var(--panel-line-gap); }
.home-scenes .result .recap li { padding-block: var(--panel-line-gap); border-radius: 0; overflow-wrap: anywhere; }

.journey-flight {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}
.journey-flight i {
  position: absolute;
  inset: -3px auto auto -3px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff8ce;
  background: #ffd76e;
  box-shadow: 0 0 7px 2px #ffb84ba6, 0 0 17px #ffd580c9;
  opacity: 0;
}
.journey-flight i:nth-child(3n + 2) {
  border-color: #ddffed;
  background: #a8ffda;
  box-shadow: 0 0 7px 2px #8affc49a, 0 0 17px #72ffe4a8;
}
.journey-lights {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(72%, 380px);
  height: 25px;
  padding-inline: 4px;
  transform: translateX(-50%);
}
.journey-lights::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 50% 6px auto;
  height: 2px;
  background: repeating-linear-gradient(90deg, #eac48880 0 4px, transparent 4px 8px);
}
.journey-lights i {
  position: relative;
  width: 15px;
  height: 17px;
  border: 2px solid #bea482;
  border-radius: 3px;
  background: #151c32;
  box-shadow: 0 2px #131528;
}
.journey-lights i::before, .journey-lights i::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 2px;
  transform: translateX(-50%);
  background: #b99f83;
}
.journey-lights i::before { top: -5px; }
.journey-lights i::after { bottom: -4px; }
.journey-lights i.up-next { border-color: #ffdf9f; }
.journey-lights i.lit {
  border-color: #fff0bf;
  background: #ffc667;
  box-shadow: 0 0 0 3px #ffc66733, 0 0 16px #ffae60d6;
  animation: lamp-lit .35s ease-out both;
}
.journey-lights i.lit::before, .journey-lights i.lit::after { background: #ffe29f; }
@keyframes lamp-lit {
  from { scale: 1.26; }
  to { scale: 1; }
}
.journey-cue {
  position: absolute;
  z-index: 3;
  top: 25%;
  left: 50%;
  margin: 0;
  padding: 7px 13px;
  border: 1px solid #f0d596;
  border-radius: 7px;
  background: #11192bec;
  color: #fff2c1;
  font: 800 clamp(.84rem, 1.8vw, 1.18rem)/1.2 var(--hud-mono);
  white-space: nowrap;
  transform: translateX(-50%);
  animation: cue-in .22s ease-out both;
}
@keyframes cue-in {
  from { opacity: 0; translate: 0 6px; }
}
.studio[data-reaction="arrival"] .game { opacity: .25; pointer-events: none; }
.studio[data-arrived]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("./firefly-dock.webp") var(--dock-pan, 50%) top / var(--forest-width) auto no-repeat;
  pointer-events: none;
  animation: dock-in .65s ease both;
}
.studio[data-arrived] .forest-texture {
  --forest-photo: url("./firefly-dock.webp");
  --forest-pan: var(--dock-pan, 50%);
}
.studio[data-arrived] .forest-motion::after {
  background: linear-gradient(0deg, #0d1528ed 0%, transparent 57%);
}
.studio[data-arrived] .forest-leaves { display: none; }
.studio[data-arrived]:has(#result:not([hidden])) .game-bar { display: none; }
.home-scenes #result {
  display: grid;
  gap: var(--panel-section-gap);
}
.result-scorecard, .result-actions {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--panel-line-gap);
  padding: clamp(12px, 2.4vw, 22px);
  border: 2px solid #405d77;
}
.result-scorecard { border-top-color: #d5a953; background: #182a40; }
.result-actions { background: var(--console-well); }
.home-scenes .result #result-title {
  margin: 0;
  color: var(--hud-cream);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
}
.home-scenes .result :is(p, #share-round-text, .share-actions) { margin: 0; }
.home-scenes .result .topic { margin: 0; font-family: var(--hud-mono); }
.home-scenes .result .result-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 9px;
}
.home-scenes .result-total strong {
  font: 850 clamp(2.25rem, 5vw, 3.45rem)/1 var(--hud-mono);
}
.home-scenes .result :is(.result-total span, #result-message, .share-note) {
  color: var(--console-light);
  font-size: .88rem;
  line-height: 1.45;
}
.home-scenes .result #share-round-text { font-size: .92rem; }
.home-scenes .result .share-actions { row-gap: var(--panel-line-gap); }
.result-mode-links {
  display: grid;
  gap: var(--panel-line-gap);
  width: 100%;
  padding-top: var(--panel-line-gap);
  border-top: 1px solid #405d77;
}
.result-mode-links h3 {
  margin: 0;
  color: var(--console-light);
  font: 750 .84rem/1.25 var(--hud-mono);
}
.home-scenes .result-mode-links a {
  border-radius: 0;
  min-height: 44px;
}
.home-scenes .result-mode-links a:hover {
  border-color: var(--mode-accent);
  background: var(--mode-selected);
}
@media (min-width: 761px) {
  .home-scenes #result { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .home-scenes #result .journey-recap { grid-column: 1 / -1; }
}
@keyframes dock-in {
  from { opacity: 0; }
}
@media (min-width: 841px) {
  .game-console:has(.play-area:not([hidden])) {
    --panel-inset: clamp(20px, 2.4vw, 28px);
    --panel-width: clamp(36rem, 46vw, 44rem);
    display: flex;
    flex-direction: column;
    width: min(100%, var(--panel-width));
    min-height: calc(var(--panel-width) / 1.618);
  }
  .home-scenes .play-area { display: flex; flex: 1; }
  .home-scenes .game { flex: 1; min-width: 0; }
  .home-scenes #round {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
  }
  .home-scenes #result {
    flex: 1;
    grid-template-rows: 1fr auto;
  }
  .home-scenes #answer-board li {
    padding-inline: 12px;
  }
  .home-scenes #question {
    font-size: clamp(1.75rem, 2.5vw, 2.15rem);
    text-wrap: balance;
  }
}
@media (max-width: 840px) {
  .home-scenes .studio:has(.play-area:not([hidden])) {
    --panel-top: clamp(88px, 32svh, 280px);
  }
  .studio[data-arrived] { --dock-pan: 77%; }
}
@media (max-height: 420px) {
  .home-scenes .studio:has(.play-area:not([hidden])) {
    --panel-top: 55px;
  }
  .studio:has(.mode-picker:not([hidden])) .forest-distance { display: none; }
}
@media (max-width: 520px) {
  .question-actions { flex-wrap: nowrap; }
  .question-actions .primary {
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    padding-inline: 9px;
    font-size: .85rem;
    overflow-wrap: anywhere;
  }
  .question-actions .next [aria-hidden] { display: none; }
}
@media (max-height: 560px) {
  .scene-art .forest-distance { top: 2px; }
  .home-scenes .studio { --skiff-width: clamp(63px, min(34vw, 19svh), 110px); }
}
@media (prefers-reduced-motion: reduce) {
  .journey-flight { display: none; }
  .journey-lights i.lit, .journey-cue, .studio[data-arrived]::before { animation: none; }
}
