@font-face {
  font-family: "Alfa Movie";
  src: url("../assets/fonts/alfa-slab-one-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Futura Web";
  src: url("../assets/fonts/jost-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Futura Web";
  src: url("../assets/fonts/jost-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Futura Web";
  src: url("../assets/fonts/jost-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #120c08;
  --ink-soft: #28180f;
  --paper: #d8c5a1;
  --paper-light: #f4e8d2;
  --cream: #fff0c4;
  --gold: #e5a408;
  --gold-bright: #ffd360;
  --gold-light: #ffe7a2;
  --gold-dark: #914800;
  --purple: #5b3370;
  --red: #d24b35;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body,
button,
a {
  font-family: "Futura Web", Futura, "Century Gothic", sans-serif;
}

body {
  color: var(--paper-light);
  line-height: 1.35;
  overscroll-behavior: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  display: flex;
  transform: translateY(-150%);
  padding: 9px 13px;
  min-height: 44px;
  align-items: center;
  border: 2px solid var(--ink);
  background: var(--gold-bright);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.game-shell {
  --play-bottom: 43px;
  --play-top: 166px;
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
  background: #110a06;
  touch-action: none;
}

#game-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  touch-action: none;
}

.screen-texture {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(circle at center, transparent 46%, rgba(4, 2, 1, 0.45) 100%);
}

.screen-flash {
  position: absolute;
  z-index: 14;
  inset: 0;
  pointer-events: none;
  background: #fff0b3;
  opacity: 0;
}

.screen-flash.active {
  animation: screen-flash 500ms ease-out;
}

html[data-game-quality="medium"] .screen-texture {
  background: radial-gradient(circle at center, transparent 46%, rgba(4, 2, 1, 0.45) 100%);
}

html[data-game-quality="low"] .screen-texture {
  display: none;
}

html[data-game-quality="low"] .hud,
html[data-game-quality="low"] .game-instructions {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.game-bar {
  position: absolute;
  z-index: 12;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 8px clamp(14px, 2.6vw, 38px);
  border-bottom: 2px solid var(--gold);
  background: rgba(10, 6, 4, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.game-paused .game-bar {
  z-index: 42;
}

.game-identity {
  min-width: 0;
}

.game-identity-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--paper);
  font-size: clamp(0.48rem, 0.7vw, 0.62rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1;
}

.game-identity h1 {
  margin: 0;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(1.08rem, 2vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.055em;
  line-height: 1;
  text-shadow: 0 2px 0 #763600;
  white-space: nowrap;
}

.game-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.game-actions button,
.game-actions a {
  min-width: 70px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 211, 96, 0.72);
  background: rgba(42, 25, 15, 0.84);
  color: var(--gold-light);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.game-actions a {
  display: grid;
  place-items: center;
}

.game-actions button:hover:not(:disabled),
.game-actions a:hover {
  background: var(--gold);
  color: var(--ink);
}

.game-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.game-actions .movement-button {
  min-width: 102px;
}

.game-actions .quality-button {
  min-width: 116px;
}

.hud {
  position: absolute;
  z-index: 10;
  top: 76px;
  right: clamp(12px, 2vw, 28px);
  left: clamp(12px, 2vw, 28px);
  display: grid;
  grid-template-columns: 0.72fr 0.72fr 1.08fr 0.62fr 0.72fr 2.35fr;
  min-height: 62px;
  border: 2px solid rgba(229, 164, 8, 0.9);
  background: rgba(16, 9, 5, 0.9);
  box-shadow: 7px 7px 0 rgba(64, 29, 6, 0.48);
  backdrop-filter: blur(7px);
}

html.game-paused .hud {
  z-index: 40;
}

html.hardcore-mode .hud {
  outline: 2px solid rgba(255, 78, 57, 0.9);
  outline-offset: 2px;
  box-shadow: 7px 7px 0 rgba(64, 29, 6, 0.48), 0 0 18px rgba(210, 75, 53, 0.2);
}

.hud-stat,
.blast-meter {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 8px clamp(8px, 1vw, 15px);
  border-right: 1px solid rgba(229, 164, 8, 0.3);
}

.hud-stat span,
.blast-label span {
  overflow: hidden;
  color: var(--paper);
  font-size: clamp(0.43rem, 0.65vw, 0.57rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-stat strong {
  overflow: hidden;
  color: var(--gold-bright);
  font-size: clamp(0.88rem, 1.35vw, 1.23rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.055em;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-lives {
  border-right: 1px solid rgba(229, 164, 8, 0.3);
}

.hud-lives strong {
  letter-spacing: 0.13em;
}

.hud-lives strong.danger {
  color: #ff7e65;
  animation: danger-pulse 550ms ease-in-out infinite alternate;
}

.blast-meter {
  border-right: 0;
}

.blast-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.blast-label strong {
  color: var(--gold-light);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.blast-tracks {
  display: grid;
  gap: 3px;
}

.blast-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid #7b3d00;
  background: #2b180b;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75);
}

.blast-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ce7100, var(--gold-bright) 70%, #fff4c0);
  box-shadow: 0 0 13px rgba(255, 211, 96, 0.8);
  transition: width 160ms ease-out;
}

.blast-track.is-ready span {
  animation: mastery-glow 600ms ease-in-out infinite alternate;
}

.blast-meter.is-dual .blast-track {
  height: 9px;
}

.mission-banner {
  position: absolute;
  z-index: 8;
  top: 151px;
  left: 50%;
  max-width: min(640px, calc(100% - 32px));
  transform: translate(-50%, -7px);
  padding: 6px 13px;
  border: 1px solid rgba(229, 164, 8, 0.65);
  background: rgba(18, 10, 6, 0.82);
  color: var(--gold-light);
  font-size: clamp(0.54rem, 0.8vw, 0.68rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mission-banner.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.mission-banner.danger {
  border-color: var(--red);
  background: rgba(82, 20, 12, 0.92);
  color: #ffd8cb;
}

.combo-callout {
  position: absolute;
  z-index: 13;
  top: 177px;
  left: 50%;
  max-width: calc(100% - 36px);
  transform: translate(-50%, -18px) scale(0.9);
  padding: 8px 14px;
  border: 2px solid var(--ink);
  background: var(--gold-bright);
  color: var(--ink);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(0.72rem, 1.3vw, 1rem);
  letter-spacing: 0.055em;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--gold-dark);
}

.combo-callout.active {
  animation: combo-callout 1.2s ease both;
}

.game-instructions {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 34px;
  padding: 9px 16px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(229, 164, 8, 0.55);
  background: rgba(10, 6, 4, 0.78);
  color: rgba(255, 231, 162, 0.82);
  font-size: clamp(0.52rem, 0.75vw, 0.65rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.mobile-instructions {
  display: none;
}

.game-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 25% 50%, rgba(229, 164, 8, 0.16), transparent 36%),
    rgba(9, 5, 3, 0.9);
  backdrop-filter: blur(5px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.game-overlay[hidden] {
  display: none;
}

.start-poster,
.intermission-panel,
.gameover-panel {
  flex: 0 0 auto;
  margin-block: auto;
}

.start-poster {
  display: grid;
  grid-template-columns: minmax(230px, 0.78fr) minmax(430px, 1.22fr);
  width: min(1120px, 100%);
  min-height: min(690px, calc(100vh - 36px));
  min-height: min(690px, calc(100dvh - 36px));
  overflow: visible;
  border: 5px solid var(--ink);
  outline: 3px solid var(--gold);
  outline-offset: -10px;
  background:
    repeating-linear-gradient(0deg, rgba(87, 44, 7, 0.032) 0 1px, transparent 1px 4px),
    var(--paper-light);
  color: var(--ink);
  box-shadow: 14px 16px 0 rgba(72, 33, 6, 0.55), 0 28px 70px rgba(0, 0, 0, 0.55);
}

.start-master-wrap {
  position: relative;
  display: flex;
  min-height: 0;
  align-items: end;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid rgba(125, 62, 4, 0.36);
  background: #d8c29a;
}

.start-rays {
  position: absolute;
  top: 56%;
  left: 50%;
  width: max(300%, 140vh);
  aspect-ratio: 1;
  background: repeating-conic-gradient(
    from -7deg at 50% 50%,
    rgba(229, 164, 8, 0.34) 0 8deg,
    rgba(255, 240, 196, 0.18) 8deg 16deg
  );
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  animation: start-rays 36s linear infinite;
}

.start-master-wrap img {
  position: relative;
  z-index: 1;
  width: auto;
  height: min(79vh, 650px);
  height: min(79dvh, 650px);
  max-width: 92%;
  margin-bottom: -2px;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 0 17px rgba(229, 164, 8, 0.72));
}

.start-copy {
  align-self: center;
  padding: clamp(24px, 3.4vw, 54px);
}

.start-copy p,
.intermission-panel p,
.gameover-panel p {
  margin: 0;
}

.poster-kicker {
  color: var(--gold-dark);
  font-size: clamp(0.58rem, 0.8vw, 0.7rem);
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.start-copy h2 {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(2.2rem, min(4.2vw, 7.6vh), 4.35rem);
  font-size: clamp(2.2rem, min(4.2vw, 7.6dvh), 4.35rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.94;
}

.poster-deck {
  padding-bottom: 18px;
  border-bottom: 2px solid rgba(108, 52, 4, 0.38);
  font-size: clamp(0.95rem, 1.25vw, 1.13rem);
  font-weight: 800;
  letter-spacing: 0.035em;
}

.rules {
  display: grid;
  gap: 11px;
  margin: 20px 0;
}

.rules p {
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  font-size: clamp(0.78rem, 1vw, 0.93rem);
  font-weight: 600;
  line-height: 1.35;
}

.rules b {
  color: var(--gold-dark);
  letter-spacing: 0.055em;
}

.controls-line {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 1.35fr;
  gap: 8px;
  margin-bottom: 18px;
}

.controls-line span {
  padding: 8px 10px;
  border: 1px solid rgba(91, 42, 2, 0.5);
  background: rgba(255, 255, 255, 0.28);
  font-size: clamp(0.56rem, 0.75vw, 0.67rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  text-align: center;
}

.controls-line b {
  color: var(--gold-dark);
  letter-spacing: 0.1em;
}

.controls-line i {
  font-style: normal;
}

.primary-button,
.secondary-button,
.blast-button {
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--gold-dark);
  transition: transform 100ms ease, box-shadow 100ms ease, filter 100ms ease;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 11px 22px;
  font-size: clamp(0.72rem, 1vw, 0.9rem);
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.start-copy .run-actions {
  justify-content: flex-start;
}

.mode-toggle {
  min-width: 190px;
}

.hardcore-warning {
  margin-top: 14px !important;
  color: #ff4e39;
  font-size: clamp(0.62rem, 0.85vw, 0.76rem);
  font-weight: 800;
  letter-spacing: 0.105em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hardcore-warning[hidden] {
  display: none;
}

#start-hardcore-warning[hidden],
#gameover-hardcore-warning[hidden] {
  display: block;
  visibility: hidden;
}

.secondary-button {
  border-color: var(--gold);
  background: rgba(18, 12, 8, 0.94);
  color: var(--gold-light);
}

.danger-button {
  border-color: #d7644e;
  color: #ff9b84;
  box-shadow: 5px 5px 0 #6f271b;
}

.primary-button:hover,
.secondary-button:hover,
.blast-button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translate(-1px, -2px);
  box-shadow: 7px 7px 0 var(--gold-dark);
}

html.controller-input .primary-button.controller-selected,
html.controller-input .secondary-button.controller-selected {
  text-decoration-line: underline;
  text-decoration-color: var(--paper-light);
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}

html.controller-input .primary-button.controller-selected:focus-visible,
html.controller-input .secondary-button.controller-selected:focus-visible {
  outline: none;
}

.primary-button:active,
.secondary-button:active,
.blast-button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--gold-dark);
}

.start-best {
  margin-top: 12px !important;
  color: #69401f;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.start-best strong {
  color: var(--gold-dark);
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
}

.resume-countdown {
  --resume-progress: 0;
  position: absolute;
  z-index: 24;
  inset: var(--play-top) 0 var(--play-bottom);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.resume-countdown[hidden] {
  display: none;
}

.resume-dial {
  position: relative;
  display: grid;
  width: clamp(104px, 12vw, 146px);
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid var(--gold-light);
  border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      rgba(255, 211, 96, 0.18) calc(var(--resume-progress) * 1turn),
      var(--gold-bright) 0
    );
  box-shadow: 0 0 0 5px rgba(18, 12, 8, 0.78), 0 12px 38px rgba(0, 0, 0, 0.62);
}

.resume-dial::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 231, 162, 0.65);
  border-radius: 50%;
  background:
    linear-gradient(transparent calc(50% - 1px), rgba(255, 231, 162, 0.25) 50%, transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 231, 162, 0.25) 50%, transparent calc(50% + 1px)),
    rgba(12, 7, 4, 0.94);
  content: "";
}

.resume-dial span {
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 3px 0 #6d3100;
}

.share-run-status {
  min-height: 1em;
  margin: 12px 0 0;
  color: var(--gold-light);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intermission-overlay,
.gameover-overlay,
.stats-overlay {
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(229, 164, 8, 0.065) 0 7deg, transparent 7deg 14deg),
    rgba(9, 5, 3, 0.9);
}

.intermission-overlay {
  inset: 0;
  padding-top: calc(var(--play-top) + 18px);
  padding-bottom: calc(var(--play-bottom) + 18px);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    ),
    repeating-conic-gradient(
      from -7deg at 50% 56%,
      #171004 0 8deg,
      #090503 8deg 16deg
    );
  backdrop-filter: none;
}

.intermission-panel,
.gameover-panel {
  padding: clamp(32px, 5vw, 64px);
  background: rgba(17, 9, 5, 0.9);
  text-align: center;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.58);
}

.intermission-panel {
  position: relative;
  width: min(1160px, calc(100vw - 32px));
  padding-inline: clamp(16px, 4vw, 56px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gameover-panel {
  width: min(720px, 92vw);
}

.gameover-layout {
  display: grid;
  width: min(1540px, 100%);
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  margin-block: auto;
}

.gameover-layout .gameover-panel {
  width: 100%;
}

.leaderboard-dock {
  display: none;
  min-width: 0;
}

.leaderboard-placement-status {
  min-height: 1.3em;
  margin: -8px 0 14px !important;
  color: var(--gold-light);
  font-size: clamp(0.55rem, 0.75vw, 0.68rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.leaderboard-name-form {
  width: min(520px, 100%);
  margin: 0 auto 18px;
  text-align: left;
}

.leaderboard-name-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--paper);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.leaderboard-name-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.leaderboard-name-form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 11px;
  border: 2px solid rgba(229, 164, 8, 0.75);
  border-radius: 0;
  background: rgba(8, 4, 3, 0.92);
  color: var(--gold-bright);
  font: 800 0.78rem/1 "Futura Web", Futura, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.leaderboard-name-form input:focus-visible {
  outline: 2px solid var(--paper-light);
  outline-offset: 2px;
}

.leaderboard-name-form .secondary-button {
  min-height: 42px;
  padding: 7px 14px;
  font-size: 0.62rem;
}

.leaderboard-name-form small {
  display: block;
  min-height: 1.2em;
  margin-top: 6px;
  color: rgba(216, 197, 161, 0.78);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.leaderboard-name-form small.is-error {
  color: #ff816d;
}

.leaderboard-overlay {
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(229, 164, 8, 0.075) 0 7deg, transparent 7deg 14deg),
    rgba(9, 5, 3, 0.97);
  backdrop-filter: none;
}

.leaderboards-panel {
  width: min(1040px, 100%);
  flex: 0 0 auto;
  margin-block: auto;
  padding: clamp(22px, 3vw, 38px);
  border: 3px solid var(--gold);
  background: rgba(17, 9, 5, 0.97);
  color: var(--gold-light);
  text-align: center;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.62);
}

.leaderboards-panel > h2 {
  margin: 6px 0 5px;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(2rem, 5vw, 4.1rem);
  font-weight: 400;
  letter-spacing: 0.055em;
  line-height: 1;
}

.leaderboard-reset-copy {
  margin: 0 0 17px;
  color: var(--paper);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.leaderboard-name-form-wide {
  margin-bottom: 20px;
}

.leaderboard-overlay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.leaderboard-mode-tabs {
  display: none;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
}

.leaderboard-mode-tab,
.leaderboard-period-tabs button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid rgba(229, 164, 8, 0.55);
  border-radius: 0;
  background: rgba(18, 12, 8, 0.92);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.leaderboard-mode-tab[aria-selected="true"],
.leaderboard-period-tabs button[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.leaderboard-mode-tab:hover,
.leaderboard-period-tabs button:hover {
  filter: brightness(1.12);
}

html.controller-input .leaderboard-mode-tab.controller-selected,
html.controller-input .leaderboard-period-tabs button.controller-selected {
  outline: none;
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.leaderboard-card {
  min-width: 0;
  border: 2px solid rgba(229, 164, 8, 0.75);
  background: rgba(10, 6, 4, 0.96);
  color: var(--gold-light);
}

.leaderboard-card-header {
  padding: 13px 13px 10px;
  border-bottom: 1px solid rgba(229, 164, 8, 0.38);
  text-align: left;
}

.leaderboard-card-header p {
  margin: 0;
  color: var(--paper);
  font-size: 0.47rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.leaderboard-card-header h2 {
  margin: 3px 0 10px;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(1.25rem, 2.1vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
}

.leaderboard-period-tabs {
  display: flex;
  gap: 6px;
}

.leaderboard-card table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.leaderboard-card th,
.leaderboard-card td {
  overflow: hidden;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(229, 164, 8, 0.2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-card thead th {
  color: var(--paper);
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: left;
}

.leaderboard-card thead th:first-child,
.leaderboard-card tbody th {
  width: 13%;
  text-align: center;
}

.leaderboard-card thead th:nth-child(2) {
  width: 52%;
}

.leaderboard-card thead th:last-child,
.leaderboard-score {
  width: 35%;
  text-align: right !important;
}

.leaderboard-card tbody th,
.leaderboard-card tbody td {
  font-size: clamp(0.59rem, 0.8vw, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.035em;
}

.leaderboard-player-name {
  text-align: left;
}

.leaderboard-card tbody tr.is-viewer {
  background: rgba(229, 164, 8, 0.2);
  color: var(--gold-bright);
  box-shadow: inset 3px 0 0 var(--gold);
}

.leaderboard-card tbody tr:last-child > * {
  border-bottom: 0;
}

.leaderboard-message td,
.leaderboard-ellipsis td {
  padding-block: 13px;
  color: var(--paper);
  font-size: 0.54rem !important;
  letter-spacing: 0.1em !important;
  text-align: center;
}

.leaderboard-ellipsis td {
  padding-block: 3px;
  font-size: 1rem !important;
  line-height: 1;
}

@media (min-width: 1280px) and (min-height: 640px) {
  .gameover-layout {
    grid-template-columns: minmax(250px, 0.78fr) minmax(520px, 1.5fr) minmax(250px, 0.78fr);
    align-items: center;
    gap: clamp(12px, 1.2vw, 22px);
  }

  .leaderboard-dock {
    display: block;
  }

  .gameover-layout .gameover-panel {
    padding: clamp(25px, 2.5vw, 42px);
  }

  .leaderboard-dock .leaderboard-card-header h2 {
    font-size: clamp(1.05rem, 1.35vw, 1.45rem);
  }

  .leaderboard-dock .leaderboard-card th,
  .leaderboard-dock .leaderboard-card td {
    padding-inline: 6px;
  }
}

@media (max-width: 760px) {
  .leaderboard-overlay-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-mode-tabs {
    display: flex;
  }

  #leaderboard-overlay[data-active-leaderboard-mode="NORMAL"] [data-leaderboard-mount="HARDCORE"],
  #leaderboard-overlay[data-active-leaderboard-mode="HARDCORE"] [data-leaderboard-mount="NORMAL"] {
    display: none;
  }

  .leaderboards-panel {
    padding: 22px 14px;
  }

  .leaderboard-name-form-wide {
    margin-bottom: 14px;
  }
}

@media (max-width: 480px) {
  .leaderboards-panel > h2 {
    font-size: clamp(1.7rem, 11vw, 2.65rem);
  }

  .leaderboard-name-form > div {
    gap: 5px;
  }

  .leaderboard-name-form input {
    font-size: 0.65rem;
  }

  .leaderboard-card th,
  .leaderboard-card td {
    padding-inline: 6px;
  }

  .leaderboard-card tbody th,
  .leaderboard-card tbody td {
    font-size: 0.58rem;
  }
}

.game-stats-panel {
  width: min(920px, 94vw);
  margin-block: auto;
  padding: clamp(24px, 4vw, 46px);
  border: 3px solid var(--gold);
  background: rgba(17, 9, 5, 0.96);
  color: var(--gold-light);
  text-align: center;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.62);
}

.game-stats-panel .poster-kicker {
  color: var(--gold-light);
}

.game-stats-panel h2 {
  margin: 7px 0 20px;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.055em;
  line-height: 1;
}

.game-stats-panel h3 {
  margin: 24px 0 10px;
  color: var(--paper);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0 0 22px;
  padding: 1px;
  background: rgba(229, 164, 8, 0.32);
}

.stats-grid > div {
  min-width: 0;
  padding: 11px 10px;
  background: rgba(14, 8, 5, 0.96);
}

.stats-grid dt {
  overflow: hidden;
  color: var(--paper);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-grid dd {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--gold-bright);
  font-size: clamp(0.9rem, 1.6vw, 1.25rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-powerups {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.intermission-panel p,
.intermission-panel > span {
  display: block;
  color: var(--gold-light);
  font-size: clamp(0.56rem, 1vw, 0.75rem);
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.intermission-panel h2 {
  max-width: 100%;
  margin: 12px auto 18px;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(1.05rem, 6vw, 4.85rem);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
  white-space: normal;
  text-shadow: 0 3px 0 #6d3100, 0 8px 20px rgba(0, 0, 0, 0.5);
}

.pause-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.reset-confirmation-panel {
  width: min(720px, calc(100vw - 32px));
  container-type: inline-size;
}

.reset-confirmation-panel h2 {
  font-size: clamp(1.35rem, 5.2vw, 3.4rem);
  font-size: clamp(1.35rem, 8cqi, 3.4rem);
}

.gameover-panel {
  border: 3px solid var(--gold);
}

.gameover-panel h2 {
  max-width: 18ch;
  margin: 9px auto 16px;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(1.6rem, 4.6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.02;
  text-transform: uppercase;
}

.gameover-panel .poster-kicker {
  color: var(--gold-light);
}

.final-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0 20px;
  border-block: 1px solid rgba(255, 211, 96, 0.45);
}

.final-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
}

.final-stat + .final-stat {
  border-left: 1px solid rgba(255, 211, 96, 0.3);
}

.final-stat span {
  color: var(--paper);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.final-stat strong {
  overflow: hidden;
  color: var(--gold-bright);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(1.8rem, 4.4vw, 3.8rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.055em;
  line-height: 1;
  text-overflow: ellipsis;
}

strong.fit-number {
  display: inline-block;
  max-width: 100%;
  text-overflow: clip;
  vertical-align: bottom;
  white-space: nowrap;
}

.touch-controls {
  position: absolute;
  z-index: 18;
  right: max(17px, env(safe-area-inset-right));
  bottom: max(48px, calc(env(safe-area-inset-bottom) + 42px));
  left: max(17px, env(safe-area-inset-left));
  display: none;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.joystick {
  position: relative;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 231, 162, 0.72);
  border-radius: 50%;
  background: rgba(18, 12, 8, 0.62);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.72), 0 5px 18px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  touch-action: none;
}

.joystick-cross {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 231, 162, 0.35);
  font-size: 3.3rem;
  transform: rotate(45deg);
}

.joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-bright), #b86700);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.48);
}

.blast-button {
  display: grid;
  width: 180px;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 2px;
  font-size: 0.62rem;
  line-height: 1;
  pointer-events: auto;
  touch-action: none;
}

.blast-button > b {
  white-space: nowrap;
}

.blast-button:disabled {
  border-color: #34251c;
  background: #49372a;
  color: #a99781;
  cursor: not-allowed;
  box-shadow: 3px 3px 0 #160f0a;
  filter: saturate(0.2);
}

.blast-button.ready {
  animation: blast-ready 600ms ease-in-out infinite alternate;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  inset: 20px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 3px solid var(--gold);
  background: var(--paper-light);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

@keyframes screen-flash {
  0% { opacity: 0; }
  14% { opacity: 0.86; }
  100% { opacity: 0; }
}

@keyframes danger-pulse {
  to { text-shadow: 0 0 12px rgba(255, 91, 64, 0.95); }
}

@keyframes mastery-glow {
  to { filter: brightness(1.24); box-shadow: 0 0 20px rgba(255, 225, 130, 1); }
}

@keyframes combo-callout {
  0% { opacity: 0; transform: translate(-50%, -18px) scale(0.9); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -7px) scale(0.96); }
}

@keyframes blast-ready {
  to { filter: brightness(1.2); box-shadow: 5px 5px 0 var(--gold-dark), 0 0 24px rgba(255, 211, 96, 0.9); }
}

@keyframes start-rays {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(1turn); }
}

@media (max-width: 980px) {
  .game-shell {
    --play-top: 198px;
  }

  .game-identity h1 {
    overflow: hidden;
    font-size: clamp(0.86rem, 2vw, 1.08rem);
    text-overflow: ellipsis;
  }

  .game-actions {
    gap: 4px;
  }

  .game-actions button,
  .game-actions a {
    min-width: 58px;
    padding-inline: 7px;
    font-size: 0.6rem;
  }

  .game-actions .movement-button {
    min-width: 88px;
  }

  .game-actions .quality-button {
    min-width: 96px;
  }

  .hud {
    grid-template-columns: 0.75fr 0.75fr 1fr 0.6fr;
  }

  .blast-meter {
    grid-column: 1 / -1;
    min-height: 29px;
    padding-block: 5px;
    border-top: 1px solid rgba(229, 164, 8, 0.3);
  }

  .blast-label {
    margin-bottom: 3px;
  }

  .blast-track {
    height: 8px;
  }

  .blast-meter.is-dual .blast-track {
    height: 5px;
  }

  .blast-meter.is-dual .blast-tracks {
    gap: 2px;
  }

  .mission-banner {
    top: 181px;
  }

  .combo-callout {
    top: 207px;
  }

  .start-poster {
    grid-template-columns: minmax(190px, 0.62fr) minmax(390px, 1.38fr);
  }
}

@media (max-width: 720px) {
  .game-shell {
    --play-bottom: 40px;
    --play-top: 170px;
  }

  .game-bar {
    height: 52px;
    gap: 9px;
    padding-inline: 11px;
  }

  .game-identity-kicker {
    display: none;
  }

  .game-identity h1 {
    max-width: 52vw;
    overflow: hidden;
    font-size: clamp(0.72rem, 3.2vw, 1rem);
    letter-spacing: 0.035em;
    text-overflow: ellipsis;
  }

  .game-actions {
    gap: 4px;
  }

  .game-actions button,
  .game-actions a {
    min-width: 0;
    min-height: 34px;
    padding: 6px 7px;
    font-size: 0.56rem;
    letter-spacing: 0.07em;
  }

  .game-actions .movement-button {
    display: none;
  }

  .game-actions .quality-button {
    min-width: 78px;
  }

  .hud {
    top: 59px;
    right: 7px;
    left: 7px;
    grid-template-columns: 0.72fr 1.2fr 0.58fr 0.8fr;
    min-height: 0;
  }

  .hud-stat,
  .blast-meter {
    padding: 6px 8px;
  }

  .hud-best {
    display: none;
  }

  .hud-lives {
    grid-column: 2;
  }

  .hud-streak {
    grid-column: 3;
  }

  .hud-best-streak {
    grid-column: 4;
    border-right: 0;
  }

  .hud-stat span,
  .blast-label span {
    font-size: clamp(0.48rem, 2.2vw, 0.56rem);
    letter-spacing: 0.08em;
  }

  .hud-stat strong {
    font-size: 0.82rem;
  }

  .blast-meter {
    grid-column: 1 / -1;
    min-height: 26px;
  }

  .mission-banner {
    top: 140px;
    max-width: calc(100% - 14px);
    padding: 5px 9px;
    font-size: 0.56rem;
  }

  .combo-callout {
    top: 168px;
  }

  .game-instructions {
    min-height: 31px;
    padding: 8px 9px max(7px, env(safe-area-inset-bottom));
    font-size: 0.54rem;
    letter-spacing: 0.075em;
  }

  .desktop-instructions {
    display: none;
  }

  .mobile-instructions {
    display: inline;
  }

  .start-poster {
    position: relative;
    display: block;
    width: min(560px, 100%);
    min-height: 0;
    max-height: none;
  }

  .start-master-wrap {
    position: absolute;
    inset: 0 auto 0 0;
    width: 36%;
    border-right: 0;
    opacity: 0.3;
  }

  .start-master-wrap::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(90deg, transparent 0 35%, var(--paper-light) 100%);
  }

  .start-master-wrap img {
    height: 73%;
  }

  .start-copy {
    position: relative;
    z-index: 3;
    padding: clamp(22px, 6vw, 36px);
  }

  .start-copy h2 {
    font-size: clamp(1.9rem, 9.5vw, 3.35rem);
  }

  .poster-deck {
    font-size: 0.88rem;
  }

  .rules {
    gap: 8px;
    margin: 15px 0;
  }

  .rules p {
    font-size: 0.72rem;
  }

  .controls-line {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 14px;
  }

  .controls-line span {
    padding: 6px 8px;
    font-size: 0.56rem;
    text-align: left;
  }

  .controls-line b {
    display: inline-block;
    min-width: 48px;
  }

  .intermission-panel,
  .gameover-panel {
    padding: 30px 18px;
  }

}

@media (hover: none), (pointer: coarse) {
  .game-actions .movement-button {
    display: none;
  }

  .touch-controls {
    display: flex;
  }
}

@media (max-height: 650px) and (min-width: 721px) {
  .game-shell {
    --play-top: 150px;
  }

  .game-bar {
    height: 52px;
  }

  .game-identity-kicker {
    display: none;
  }

  .hud {
    top: 60px;
  }

  .mission-banner {
    top: 135px;
  }

  .combo-callout {
    top: 162px;
  }

  .start-poster {
    grid-template-columns: minmax(180px, 0.55fr) minmax(430px, 1.45fr);
    min-height: 0;
  }

  .start-master-wrap img {
    height: 88vh;
  }

  .start-copy {
    padding-block: 22px;
  }

  .start-copy h2 {
    font-size: clamp(2rem, min(5vw, 10vh), 3.45rem);
    font-size: clamp(2rem, min(5vw, 10dvh), 3.45rem);
  }

  .poster-deck {
    padding-bottom: 11px;
  }

  .rules {
    gap: 6px;
    margin: 12px 0;
  }

  .rules p {
    font-size: 0.69rem;
  }

  .controls-line {
    margin-bottom: 12px;
  }
}

@media (max-height: 500px) {
  .game-shell {
    --play-bottom: 10px;
    --play-top: 110px;
  }

  .game-bar {
    height: 42px;
    gap: 7px;
    padding-block: 5px;
  }

  .game-identity-kicker {
    display: none;
  }

  .game-identity h1 {
    font-size: clamp(0.68rem, 2.2vw, 1rem);
  }

  .game-actions button,
  .game-actions a {
    min-height: 34px;
    padding: 5px 7px;
    font-size: 0.54rem;
  }

  .hud {
    top: 48px;
    right: 6px;
    left: 6px;
    grid-template-columns: 0.58fr 0.95fr 0.48fr 0.62fr 1.55fr;
    min-height: 42px;
  }

  .hud-best {
    display: none;
  }

  .hud-lives,
  .blast-meter {
    grid-column: auto;
    min-height: 0;
    border-top: 0;
  }

  .hud-lives {
    border-right: 1px solid rgba(229, 164, 8, 0.3);
  }

  .hud-streak {
    grid-column: auto;
    border-right: 1px solid rgba(229, 164, 8, 0.3);
  }

  .hud-stat,
  .blast-meter {
    padding: 3px 7px;
  }

  .hud-stat span,
  .blast-label span {
    font-size: 0.45rem;
    letter-spacing: 0.08em;
  }

  .hud-stat strong {
    font-size: 0.72rem;
  }

  .blast-label {
    gap: 5px;
    margin-bottom: 2px;
  }

  .blast-label strong {
    font-size: 0.56rem;
  }

  .blast-track {
    height: 6px;
  }

  .blast-meter.is-dual .blast-track {
    height: 4px;
  }

  .blast-meter.is-dual .blast-tracks {
    gap: 1px;
  }

  .mission-banner {
    top: 94px;
    max-width: calc(100% - 12px);
    padding: 3px 7px;
    font-size: 0.5rem;
  }

  .combo-callout {
    top: 116px;
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .game-instructions {
    display: none;
  }

  .touch-controls {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
  }

  .joystick {
    width: 78px;
    height: 78px;
  }

  .joystick-cross {
    font-size: 2.35rem;
  }

  .joystick-knob {
    width: 34px;
    height: 34px;
    border-width: 2px;
  }

  .blast-button {
    width: 150px;
    min-height: 44px;
    padding: 7px 10px;
    font-size: 0.58rem;
  }

  .game-overlay {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .intermission-panel,
  .gameover-panel {
    padding: 16px 12px;
  }

  .intermission-panel h2 {
    margin-block: 6px 8px;
    font-size: clamp(1.05rem, min(9vw, 18vh), 3rem);
    font-size: clamp(1.05rem, min(9vw, 18dvh), 3rem);
  }

  .pause-actions {
    gap: 8px;
    margin-top: 10px;
  }

  .gameover-panel h2 {
    margin-block: 5px 8px;
    font-size: clamp(1.15rem, min(4.4vw, 10vh), 2.25rem);
    font-size: clamp(1.15rem, min(4.4vw, 10dvh), 2.25rem);
  }

  .final-stats {
    margin: 8px 0 10px;
  }

  .final-stat {
    padding: 7px;
  }

  .final-stat strong {
    font-size: clamp(1.8rem, min(6vw, 13vh), 3rem);
    font-size: clamp(1.8rem, min(6vw, 13dvh), 3rem);
  }

  .primary-button,
  .secondary-button {
    min-height: 38px;
    padding: 7px 16px;
    font-size: 0.64rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 520px) {
  .start-poster {
    display: grid;
    grid-template-columns: minmax(118px, 0.42fr) minmax(0, 1.58fr);
    width: 100%;
    min-height: calc(100vh - 16px);
    min-height: calc(100dvh - 16px);
  }

  .start-master-wrap {
    position: relative;
    inset: auto;
    width: auto;
    border-right: 1px solid rgba(125, 62, 4, 0.36);
    opacity: 1;
  }

  .start-master-wrap::after {
    display: none;
  }

  .start-master-wrap img {
    height: min(88vh, 360px);
    height: min(88dvh, 360px);
    max-width: 94%;
  }

  .start-copy {
    align-self: center;
    padding: 10px 14px;
  }

  .start-copy h2 {
    margin-bottom: 5px;
    font-size: clamp(1.5rem, min(5vw, 11vh), 2.45rem);
    font-size: clamp(1.5rem, min(5vw, 11dvh), 2.45rem);
    line-height: 0.9;
  }

  .poster-deck {
    padding-bottom: 6px;
    font-size: 0.64rem;
  }

  .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    margin: 7px 0;
  }

  .rules p {
    padding-left: 7px;
    border-left-width: 2px;
    font-size: 0.58rem;
    line-height: 1.18;
  }

  .controls-line {
    grid-template-columns: 0.9fr 1.15fr 1.35fr;
    gap: 4px;
    margin-bottom: 7px;
  }

  .controls-line span {
    padding: 4px 5px;
    font-size: 0.5rem;
    line-height: 1.15;
    text-align: center;
  }

  .controls-line b {
    display: block;
    min-width: 0;
  }

  .start-best {
    margin-top: 5px !important;
    font-size: 0.58rem;
  }
}

@media (max-width: 420px) {
  .game-bar {
    padding-inline: 7px;
  }

  .game-identity h1 {
    max-width: 42vw;
    font-size: 0.68rem;
  }

  .game-actions {
    gap: 3px;
  }

  .game-actions button,
  .game-actions a {
    padding-inline: 4px;
    font-size: 0.5rem;
  }

  .game-actions .quality-button {
    min-width: 72px;
  }

  .game-overlay {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .run-actions {
    gap: 8px;
  }

  .run-actions .primary-button,
  .run-actions .secondary-button {
    min-width: min(210px, 100%);
  }

  .game-stats-panel {
    width: 100%;
    padding: 19px 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-powerups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .start-copy {
    padding: 20px 17px;
  }

  .start-copy h2 {
    font-size: clamp(1.85rem, 10vw, 2.45rem);
  }

  .poster-deck {
    padding-bottom: 12px;
    font-size: 0.78rem;
  }

  .rules {
    gap: 7px;
    margin: 12px 0;
  }

  .rules p {
    padding-left: 10px;
    font-size: 0.67rem;
    line-height: 1.28;
  }
}

@media (max-width: 420px) and (max-height: 650px) {
  .start-copy {
    padding: 12px 13px;
  }

  .start-copy h2 {
    margin-bottom: 6px;
    font-size: 1.65rem;
    line-height: 0.91;
  }

  .poster-deck {
    padding-bottom: 7px;
    font-size: 0.68rem;
    line-height: 1.22;
  }

  .rules {
    gap: 4px;
    margin: 7px 0;
  }

  .rules p {
    padding-left: 7px;
    border-left-width: 2px;
    font-size: 0.62rem;
    line-height: 1.18;
  }

  .controls-line {
    gap: 3px;
    margin-bottom: 6px;
  }

  .controls-line span {
    padding: 4px 6px;
    font-size: 0.52rem;
    line-height: 1.1;
  }

  .start-poster .primary-button {
    min-height: 44px;
    padding: 9px 14px;
    font-size: 0.68rem;
  }

  .start-best {
    margin-top: 5px !important;
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .game-actions button,
  .game-actions a {
    min-height: 44px;
    padding-block: 8px;
  }

  .primary-button,
  .secondary-button,
  .leaderboard-mode-tab,
  .leaderboard-period-tabs button,
  .leaderboard-name-form input,
  .leaderboard-name-form .secondary-button {
    min-height: 44px;
  }
}

@media (hover: none) and (max-width: 720px), (pointer: coarse) and (max-width: 720px) {
  .game-shell {
    --play-top: 182px;
  }

  .game-bar {
    height: 64px;
  }

  .hud {
    top: 71px;
  }

  .mission-banner {
    top: 152px;
  }

  .combo-callout {
    top: 180px;
  }
}

@media (hover: none) and (max-height: 500px), (pointer: coarse) and (max-height: 500px) {
  .game-shell {
    --play-top: 126px;
  }

  .game-bar {
    height: 58px;
  }

  .hud {
    top: 64px;
  }

  .mission-banner {
    top: 110px;
  }

  .combo-callout {
    top: 134px;
  }
}


/* Concise onboarding + opt-in full instructions. */
.start-poster {
  min-height: min(570px, calc(100vh - 36px));
  min-height: min(570px, calc(100dvh - 36px));
}

.start-master-wrap img {
  height: min(70vh, 545px);
  height: min(70dvh, 545px);
}

.start-quick-copy {
  margin-bottom: 22px !important;
  padding-bottom: 20px;
  color: #5d3415;
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-wrap: balance;
}

.game-actions .info-button {
  min-width: 64px;
}

.info-overlay {
  z-index: 50;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(229, 164, 8, 0.07) 0 7deg, transparent 7deg 14deg),
    rgba(9, 5, 3, 0.97);
  backdrop-filter: none;
}

.info-panel {
  width: min(920px, 100%);
  flex: 0 0 auto;
  margin-block: auto;
  padding: clamp(24px, 4vw, 46px);
  border: 4px solid var(--ink);
  outline: 3px solid var(--gold);
  outline-offset: -9px;
  background:
    repeating-linear-gradient(0deg, rgba(87, 44, 7, 0.032) 0 1px, transparent 1px 4px),
    var(--paper-light);
  color: var(--ink);
  box-shadow: 12px 14px 0 rgba(72, 33, 6, 0.52), 0 24px 70px rgba(0, 0, 0, 0.62);
}

.info-panel .poster-kicker {
  color: var(--gold-dark);
  text-align: center;
}

.info-panel h2 {
  margin: 7px 0 10px;
  color: var(--gold-dark);
  font-family: "Alfa Movie", Rockwell, serif;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1;
  text-align: center;
}

.info-summary {
  margin: 0 auto 22px;
  color: #5d3415;
  font-size: clamp(0.86rem, 1.3vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.035em;
  text-align: center;
}

.info-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0 0 20px;
}

.info-rules p {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.22);
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  font-weight: 600;
  line-height: 1.38;
}

.info-rules b {
  color: var(--gold-dark);
  letter-spacing: 0.055em;
}

.info-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 22px;
}

.info-controls > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 9px 8px;
  border: 1px solid rgba(91, 42, 2, 0.48);
  background: rgba(255, 255, 255, 0.3);
  text-align: center;
}

.info-controls b {
  color: var(--gold-dark);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.info-controls span {
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 720px) {
  .start-poster {
    min-height: 0;
  }

  .start-master-wrap img {
    height: 62vh;
    height: 62dvh;
  }

  .start-quick-copy {
    margin-bottom: 14px !important;
    padding-bottom: 14px;
    font-size: 0.9rem;
  }

  .game-actions .info-button {
    min-width: 0;
  }

  .info-rules {
    grid-template-columns: 1fr;
  }

  .info-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .info-panel {
    padding: 22px 14px;
  }

  .info-panel h2 {
    font-size: clamp(2rem, 14vw, 3.2rem);
  }

  .info-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 520px) {
  .start-quick-copy {
    margin-bottom: 7px !important;
    padding-bottom: 7px;
    font-size: 0.68rem;
  }

  .info-panel {
    margin-block: 0;
    padding: 14px 18px;
  }

  .info-panel h2 {
    margin-block: 3px 6px;
    font-size: 2rem;
  }

  .info-summary {
    margin-bottom: 8px;
    font-size: 0.76rem;
  }

  .info-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    margin-bottom: 8px;
  }

  .info-rules p {
    padding: 5px 7px;
    font-size: 0.64rem;
    line-height: 1.28;
  }

  .info-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 9px;
  }

  .info-controls > div {
    padding: 5px;
  }

  .info-controls b,
  .info-controls span {
    font-size: 0.64rem;
  }
}


/* Preserve the compact start poster on short desktop/landscape screens. */
@media (max-height: 650px) and (min-width: 721px) {
  .start-poster {
    min-height: 0;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 520px) {
  .start-poster {
    min-height: calc(100vh - 16px);
    min-height: calc(100dvh - 16px);
  }
}


/* Readability refinements for the concise onboarding and INFO screen. */
.start-quick-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.start-quick-copy > span {
  display: block;
}

.start-quick-copy .start-blast-copy {
  margin-top: 5px;
  color: var(--gold-dark);
  font-size: 0.86em;
  letter-spacing: 0.055em;
}

/* Do not stretch short instruction cards to the height of their grid partner. */
.info-rules {
  align-items: start;
}

.info-rules p {
  align-self: start;
}

/* Controls are reference information, not fine print. */
.info-controls > div {
  gap: 7px;
  padding: 12px 10px;
}

.info-controls b {
  font-size: clamp(0.84rem, 1.18vw, 1rem);
  letter-spacing: 0.1em;
}

.info-controls span {
  font-size: clamp(0.78rem, 1.06vw, 0.92rem);
  line-height: 1.32;
}

@media (max-width: 720px) {
  .start-quick-copy {
    gap: 1px;
  }

  .start-quick-copy .start-blast-copy {
    margin-top: 4px;
  }

  .info-controls b {
    font-size: 0.84rem;
  }

  .info-controls span {
    font-size: 0.78rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 520px) {
  .start-quick-copy {
    gap: 0;
    font-size: 0.62rem;
    line-height: 1.18;
  }

  .start-quick-copy .start-blast-copy {
    margin-top: 2px;
    font-size: 0.9em;
  }

  .info-controls > div {
    gap: 3px;
    padding: 6px;
  }

  .info-controls b {
    font-size: 0.68rem;
  }

  .info-controls span {
    font-size: 0.64rem;
    line-height: 1.2;
  }
}


/* INFO rules use independent columns so short cards never inherit a taller row's whitespace. */
.info-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.info-rule-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}

.info-rule-column > p {
  flex: none;
  align-self: stretch;
}

@media (max-width: 720px) {
  .info-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .info-rule-column {
    display: contents;
  }

  .info-rule-keep { order: 1; }
  .info-rule-popcorn { order: 2; }
  .info-rule-powerups { order: 3; }
  .info-rule-garbage { order: 4; }
  .info-rule-blast { order: 5; }
}

@media (max-height: 500px) and (orientation: landscape) and (min-width: 721px) {
  .info-rule-column {
    gap: 5px;
  }
}
