@font-face {
  font-family: Kumbh;
  src: url("/vendor/kumbh-sans/regular.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --run-bg: #1c2231;
  --run-panel: #273345;
  --run-high: #344359;
  --run-ink: #f2f2ec;
  --run-muted: #bbc5d0;
  --run-accent: #f8a78f;
  --run-coral: #f77062;
  --run-line: #adbdcf33;
  --run-focus: #ffe0a5;
  --run-font: Arial, Helvetica, sans-serif;
}
html[data-theme="day"] {
  color-scheme: light;
  --run-bg: #eeede7;
  --run-panel: #e3e7e3;
  --run-high: #f3f3ed;
  --run-ink: #292e31;
  --run-muted: #495355;
  --run-accent: #923328;
  --run-line: #5263733a;
  --run-focus: #923328;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--run-bg);
  color: var(--run-ink);
  font: 15px/1.55 var(--run-font);
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--run-line);
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff0e, transparent), var(--run-panel);
  padding: 10px 18px;
  min-height: 46px;
  font-weight: 600;
  box-shadow: 0 3px 0 #080e191c;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: var(--run-high);
  border-color: var(--run-accent);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--run-focus);
  outline-offset: 4px;
}
.skip {
  position: absolute;
  left: 14px;
  top: -70px;
  z-index: 20;
  padding: 14px;
  background: var(--run-panel);
}
.skip:focus {
  top: 10px;
}
.run-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 80px);
  border-bottom: 1px solid var(--run-line);
  background: var(--run-panel);
}
.wordmark {
  font:
    30px/1 Kumbh,
    var(--run-font);
  letter-spacing: -1px;
  text-decoration: none;
  color: var(--run-coral);
  display: flex;
  gap: 12px;
  align-items: center;
}
.wordmark > span {
  font: bold 13px/1 Arial;
  background: var(--run-coral);
  color: #fff;
  padding: 10px 5px;
  border-radius: 3px;
  letter-spacing: 0;
}
.run-header nav {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.run-header nav a {
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.run-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 56px);
}
.game-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--run-muted);
  margin: 0 0 9px;
}
h1 {
  margin: 0;
  font:
    600 clamp(26px, 3.4vw, 42px) / 1.1 Kumbh,
    var(--run-font);
  letter-spacing: -0.045em;
}
h1 span {
  font: 14px/1.4 var(--run-font);
  display: inline-block;
  color: var(--run-muted);
  letter-spacing: 0;
  margin-left: 18px;
}
.quiet-link {
  font-size: 12px;
  color: var(--run-accent);
}
.game-frame {
  border: 1px solid var(--run-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--run-panel);
  box-shadow:
    0 20px 50px #080d2022,
    0 4px 0 #080d201c;
}
.hud {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: 15px 22px;
}
.hud > div {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}
.hud .hud-stage {
  margin-right: auto;
}
.hud small {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--run-muted);
}
.hud strong {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.hud #health {
  letter-spacing: 3px;
  color: var(--run-accent);
}
#pause {
  min-width: 46px;
  padding: 8px;
}
.progress-track {
  height: 4px;
  position: relative;
}
.progress-track progress {
  width: 100%;
  height: 4px;
  display: block;
  border: 0;
  background: #53657944;
  appearance: none;
}
.progress-track progress::-webkit-progress-bar {
  background: #53657944;
}
.progress-track progress::-webkit-progress-value {
  background: var(--run-coral);
}
.progress-track progress::-moz-progress-bar {
  background: var(--run-coral);
}
.progress-track span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.game-stage {
  position: relative;
  height: clamp(300px, 46vw, 590px);
  max-height: max(240px, calc(100svh - 320px));
  background: #263950;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  outline-offset: -4px;
}
.game-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: clamp(18px, 4vw, 56px);
  background: linear-gradient(
    90deg,
    #192535c9 0,
    #19253599 45%,
    transparent 78%
  );
  color: #f2f2ec;
  overflow: auto;
}
.game-screen[hidden] {
  display: none;
}
.screen-card {
  max-width: 405px;
}
.screen-card .eyebrow {
  color: #f8a78f;
}
.screen-card h2 {
  font:
    600 clamp(34px, 4.5vw, 62px) / 1.02 Kumbh,
    Arial;
  letter-spacing: -0.05em;
  margin: 12px 0 16px;
}
.screen-card > p {
  max-width: 35ch;
  color: #dce3e8;
  font-size: 14px;
  line-height: 1.7;
}
.screen-card label {
  display: block;
  font-size: 11px;
  margin: 18px 0 6px;
  color: #dce3e8;
}
.screen-card select {
  display: block;
  background: #26354a;
  color: #f2f2ec;
  border: 1px solid #bbd0e655;
  border-radius: 9px;
  padding: 10px;
  width: 100%;
  min-height: 44px;
  font-size: 13px;
}
.screen-card button {
  margin: 12px 9px 0 0;
  background: #314359;
  color: #f2f2ec;
  border-color: #c8d5df66;
}
.screen-card .primary {
  display: inline-flex;
  background: #f8a78f;
  color: #252b37;
  border-color: #f8a78f;
  min-width: 150px;
  justify-content: center;
}
.screen-card .primary:hover {
  background: #ffd0b9;
  color: #252b37;
}
.screen-card .screen-note {
  font-size: 11px;
  color: #d2d9e2;
  line-height: 1.6;
}
.screen-card .screen-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.screen-card .screen-actions a {
  margin-top: 12px;
  font-size: 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.game-screen.is-result {
  background: linear-gradient(
    90deg,
    #192535f0 0,
    #192535aa 50%,
    transparent 85%
  );
}
.is-result .screen-card {
  max-width: 440px;
}
.is-result h2 {
  font-size: clamp(30px, 4vw, 48px);
}
.run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.run-stats > div {
  border-top: 1px solid #c3d0df55;
  padding-top: 8px;
}
.run-stats dt {
  font-size: 10px;
  color: #bbc5d0;
}
.run-stats dd {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
}
.chapter-banner {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 22px;
  border: 1px solid #dfbeaa77;
  border-radius: 12px;
  background: #1a293be6;
  box-shadow: 0 12px 20px #0002;
  color: #f3eee8;
  text-align: center;
  max-width: 90%;
  font-size: 14px;
  pointer-events: none;
}
.chapter-banner small {
  display: block;
  color: #f8a78f;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 9px;
  margin-bottom: 3px;
}
.game-caption {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-top: 1px solid var(--run-line);
  min-height: 51px;
}
.game-caption p {
  margin: 0;
  font-size: 12px;
}
.game-caption #dev-line {
  color: var(--run-accent);
  margin-right: auto;
}
.game-caption #kit {
  font-size: 10px;
  color: var(--run-muted);
  text-align: right;
}
.next-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px 10px;
  min-height: 28px;
  font-size: 11px;
}
.next-row p {
  margin: 0;
}
.next-row span {
  color: var(--run-muted);
}
.touch-controls {
  display: flex;
  gap: 10px;
  padding: 0 22px 17px;
}
.touch-controls #jump,
.touch-controls #slide {
  min-width: 140px;
  min-height: 54px;
  touch-action: none;
}
.touch-controls button span {
  font-size: 20px;
  color: var(--run-accent);
  margin-right: 12px;
}
.touch-controls #sound {
  margin-left: auto;
  min-width: 110px;
  font-size: 11px;
}
kbd {
  font: 10px/1.4 var(--run-font);
  color: var(--run-muted);
  border: 1px solid var(--run-line);
  border-radius: 4px;
  padding: 3px 5px;
  margin-left: 8px;
}
.instructions {
  font-size: 11px;
  line-height: 2;
  color: var(--run-muted);
  margin: 17px 0 22px;
}
.instructions kbd {
  margin-left: 0;
}
.orientation-note {
  display: none;
  font-size: 11px;
  color: var(--run-muted);
}
.field-notes {
  border-top: 1px solid var(--run-line);
  padding: 16px 0;
}
.field-notes summary {
  cursor: pointer;
  min-height: 44px;
  color: var(--run-accent);
  font-size: 13px;
}
.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1050px;
}
.notes-grid h2 {
  font-size: 18px;
}
.notes-grid p,
.credits {
  font-size: 12px;
  line-height: 1.9;
  color: var(--run-muted);
}
.credits {
  max-width: 1000px;
  margin-top: 20px;
}
.toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 15px 0;
}
.toolbox span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--run-line);
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 10px;
}
.toolbox img {
  height: 20px;
  max-width: 48px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 2px;
}
.run-footer {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--run-line);
  padding: 30px clamp(20px, 5vw, 80px);
  font-size: 11px;
  color: var(--run-muted);
}
.run-footer > span {
  margin-right: auto;
}
.run-footer b {
  color: var(--run-accent);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.run-debug {
  padding: 20px;
  font: 12px monospace;
  background: #101927;
  color: #fff;
  white-space: pre-wrap;
}
.run-debug button {
  margin: 5px;
}
.performance-note {
  font-size: 10px;
  color: #bbc5d0;
}
.game-frame[data-status="running"] #world {
  cursor: default;
}
@media (max-width: 700px) {
  .run-header {
    padding: 10px 16px;
    min-height: 62px;
  }
  .wordmark {
    font-size: 23px;
    gap: 8px;
  }
  .wordmark > span {
    font-size: 10px;
    padding: 8px 4px;
  }
  .run-header nav {
    gap: 13px;
    font-size: 10px;
  }
  .run-shell {
    padding: 20px 12px;
  }
  .game-heading {
    margin-bottom: 16px;
  }
  .game-heading .quiet-link {
    display: none;
  }
  h1 span {
    font-size: 11px;
    margin-left: 10px;
  }
  .hud {
    padding: 11px 12px;
    gap: 12px;
  }
  .hud > div {
    min-width: 46px;
  }
  .hud small {
    font-size: 8px;
  }
  .hud strong {
    font-size: 13px;
  }
  .hud-stage {
    max-width: 38%;
  }
  .hud #health {
    letter-spacing: 0;
  }
  #pause {
    min-width: 40px;
    min-height: 40px;
  }
  .game-frame {
    border-radius: 14px;
  }
  .game-stage {
    height: 350px;
    max-height: none;
  }
  .game-caption {
    padding: 10px 12px;
    align-items: flex-start;
    min-height: 56px;
  }
  .game-caption #dev-line {
    font-size: 11px;
    max-width: 58%;
  }
  .game-caption #kit {
    font-size: 9px;
    max-width: 40%;
  }
  .touch-controls {
    padding: 0 12px 12px;
    gap: 8px;
  }
  .touch-controls #jump,
  .touch-controls #slide {
    flex: 1;
    min-width: 0;
    min-height: 58px;
    padding: 10px;
  }
  .touch-controls #sound {
    min-width: 73px;
    padding: 8px;
    font-size: 10px;
  }
  .touch-controls kbd {
    display: none;
  }
  .next-row {
    font-size: 10px;
    padding: 0 12px 10px;
  }
  .next-row #best {
    max-width: 110px;
    text-align: right;
  }
  .orientation-note {
    display: block;
  }
  .screen-card {
    max-width: 300px;
  }
  .screen-card h2 {
    font-size: 35px;
    line-height: 1.03;
    margin: 8px 0 10px;
  }
  .screen-card > p {
    font-size: 12px;
    max-width: 29ch;
  }
  .screen-card label {
    margin-top: 9px;
  }
  .screen-card select {
    font-size: 11px;
    padding: 8px;
    min-height: 40px;
  }
  .screen-card .screen-note {
    font-size: 9px;
    margin-bottom: 0;
  }
  .screen-card .primary {
    min-height: 44px;
    margin-top: 10px;
  }
  .game-screen {
    padding: 20px;
    background: linear-gradient(90deg, #192535e6, #19253599);
  }
  .screen-card > p:nth-child(3) {
    margin: 8px 0;
  }
  .game-screen.is-result {
    padding: 17px;
    background: #192535db;
  }
  .is-result h2 {
    font-size: 30px;
  }
  .run-stats {
    gap: 9px;
    margin: 14px 0;
  }
  .run-stats dd {
    font-size: 18px;
  }
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .run-footer {
    padding: 24px 16px;
    gap: 16px;
  }
  .run-footer > span {
    width: 100%;
  }
  .instructions {
    font-size: 10px;
  }
}
@media (max-width: 380px) {
  .run-header nav a:last-child {
    display: none;
  }
  .game-stage {
    height: 354px;
  }
  .hud {
    gap: 9px;
  }
  .hud strong {
    font-size: 12px;
  }
  .hud small {
    font-size: 7px;
  }
  .game-heading h1 span {
    display: block;
    margin: 6px 0 0;
  }
  .game-caption #kit {
    font-size: 8px;
  }
  .touch-controls button span {
    margin-right: 5px;
  }
}
@media (max-height: 600px) and (min-width: 600px) {
  .run-header {
    padding: 6px 20px;
    min-height: 48px;
  }
  .wordmark {
    font-size: 22px;
  }
  .wordmark > span {
    padding: 7px 4px;
  }
  .run-shell {
    padding: 10px 15px;
  }
  .game-heading,
  .instructions,
  .orientation-note {
    display: none;
  }
  .hud {
    padding: 6px 12px;
    gap: 22px;
  }
  .hud strong {
    font-size: 13px;
  }
  .hud small {
    font-size: 8px;
  }
  .hud #pause {
    min-height: 36px;
  }
  .game-stage {
    height: calc(100svh - 195px);
    min-height: 200px;
    max-height: none;
  }
  .touch-controls {
    padding: 0 12px 9px;
    gap: 8px;
  }
  .touch-controls #jump,
  .touch-controls #slide {
    min-height: 43px;
  }
  .game-caption {
    padding: 5px 12px;
    min-height: 30px;
  }
  .next-row {
    padding: 0 12px 5px;
    font-size: 10px;
    min-height: 20px;
  }
  .game-screen {
    padding: 16px 24px;
  }
  .screen-card {
    max-width: 470px;
  }
  .screen-card h2 {
    font-size: 30px;
    margin: 3px 0;
  }
  .screen-card h2 br {
    display: none;
  }
  .screen-card > p {
    font-size: 11px;
    margin: 4px 0;
    max-width: none;
  }
  .screen-card label,
  .screen-note,
  .screen-card > .eyebrow {
    display: none;
  }
  .screen-card select {
    display: inline-block;
    width: 235px;
    min-height: 38px;
    font-size: 11px;
  }
  .screen-card .primary {
    margin: 7px 0 0 10px;
    min-height: 38px;
  }
  .run-stats {
    grid-template-columns: repeat(6, 1fr);
    margin: 8px 0;
  }
  .run-stats dd {
    font-size: 16px;
  }
  .run-stats dt {
    font-size: 8px;
  }
  .screen-card .screen-actions button {
    margin-top: 2px;
    min-height: 37px;
  }
  .field-notes {
    margin-top: 18px;
  }
  .game-screen.is-result {
    padding: 10px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Menus stay wholly reachable, including compact laptop and phone viewports. */
.game-screen {
  align-items: safe center;
  padding: 24px 4%;
}
.screen-card {
  max-width: 390px;
}
.screen-card h2 {
  font-size: clamp(34px, 4vw, 50px);
  margin: 5px 0 12px;
}
.screen-card > .eyebrow {
  margin: 0 0 6px;
}
.screen-card > p {
  margin: 8px 0;
  line-height: 1.5;
}
.screen-card label {
  margin: 10px 0 5px;
}
.screen-card .screen-note {
  line-height: 1.4;
}
.screen-card .primary {
  margin-top: 10px;
}
@media (max-width: 700px) {
  .game-screen {
    padding: 17px 20px;
  }
  .screen-card h2 {
    font-size: 34px;
  }
  .screen-card > p {
    font-size: 12px;
  }
  .screen-card .screen-note {
    font-size: 9px;
  }
  .hud .hud-stage {
    min-width: 0;
    flex: 1;
  }
  .hud > div:not(.hud-stage) {
    min-width: 38px;
  }
  .hud {
    gap: 9px;
  }
  .hud #pause {
    padding: 7px;
    min-width: 36px;
  }
  .run-stats {
    margin: 10px 0;
  }
}
@media (max-height: 600px) and (min-width: 600px) {
  .game-screen {
    padding: 12px 24px;
  }
  .screen-card {
    max-width: 500px;
  }
  .screen-card h2 {
    font-size: 29px;
    margin: 0 0 5px;
  }
  .screen-card > p {
    font-size: 11px;
    margin: 4px 0;
  }
  .screen-card .primary {
    margin: 7px 0 0 10px;
  }
  .screen-card .screen-note {
    display: none;
  }
}

.screen-card {
  width: 390px;
  flex-shrink: 0;
  max-width: 100%;
}
@media (max-width: 700px) {
  .screen-card {
    width: 300px;
  }
}
@media (max-height: 600px) and (min-width: 600px) {
  .screen-card {
    width: 500px;
  }
}

@media (min-width: 701px) {
  .is-result .screen-card {
    width: 570px;
    max-width: 64%;
  }
  .is-result h2 {
    font-size: 40px;
  }
  .is-result .run-stats {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 15px 0;
  }
  .is-result .run-stats dd {
    font-size: 19px;
  }
  .is-result .screen-actions {
    gap: 12px;
  }
}
@media (max-width: 700px) {
  .is-result h2 {
    font-size: 27px;
  }
  .is-result .screen-card > p {
    font-size: 11px;
  }
  .is-result .run-stats {
    gap: 7px;
    margin: 10px 0;
  }
  .is-result .screen-actions {
    gap: 4px 12px;
  }
  .is-result .screen-actions button,
  .is-result .screen-actions a {
    margin-top: 4px;
    min-height: 38px;
  }
  .is-result .screen-actions a {
    font-size: 11px;
  }
  .is-result .screen-note,
  .is-result .performance-note {
    font-size: 9px;
  }
}

.screen-card .eyebrow,
.screen-card .screen-note {
  max-width: none;
}

html[data-theme="day"] .wordmark {
  color: #923328;
}
.wordmark > span {
  color: #1c2231;
}
@media (max-width: 700px) {
  .game-stage {
    height: clamp(240px, calc(100svh - 250px), 350px);
  }
  .hud-stage strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .is-result .screen-card > p:not(.performance-note) {
    display: none;
  }
  .is-result h2 {
    font-size: 26px;
    margin: 0 0 8px;
  }
  .is-result .run-stats {
    margin: 8px 0;
    gap: 7px;
  }
  .is-result .run-stats dd {
    font-size: 17px;
  }
  .is-result .run-stats dt {
    font-size: 9px;
  }
  .is-result .performance-note {
    font-size: 9px;
    line-height: 1.3;
    margin: 6px 0;
  }
  .is-result .screen-actions .primary {
    width: 100%;
    margin: 0;
    min-height: 40px;
  }
  .is-result .screen-actions a {
    min-height: 28px;
    font-size: 10px;
    margin-top: 0;
  }
}

.game-screen .screen-card {
  max-width: 100%;
}
@media (max-height: 600px) and (min-width: 600px) {
  .is-result h2 {
    font-size: 28px;
    margin: 0 0 6px;
  }
  .is-result .screen-card > p:not(.performance-note) {
    display: none;
  }
  .is-result .run-stats {
    margin: 8px 0;
    gap: 10px;
  }
  .is-result .run-stats dd {
    font-size: 17px;
  }
  .is-result .performance-note {
    font-size: 9px;
    margin: 4px 0;
  }
  .is-result .screen-actions {
    gap: 10px;
  }
  .is-result .screen-actions button,
  .is-result .screen-actions a {
    margin: 3px 0 0;
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}
@media (max-height: 600px) and (min-width: 600px) {
  .game-heading {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .game-heading .quiet-link {
    display: none;
  }
}
/* The quiet route keeps every ceremony beat, without timed motion. */
#screen.ceremony-screen {
  align-items: end;
  background: linear-gradient(transparent 60%, #142031c9);
  pointer-events: none;
}
.ceremony-card {
  pointer-events: auto;
  position: absolute;
  left: 4%;
  bottom: 4%;
  max-width: 90%;
}
.ceremony-card h2 {
  font-size: clamp(16px, 2.4vw, 25px);
  margin: 0 0 10px;
}
#kit[data-cover="true"]::before {
  content: "◆ ";
  color: var(--run-accent);
}
.run-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 480px) {
  .run-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .run-stats dt {
    font-size: 9px;
  }
  .run-stats dd {
    font-size: 17px;
  }
  .ceremony-card {
    bottom: 4%;
    left: 5%;
  }
  .ceremony-card h2 {
    font-size: 17px;
  }
}
/* The ending stays visible. Results become the next part of the page. */
.game-stage:has(#screen.epilogue) {
  height: auto;
  max-height: none;
}
.game-stage:has(#screen.epilogue) #world {
  height: clamp(280px, 38vw, 430px);
}
#screen.epilogue {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  padding: 25px 28px;
  background: var(--run-panel);
  border-top: 1px solid var(--run-line);
}
#screen.epilogue .screen-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
#screen.epilogue .screen-card h2 {
  font-size: 32px;
  margin: 0 0 10px;
}
#screen.epilogue .run-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: none;
}
#screen.epilogue .screen-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
@media (max-width: 600px) {
  .game-stage:has(#screen.epilogue) #world {
    height: 280px;
  }
  #screen.epilogue {
    padding: 20px 16px;
  }
  #screen.epilogue .run-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #screen.epilogue .screen-actions {
    gap: 12px;
  }
  #screen.epilogue .screen-card h2 {
    font-size: 27px;
  }
}
#screen.epilogue {
  color: var(--run-ink);
}
#screen.epilogue .run-stats dt,
#screen.epilogue .screen-card > p {
  color: var(--run-muted);
}
#screen.epilogue .screen-card > .eyebrow {
  color: var(--run-accent);
}
#screen.epilogue .run-stats dt {
  font-size: 11px;
}
#screen.epilogue .screen-actions a {
  font-size: 12px;
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
}
.touch-controls button {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  min-height: 52px;
}
.touch-controls button[aria-pressed="true"] {
  background: #f77062;
  color: #172333;
}
.walk-option {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin: 12px 0;
}
.walk-option input {
  width: 20px;
  height: 20px;
  accent-color: #f77062;
}
@media (max-width: 600px) {
  .touch-controls {
    gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .touch-controls #sound {
    grid-column: 1/-1;
    min-height: 32px;
  }
  .touch-controls button {
    padding: 8px 4px;
    font-size: 12px;
  }
  .touch-controls kbd {
    display: none;
  }
}

/* Companion occupies its own HUD column; it never floats over controls or hazards. */
.hud .run-companion{flex:0 0 44px;width:44px;height:50px;min-width:44px;min-height:50px;padding:0;background:transparent;border:0;display:grid;place-items:center;align-self:center;box-shadow:none}
.run-companion canvas{display:block;width:30px;height:50px;pointer-events:none}
.run-companion:focus-visible{outline:2px solid #f8a78f;outline-offset:-2px;border-radius:8px}
.hud-stage{min-width:0}.hud-stage strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.companion-panel{position:absolute;z-index:18;left:12px;top:62px;max-width:min(310px,calc(100% - 24px));max-height:calc(100% - 90px);overflow:auto;padding:16px;border:1px solid #9cacb8;border-radius:16px;background:#233243;color:#f3f1e9;box-shadow:0 8px 24px #10172288}
.companion-panel[hidden]{display:none}.companion-panel p{margin:0 0 12px;font-size:14px;line-height:1.5}.companion-panel button{min-height:44px;min-width:72px}
.journey-choice{font-size:12px!important;margin:5px 0 12px!important}.journey-choice a{color:#f8a78f;text-underline-offset:3px}
@media(max-width:500px){.hud{gap:7px}.hud .run-companion{flex-basis:44px}.hud-stage{flex:1}.hud-tools{display:none}}

/* Fullscreen discovery: a reserved HUD cell, never a floating playfield control. */
.hud #exit-immersive{display:none!important}
.hud .fullscreen-control{display:flex;flex:0 0 58px;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:58px;min-height:46px;height:46px;padding:3px;border-radius:11px;background:#fa677114;border:1px solid #fa677180;color:inherit;cursor:pointer;position:static;order:0}
.fullscreen-control svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;transition:transform .18s}.fullscreen-control span{font:600 9px/1.1 system-ui,sans-serif;white-space:nowrap}
.fullscreen-control:hover svg,.fullscreen-control:focus-visible svg{transform:scale(1.12)}.fullscreen-control:hover{box-shadow:0 0 0 3px #fa67711a}.fullscreen-control:active{transform:translateY(1px)}.fullscreen-control:focus-visible{outline:3px solid #fa6771;outline-offset:3px}
.fullscreen-control[data-active="true"] svg{transform:rotate(180deg) scale(.8)}
.fullscreen-invite{position:relative;z-index:11;top:auto;left:auto;margin:8px 12px;display:flex;gap:6px;max-width:calc(100% - 24px);padding:7px;background:#f7eee1;color:#293043;border:1px solid #fa677188;border-radius:13px;box-shadow:0 5px 15px #0002}
.fullscreen-invite[hidden]{display:none}.fullscreen-invite button{font:500 12px/1.35 system-ui;text-align:left;min-height:44px;padding:4px 10px;background:none;color:inherit;border:0;border-radius:7px;cursor:pointer}.fullscreen-invite b{display:block}.fullscreen-invite [data-dismiss]{min-width:44px;text-align:center;font-size:22px}
.companion-panel [data-fullscreen-action]{margin-left:7px}.is-immersive .fullscreen-control{color:#f5f0e6;flex-basis:58px}
@keyframes expand-invite{50%{box-shadow:0 0 0 4px #fa677130}}
.fullscreen-control.first-look{animation:expand-invite 1.4s ease-in-out 3}
@media(prefers-reduced-motion:reduce){.fullscreen-control.first-look{animation:none}.fullscreen-control svg{transition:none}}
@media(max-width:700px){.hud .hud-tools{display:none}.fullscreen-invite{top:auto}.hud .hud-stage{min-width:0}.hud .hud-stage strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}

@media(max-width:700px){.game-frame:not(.is-immersive) .hud .hud-score,.game-frame:not(.is-immersive) .hud .hud-time{display:none}.game-frame:not(.is-immersive) .hud{gap:7px;padding:9px 10px;flex-wrap:nowrap}.game-frame:not(.is-immersive) .hud .hud-stage{flex:1;min-width:0;max-width:none;width:auto}.game-frame:not(.is-immersive) .hud>div:not(.hud-stage){flex:0 0 auto}.game-frame:not(.is-immersive) .hud #pause{flex:0 0 44px;min-width:44px;padding:0;position:static}}
