:root {
  --bg: #b9ecff;
  --panel: rgba(247, 255, 236, 0.88);
  --panel-strong: rgba(255, 252, 226, 0.97);
  --text: #163046;
  --muted: #48667a;
  --accent: #1599c7;
  --accent2: #58ad2d;
  --accent-soft: #f5b93f;
  --danger: #ff4b5f;
  --gold: #f3b537;
  --line: rgba(22, 122, 151, 0.24);
  --shadow: 0 24px 58px rgba(35, 82, 105, 0.24);
  --radius: 28px;
  --font: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-display: "Arial Black", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

/* Cave Flight page: preserves the earlier vertical helicopter game presentation. */
.cave-flight-page {
  color: #dce9ff;
  background:
    radial-gradient(circle at 18% 88%, rgba(19, 105, 145, 0.26), transparent 28%),
    radial-gradient(circle at 80% 8%, rgba(110, 60, 180, 0.28), transparent 34%),
    linear-gradient(180deg, #130d2c 0%, #060613 52%, #071525 100%);
}

.cave-flight-page::before {
  opacity: 0.16;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px);
}

.cave-flight-page::after {
  opacity: 0.28;
  background: radial-gradient(circle at 50% -10%, rgba(98, 70, 180, 0.45), transparent 38%);
}

.cave-flight-shell {
  width: min(1180px, calc(100% - 32px));
}

.cave-flight-hero,
.cave-flight-board {
  background:
    radial-gradient(circle at 58% 0%, rgba(75, 35, 140, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(13, 9, 36, 0.96), rgba(7, 6, 20, 0.98));
  border: 1px solid rgba(111, 62, 190, 0.42);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255,255,255,0.06);
}

.cave-flight-copy h1 {
  max-width: 8ch;
  color: #d9f8ff;
  -webkit-text-stroke: 0;
  text-shadow:
    0 0 22px rgba(77, 217, 255, 0.22),
    0 4px 0 rgba(12, 15, 36, 0.88);
}

.cave-flight-copy .eyebrow,
.cave-flight-board .section-label {
  color: #f7d83b;
  text-shadow: none;
}

.cave-flight-copy .lede,
.cave-flight-copy .feature-list,
.cave-flight-board p {
  color: #aebff6;
}

.cave-flight-copy .reward-strip div {
  background: linear-gradient(180deg, rgba(15, 24, 54, 0.94), rgba(10, 7, 28, 0.98));
  border-color: rgba(77, 217, 255, 0.28);
}

.cave-flight-copy .reward-strip div:nth-child(2) {
  border-color: rgba(167, 83, 255, 0.45);
}

.cave-flight-copy .reward-strip strong,
.cave-flight-board h2 {
  color: #ffffff;
}

.cave-flight-page .game-card {
  align-items: center;
}

.cave-flight-page .game-frame {
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(112, 54, 230, 0.56), rgba(35, 21, 102, 0.94)),
    linear-gradient(180deg, rgba(40, 16, 105, 1), rgba(10, 8, 38, 1));
  border: 1px solid rgba(135, 92, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.09) inset,
    0 20px 50px rgba(0,0,0,0.42),
    0 0 34px rgba(84, 57, 210, 0.35);
}

.cave-flight-page .game-frame::before {
  inset: 12px;
  border-radius: 22px;
  border: 1px solid rgba(77, 217, 255, 0.25);
  opacity: 0.36;
}

.cave-flight-page canvas {
  border-radius: 20px;
  background: #050607;
}

.cave-flight-page .start-overlay,
.cave-flight-page .game-over-overlay,
.cave-flight-page .level-gate-overlay {
  border-radius: 30px;
  background: rgba(8, 5, 25, 0.82);
}

.cave-flight-start-card {
  color: #eef8ff;
  background:
    radial-gradient(circle at 50% 0%, rgba(77, 217, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(14, 17, 47, 0.96), rgba(8, 6, 26, 0.98));
  border: 1px solid rgba(77, 217, 255, 0.28);
  box-shadow: 0 20px 44px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.08);
}

.cave-flight-start-card h2 {
  color: #ffffff;
  -webkit-text-stroke: 0;
  text-shadow: 0 3px 0 rgba(6, 9, 28, 0.82), 0 0 18px rgba(77, 217, 255, 0.18);
}

.cave-flight-gate-score {
  font-size: 1.02rem;
  color: #aebff6;
}

.cave-flight-next-card {
  margin: 14px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: left;
  background: rgba(77, 217, 255, 0.07);
  border: 1px solid rgba(77, 217, 255, 0.18);
}

.cave-flight-next-card p {
  margin: 0 0 4px;
  color: #f7d83b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.cave-flight-next-card strong,
.cave-flight-next-card span {
  display: block;
}

.cave-flight-next-card span {
  margin-top: 6px;
  color: #aebff6;
  font-size: 0.88rem;
  line-height: 1.45;
}

.cave-flight-page .hud-strip {
  left: 22px;
  right: 22px;
  bottom: 20px;
}

.cave-flight-page .cave-fire-btn {
  right: 26px;
  bottom: 122px;
}

.cave-flight-board {
  margin-top: 24px;
  padding: 24px;
}

@media (min-width: 961px) {
  .cave-flight-page .hero-panel {
    grid-template-columns: minmax(330px, 0.98fr) minmax(360px, 0.82fr);
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas {
    border-radius: 0;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 126px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 10px);
    bottom: auto;
  }
}

/* Monthly leaderboard clarity pass. Keep this last so older table rules cannot hide the submitted date. */
@media (max-width: 640px) {
  .leaderboard_table,
  .table-shell {
    overflow-x: visible;
  }

  .leaderboard_table table,
  .table-shell table {
    min-width: 0 !important;
    border-spacing: 0 10px;
  }

  .leaderboard_table thead,
  .table-shell thead {
    display: none;
  }

  .leaderboard_table tbody,
  .leaderboard_table tr,
  .leaderboard_table td,
  .table-shell tbody,
  .table-shell tr,
  .table-shell td {
    display: block !important;
    width: 100%;
  }

  .leaderboard_table tbody tr,
  .table-shell tbody tr {
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 82, 72, 0.94), rgba(5, 35, 38, 0.96));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 16px rgba(0,0,0,0.24);
  }

  .leaderboard_table tbody td,
  .table-shell tbody td {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 4px;
    border: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: right;
  }

  .leaderboard_table tbody td::before,
  .table-shell tbody td::before {
    content: attr(data-label);
    color: #ffb342;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
  }

  .leaderboard_table .empty-state,
  .table-shell .empty-state {
    display: block !important;
    text-align: center;
  }

  .leaderboard_table .empty-state::before,
  .table-shell .empty-state::before {
    content: "★";
  }
}

/* Ink Flight Rush responsive horizontal layout override. */
body.cave-flight-page .cave-flight-hero {
  grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.35fr) !important;
  align-items: center !important;
}

body.cave-flight-page .cave-flight-game-card {
  width: 100% !important;
}

body.cave-flight-page .game-frame.cave-flight-frame {
  width: min(100%, 1120px) !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 26px !important;
  padding: 12px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame canvas {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: contain !important;
  border-radius: 18px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
  left: 24px !important;
  right: 24px !important;
  bottom: 20px !important;
  width: auto !important;
  max-width: none !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
  right: 34px !important;
  bottom: 100px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .cave-brand-logo {
  top: 62px !important;
  right: 30px !important;
}

@media (max-width: 960px) {
  body.cave-flight-page .cave-flight-hero {
    grid-template-columns: 1fr !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: min(100%, 940px) !important;
  }
}

@media (max-width: 640px) {
  body.cave-flight-page .hero-panel {
    min-height: 100dvh !important;
    height: auto !important;
    overflow-y: auto !important;
  }

  body.cave-flight-page .cave-flight-game-card {
    height: auto !important;
    flex: 0 0 auto !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    width: var(--mobile-canvas-width, 100vw) !important;
    height: var(--mobile-canvas-height, auto) !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px) !important;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px) !important;
    bottom: auto !important;
  }
}

.cave-flight-page {
  color: #eefdf4;
  background:
    radial-gradient(circle at 14% 84%, rgba(125, 255, 99, 0.20), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 138, 0, 0.16), transparent 30%),
    linear-gradient(180deg, #04181c 0%, #020a0d 56%, #061510 100%);
}

.cave-flight-page .hero-panel,
.cave-flight-page .board-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 255, 99, 0.14), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(255, 138, 0, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.34);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.12), 0 0 30px rgba(102,255,72,0.12);
}

.cave-flight-page h1 {
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 4px 0 #061c20, 0 7px 0 #1c7f21, 0 12px 24px rgba(0, 0, 0, 0.66);
}

.cave-flight-page .eyebrow,
.cave-flight-page .section-label,
.cave-flight-page .reward-label {
  color: #7dff63;
  text-shadow: 0 0 12px rgba(125,255,99,0.40);
}

.cave-flight-page .lede,
.cave-flight-page .feature-list,
.cave-flight-page .board-panel p {
  color: #dff8ef;
}

.cave-flight-page .game-frame {
  overflow: hidden;
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(125,255,99,0.18), transparent 28% 74%, rgba(255,138,0,0.18)), linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border: 2px solid rgba(77, 217, 255, 0.36) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(125,255,99,0.16), 0 24px 58px rgba(0,0,0,0.44), 0 0 36px rgba(77,217,255,0.18), 0 0 26px rgba(125,255,99,0.14) !important;
}

.cave-flight-page .game-frame::before {
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(125,255,99,0.18);
  background: linear-gradient(120deg, rgba(255,255,255,0.12), transparent 18% 76%, rgba(125,255,99,0.06));
  opacity: 0.34;
}

.cave-flight-page .game-frame::after {
  display: block;
  left: 28px;
  right: 28px;
  top: 20px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(125,255,99,0.82), transparent);
  box-shadow: 0 0 18px rgba(125,255,99,0.62);
}

.cave-flight-page canvas {
  border-radius: 18px;
  background: #031114;
}

.cave-brand-logo {
  position: absolute;
  right: 22px;
  top: 60px;
  z-index: 5;
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0.68;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.48));
  pointer-events: none;
}

.cave-flight-page .hud-strip {
  left: 24px;
  right: 24px;
  bottom: 22px;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: radial-gradient(circle at 15% 0%, rgba(125,255,99,0.12), transparent 42%), linear-gradient(180deg, rgba(8, 46, 49, 0.88), rgba(1, 14, 18, 0.95));
  border: 1px solid rgba(125,255,99,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 12px 24px rgba(0,0,0,0.30), 0 0 20px rgba(125,255,99,0.14);
  backdrop-filter: blur(8px);
}

.cave-flight-page .hud-actions {
  margin-right: 0;
}

.cave-flight-page .hud-pill {
  width: auto;
  min-width: 58px;
  flex: 1 1 0;
  padding: 7px 6px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.cave-flight-page .hud-pill span {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: #7dff63;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.cave-flight-page .hud-pill strong {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.42), 0 0 12px rgba(125,255,99,0.22);
}

.cave-flight-page .hud-pill:last-child strong {
  color: #ffb342;
}

.cave-flight-page .pause-btn-pill {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.18), transparent 44%), linear-gradient(180deg, rgba(16, 82, 80, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.34);
}

.cave-flight-page .pause-btn-pill::before {
  content: "II";
  font-size: 0.92rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.cave-flight-page .cave-fire-btn {
  right: 28px;
  bottom: 106px;
  width: 88px;
  height: 48px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.42), transparent 42%), linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.92);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.36), inset 0 -4px 0 rgba(122,45,0,0.34), 0 9px 16px rgba(0,0,0,0.32), 0 0 22px rgba(255,138,0,0.36);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .cave-fire-btn:hover,
.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.70);
  outline-offset: 3px;
}

.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.98);
  background: linear-gradient(180deg, #ff9f1f, #e35f00);
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas {
    border-radius: 0;
  }

  .cave-brand-logo {
    top: 54px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    width: 28px;
    height: 28px;
  }

  .cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 58px;
    height: 58px;
    padding: 6px 7px;
    border-radius: 0;
  }

  .cave-flight-page .hud-pill {
    min-width: 0;
    padding: 5px 3px;
    border-radius: 10px;
  }

  .cave-flight-page .hud-pill span {
    font-size: 0.48rem;
  }

  .cave-flight-page .hud-pill strong {
    font-size: 0.82rem;
  }

  .cave-flight-page .pause-btn-pill {
    width: 42px;
    height: 42px;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 78px;
    height: 44px;
    font-size: 0.8rem;
  }
}

/* Ink Flight Rush embedded arcade shell fix.
   Keep the website shell consistent with the main arcade page; only the game frame stays Flight-themed. */
.cave-flight-doc,
.cave-flight-doc body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: manipulation;
}

body.cave-flight-page {
  color: var(--text) !important;
  background:
    radial-gradient(ellipse at 18% 15%, rgba(255, 255, 255, 0.78) 0 12%, transparent 12.5%),
    radial-gradient(ellipse at 68% 13%, rgba(255, 255, 255, 0.64) 0 10%, transparent 10.5%),
    radial-gradient(circle at 18% 82%, rgba(88, 173, 45, 0.30), transparent 32%),
    radial-gradient(circle at 84% 22%, rgba(21, 153, 199, 0.26), transparent 30%),
    linear-gradient(180deg, #b9ecff 0%, #eaffdf 62%, #fff6cf 100%) !important;
}

body.cave-flight-page::before {
  opacity: 0.45 !important;
  background-image:
    linear-gradient(22deg, transparent 0 44%, rgba(255,255,255,0.20) 44.3% 47.5%, transparent 47.8%),
    linear-gradient(-24deg, transparent 0 42%, rgba(255,255,255,0.16) 42.3% 45.2%, transparent 45.5%) !important;
  background-size: 100% 100% !important;
  mask-image: linear-gradient(180deg, black 0, transparent 76%) !important;
}

body.cave-flight-page::after {
  opacity: 0.20 !important;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,0.80), transparent 28%),
    radial-gradient(circle at center, transparent 42%, rgba(24, 94, 120, 0.30) 100%) !important;
}

body.cave-flight-page .app-shell.cave-flight-shell {
  width: min(1480px, calc(100% - 36px)) !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 28px 0 48px !important;
  overflow: visible !important;
}

body.cave-flight-page .hero-panel.cave-flight-hero {
  display: grid !important;
  grid-template-columns: minmax(320px, 0.58fr) minmax(0, 1.42fr) !important;
  align-items: center !important;
  gap: 22px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 28px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(240,255,230,0.80)),
    radial-gradient(ellipse at 15% 18%, rgba(255,255,255,0.68) 0 14%, transparent 14.5%),
    radial-gradient(ellipse at 88% 12%, rgba(255,255,255,0.58) 0 12%, transparent 12.5%) !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(18px);
  overflow: visible !important;
}

body.cave-flight-page .hero-copy.game_info_card {
  display: flex !important;
}

body.cave-flight-page .cave-flight-info-card .delivery-back-link {
  margin: 0 0 12px;
  align-self: flex-start;
}

body.cave-flight-page .game_info_title h1 {
  max-width: none !important;
  color: #ffffff !important;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3vw, 3.35rem) !important;
  line-height: 0.88 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 #061c20,
    0 7px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.68) !important;
}

body.cave-flight-page .game_info_title h1 span {
  color: #ff8a00 !important;
  text-shadow:
    0 4px 0 #3d1600,
    0 7px 0 #0d3412,
    0 12px 24px rgba(0, 0, 0, 0.68) !important;
}

body.cave-flight-page .cave-flight-game-card {
  width: 100% !important;
  height: auto !important;
  flex: 0 1 auto !important;
  align-items: stretch !important;
  overflow: visible !important;
}

body.cave-flight-page .game-frame.cave-flight-frame {
  width: min(100%, 960px) !important;
  height: min(67vh, 540px) !important;
  max-height: 540px !important;
  aspect-ratio: 16 / 9 !important;
  flex: 0 1 auto !important;
  margin-left: auto !important;
  padding: 8px !important;
  border-radius: 14px !important;
  background:
    linear-gradient(135deg, rgba(125,255,99,0.18), transparent 28% 74%, rgba(255,138,0,0.18)),
    linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border: 2px solid rgba(77, 217, 255, 0.36) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(125,255,99,0.16),
    0 18px 42px rgba(19, 98, 118, 0.20),
    0 0 28px rgba(77,217,255,0.18) !important;
}

body.cave-flight-page .game-frame.cave-flight-frame canvas {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 8px !important;
}

body.cave-flight-page .board-panel.cave-flight-board {
  display: block !important;
  margin-top: 24px !important;
}

body.cave-flight-page .board-panel.cave-flight-board.leaderboard_panel {
  background:
    linear-gradient(180deg, rgba(4, 28, 31, 0.96), rgba(2, 14, 17, 0.98)) !important;
  border: 2px solid rgba(115, 255, 78, 0.45) !important;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 28px rgba(102, 255, 72, 0.22) !important;
}

@media (max-width: 960px) {
  body.cave-flight-page .hero-panel.cave-flight-hero {
    grid-template-columns: 1fr !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 640px) {
  .cave-flight-doc,
  .cave-flight-doc body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: manipulation !important;
  }

  body.cave-flight-page .app-shell.cave-flight-shell {
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  body.cave-flight-page .hero-panel.cave-flight-hero {
    display: grid !important;
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 22px !important;
    overflow: visible !important;
  }

  body.cave-flight-page .hero-panel.cave-flight-hero > *,
  body.cave-flight-page .hero-copy.game_info_card,
  body.cave-flight-page .cave-flight-game-card,
  body.cave-flight-page .board-panel.cave-flight-board {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.cave-flight-page .hero-copy.game_info_card {
    display: flex !important;
  }

  body.cave-flight-page .board-panel.cave-flight-board {
    display: block !important;
  }

  body.cave-flight-page .game_info_title h1 {
    max-width: 10ch !important;
    font-size: clamp(2.15rem, 8vw, 3.1rem) !important;
  }

  body.cave-flight-page .cave-flight-game-card {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    flex: 0 0 auto !important;
    padding: 6px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame:has(.cave-level-select-overlay:not(.hidden)),
  body.cave-flight-page .game-frame.cave-flight-frame:has(.start-overlay:not(.hidden)) {
    min-height: min(60vh, 340px) !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    display: block !important;
    width: calc(100vw - 54px) !important;
    max-width: calc(100vw - 54px) !important;
    height: calc((100vw - 54px) * 0.5625) !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 8px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-select-overlay {
    padding: 8px !important;
    overflow: hidden auto !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-select-panel {
    width: calc(100% - 12px) !important;
    max-height: calc(100% - 12px) !important;
    padding: 10px !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-back {
    min-height: 30px !important;
    margin-bottom: 4px !important;
    padding: 0 12px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-select-panel .overlay-kicker {
    font-size: 0.62rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-select-panel h2 {
    margin: 2px 0 4px !important;
    font-size: 1.55rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-select-copy {
    margin-bottom: 8px !important;
    font-size: 0.78rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-grid {
    gap: 5px !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 2px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-button {
    min-height: 42px !important;
    border-radius: 10px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-number {
    font-size: 1.05rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-state {
    min-height: 12px !important;
    font-size: 0.42rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 8px !important;
    width: auto !important;
    height: auto !important;
    min-height: 46px !important;
    padding: 5px !important;
    border-radius: 12px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill {
    padding: 4px 3px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill span {
    font-size: 0.45rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill strong {
    font-size: 0.72rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    top: auto !important;
    right: 14px !important;
    bottom: 70px !important;
    width: 72px !important;
    height: 40px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-brand-logo {
    top: 18px !important;
    right: 18px !important;
    width: 26px !important;
    height: 26px !important;
  }
}

/* Final monthly leaderboard mobile layout override. */
@media (max-width: 760px) {
  .leaderboard_table,
  .table-shell {
    overflow-x: visible !important;
  }

  .leaderboard_table table,
  .table-shell table {
    min-width: 0 !important;
    width: 100% !important;
    border-spacing: 0 10px;
  }

  .leaderboard_table thead,
  .table-shell thead {
    display: none !important;
  }

  .leaderboard_table tbody,
  .leaderboard_table tr,
  .leaderboard_table td,
  .table-shell tbody,
  .table-shell tr,
  .table-shell td {
    display: block !important;
    width: 100% !important;
  }

  .leaderboard_table tbody tr,
  .table-shell tbody tr {
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 82, 72, 0.94), rgba(5, 35, 38, 0.96));
    border: 1px solid rgba(115, 255, 78, 0.18);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  }

  .leaderboard_table tbody td,
  .table-shell tbody td {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: right;
  }

  .leaderboard_table tbody td::before,
  .table-shell tbody td::before {
    content: attr(data-label);
    color: #ffb342;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
  }

  .leaderboard_table .empty-state,
  .table-shell .empty-state {
    display: block !important;
    text-align: center;
  }
}

/* Final Ink Flight Rush pause icon fix. This must stay after legacy cave-flight rules. */
body.cave-flight-page .game-frame.cave-flight-frame #pause-btn.pause-btn-pill,
body.cave-flight-page #pause-btn.pause-btn-pill {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 2px solid rgba(67, 255, 117, 0.9) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.22), transparent 44%),
    linear-gradient(180deg, #0f4f48, #062b2b) !important;
  box-shadow:
    0 0 12px rgba(67, 255, 117, 0.38),
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -4px 7px rgba(0,0,0,0.38),
    0 8px 16px rgba(0,0,0,0.28) !important;
  color: #ffffff !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

body.cave-flight-page .game-frame.cave-flight-frame #pause-btn.pause-btn-pill::before,
body.cave-flight-page #pause-btn.pause-btn-pill::before,
body.cave-flight-page .game-frame.cave-flight-frame #pause-btn.pause-btn-pill::after,
body.cave-flight-page #pause-btn.pause-btn-pill::after {
  content: none !important;
  display: none !important;
}

body.cave-flight-page #pause-btn.pause-btn-pill .pause-icon {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  overflow: visible !important;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.46));
}

body.cave-flight-page #pause-btn.pause-btn-pill .pause-icon rect {
  fill: #ffffff !important;
}

/* High-specificity Ink Flight Rush pause control override. */
body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill,
body.cave-flight-page .pause-btn-pill {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 2px solid rgba(67, 255, 117, 0.88) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.24), transparent 44%),
    linear-gradient(180deg, #0f4f48, #062b2b) !important;
  box-shadow:
    0 0 12px rgba(67, 255, 117, 0.36),
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -4px 7px rgba(0,0,0,0.38),
    0 8px 16px rgba(0,0,0,0.28) !important;
  color: #ffffff !important;
  font-size: 0 !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before,
body.cave-flight-page .pause-btn-pill::before {
  content: none !important;
}

body.cave-flight-page .pause-btn-pill .pause-icon {
  width: 18px !important;
  height: 22px !important;
  display: flex !important;
  gap: 5px !important;
  align-items: stretch !important;
  justify-content: center !important;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.45));
}

body.cave-flight-page .pause-btn-pill .pause-icon span {
  width: 6px !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffffff, #dff8ef) !important;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.16);
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill,
body.cave-flight-page .pause-btn-pill {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 14px !important;
  border: 2px solid rgba(67, 255, 117, 0.88) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.24), transparent 44%),
    linear-gradient(180deg, #0f4f48, #062b2b) !important;
  box-shadow:
    0 0 12px rgba(67, 255, 117, 0.36),
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -4px 7px rgba(0,0,0,0.38),
    0 8px 16px rgba(0,0,0,0.28) !important;
  color: #ffffff !important;
  font-size: 0 !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before,
body.cave-flight-page .pause-btn-pill::before {
  content: none !important;
}

body.cave-flight-page .pause-btn-pill .pause-icon {
  width: 18px;
  height: 22px;
  display: flex;
  gap: 5px;
  align-items: stretch;
  justify-content: center;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.45));
}

body.cave-flight-page .pause-btn-pill .pause-icon span {
  width: 6px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #dff8ef);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.16);
}

body.cave-flight-page .pause-btn-pill:hover,
body.cave-flight-page .pause-btn-pill:focus-visible {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08);
  outline: 3px solid rgba(125,255,99,0.42);
  outline-offset: 3px;
}

body.cave-flight-page .pause-btn-pill:active {
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.94);
}

/* Final Ink Flight pause-button override: keep the coded icon aligned after legacy rules. */
body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill,
body.cave-flight-page .pause-btn-pill {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 15px !important;
  color: #ffffff !important;
  font-size: 0 !important;
  background:
    radial-gradient(circle at 48% 8%, rgba(255,255,255,0.28), rgba(255,255,255,0.06) 34%, transparent 54%),
    linear-gradient(180deg, #12635b 0%, #07373a 56%, #03191c 100%) !important;
  border: 2px solid rgba(67,255,117,0.78) !important;
  box-shadow:
    0 0 14px rgba(67,255,117,0.34),
    0 8px 16px rgba(0,0,0,0.34),
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -4px 7px rgba(0,0,0,0.42) !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before,
body.cave-flight-page .pause-btn-pill::before {
  content: none !important;
}

body.cave-flight-page .pause-btn-pill .pause-icon {
  width: 18px;
  height: 21px;
  display: flex;
  justify-content: center;
  gap: 5px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.38));
}

body.cave-flight-page .pause-btn-pill .pause-icon span {
  width: 6px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #d9ffef);
}

@media (max-width: 640px) {
  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill,
  body.cave-flight-page .pause-btn-pill {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }
}

/* Ink Flight Rush focused QA pass: level select, compact results, and premium pause control. */
@media (min-width: 641px) {
  .cave-flight-page .game-frame.cave-flight-frame {
    width: min(100%, 900px) !important;
    max-height: calc(100vh - 120px);
    aspect-ratio: 16 / 9 !important;
  }
}

.cave-flight-page .cave-level-select-overlay,
.cave-flight-page .start-overlay,
.cave-flight-page .game-over-overlay,
.cave-flight-page .level-gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 18px);
  border-radius: inherit;
  background: rgba(0, 10, 12, 0.66) !important;
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.cave-flight-page .cave-level-select-overlay.hidden,
.cave-flight-page .start-overlay.hidden,
.cave-flight-page .game-over-overlay.hidden,
.cave-flight-page .level-gate-overlay.hidden {
  display: none !important;
}

.cave-flight-page .cave-level-select-panel,
.cave-flight-page .cave-result-panel,
.cave-flight-page .cave-flight-start-card {
  width: min(760px, 94%);
  max-height: calc(100% - 16px);
  overflow: hidden;
  border-radius: 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 255, 99, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99)) !important;
  border: 2px solid rgba(115, 255, 78, 0.46) !important;
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 30px rgba(102, 255, 72, 0.20) !important;
}

.cave-flight-page .cave-level-select-panel {
  position: relative;
  padding: 18px;
  text-align: center;
}

.cave-flight-page .cave-level-select-panel h2,
.cave-flight-page .cave-result-panel h2,
.cave-flight-page .cave-flight-start-card h2 {
  margin: 4px 0 8px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #061c20, 0 6px 0 #1c7f21, 0 12px 24px rgba(0, 0, 0, 0.58) !important;
}

.cave-flight-page .cave-level-select-copy {
  max-width: 520px;
  margin: 0 auto 12px;
  color: #dff8ef;
  font-weight: 800;
  line-height: 1.25;
}

.cave-flight-page .cave-level-back {
  position: absolute;
  left: 14px;
  top: 14px;
  min-height: 36px;
  padding: 0 16px;
  border: 2px solid rgba(255, 220, 115, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffbd45, #ff7300);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 1000;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 7px 14px rgba(0,0,0,0.30);
}

.cave-flight-page .cave-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  max-height: min(310px, calc(100% - 118px));
  overflow-y: auto;
  padding: 4px;
}

.cave-flight-page .cave-level-button {
  min-height: 66px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(180deg, #bcecff, #55c7dc);
  color: #ffffff;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.38), inset 0 -5px 0 rgba(0,0,0,0.18), 0 8px 0 rgba(0,0,0,0.42);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .cave-level-button:hover,
.cave-flight-page .cave-level-button:focus-visible {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.9);
  outline-offset: 2px;
}

.cave-flight-page .cave-level-button:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.24), inset 0 -2px 0 rgba(0,0,0,0.2), 0 3px 0 rgba(0,0,0,0.42);
}

.cave-flight-page .cave-level-button.completed {
  background: linear-gradient(180deg, #90ff66, #26bf4e);
  border-color: rgba(210, 255, 169, 0.88);
}

.cave-flight-page .cave-level-button.current {
  background: linear-gradient(180deg, #9dff64, #38cf46);
  border-color: rgba(255, 190, 55, 0.96);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.42), inset 0 -5px 0 rgba(0,0,0,0.18), 0 8px 0 rgba(0,0,0,0.42), 0 0 22px rgba(255, 186, 59, 0.44);
}

.cave-flight-page .cave-level-button.locked {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.84;
  background: linear-gradient(180deg, #a5b3b4, #4f5f61);
  border-color: rgba(255,255,255,0.32);
}

.cave-flight-page .cave-level-number {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(0,0,0,0.62), 0 5px 8px rgba(0,0,0,0.34);
}

.cave-flight-page .cave-level-state {
  min-height: 16px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

.cave-flight-page .cave-level-state svg {
  width: 16px;
  height: 16px;
  display: block;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.55));
}

.cave-flight-page .cave-result-panel,
.cave-flight-page .cave-level-complete-panel {
  width: min(410px, 92%);
  overflow-y: auto;
  padding: 10px 14px;
  text-align: center;
}

.cave-flight-page .cave-result-level,
.cave-flight-page .cave-flight-gate-score {
  margin: 0 0 4px;
  color: #ffb342;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cave-flight-page .cave-result-panel #result-message,
.cave-flight-page .cave-result-panel #result-rank-message,
.cave-flight-page .cave-level-complete-panel #gate-rank-message {
  min-height: 0;
  margin: 5px 0;
  color: #dff8ef;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.18;
}

.cave-flight-page .cave-result-panel #result-rank-message,
.cave-flight-page .cave-level-complete-panel #gate-rank-message {
  color: #ffb342;
}

.cave-flight-page .cave-result-panel .overlay-kicker,
.cave-flight-page .cave-level-select-panel .overlay-kicker {
  margin: 0;
  color: #7dff63;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cave-flight-page .cave-result-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.38rem, 3vw, 1.95rem);
  line-height: 0.98;
}

.cave-flight-page .cave-result-prize-summary {
  gap: 6px;
  margin: 6px 0;
}

.cave-flight-page .cave-gate-prize-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cave-flight-page .cave-result-prize-summary div {
  padding: 7px 6px;
  border-radius: 11px;
}

.cave-flight-page .cave-result-prize-summary span {
  font-size: 0.48rem;
}

.cave-flight-page .cave-result-prize-summary strong {
  font-size: 0.88rem;
}

.cave-flight-page .cave-flight-next-card {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 14px;
  text-align: left;
  background: linear-gradient(180deg, rgba(13, 72, 65, 0.9), rgba(4, 30, 34, 0.94));
  border: 1px solid rgba(255, 138, 0, 0.62);
}

.cave-flight-page .cave-flight-next-card p,
.cave-flight-page .cave-flight-next-card strong,
.cave-flight-page .cave-flight-next-card span {
  margin: 0;
  line-height: 1.22;
}

.cave-flight-page .cave-flight-next-card p {
  color: #ffb342;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cave-flight-page .cave-flight-next-card strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 1000;
}

.cave-flight-page .cave-flight-next-card span {
  display: block;
  margin-top: 5px;
  color: #dff8ef;
  font-size: 0.78rem;
  font-weight: 800;
}

.cave-flight-page .score-form {
  margin-top: 6px;
}

.cave-flight-page .score-form label {
  margin-bottom: 5px;
  text-align: left;
}

.cave-flight-page .score-form span {
  margin-bottom: 4px;
  color: #7dff63;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cave-flight-page .score-form input {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 11px;
  border: 1px solid rgba(125, 255, 99, 0.26);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  font-weight: 800;
}

.cave-flight-page .score-form input::placeholder {
  color: rgba(223,248,239,0.55);
}

.cave-flight-page .score-form .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.cave-flight-page .score-form .button {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 12px;
  font-size: 0.78rem;
}

.cave-flight-page .score-form .button.primary {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.92);
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.38);
}

.cave-flight-page .score-form .button.ghost {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1));
  border: 2px solid rgba(255,255,255,0.16);
}

@media (min-width: 641px) {
  .cave-flight-page .cave-result-panel .score-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .cave-flight-page .cave-result-panel .score-form label {
    margin-bottom: 0;
  }

  .cave-flight-page .cave-result-panel .score-form .form-actions {
    grid-column: 1 / -1;
  }
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 14px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.22), transparent 46%),
    linear-gradient(180deg, rgba(18, 92, 83, 0.98), rgba(3, 31, 32, 0.98)) !important;
  border: 2px solid rgba(125,255,99,0.54) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 16px rgba(0,0,0,0.32), 0 0 18px rgba(125,255,99,0.22) !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before {
  content: "" !important;
  display: block !important;
  width: 15px !important;
  height: 19px !important;
  margin: 0 !important;
  background: linear-gradient(90deg, #ffffff 0 34%, transparent 34% 66%, #ffffff 66% 100%) !important;
  border-radius: 2px !important;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.35)) !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill:hover,
body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.72);
  outline-offset: 2px;
}

.cave-flight-page .cave-pause-menu {
  max-height: calc(100% - 24px);
  overflow-y: auto;
}

@media (max-width: 640px) {
  .cave-flight-page .cave-flight-shell,
  .cave-flight-page .hero-panel.cave-flight-hero,
  .cave-flight-page .cave-flight-game-card,
  .cave-flight-page .game-frame.cave-flight-frame {
    min-height: 100vh !important;
    min-height: 100svh !important;
  }

  .cave-flight-page .hero-panel.cave-flight-hero {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .cave-flight-page .cave-flight-game-card {
    height: 100vh !important;
    height: 100svh !important;
  }

  .cave-flight-page .cave-level-select-overlay,
  .cave-flight-page .start-overlay,
  .cave-flight-page .game-over-overlay,
  .cave-flight-page .level-gate-overlay {
    min-height: 100% !important;
    align-items: center;
  }

  .cave-flight-page .cave-level-select-panel,
  .cave-flight-page .cave-result-panel,
  .cave-flight-page .cave-level-complete-panel {
    width: min(356px, calc(100vw - 18px));
    max-height: calc(100% - 14px);
    padding: 12px;
    border-radius: 18px;
  }

  .cave-flight-page .cave-level-back {
    position: static;
    margin: 0 auto 6px 0;
    min-height: 32px;
    padding: 0 13px;
  }

  .cave-flight-page .cave-level-select-panel h2 {
    font-size: 1.9rem;
  }

  .cave-flight-page .cave-level-grid {
    gap: 6px;
    max-height: 270px;
  }

  .cave-flight-page .cave-level-button {
    min-height: 50px;
    border-radius: 12px;
  }

  .cave-flight-page .cave-level-number {
    font-size: 1.3rem;
  }

  .cave-flight-page .cave-level-state {
    font-size: 0.48rem;
  }

  .cave-flight-page .cave-result-panel h2 {
    font-size: 1.55rem;
  }

  .cave-flight-page .cave-gate-prize-summary,
  .cave-flight-page .cave-result-prize-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cave-flight-page .cave-gate-prize-summary div:first-child {
    grid-column: 1 / -1;
  }

  .cave-flight-page .score-form .form-actions {
    grid-template-columns: 1fr;
  }

  .cave-flight-page .score-form .button {
    min-height: 38px;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
  }
}

/* Ink Flight power-up/pause polish pass. */
body.cave-flight-page {
  overflow-x: hidden;
  touch-action: manipulation;
}

body.cave-flight-page #game-canvas {
  touch-action: none;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: 15px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 48% 8%, rgba(255,255,255,0.28), rgba(255,255,255,0.06) 34%, transparent 54%),
    linear-gradient(180deg, #12635b 0%, #07373a 56%, #03191c 100%) !important;
  border: 2px solid rgba(67, 255, 117, 0.78) !important;
  box-shadow:
    0 0 14px rgba(67, 255, 117, 0.34),
    0 8px 16px rgba(0,0,0,0.34),
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -4px 7px rgba(0,0,0,0.42) !important;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before {
  content: none !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill .pause-icon {
  width: 18px;
  height: 21px;
  display: flex;
  justify-content: center;
  gap: 5px;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.38));
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill .pause-icon span {
  width: 6px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #d9ffef);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill:hover,
body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill:focus-visible {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.76);
  outline-offset: 3px;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.96);
}

@media (max-width: 640px) {
  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
  }
}

/* Launch QA pass: compact game picker and clearer shared leaderboard. */
body:not(.cave-flight-page) .game-select-overlay {
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.4vw, 16px);
}

body:not(.cave-flight-page) .game-select-panel {
  width: min(990px, calc(100% - 18px));
  max-height: min(94vh, calc(100% - 12px));
  padding: clamp(16px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

body:not(.cave-flight-page) .game-select-kicker {
  font-size: clamp(0.62rem, 1vw, 0.74rem);
}

body:not(.cave-flight-page) .game-select-panel h2 {
  margin: 4px 0 4px;
  font-size: clamp(2.2rem, 5.1vw, 3.65rem);
  line-height: 0.9;
}

body:not(.cave-flight-page) .game-select-intro {
  margin: 0 auto 12px;
  font-size: clamp(0.82rem, 1.25vw, 0.98rem);
  line-height: 1.25;
}

body:not(.cave-flight-page) .arcade-game-grid {
  gap: clamp(10px, 1.5vw, 16px);
  align-items: stretch;
}

body:not(.cave-flight-page) .arcade-game-card {
  min-height: clamp(208px, 39vh, 232px);
  padding: clamp(13px, 1.6vw, 16px);
  gap: 10px;
  border-radius: 20px;
}

body:not(.cave-flight-page) .arcade-game-copy {
  height: 100%;
  gap: 7px;
}

body:not(.cave-flight-page) .arcade-game-copy strong {
  font-size: clamp(1.15rem, 2vw, 1.46rem);
  line-height: 0.98;
}

body:not(.cave-flight-page) .arcade-game-copy small {
  font-size: clamp(0.76rem, 1.15vw, 0.86rem);
  line-height: 1.22;
}

body:not(.cave-flight-page) .arcade-game-meta {
  padding: 5px 8px;
  font-size: clamp(0.66rem, 0.95vw, 0.74rem);
}

body:not(.cave-flight-page) .arcade-game-copy em {
  margin-top: auto;
  padding: 8px 12px;
  font-size: 0.72rem;
}

.leaderboard-empty-card {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.leaderboard-empty-card strong {
  color: #eefdf4;
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

.leaderboard-play-now {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 220, 115, 0.9);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.38), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -3px 0 rgba(122, 45, 0, 0.34),
    0 8px 16px rgba(0,0,0,0.28),
    0 0 18px rgba(255, 138, 0, 0.28);
  text-shadow: 0 2px 0 rgba(0,0,0,0.35);
}

.leaderboard-play-now:hover,
.leaderboard-play-now:focus-visible {
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.70);
  outline-offset: 3px;
}

.leaderboard_table tbody tr.current-player td {
  border-top-color: rgba(255, 179, 66, 0.56);
  border-bottom-color: rgba(255, 179, 66, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(255, 179, 66, 0.18),
    0 0 18px rgba(255, 138, 0, 0.16),
    0 7px 14px rgba(0,0,0,0.20);
}

@media (max-width: 820px) {
  body:not(.cave-flight-page) .game-select-panel {
    overflow-y: auto;
  }

  body:not(.cave-flight-page) .arcade-game-grid {
    grid-template-columns: 1fr;
  }

  body:not(.cave-flight-page) .arcade-game-card {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  body:not(.cave-flight-page) .game-select-overlay {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 10px;
  }

  body:not(.cave-flight-page) .game-select-panel {
    width: min(370px, calc(100vw - 20px));
    max-height: none;
    padding: 14px;
    border-radius: 20px;
  }

  body:not(.cave-flight-page) .game-select-panel h2 {
    font-size: 2rem;
  }

  body:not(.cave-flight-page) .game-select-intro {
    margin-bottom: 10px;
    font-size: 0.78rem;
  }

  body:not(.cave-flight-page) .arcade-game-grid {
    gap: 8px;
  }

  body:not(.cave-flight-page) .arcade-game-card {
    min-height: 0;
    padding: 10px;
    border-radius: 16px;
  }

  body:not(.cave-flight-page) .arcade-game-copy {
    gap: 4px;
  }

  body:not(.cave-flight-page) .arcade-game-copy strong {
    font-size: 1rem;
  }

  body:not(.cave-flight-page) .arcade-game-copy small {
    font-size: 0.72rem;
  }

  body:not(.cave-flight-page) .arcade-game-meta {
    padding: 4px 7px;
    font-size: 0.6rem;
  }

  body:not(.cave-flight-page) .arcade-game-copy em {
    padding: 6px 9px;
    font-size: 0.6rem;
  }

  .leaderboard_table {
    overflow-x: visible;
  }

  .leaderboard_table table {
    min-width: 0;
  }

  .leaderboard_table th:nth-child(4),
  .leaderboard_table th:nth-child(5),
  .leaderboard_table td:nth-child(4),
  .leaderboard_table td:nth-child(5) {
    display: none;
  }

  .leaderboard_table th,
  .leaderboard_table td {
    padding: 10px 8px;
  }
}

/* Final gameplay polish overrides. Keep these last so older duplicated rules cannot win. */
body:not(.cave-flight-page) #cave-fire-btn {
  right: clamp(14px, 2.4vw, 30px) !important;
  bottom: clamp(92px, 14%, 132px) !important;
  top: auto !important;
  width: clamp(84px, 9vw, 108px) !important;
  height: clamp(46px, 5vw, 56px) !important;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.38), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300) !important;
  border: 2px solid rgba(255, 220, 115, 0.94) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 -4px 0 rgba(122,45,0,0.34),
    0 10px 18px rgba(0,0,0,0.34),
    0 0 22px rgba(255,138,0,0.34) !important;
  color: #fff !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-weight: 1000 !important;
  letter-spacing: 0.06em !important;
  z-index: 24 !important;
}

body:not(.cave-flight-page) #cave-fire-btn:hover,
body:not(.cave-flight-page) #cave-fire-btn:focus-visible {
  transform: scale(1.03);
  filter: brightness(1.08);
}

body:not(.cave-flight-page) #cave-fire-btn:active {
  transform: translateY(2px) scale(0.97);
}

body.cave-flight-page .cave-flight-hero {
  grid-template-columns: minmax(300px, 0.74fr) minmax(560px, 1.35fr) !important;
  align-items: center !important;
}

body.cave-flight-page .cave-flight-game-card {
  width: 100% !important;
  height: auto !important;
}

body.cave-flight-page .game-frame.cave-flight-frame {
  width: min(100%, 1120px) !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  padding: 14px !important;
  border-radius: 26px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 18px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
  position: absolute !important;
  left: 24px !important;
  right: 24px !important;
  bottom: 20px !important;
  width: auto !important;
  min-height: 66px !important;
  height: auto !important;
  border-radius: 18px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
  top: auto !important;
  right: 34px !important;
  bottom: 102px !important;
  width: 96px !important;
  height: 52px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 48px !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before {
  content: "" !important;
  display: block !important;
  width: 18px !important;
  height: 20px !important;
  margin: 0 !important;
  border: 0 !important;
  background: linear-gradient(90deg, #ffffff 0 34%, transparent 34% 66%, #ffffff 66% 100%) !important;
  border-radius: 2px !important;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.35)) !important;
}

.cave-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 10, 12, 0.62);
  backdrop-filter: blur(4px);
}

.cave-pause-overlay.hidden {
  display: none !important;
}

.cave-pause-menu {
  width: min(360px, 90vw);
  padding: 26px;
  border-radius: 28px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.52);
  box-shadow:
    0 22px 58px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 34px rgba(102,255,72,0.22);
}

.cave-pause-kicker {
  margin: 0 0 8px;
  color: #7dff63;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cave-pause-menu h2 {
  margin: 0 0 20px;
  color: #fff;
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: clamp(34px, 5vw, 44px);
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 3px 0 #061c20, 0 6px 0 #1c7f21, 0 12px 24px rgba(0,0,0,0.62);
}

.cave-pause-actions {
  display: grid;
  gap: 10px;
}

.cave-pause-button {
  min-height: 48px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1));
  color: #fff;
  font-family: var(--font-display, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 16px rgba(0,0,0,0.32);
  transition: transform 130ms ease, filter 130ms ease;
}

.cave-pause-button.primary {
  background: linear-gradient(180deg, #ffb13b, #ff7300);
  border-color: rgba(255, 220, 115, 0.95);
  text-shadow: 0 2px 0 rgba(0,0,0,0.35);
}

.cave-pause-button.muted {
  opacity: 0.72;
}

.cave-pause-button:hover,
.cave-pause-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.cave-pause-button:active {
  transform: translateY(1px);
}

@media (max-width: 900px) {
  body.cave-flight-page .cave-flight-hero {
    grid-template-columns: 1fr !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: min(100%, 940px) !important;
  }
}

@media (max-width: 640px) {
  body:not(.cave-flight-page) #cave-fire-btn {
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 14px) !important;
    top: calc(var(--mobile-canvas-height, 70vh) - 124px) !important;
    bottom: auto !important;
    width: 86px !important;
    height: 46px !important;
    font-size: 0.78rem !important;
  }

  body.cave-flight-page .hero-panel {
    min-height: 100dvh !important;
    height: auto !important;
    overflow-y: auto !important;
  }

  body.cave-flight-page .cave-flight-game-card {
    height: auto !important;
    flex: 0 0 auto !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    width: var(--mobile-canvas-width, 100vw) !important;
    height: var(--mobile-canvas-height, auto) !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    min-height: 58px !important;
    height: 58px !important;
    padding: 6px 7px !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px) !important;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px) !important;
    bottom: auto !important;
    width: 84px !important;
    height: 46px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill::before {
    width: 16px !important;
    height: 17px !important;
  }

  .cave-pause-overlay {
    align-items: flex-start !important;
    padding: 8px !important;
  }

  .cave-pause-menu {
    width: min(330px, 94vw) !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  .cave-pause-kicker {
    margin-bottom: 3px !important;
    font-size: 0.62rem !important;
  }

  .cave-pause-menu h2 {
    margin-bottom: 9px !important;
    font-size: 30px !important;
  }

  .cave-pause-actions {
    gap: 6px !important;
  }

  .cave-pause-button {
    min-height: 36px !important;
    border-radius: 13px !important;
    font-size: 0.82rem !important;
  }
}

/* Final Ink Flight Rush horizontal layout override. */
body.cave-flight-page .cave-flight-hero {
  grid-template-columns: minmax(300px, 0.72fr) minmax(560px, 1.35fr) !important;
  align-items: center !important;
}

body.cave-flight-page .cave-flight-game-card {
  width: 100% !important;
}

body.cave-flight-page .game-frame.cave-flight-frame {
  width: min(100%, 1120px) !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 26px !important;
  padding: 12px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame canvas {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 9 !important;
  object-fit: contain !important;
  border-radius: 18px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
  left: 24px !important;
  right: 24px !important;
  bottom: 20px !important;
  width: auto !important;
  max-width: none !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
  right: 34px !important;
  bottom: 100px !important;
}

body.cave-flight-page .game-frame.cave-flight-frame .cave-brand-logo {
  top: 62px !important;
  right: 30px !important;
}

@media (max-width: 960px) {
  body.cave-flight-page .cave-flight-hero {
    grid-template-columns: 1fr !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: min(100%, 940px) !important;
  }
}

@media (max-width: 640px) {
  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    width: var(--mobile-canvas-width, 100vw) !important;
    height: var(--mobile-canvas-height, auto) !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px) !important;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px) !important;
    bottom: auto !important;
  }
}

/* Cave Flight HUD polish - final override. */
body.cave-flight-page .game-frame {
  background:
    radial-gradient(circle at 50% 0%, rgba(125,255,99,0.16), transparent 28%),
    linear-gradient(135deg, rgba(125,255,99,0.20), transparent 30% 72%, rgba(255,138,0,0.18)),
    linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border-color: rgba(125, 255, 99, 0.40) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(77,217,255,0.18),
    inset 0 -28px 40px rgba(0,0,0,0.32),
    0 24px 58px rgba(0,0,0,0.46),
    0 0 38px rgba(125,255,99,0.18),
    0 0 32px rgba(77,217,255,0.16) !important;
}

body.cave-flight-page .game-frame::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(0,0,0,0), rgba(0,0,0,0.22) 72%),
    linear-gradient(120deg, rgba(255,255,255,0.13), transparent 20% 76%, rgba(125,255,99,0.08));
  opacity: 0.52;
}

body.cave-flight-page .cave-brand-logo {
  top: 66px;
  right: 24px;
  width: 30px;
  height: 30px;
  opacity: 0.52;
}

body.cave-flight-page .hud-strip {
  display: flex;
  left: 24px;
  right: 24px;
  bottom: 20px;
  min-height: 68px;
  padding: 8px;
  gap: 7px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 0%, rgba(125,255,99,0.16), transparent 45%),
    linear-gradient(180deg, rgba(9, 55, 57, 0.90), rgba(1, 14, 18, 0.96));
  border: 1px solid rgba(125,255,99,0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -10px 18px rgba(0,0,0,0.24),
    0 12px 24px rgba(0,0,0,0.34),
    0 0 22px rgba(125,255,99,0.18);
}

body.cave-flight-page .hud-pill {
  min-width: 0;
  padding: 8px 6px 7px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.10), transparent 46%),
    linear-gradient(180deg, rgba(24, 82, 80, 0.72), rgba(6, 31, 35, 0.86));
  border: 1px solid rgba(255,255,255,0.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -5px 10px rgba(0,0,0,0.16);
}

body.cave-flight-page .hud-pill span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.54rem;
  letter-spacing: 0.10em;
  color: #7dff63;
  opacity: 0.96;
}

body.cave-flight-page .hud-pill strong {
  display: block;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 13px rgba(125,255,99,0.20);
}

body.cave-flight-page .hud-pill:last-child {
  border-color: rgba(255, 179, 66, 0.24);
}

body.cave-flight-page .hud-pill:last-child strong {
  color: #ffb342;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 14px rgba(255,138,0,0.30);
}

body.cave-flight-page .pause-btn-pill {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.20), transparent 45%),
    linear-gradient(180deg, rgba(18, 92, 88, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -5px 10px rgba(0,0,0,0.22), 0 0 16px rgba(125,255,99,0.18);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

body.cave-flight-page .pause-btn-pill::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 10px 0 0 #ffffff, 0 2px 0 rgba(0,0,0,0.36), 10px 2px 0 rgba(0,0,0,0.36);
}

body.cave-flight-page .pause-btn-pill:hover,
body.cave-flight-page .pause-btn-pill:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(125,255,99,0.35);
  outline-offset: 3px;
}

body.cave-flight-page .pause-btn-pill:active {
  transform: translateY(2px) scale(0.98);
}

body.cave-flight-page .cave-fire-btn {
  z-index: 7;
  right: 27px;
  bottom: 104px;
  width: 96px;
  height: 52px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 4%, rgba(255,255,255,0.50), transparent 42%),
    linear-gradient(180deg, #ffc451 0%, #ff8f17 48%, #f56a00 100%);
  border: 2px solid rgba(255, 223, 120, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.44),
    inset 0 -5px 0 rgba(124,44,0,0.30),
    0 11px 18px rgba(0,0,0,0.34),
    0 0 24px rgba(255,138,0,0.42);
}

body.cave-flight-page .cave-fire-btn:hover,
body.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.03);
  filter: brightness(1.10);
  outline: 3px solid rgba(255, 186, 59, 0.74);
  outline-offset: 3px;
}

body.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.97);
  filter: brightness(0.98);
}

@media (max-width: 640px) {
  body.cave-flight-page .cave-brand-logo {
    top: 62px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 14px);
    width: 24px;
    height: 24px;
    opacity: 0.45;
  }

  body.cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 60px;
    min-height: 60px;
    padding: 6px;
    gap: 5px;
    border-radius: 0;
  }

  body.cave-flight-page .hud-pill {
    padding: 5px 3px;
    border-radius: 11px;
  }

  body.cave-flight-page .hud-pill span {
    font-size: 0.46rem;
    letter-spacing: 0.08em;
  }

  body.cave-flight-page .hud-pill strong {
    font-size: 0.83rem;
  }

  body.cave-flight-page .pause-btn-pill {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  body.cave-flight-page .pause-btn-pill::before {
    height: 16px;
  }

  body.cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 126px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 84px;
    height: 46px;
    font-size: 0.82rem;
  }
}
.cave-flight-page .game-frame {
  background:
    radial-gradient(circle at 50% 0%, rgba(125,255,99,0.16), transparent 28%),
    linear-gradient(135deg, rgba(125,255,99,0.20), transparent 30% 72%, rgba(255,138,0,0.18)),
    linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border-color: rgba(125, 255, 99, 0.40) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(77,217,255,0.18),
    inset 0 -28px 40px rgba(0,0,0,0.32),
    0 24px 58px rgba(0,0,0,0.46),
    0 0 38px rgba(125,255,99,0.18),
    0 0 32px rgba(77,217,255,0.16) !important;
}

.cave-flight-page .game-frame::before {
  background:
    radial-gradient(circle at 50% 46%, rgba(0,0,0,0), rgba(0,0,0,0.22) 72%),
    linear-gradient(120deg, rgba(255,255,255,0.13), transparent 20% 76%, rgba(125,255,99,0.08));
  opacity: 0.52;
}

.cave-brand-logo {
  top: 66px;
  right: 24px;
  width: 30px;
  height: 30px;
  opacity: 0.52;
}

.cave-flight-page .hud-strip {
  display: flex;
  left: 24px;
  right: 24px;
  bottom: 20px;
  min-height: 68px;
  padding: 8px;
  gap: 7px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 0%, rgba(125,255,99,0.16), transparent 45%),
    linear-gradient(180deg, rgba(9, 55, 57, 0.90), rgba(1, 14, 18, 0.96));
  border: 1px solid rgba(125,255,99,0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -10px 18px rgba(0,0,0,0.24),
    0 12px 24px rgba(0,0,0,0.34),
    0 0 22px rgba(125,255,99,0.18);
}

.cave-flight-page .hud-pill {
  min-width: 0;
  padding: 8px 6px 7px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.10), transparent 46%),
    linear-gradient(180deg, rgba(24, 82, 80, 0.72), rgba(6, 31, 35, 0.86));
  border: 1px solid rgba(255,255,255,0.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -5px 10px rgba(0,0,0,0.16);
}

.cave-flight-page .hud-pill span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.54rem;
  letter-spacing: 0.10em;
  color: #7dff63;
  opacity: 0.96;
}

.cave-flight-page .hud-pill strong {
  display: block;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 13px rgba(125,255,99,0.20);
}

.cave-flight-page .hud-pill:last-child {
  border-color: rgba(255, 179, 66, 0.24);
}

.cave-flight-page .hud-pill:last-child strong {
  color: #ffb342;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 14px rgba(255,138,0,0.30);
}

.cave-flight-page .pause-btn-pill {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.20), transparent 45%),
    linear-gradient(180deg, rgba(18, 92, 88, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -5px 10px rgba(0,0,0,0.22), 0 0 16px rgba(125,255,99,0.18);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .pause-btn-pill::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 10px 0 0 #ffffff, 0 2px 0 rgba(0,0,0,0.36), 10px 2px 0 rgba(0,0,0,0.36);
}

.cave-flight-page .pause-btn-pill:hover,
.cave-flight-page .pause-btn-pill:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(125,255,99,0.35);
  outline-offset: 3px;
}

.cave-flight-page .pause-btn-pill:active {
  transform: translateY(2px) scale(0.98);
}

.cave-flight-page .cave-fire-btn {
  z-index: 7;
  right: 27px;
  bottom: 104px;
  width: 96px;
  height: 52px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 4%, rgba(255,255,255,0.50), transparent 42%),
    linear-gradient(180deg, #ffc451 0%, #ff8f17 48%, #f56a00 100%);
  border: 2px solid rgba(255, 223, 120, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.44),
    inset 0 -5px 0 rgba(124,44,0,0.30),
    0 11px 18px rgba(0,0,0,0.34),
    0 0 24px rgba(255,138,0,0.42);
}

.cave-flight-page .cave-fire-btn:hover,
.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.03);
  filter: brightness(1.10);
  outline: 3px solid rgba(255, 186, 59, 0.74);
  outline-offset: 3px;
}

.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.97);
  filter: brightness(0.98);
}

@media (max-width: 640px) {
  .cave-brand-logo {
    top: 62px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 14px);
    width: 24px;
    height: 24px;
    opacity: 0.45;
  }

  .cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 60px;
    min-height: 60px;
    padding: 6px;
    gap: 5px;
    border-radius: 0;
  }

  .cave-flight-page .hud-pill {
    padding: 5px 3px;
    border-radius: 11px;
  }

  .cave-flight-page .hud-pill span {
    font-size: 0.46rem;
    letter-spacing: 0.08em;
  }

  .cave-flight-page .hud-pill strong {
    font-size: 0.83rem;
  }

  .cave-flight-page .pause-btn-pill {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .cave-flight-page .pause-btn-pill::before {
    height: 16px;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 126px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 84px;
    height: 46px;
    font-size: 0.82rem;
  }
}

/* Final Cave Flight premium UI overrides. */
.cave-flight-page {
  color: #eefdf4;
  background:
    radial-gradient(circle at 14% 84%, rgba(125, 255, 99, 0.20), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 138, 0, 0.16), transparent 30%),
    linear-gradient(180deg, #04181c 0%, #020a0d 56%, #061510 100%);
}

.cave-flight-page .hero-panel,
.cave-flight-page .board-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 255, 99, 0.14), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(255, 138, 0, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.34);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 30px rgba(102,255,72,0.12);
}

.cave-flight-page h1 {
  color: #ffffff;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #061c20,
    0 7px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.66);
}

.cave-flight-page .eyebrow,
.cave-flight-page .section-label,
.cave-flight-page .reward-label {
  color: #7dff63;
  text-shadow: 0 0 12px rgba(125,255,99,0.40);
}

.cave-flight-page .lede,
.cave-flight-page .feature-list,
.cave-flight-page .board-panel p {
  color: #dff8ef;
}

.cave-flight-page .game-frame {
  overflow: hidden;
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(125,255,99,0.18), transparent 28% 74%, rgba(255,138,0,0.18)),
    linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border: 2px solid rgba(77, 217, 255, 0.36) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(125,255,99,0.16),
    0 24px 58px rgba(0,0,0,0.44),
    0 0 36px rgba(77,217,255,0.18),
    0 0 26px rgba(125,255,99,0.14) !important;
}

.cave-flight-page .game-frame::before {
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(125,255,99,0.18);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.12), transparent 18% 76%, rgba(125,255,99,0.06));
  opacity: 0.34;
}

.cave-flight-page .game-frame::after {
  display: block;
  left: 28px;
  right: 28px;
  top: 20px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(125,255,99,0.82), transparent);
  box-shadow: 0 0 18px rgba(125,255,99,0.62);
}

.cave-flight-page canvas {
  border-radius: 18px;
  background: #031114;
}

.cave-brand-logo {
  position: absolute;
  right: 22px;
  top: 60px;
  z-index: 5;
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0.68;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.48));
  pointer-events: none;
}

.cave-flight-page .hud-strip {
  left: 24px;
  right: 24px;
  bottom: 22px;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 0%, rgba(125,255,99,0.12), transparent 42%),
    linear-gradient(180deg, rgba(8, 46, 49, 0.88), rgba(1, 14, 18, 0.95));
  border: 1px solid rgba(125,255,99,0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 12px 24px rgba(0,0,0,0.30),
    0 0 20px rgba(125,255,99,0.14);
  backdrop-filter: blur(8px);
}

.cave-flight-page .hud-actions {
  margin-right: 0;
}

.cave-flight-page .hud-pill {
  width: auto;
  min-width: 58px;
  flex: 1 1 0;
  padding: 7px 6px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.cave-flight-page .hud-pill span {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: #7dff63;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.cave-flight-page .hud-pill strong {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.42), 0 0 12px rgba(125,255,99,0.22);
}

.cave-flight-page .hud-pill:last-child strong {
  color: #ffb342;
}

.cave-flight-page .pause-btn-pill {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.18), transparent 44%),
    linear-gradient(180deg, rgba(16, 82, 80, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.34);
}

.cave-flight-page .pause-btn-pill::before {
  content: "II";
  font-size: 0.92rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.cave-flight-page .cave-fire-btn {
  right: 28px;
  bottom: 106px;
  width: 88px;
  height: 48px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.42), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.92);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.38);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 -4px 0 rgba(122,45,0,0.34),
    0 9px 16px rgba(0,0,0,0.32),
    0 0 22px rgba(255,138,0,0.36);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .cave-fire-btn:hover,
.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.70);
  outline-offset: 3px;
}

.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.98);
  background: linear-gradient(180deg, #ff9f1f, #e35f00);
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas {
    border-radius: 0;
  }

  .cave-brand-logo {
    top: 54px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    width: 28px;
    height: 28px;
  }

  .cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 58px;
    height: 58px;
    padding: 6px 7px;
    border-radius: 0;
  }

  .cave-flight-page .hud-pill {
    min-width: 0;
    padding: 5px 3px;
    border-radius: 10px;
  }

  .cave-flight-page .hud-pill span {
    font-size: 0.48rem;
  }

  .cave-flight-page .hud-pill strong {
    font-size: 0.82rem;
  }

  .cave-flight-page .pause-btn-pill {
    width: 42px;
    height: 42px;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 78px;
    height: 44px;
    font-size: 0.8rem;
  }
}

/* Premium arcade pass for Cave Flight. These final overrides only affect the helicopter game UI. */
.cave-flight-page {
  color: #eefdf4;
  background:
    radial-gradient(circle at 14% 84%, rgba(125, 255, 99, 0.20), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 138, 0, 0.16), transparent 30%),
    linear-gradient(180deg, #04181c 0%, #020a0d 56%, #061510 100%);
}

.cave-flight-page::before {
  opacity: 0.13;
  background-image:
    repeating-linear-gradient(0deg, rgba(125,255,99,0.08) 0 1px, transparent 1px 6px),
    linear-gradient(120deg, transparent 0 44%, rgba(255,255,255,0.10) 44.2% 46%, transparent 46.2%);
}

.cave-flight-page::after {
  opacity: 0.42;
  background:
    radial-gradient(circle at 50% -8%, rgba(125, 255, 99, 0.22), transparent 34%),
    radial-gradient(circle at 50% 52%, transparent 0 46%, rgba(0,0,0,0.26) 100%);
}

.cave-flight-page .hero-panel,
.cave-flight-page .board-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 255, 99, 0.14), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(255, 138, 0, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.34);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 30px rgba(102,255,72,0.12);
}

.cave-flight-page h1 {
  color: #ffffff;
  max-width: 9ch;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #061c20,
    0 7px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.66);
}

.cave-flight-page .eyebrow,
.cave-flight-page .section-label,
.cave-flight-page .reward-label {
  color: #7dff63;
  text-shadow: 0 0 12px rgba(125,255,99,0.40);
}

.cave-flight-page .lede,
.cave-flight-page .feature-list,
.cave-flight-page .board-panel p {
  color: #dff8ef;
}

.cave-flight-page .reward-strip div {
  background:
    linear-gradient(180deg, rgba(14, 83, 71, 0.98), rgba(4, 30, 34, 0.98));
  border-color: rgba(255, 138, 0, 0.56);
}

.cave-flight-page .reward-strip div:nth-child(2) {
  border-color: rgba(125, 255, 99, 0.46);
}

.cave-flight-page .game-frame {
  overflow: hidden;
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(125,255,99,0.18), transparent 28% 74%, rgba(255,138,0,0.18)),
    linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1));
  border: 2px solid rgba(77, 217, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 0 0 1px rgba(125,255,99,0.16),
    0 24px 58px rgba(0,0,0,0.44),
    0 0 36px rgba(77,217,255,0.18),
    0 0 26px rgba(125,255,99,0.14);
}

.cave-flight-page .game-frame::before {
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(125,255,99,0.18);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.12), transparent 18% 76%, rgba(125,255,99,0.06));
  opacity: 0.34;
  mix-blend-mode: screen;
}

.cave-flight-page .game-frame::after {
  display: block;
  left: 28px;
  right: 28px;
  top: 20px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(125,255,99,0.82), transparent);
  box-shadow: 0 0 18px rgba(125,255,99,0.62);
}

.cave-flight-page canvas {
  border-radius: 18px;
  background: #031114;
}

.cave-brand-logo {
  position: absolute;
  right: 22px;
  top: 60px;
  z-index: 5;
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0.78;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.48));
  pointer-events: none;
}

.cave-flight-page .hud-strip {
  left: 24px;
  right: 24px;
  bottom: 22px;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% 0%, rgba(125,255,99,0.12), transparent 42%),
    linear-gradient(180deg, rgba(8, 46, 49, 0.88), rgba(1, 14, 18, 0.95));
  border: 1px solid rgba(125,255,99,0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 12px 24px rgba(0,0,0,0.30),
    0 0 20px rgba(125,255,99,0.14);
  backdrop-filter: blur(8px);
}

.cave-flight-page .hud-actions {
  margin-right: 0;
}

.cave-flight-page .hud-pill {
  width: auto;
  min-width: 58px;
  flex: 1 1 0;
  padding: 7px 6px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.cave-flight-page .hud-pill span {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: #7dff63;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.cave-flight-page .hud-pill strong {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.42), 0 0 12px rgba(125,255,99,0.22);
}

.cave-flight-page .hud-pill:last-child strong {
  color: #ffb342;
}

.cave-flight-page .pause-btn-pill {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.18), transparent 44%),
    linear-gradient(180deg, rgba(16, 82, 80, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.34);
}

.cave-flight-page .pause-btn-pill::before {
  content: "II";
  font-size: 0.92rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.cave-flight-page .cave-fire-btn {
  right: 28px;
  bottom: 106px;
  width: 88px;
  height: 48px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.42), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.92);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.38);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 -4px 0 rgba(122,45,0,0.34),
    0 9px 16px rgba(0,0,0,0.32),
    0 0 22px rgba(255,138,0,0.36);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .cave-fire-btn:hover,
.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.70);
  outline-offset: 3px;
}

.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.98);
  background: linear-gradient(180deg, #ff9f1f, #e35f00);
  box-shadow:
    inset 0 3px 7px rgba(93,31,0,0.34),
    0 5px 10px rgba(0,0,0,0.28),
    0 0 18px rgba(255,138,0,0.42);
}

.cave-flight-page .start-overlay,
.cave-flight-page .game-over-overlay,
.cave-flight-page .level-gate-overlay {
  border-radius: 28px;
  background: rgba(0, 10, 12, 0.64);
  backdrop-filter: blur(4px);
}

.cave-flight-page .overlay-card {
  background:
    radial-gradient(circle at 18% 0%, rgba(125,255,99,0.16), transparent 34%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.44);
  color: #eefdf4;
  box-shadow:
    0 22px 50px rgba(0,0,0,0.46),
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 28px rgba(102,255,72,0.18);
}

.cave-flight-page .overlay-card h2 {
  color: #ffffff;
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #1c7f21,
    0 12px 24px rgba(0,0,0,0.58);
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas {
    border-radius: 0;
  }

  .cave-brand-logo {
    top: 54px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    width: 28px;
    height: 28px;
  }

  .cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 58px;
    height: 58px;
    padding: 6px 7px;
    border-radius: 0;
  }

  .cave-flight-page .hud-pill {
    min-width: 0;
    padding: 5px 3px;
    border-radius: 10px;
  }

  .cave-flight-page .hud-pill span {
    font-size: 0.48rem;
  }

  .cave-flight-page .hud-pill strong {
    font-size: 0.82rem;
  }

  .cave-flight-page .pause-btn-pill {
    width: 42px;
    height: 42px;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 78px;
    height: 44px;
    font-size: 0.8rem;
  }
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at 18% 15%, rgba(255, 255, 255, 0.78) 0 12%, transparent 12.5%),
    radial-gradient(ellipse at 68% 13%, rgba(255, 255, 255, 0.64) 0 10%, transparent 10.5%),
    radial-gradient(ellipse at 88% 25%, rgba(255, 255, 255, 0.52) 0 9%, transparent 9.5%),
    radial-gradient(ellipse at 18% 88%, rgba(87, 165, 54, 0.44) 0 28%, transparent 28.5%),
    radial-gradient(ellipse at 82% 91%, rgba(65, 148, 52, 0.36) 0 31%, transparent 31.5%),
    linear-gradient(180deg, #9fe7ff 0%, #dff7ff 46%, #fff0a8 64%, #8cca57 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  opacity: 0.45;
  background-image:
    linear-gradient(22deg, transparent 0 44%, rgba(255,255,255,0.20) 44.3% 47.5%, transparent 47.8%),
    linear-gradient(-24deg, transparent 0 42%, rgba(255,255,255,0.16) 42.3% 45.2%, transparent 45.5%);
  background-size: 100% 100%;
  mask-image: linear-gradient(180deg, black 0, transparent 76%);
}

body::after {
  opacity: 0.20;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,0.80), transparent 28%),
    radial-gradient(circle at center, transparent 42%, rgba(24, 94, 120, 0.30) 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero-panel,
.board-panel,
.ops-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(240,255,230,0.80)),
    radial-gradient(ellipse at 15% 18%, rgba(255,255,255,0.68) 0 14%, transparent 14.5%),
    radial-gradient(ellipse at 88% 12%, rgba(255,255,255,0.58) 0 12%, transparent 12.5%),
    radial-gradient(ellipse at 25% 95%, rgba(98, 176, 54, 0.20) 0 28%, transparent 28.5%),
    var(--panel);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-label,
.overlay-kicker,
.reward-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: #9b6517;
  font-family: var(--font-display);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,0.72);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.92;
  color: #fff8dd;
  -webkit-text-stroke: 2px #17475d;
  text-shadow:
    3px 4px 0 #2b8ab0,
    5px 7px 0 rgba(79, 154, 52, 0.56),
    0 10px 18px rgba(35, 94, 106, 0.22);
}

.lede {
  margin-top: 16px;
  max-width: 52ch;
  color: #315a70;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.6;
}

.reward-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.reward-strip div,
.ops-grid article {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.reward-strip div:nth-child(1) { border-color: rgba(43, 143, 58, 0.34); background: linear-gradient(180deg, rgba(238, 255, 219, 0.82), rgba(190, 232, 137, 0.36)); }
.reward-strip div:nth-child(2) { border-color: rgba(220, 142, 35, 0.42); background: linear-gradient(180deg, rgba(255, 244, 190, 0.84), rgba(250, 184, 68, 0.28)); }
.reward-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  font-family: var(--font-display);
  color: #153047;
}

.feature-list {
  margin: 24px 0 0;
  padding-left: 18px;
  color: #315a70;
  font-weight: 800;
  line-height: 1.8;
}

.game_info_card {
  position: relative;
  justify-content: center;
  width: 100%;
  padding: clamp(22px, 2.2vw, 32px);
  overflow: hidden;
  border-radius: 28px;
  border: 2px solid rgba(125, 255, 99, 0.44);
  background:
    radial-gradient(circle at 16% 0%, rgba(125, 255, 99, 0.18), transparent 32%),
    radial-gradient(circle at 92% 14%, rgba(255, 138, 0, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(5, 38, 39, 0.98), rgba(2, 14, 17, 0.99));
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -20px 42px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(102, 255, 72, 0.22);
  color: #fff;
}

.game_info_card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.12), transparent 18% 78%, rgba(255,255,255,0.06)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 6px);
  opacity: 0.55;
}

.game_info_card > * {
  position: relative;
  z-index: 1;
}

.game_info_eyebrow {
  margin-bottom: 12px;
  color: #7dff63;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(125, 255, 99, 0.42);
}

.game_info_title h1 {
  margin: 0;
  max-width: 8.4ch;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 4.2vw, 4.55rem);
  font-weight: 1000;
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
  text-shadow:
    0 4px 0 #061c20,
    0 7px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.68);
}

.game_info_title h1 span {
  display: block;
  margin-top: 6px;
  color: #ff8a00;
  text-shadow:
    0 4px 0 #3d1600,
    0 7px 0 #0d3412,
    0 12px 24px rgba(0, 0, 0, 0.68);
}

.game_info_intro {
  margin: 20px 0 0;
  color: #dff8ef;
  font-size: clamp(0.98rem, 1.05vw, 1.12rem);
  line-height: 1.45;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0,0,0,0.38);
}

.home_leaderboard_preview {
  margin: 18px 0 20px;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 179, 66, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(13, 72, 65, 0.98), rgba(4, 30, 34, 0.98));
  border: 2px solid rgba(125, 255, 99, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.home_leaderboard_preview small,
.home_leaderboard_preview p {
  display: block;
  margin: 0;
  color: #7dff63;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home_leaderboard_preview strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.08rem;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

.home_leaderboard_preview ol {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.home_leaderboard_preview li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
  font-weight: 900;
}

.home_leaderboard_preview li span {
  color: #ffb342;
}

.home_leaderboard_preview li.empty {
  justify-content: center;
  color: #dff8ef;
}

.leaderboard-preview-link {
  display: inline-flex;
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffb13b, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.85);
  box-shadow: 0 6px 14px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.24);
}

.game_prize_grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.game_prize_card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 12px;
  border-radius: 18px;
  border: 2px solid rgba(255, 138, 0, 0.64);
  background:
    linear-gradient(180deg, rgba(14, 83, 71, 0.98), rgba(4, 30, 34, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -10px 18px rgba(0,0,0,0.18),
    0 8px 18px rgba(0, 0, 0, 0.30);
}

.game_prize_card:nth-child(2) {
  border-color: rgba(125, 255, 99, 0.54);
}

.game_prize_icon,
.step_icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
}

.game_prize_icon {
  width: 34px;
  height: 34px;
}

.game_prize_icon svg,
.step_icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.game_prize_card small {
  display: block;
  color: #ffb342;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game_prize_card strong {
  display: block;
  margin-top: 3px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.08;
  text-shadow: 0 2px 0 rgba(0,0,0,0.52);
}

.game_instructions {
  display: grid;
  gap: 9px;
  margin-top: 4px;
}

.game_step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.085), rgba(255,255,255,0.045));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 5px 12px rgba(0,0,0,0.13);
}

.step_icon {
  width: 24px;
  height: 24px;
  margin-top: 1px;
}

.game_step p {
  margin: 0;
  color: #eefdf4;
  font-size: 0.91rem;
  line-height: 1.35;
  font-weight: 850;
  text-shadow: 0 1px 5px rgba(0,0,0,0.34);
}

.game-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.game-frame {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 9 / 16;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(40, 170, 205, 0.44), transparent 20% 80%, rgba(243, 181, 55, 0.40)),
    linear-gradient(180deg, rgba(238, 253, 255, 0.96), rgba(74, 156, 67, 0.55));
  border: 1px solid rgba(28, 127, 159, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.42) inset,
    0 14px 34px rgba(19, 98, 118, 0.24),
    0 28px 58px rgba(54, 105, 45, 0.18);
  transform: rotateX(0.001deg);
}

.game-frame::before,
.game-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.game-frame::before {
  inset: 10px;
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.16), transparent 20% 70%, rgba(77, 217, 255, 0.10));
  mix-blend-mode: screen;
  opacity: 0.28;
}

.game-frame::after {
  left: 22px;
  right: 22px;
  top: 18px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(158, 247, 255, 0.95), transparent);
  box-shadow: 0 0 18px rgba(77, 217, 255, 0.72);
}

body.arcade-game-mode:not(.cave-flight-page) .game-frame::after {
  display: none;
}

canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #050607;
  touch-action: none;
}

.hud-strip {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.hud-pill {
  width: clamp(66px, 8.4vw, 88px);
  min-width: 0;
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(15, 24, 54, 0.94), rgba(5, 4, 18, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(77, 217, 255, 0.20), transparent 72%);
  border: 1px solid rgba(77, 217, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 0 18px rgba(77, 217, 255, 0.10);
}

.hud-pill span {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hud-pill strong {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(77, 217, 255, 0.34);
}

.projectile-indicator {
  position: absolute;
  left: 20px;
  top: 76px;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto;
  align-items: center;
  gap: 7px;
  max-width: min(420px, calc(100% - 40px));
  padding: 8px;
  border-radius: 14px;
  color: #fff;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 28, 31, 0.88), rgba(3, 12, 17, 0.94)),
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--projectile-accent, #7dff63) 26%, transparent), transparent 64%);
  border: 1px solid color-mix(in srgb, var(--projectile-accent, #7dff63) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 22px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(125, 255, 99, 0.18);
}

.projectile-current,
.projectile-next {
  min-width: 0;
}

.projectile-kicker,
.projectile-next span {
  display: block;
  color: #7dff63;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.projectile-current strong,
.projectile-next strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.6),
    0 0 10px rgba(255, 179, 66, 0.24);
}

.projectile-current small {
  display: block;
  margin-top: 4px;
  color: #dff8ef;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.9;
}

.projectile-next {
  min-width: 74px;
  padding: 7px 9px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 138, 0, 0.26), rgba(16, 34, 28, 0.42));
  border: 1px solid rgba(255, 179, 66, 0.48);
}

.projectile-order {
  grid-column: 1 / -1;
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.projectile-chip {
  min-width: 0;
  flex: 0 1 auto;
  padding: 4px 6px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.54rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(0,0,0,0.28));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  opacity: 0.82;
}

.projectile-chip.active {
  color: #061016 !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--projectile-accent, #7dff63) 86%, #ffffff), var(--projectile-accent, #7dff63));
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.48),
    0 0 12px color-mix(in srgb, var(--projectile-accent, #7dff63) 70%, transparent);
  opacity: 1;
}

.start-overlay,
.game-select-overlay,
.level-select-overlay,
.game-over-overlay,
.level-gate-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 26px;
  background: rgba(8, 12, 19, 0.82);
  backdrop-filter: blur(8px);
  z-index: 10;
  overflow-y: auto;
}

/* Home screen artwork plus real coded controls. */
.start-overlay {
  padding: 0;
  overflow: hidden;
  background: #081511;
  backdrop-filter: none;
}

.start-overlay::before,
.start-overlay::after { display: none; }

.splash-home {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  pointer-events: none;
  user-select: none;
}

.home-ui-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.8vw, 18px);
  padding: clamp(16px, 2.5vw, 34px);
  pointer-events: none;
}

.home-ui-layer > * {
  pointer-events: auto;
}

.play-btn-hot {
  position: relative;
  min-width: min(520px, 78%);
  min-height: clamp(58px, 7.4vw, 86px);
  padding: 0 clamp(26px, 4vw, 58px);
  border: 3px solid rgba(255, 242, 178, 0.96);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.52), transparent 38%),
    linear-gradient(180deg, #ffd45a 0%, #ff9f1f 42%, #ff6900 100%);
  color: #ffffff;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.58),
    inset 0 -7px 0 rgba(142, 43, 0, 0.36),
    0 10px 0 rgba(112, 41, 0, 0.72),
    0 16px 28px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(255, 148, 30, 0.54);
  cursor: pointer;
  transform-origin: center;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.play-btn-hot span {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 2.15rem);
  font-weight: 1000;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(105, 39, 0, 0.86),
    0 5px 8px rgba(0, 0, 0, 0.34);
}

.play-btn-hot::before {
  content: "";
  position: absolute;
  inset: 8px 12px auto;
  height: 36%;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0));
  opacity: 0.58;
}

.play-btn-hot::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 34px rgba(255, 190, 55, 0.75);
  transition: opacity 140ms ease, transform 140ms ease;
}

.play-btn-hot:hover,
.play-btn-hot:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.06);
}

.play-btn-hot:hover::after,
.play-btn-hot:focus-visible::after {
  opacity: 1;
  transform: scale(1.02);
}

.play-btn-hot:active {
  transform: translateY(6px) scale(0.99);
  filter: brightness(0.96);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.38),
    inset 0 -3px 0 rgba(142, 43, 0, 0.38),
    0 4px 0 rgba(112, 41, 0, 0.72),
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 18px rgba(255, 148, 30, 0.42);
}

.play-btn-hot:active::after {
  opacity: 0.72;
}

.play-btn-hot:focus-visible {
  outline: 3px solid rgba(255, 186, 59, 0.95);
  outline-offset: 4px;
}

.home-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 12px);
}

.home-circle-hot,
.website-btn-hot {
  position: relative;
  min-height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.30);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.28), transparent 46%),
    linear-gradient(180deg, rgba(20, 82, 84, 0.96), rgba(5, 36, 42, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 7px 14px rgba(0, 0, 0, 0.28),
    0 0 14px rgba(125, 255, 99, 0.16);
  cursor: pointer;
  text-decoration: none;
  transform-origin: center;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.home-circle-hot {
  min-width: 92px;
  padding: 0 14px;
}

.home-leaderboard-hot {
  min-width: 116px;
}

.home-circle-hot span,
.website-btn-hot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.38);
}

.website-btn-hot {
  min-height: 36px;
  padding: 0 18px;
  border-color: rgba(125, 255, 99, 0.40);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.24), transparent 44%),
    linear-gradient(180deg, rgba(37, 143, 55, 0.96), rgba(8, 73, 33, 0.98));
}

.home-circle-hot:hover,
.home-circle-hot:focus-visible,
.website-btn-hot:hover,
.website-btn-hot:focus-visible {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.08);
  border-color: rgba(255, 221, 93, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    0 9px 17px rgba(0, 0, 0, 0.30),
    0 0 18px rgba(255, 190, 55, 0.48);
  outline: none;
}

.home-circle-hot:active,
.website-btn-hot:active {
  transform: translateY(2px) scale(0.98);
  filter: brightness(0.96);
}

.home-circle-hot:focus-visible,
.website-btn-hot:focus-visible {
  outline: 3px solid rgba(255, 186, 59, 0.95);
  outline-offset: 3px;
}

.home-sound-hot.is-muted {
  opacity: 0.78;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.22), transparent 44%),
    linear-gradient(180deg, rgba(68, 77, 82, 0.96), rgba(28, 31, 35, 0.98));
}

.home-sound-hot.is-muted::after {
  content: "";
  position: absolute;
  left: 14%;
  top: 48%;
  width: 72%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6158, #b41414);
  box-shadow: 0 2px 0 rgba(255,255,255,0.55), 0 4px 7px rgba(0,0,0,0.45);
  transform: rotate(-38deg);
}

.home-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 36px);
  background: rgba(5, 18, 12, 0.38);
}

.home-modal.hidden {
  display: none;
}

.home-modal-card {
  width: min(330px, 88%);
  padding: 20px;
  border-radius: 18px;
  border: 3px solid #ffd64d;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(231,255,206,0.95)),
    #eefbd7;
  box-shadow:
    0 5px 0 #7d4d15,
    0 18px 36px rgba(0,0,0,0.45),
    inset 0 2px 0 rgba(255,255,255,0.95);
  color: #183044;
  text-align: center;
}

.home-modal-card h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  color: #173246;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(255,255,255,0.8), 0 4px 0 rgba(43,83,35,0.18);
}

.home-modal-card p {
  margin: 0 0 16px;
  color: #3e5a67;
  font-weight: 800;
  line-height: 1.4;
}

.home-setting-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(92, 153, 38, 0.45);
  background: linear-gradient(180deg, #f9fff0, #d8f7b3);
  color: #183044;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 4px 0 rgba(36,98,31,0.22);
}

.home-setting-row.danger {
  border-color: rgba(219, 108, 34, 0.48);
  background: linear-gradient(180deg, #fff8e7, #ffd68d);
}

.home-setting-row strong {
  color: #1f7a24;
}

.home-setting-row.danger strong {
  color: #a54215;
}

.home-modal-close {
  margin-top: 12px;
  min-width: 130px;
}

.game-select-overlay {
  background:
    linear-gradient(180deg, rgba(2, 20, 15, 0.26), rgba(1, 13, 10, 0.56)),
    url("./Assets/slingshot/home-page1.png") center / cover no-repeat;
  backdrop-filter: none;
  overflow: hidden;
  padding: clamp(12px, 2vw, 24px);
}

.game-select-panel {
  position: relative;
  width: min(930px, 96%);
  max-height: calc(100% - 16px);
  overflow: hidden;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 30px;
  color: #ffffff;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 20% 76%, rgba(255, 173, 44, 0.10)),
    radial-gradient(circle at 50% 100%, rgba(255, 185, 40, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(9, 52, 32, 0.94), rgba(3, 22, 18, 0.98));
  border: 3px solid rgba(98, 255, 61, 0.72);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.48),
    inset 0 2px 0 rgba(255, 255, 255, 0.22),
    inset 0 -34px 54px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 179, 66, 0.18),
    0 0 40px rgba(102, 255, 72, 0.36);
}

.game-select-panel::before,
.game-select-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.game-select-panel::before {
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 28px rgba(125, 255, 99, 0.12),
    inset 0 0 0 2px rgba(0, 0, 0, 0.14);
}

.game-select-panel::after {
  left: 12%;
  right: 12%;
  top: 10px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 197, 68, 0.96), rgba(125, 255, 99, 0.88), transparent);
  box-shadow: 0 0 24px rgba(255, 179, 66, 0.46);
}

.game-select-panel > * {
  position: relative;
  z-index: 1;
}

.game-select-back {
  position: absolute;
  left: clamp(16px, 2vw, 24px);
  top: clamp(16px, 2vw, 24px);
  z-index: 3;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 220, 115, 0.85);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.42), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 1000;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    inset 0 -3px 0 rgba(122, 45, 0, 0.34),
    0 6px 12px rgba(0,0,0,0.30),
    0 0 16px rgba(255, 138, 0, 0.30);
  text-shadow: 0 2px 0 rgba(0,0,0,0.32);
  transition: transform 130ms ease, filter 130ms ease;
}

.game-select-back:hover,
.game-select-back:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.game-select-back:active {
  transform: translateY(1px);
}

.game-select-kicker {
  color: #9dff6f;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(0,0,0,0.65),
    0 0 12px rgba(125, 255, 99, 0.56);
}

.game-select-panel h2 {
  margin: 8px 0 6px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6vw, 4.65rem);
  line-height: 0.88;
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #061c20,
    0 8px 0 #208f20,
    0 14px 26px rgba(0, 0, 0, 0.68);
}

.game-select-intro {
  max-width: 58ch;
  margin: 0 auto 22px;
  color: #dff8ef;
  font-weight: 800;
  line-height: 1.38;
  text-shadow: 0 2px 8px rgba(0,0,0,0.36);
}

.arcade-game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 24px);
}

.arcade-game-card {
  position: relative;
  min-height: 258px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 18px;
  overflow: hidden;
  padding: 20px;
  border-radius: 24px;
  border: 2px solid rgba(255, 151, 13, 0.72);
  background:
    linear-gradient(180deg, rgba(24, 102, 59, 0.18), rgba(3, 24, 20, 0.80)),
    linear-gradient(180deg, rgba(13, 72, 65, 0.92), rgba(4, 30, 34, 0.98));
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -22px 34px rgba(0,0,0,0.30),
    0 15px 30px rgba(0,0,0,0.34),
    0 0 18px rgba(255, 138, 0, 0.18);
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.arcade-game-card::before,
.arcade-game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.arcade-game-card::before {
  opacity: 0.52;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.04), rgba(0,0,0,0.72)),
    var(--game-card-art, none);
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
}

.arcade-game-card::after {
  border-radius: inherit;
  background:
    linear-gradient(125deg, rgba(255,255,255,0.18), transparent 18% 76%, rgba(125,255,99,0.10)),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.16), transparent 46%);
  opacity: 0.70;
}

.arcade-game-card > * {
  position: relative;
  z-index: 1;
}

#select-slingshot-game {
  --game-card-art: url("./Assets/slingshot/background.png");
}

#select-delivery-game {
  --game-card-art: url("./Assets/slingshot/helicopter/background2.png");
}

#select-ink-run-game {
  --game-card-art: url("./Surfers/assets/stage2.png");
}

.arcade-game-card.coming-soon {
  --game-card-art: url("./Assets/slingshot/background-level-18.png");
}

.arcade-game-card.playable {
  border-color: rgba(255, 138, 0, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    inset 0 -18px 28px rgba(0,0,0,0.22),
    0 14px 28px rgba(0,0,0,0.32),
    0 0 24px rgba(255, 138, 0, 0.22);
}

.arcade-game-card.playable:hover,
.arcade-game-card.playable:focus-visible {
  transform: translateY(-5px) scale(1.012);
  filter: brightness(1.08);
  border-color: rgba(255, 215, 91, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -18px 28px rgba(0,0,0,0.20),
    0 18px 34px rgba(0,0,0,0.38),
    0 0 32px rgba(255, 138, 0, 0.34);
  outline: none;
}

.arcade-game-card.playable:active {
  transform: translateY(2px) scale(0.992);
}

.arcade-game-card.coming-soon {
  cursor: default;
  opacity: 0.90;
  filter: saturate(0.76);
  border-color: rgba(188, 212, 205, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.12), transparent 48%),
    linear-gradient(180deg, rgba(34, 70, 65, 0.94), rgba(13, 28, 26, 0.98));
}

.arcade-game-copy {
  display: grid;
  gap: 11px;
}

.arcade-game-copy strong {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 2.25vw, 1.72rem);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(0,0,0,0.78),
    0 6px 0 rgba(31, 131, 32, 0.72),
    0 10px 18px rgba(0,0,0,0.42);
}

.arcade-game-copy small {
  color: #f0fff6;
  font-weight: 900;
  line-height: 1.38;
  text-shadow: 0 2px 8px rgba(0,0,0,0.62);
}

.arcade-game-meta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  color: #dff8ef;
  background: rgba(2, 14, 17, 0.56);
  border: 1px solid rgba(125,255,99,0.22);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.15;
}

.arcade-game-meta b {
  color: #ffb342;
  margin-left: 4px;
}

.arcade-game-copy em {
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffffff;
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.36), transparent 42%),
    linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -3px 0 rgba(122, 45, 0, 0.34),
    0 7px 14px rgba(0,0,0,0.28),
    0 0 16px rgba(255, 138, 0, 0.24);
  text-shadow: 0 2px 0 rgba(0,0,0,0.34);
}

.arcade-game-card.coming-soon .arcade-game-copy em {
  background: linear-gradient(180deg, rgba(85, 111, 117, 0.95), rgba(34, 48, 53, 0.98));
  border-color: rgba(255, 255, 255, 0.18);
  color: #bde4e6;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 7px 14px rgba(0,0,0,0.20);
}

/* ── LEVEL-SELECT IMAGE ─────────────────────────────────────────────────── */
/* Delivery Dash standalone game page */
.delivery-page {
  background:
    radial-gradient(circle at 20% 8%, rgba(77, 217, 255, 0.22), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(255, 138, 0, 0.16), transparent 34%),
    linear-gradient(180deg, #051116 0%, #092d32 52%, #061014 100%);
}

.delivery-page::before {
  opacity: 0.18;
}

.delivery-page::after {
  opacity: 0.16;
}

.delivery-shell {
  width: min(1480px, calc(100% - 36px));
}

.delivery-hero {
  background:
    radial-gradient(circle at 55% 0%, rgba(125, 255, 99, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.96), rgba(1, 15, 18, 0.98));
  border: 2px solid rgba(115, 255, 78, 0.32);
}

.delivery-back-link {
  width: fit-content;
  margin-bottom: 14px;
  padding: 9px 14px;
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 1000;
  background: linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1));
  border: 1px solid rgba(125, 255, 99, 0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 16px rgba(0,0,0,0.24);
}

.delivery-back-link:hover,
.delivery-back-link:focus-visible {
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.9);
  outline-offset: 3px;
}

.delivery-page .game-frame {
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(77, 217, 255, 0.28), rgba(255, 138, 0, 0.18)),
    linear-gradient(180deg, rgba(3, 20, 28, 0.98), rgba(5, 42, 48, 0.95));
  border-color: rgba(77, 217, 255, 0.45);
}

.delivery-page .start-overlay {
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(77, 217, 255, 0.18), transparent 45%),
    rgba(0, 10, 12, 0.72);
  backdrop-filter: blur(4px);
}

.delivery-start-card {
  width: min(420px, 88vw);
  padding: 26px;
  border-radius: 28px;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.55);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 36px rgba(102, 255, 72, 0.24);
}

.delivery-start-card h2 {
  margin: 8px 0 12px;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 0.95;
  font-weight: 1000;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #061c20, 0 6px 0 #1c7f21, 0 12px 24px rgba(0, 0, 0, 0.6);
}

.delivery-start-card p {
  margin: 0 0 18px;
  color: #dff8ef;
  font-weight: 800;
  line-height: 1.4;
}

.delivery-complete-badge {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 1000;
  color: #052226;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  background: radial-gradient(circle at 30% 25%, #ffffff, #ffd45a 35%, #ff8a00 70%, #7a3300);
}

.delivery-page .cave-fire-btn {
  right: 22px;
  bottom: 106px;
}

.delivery-page .leaderboard_panel {
  margin-top: 24px;
}

.level-select-overlay {
  padding: 0;
  overflow: hidden;
  background: #0d1822;   /* dark fallback while image loads */
  backdrop-filter: none;
}

/* full-bleed level-select artwork */
.level-select-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* transparent hot-zone exactly over the Back pill drawn in the artwork */
.level-back-btn-hot {
  position: absolute;
  left: 18%;
  top: 6.5%;
  width: 11%;
  min-width: 48px;
  height: 12%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
  border-radius: 10px;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.level-back-btn-hot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* .level-select-panel removed — panel is now the full artwork image */

/* .level-back-button renamed → .level-back-btn-hot (transparent hot-zone above) */

/* invisible click-target grid overlaid on the artwork's button area */
.level-select-grid {
  position: absolute;
  left: 25.4%;
  top: 20.8%;
  width: 45.2%;
  height: 72.6%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px 13px;
  padding: 0;
  z-index: 1;
  overflow: visible;
}

/* cards are fully transparent — the artwork provides all the visuals */
.level-card {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  min-height: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  background: linear-gradient(180deg, #d8dde0 0%, #8e969b 44%, #3f4448 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.7),
    inset 0 -4px 0 rgba(0, 0, 0, 0.42),
    0 4px 0 #14191b,
    0 7px 12px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  opacity: 1;
  color: #f7fbff;
  display: grid;
  place-items: center;
  transform-origin: center center;
  transform: scale(1);
  transition: transform 100ms ease, box-shadow 100ms ease, filter 100ms ease;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.level-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.level-card strong {
  position: relative;
  display: block;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  color: #f8fbff;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.75),
    0 -1px 0 rgba(255, 255, 255, 0.45),
    2px 0 0 rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.level-card.completed {
  border-color: #f4ff8a;
  background: linear-gradient(180deg, #9dff3d 0%, #4dc31f 50%, #1e8319 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.75),
    inset 0 -4px 0 rgba(5, 71, 7, 0.55),
    0 4px 0 #143f10,
    0 0 14px rgba(123, 255, 59, 0.35);
}

.level-card.current {
  border-color: #ffeb67;
  background: linear-gradient(180deg, #b7ff47 0%, #64dc22 45%, #20921c 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.85),
    inset 0 -5px 0 rgba(8, 83, 7, 0.58),
    0 4px 0 #5f3a00,
    0 0 0 4px rgba(255, 145, 0, 0.7),
    0 0 22px rgba(255, 178, 24, 0.9);
  z-index: 2;
}

/* subtle highlight ring on hover for unlocked levels only */
.level-card:not(.locked):hover,
.level-card:not(.locked):focus-visible {
  transform: scale(1.06);
  z-index: 2;
  filter: brightness(1.08);
}

/* locked cards — darker translucent tint so cursor change signals "no" */
.level-card.locked {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(180deg, #c4c8ca 0%, #71787d 48%, #303538 100%);
  border-color: rgba(240, 243, 244, 0.78);
  cursor: default;
  opacity: 1;
  filter: saturate(0.82);
}

.level-card.locked strong {
  transform: translateY(-2px);
}

/* hide all text & lock widget — the artwork image draws the numbers */
.level-check,
.level-current-mark,
.level-lock {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.level-check {
  right: 7px;
  bottom: 7px;
  width: 16px;
  height: 10px;
  border-left: 4px solid #fffef0;
  border-bottom: 4px solid #fffef0;
  transform: rotate(-45deg);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55));
}

.level-current-mark {
  left: 50%;
  bottom: 6px;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: #fff174;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(255, 196, 39, 0.95);
}

.level-lock {
  position: relative;
  width: clamp(14px, 1.9vw, 18px);
  height: clamp(14px, 1.9vw, 18px);
  margin-top: 0;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
  opacity: 0.96;
}

.level-lock svg {
  display: block;
  width: 100%;
  height: 100%;
}

.level-card.completed .level-lock,
.level-card.completed .level-current-mark,
.level-card.current .level-lock,
.level-card.current .level-check,
.level-card.locked .level-check,
.level-card.locked .level-current-mark {
  display: none;
}

@media (hover: none) {
  .level-card:not(.locked):hover {
    transform: none;
    filter: none;
  }
}

.overlay-card {
  width: min(100%, 320px);
  padding: 24px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    var(--panel-strong);
  border: 1px solid rgba(77, 217, 255, 0.18);
  box-shadow:
    0 0 32px rgba(77, 217, 255, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.45);
}

.overlay-card h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  color: #173048;
  font-size: 1.65rem;
}

.gate-badge-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
}

.gate-badge-image,
.gate-badge-logo {
  position: absolute;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.gate-badge-image {
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 18px rgba(255, 216, 77, 0.24));
}

.gate-badge-logo {
  left: 50%;
  top: 50%;
  width: 31px;
  height: 31px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 1px rgba(255,255,255,0.66));
}

.level-gate-overlay {
  align-items: center;
  justify-items: center;
  background: rgba(0, 10, 12, 0.62);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.level_complete_panel {
  width: min(500px, 90vw);
  max-height: calc(100% - 28px);
  overflow: hidden;
  padding: 16px 20px 18px;
  border-radius: 26px;
  text-align: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 255, 99, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.55);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 36px rgba(102, 255, 72, 0.24);
}

.level_complete_panel .gate-badge-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 50%;
  filter: drop-shadow(0 8px 18px rgba(255, 179, 66, 0.35));
}

.level_complete_panel .gate-badge-image {
  filter:
    drop-shadow(0 8px 18px rgba(255, 216, 77, 0.28))
    drop-shadow(0 0 12px rgba(125, 255, 99, 0.22));
}

.level_complete_panel .gate-badge-logo {
  width: 21px;
  height: 21px;
}

.complete_eyebrow {
  margin: 0;
  color: #7dff63;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.level_complete_panel h2 {
  display: -webkit-box;
  margin: 4px 0 8px;
  color: #ffffff;
  font-size: clamp(25px, 3vw, 31px);
  line-height: 0.94;
  font-weight: 1000;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.6);
}

.complete_score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 7px;
  padding: 8px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.complete_score span,
.complete_bonus_grid span {
  display: block;
  color: #dff8ef;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
}

.complete_score strong {
  display: block;
  margin-top: 0;
  font-size: 24px;
  line-height: 1;
  color: #ffb342;
  font-weight: 1000;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

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

.complete_bonus_grid > div {
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.complete_bonus_grid strong {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 1000;
}

.next_level_card {
  margin: 8px 0;
  padding: 10px 13px;
  border-radius: 14px;
  text-align: left;
  background: linear-gradient(180deg, rgba(13, 72, 65, 0.98), rgba(4, 30, 34, 0.98));
  border: 2px solid rgba(255, 138, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.next_level_card small {
  display: block;
  color: #ffb342;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.next_level_card #gate-next-name {
  display: block !important;
  margin: 3px 0 0 !important;
  color: #ffffff !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  opacity: 1 !important;
}

.next_level_card p {
  margin: 4px 0 0 !important;
  color: #dff8ef !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  line-height: 1.25 !important;
  opacity: 1 !important;
}

.complete_actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.complete_button {
  min-height: 38px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.32);
}

.complete_button.primary {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #ffb13b, #ff7300);
  border-color: rgba(255, 220, 115, 0.95);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.complete_button.secondary {
  background: linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1));
}

.complete_button:hover,
.complete_button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.complete_button:focus-visible {
  outline: 3px solid rgba(255, 186, 59, 0.92);
  outline-offset: 3px;
}

.complete_button:active {
  transform: translateY(1px);
}

.game-over-overlay {
  background: rgba(0, 10, 12, 0.64);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.run_result_panel {
  width: min(430px, 90vw);
  max-height: calc(100% - 24px);
  overflow: hidden;
  padding: 16px 20px;
  border-radius: 24px;
  text-align: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 138, 0, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(255, 138, 0, 0.65);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 36px rgba(255, 138, 0, 0.24);
}

.failed_badge {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
  background: radial-gradient(circle at 30% 25%, #ffffff, #ffcf5a 32%, #ff7300 72%, #7a2500);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(255, 138, 0, 0.5);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.game-over-overlay.is-complete .failed_badge {
  background: radial-gradient(circle at 30% 25%, #ffffff, #ffd45a 35%, #ff8a00 70%, #7a3300);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35),
    0 0 20px rgba(125, 255, 99, 0.32);
}

.run_result_panel .failed_eyebrow {
  margin: 0;
  color: #ffb342;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  line-height: 1;
  text-transform: uppercase;
}

.run_result_panel h2 {
  margin: 5px 0 9px;
  color: #ffffff;
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 0.92;
  font-weight: 1000;
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #7a2500,
    0 12px 24px rgba(0, 0, 0, 0.6);
}

.failed_score {
  margin: 9px 0;
  padding: 9px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.failed_score span {
  display: block;
  color: #dff8ef;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
}

.failed_score strong {
  display: block;
  margin-top: 3px;
  font-size: 25px;
  line-height: 1;
  color: #ffb342;
  font-weight: 1000;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

.result_prize_summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0;
}

.result_prize_summary div {
  padding: 9px 10px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(13, 72, 65, 0.92), rgba(4, 30, 34, 0.96));
  border: 1px solid rgba(125,255,99,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

.result_prize_summary span {
  display: block;
  color: #7dff63;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result_prize_summary strong {
  display: block;
  margin-top: 3px;
  color: #ffb342;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
}

.result_rank_message {
  min-height: 1.1em;
  margin: -2px 0 8px;
  color: #ffb342;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.25;
}

.run_result_panel .failed_message {
  margin: 0 0 9px;
  color: #dff8ef;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.22;
}

.failed_stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 9px 0;
}

.failed_stats div {
  padding: 7px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.failed_stats span {
  display: block;
  color: #7dff63;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.failed_stats strong {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 1000;
}

.failed_actions,
.run_result_panel .form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.failed_button {
  min-height: 38px;
  border-radius: 13px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.32);
}

.failed_button.primary {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #ffb13b, #ff7300);
  border-color: rgba(255, 220, 115, 0.95);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.failed_button.secondary {
  background: linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1));
}

.failed_button:hover,
.failed_button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.failed_button:focus-visible {
  outline: 3px solid rgba(255, 186, 59, 0.92);
  outline-offset: 3px;
}

.failed_button:active {
  transform: translateY(1px);
}

.game-over-overlay.is-failed .result_score_form {
  display: none;
}

.game-over-overlay.is-complete .failed_actions,
.game-over-overlay.is-complete .failed_stats {
  display: none;
}

.game-over-overlay.is-complete .run_result_panel {
  border-color: rgba(115, 255, 78, 0.55);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 36px rgba(102, 255, 72, 0.24);
}

.game-over-overlay.is-complete .run_result_panel h2 {
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.6);
}

.result_score_form {
  margin-top: 16px;
  text-align: left;
}

.result_score_form label {
  display: block;
  margin-bottom: 10px;
}

.result_score_form span {
  display: block;
  margin-bottom: 6px;
  color: #7dff63;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.result_score_form input {
  width: 100%;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(125, 255, 99, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.result_score_form input::placeholder {
  color: rgba(223, 248, 239, 0.58);
}

.overlay-card p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.overlay-note {
  font-size: 0.9rem;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-family: var(--font-display);
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(180deg, #ffd76e, #f39a26);
  color: white;
  box-shadow:
    0 4px 0 #9c611d,
    0 12px 22px rgba(119, 86, 21, 0.24);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(22, 122, 151, 0.18);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(22, 122, 151, 0.20);
}

.score-form {
  margin-top: 18px;
}

.score-form label {
  display: block;
  margin-bottom: 12px;
}

.score-form span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.score-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(22, 122, 151, 0.20);
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
}

.run_result_panel .result_score_form input {
  border-color: rgba(125, 255, 99, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
}

.form-actions,
.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.board-panel,
.ops-panel {
  margin-top: 24px;
  padding: 24px;
}

.panel-head,
.board-grid,
.leaderboard_table .status-badge {
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,0.35);
}

.leaderboard_table .status-badge.champion {
  color: #3c2200;
  background: linear-gradient(180deg, #ffe56b, #ffb342);
  border-color: rgba(255,255,255,0.42);
}

.leaderboard_table .status-badge.raffle {
  color: #062214;
  background: linear-gradient(180deg, #93ff68, #28c85a);
  border-color: rgba(255,255,255,0.34);
}

.ops-grid {
  display: grid;
  gap: 20px;
}

.panel-head {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.board-grid {
  grid-template-columns: 0.9fr 1.1fr;
  margin-top: 20px;
}

.board-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.table-shell {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr + tr {
  border-top: 1px solid var(--line);
}

tbody tr.champion {
  background: rgba(245, 185, 63, 0.18);
}

tbody tr.raffle {
  background: rgba(88, 173, 45, 0.13);
}

.status-badge {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-badge.champion {
  color: #7a4a0f;
  background: rgba(245, 185, 63, 0.26);
}

.status-badge.raffle {
  color: #2e6b24;
  background: rgba(88, 173, 45, 0.20);
}

.status-badge.standard {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.leaderboard_panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(125, 255, 99, 0.16), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(255, 138, 0, 0.15), transparent 28%),
    linear-gradient(180deg, rgba(4, 28, 31, 0.96), rgba(2, 14, 17, 0.98));
  border: 2px solid rgba(115, 255, 78, 0.45);
  border-radius: 28px;
  padding: clamp(22px, 3vw, 34px);
  color: #ffffff;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -18px 42px rgba(0,0,0,0.24),
    0 0 28px rgba(102, 255, 72, 0.22);
}

.leaderboard_panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.10), transparent 20% 78%, rgba(255,255,255,0.05)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 7px);
  opacity: 0.58;
}

.leaderboard_panel > * {
  position: relative;
  z-index: 1;
}

.leaderboard_header {
  max-width: 760px;
  margin-bottom: 18px;
}

.leaderboard_eyebrow {
  color: #7dff63;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  text-shadow: 0 2px 8px rgba(125, 255, 99, 0.42);
}

.leaderboard_panel h2 {
  margin: 6px 0 10px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 1000;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #1c7f21,
    0 12px 24px rgba(0,0,0,0.58);
}

.leaderboard_panel p {
  margin: 0;
  color: #dff8ef;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.34);
}

.leaderboard_table {
  overflow: hidden;
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.035));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 12px 28px rgba(0,0,0,0.24);
}

.leaderboard_table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.leaderboard_table th,
.leaderboard_table td {
  padding: 12px 14px;
  text-align: left;
}

.leaderboard_table th {
  color: #ffb342;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.46);
}

.leaderboard_table tbody tr + tr {
  border-top: 0;
}

.leaderboard_table tbody td {
  color: #f5fff8;
  font-weight: 900;
  background:
    linear-gradient(180deg, rgba(15, 82, 72, 0.94), rgba(5, 35, 38, 0.96));
  border-top: 1px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(0,0,0,0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.11),
    0 7px 14px rgba(0,0,0,0.18);
}

.leaderboard_table tbody td:first-child {
  border-radius: 13px 0 0 13px;
  color: #7dff63;
}

.leaderboard_table tbody td:last-child {
  border-radius: 0 13px 13px 0;
  color: #ffb342;
}

.leaderboard_table tbody tr.winner td {
  background:
    linear-gradient(180deg, rgba(135, 93, 20, 0.98), rgba(62, 42, 11, 0.98));
  color: #fff9df;
}

.leaderboard_table tbody tr.winner td:first-child,
.leaderboard_table tbody tr.winner td:last-child {
  color: #ffe56b;
}

.leaderboard_table tbody tr.raffle td {
  background:
    linear-gradient(180deg, rgba(20, 95, 64, 0.95), rgba(5, 45, 39, 0.98));
}

.leaderboard_table .empty-state {
  position: relative;
  padding: 26px 20px;
  color: #eefdf4;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 255, 99, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(15, 82, 72, 0.76), rgba(5, 35, 38, 0.86));
  border: 1px solid rgba(125, 255, 99, 0.24);
  border-radius: 15px;
  font-weight: 900;
}

.leaderboard_table .empty-state::before {
  content: "★";
  display: block;
  margin-bottom: 8px;
  color: #ffb342;
  font-size: 1.45rem;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0,0,0,0.42);
}

.ops-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.ops-grid p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.hidden {
  display: none !important;
}

/* ── Pause button — lives in the HUD strip ─────────────── */
.hud-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  pointer-events: auto;
}

.pause-btn-pill {
  min-width: 0;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  margin-right: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18,18,18,0.96), rgba(5,5,5,0.98));
  border: 1px solid rgba(77, 217, 255, 0.35);
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.pause-btn-pill:active {
  background: rgba(77, 217, 255, 0.18);
  border-color: rgba(77, 217, 255, 0.75);
}

.restart-control {
  position: relative;
}

.restart-btn {
  font-size: 19px;
}

.restart-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 158px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(77, 217, 255, 0.32);
  background: rgba(5, 9, 20, 0.94);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.restart-menu button {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #eef8ff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.restart-menu button:active,
.restart-menu button:hover {
  background: rgba(77, 217, 255, 0.14);
}

.pause-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 28px);
  background: rgba(0, 10, 12, 0.58);
  backdrop-filter: blur(3px);
}

.pause-menu {
  width: min(360px, 88vw);
  padding: clamp(20px, 3.2vw, 28px);
  border-radius: 28px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 255, 99, 0.18), transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(255, 138, 0, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.96), rgba(1, 15, 18, 0.98));
  border: 2px solid rgba(115, 255, 78, 0.52);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 32px rgba(102, 255, 72, 0.22);
}

.pause-kicker {
  margin: 0 0 8px;
  color: #7dff63;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
}

.pause-menu h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 2.9rem);
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-shadow:
    0 3px 0 #061c20,
    0 6px 0 #1c7f21,
    0 12px 24px rgba(0, 0, 0, 0.6);
}

.pause-menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.pause-menu-button {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(20, 82, 84, 1), rgba(5, 36, 42, 1)),
    radial-gradient(circle at 50% 0%, rgba(125, 255, 99, 0.18), transparent 70%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 1000;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.32);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.pause-menu-button.primary {
  min-height: 54px;
  background: linear-gradient(180deg, #ffbd45, #ff7300);
  border-color: rgba(255, 220, 115, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 10px 18px rgba(122, 55, 0, 0.34),
    0 0 18px rgba(255, 138, 0, 0.24);
}

.pause-menu-button.sound.is-muted {
  color: #bfe0e5;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(48, 59, 64, 0.98), rgba(20, 24, 29, 0.98));
}

.pause-menu-button:hover,
.pause-menu-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.pause-menu-button:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

/* ── Cave gun fire button ───────────────────────────────── */
.cave-fire-btn {
  position: absolute;
  right: 14px;
  bottom: 120px;
  z-index: 5;
  width: 70px;
  height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(145deg, #203b68, #0d1e36);
  border: 2px solid rgba(255, 189, 70, 0.78);
  color: #ffe1a3;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: none;
  box-shadow:
    0 0 22px rgba(255, 120, 20, 0.52),
    0 0 42px rgba(255, 61, 242, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.18);
  user-select: none;
  -webkit-user-select: none;
}

.cave-fire-btn:active {
  background: linear-gradient(145deg, #2a4870, #1a3050);
  box-shadow: 0 0 28px rgba(255, 140, 20, 0.75);
  border-color: rgba(255, 180, 60, 0.9);
}

@media (min-width: 961px) {
  .app-shell {
    width: min(1480px, calc(100% - 36px));
  }

  .hero-panel {
    grid-template-columns: minmax(320px, 0.58fr) minmax(0, 1.42fr);
    align-items: center;
    gap: 22px;
  }

  h1 {
    font-size: clamp(2.25rem, 4vw, 4.05rem);
  }

  .game_info_card {
    padding: 22px 24px;
  }

  .game_info_title h1 {
    max-width: none;
    font-size: clamp(2.15rem, 3vw, 3.35rem);
    line-height: 0.88;
  }

  .game_info_intro {
    margin-top: 16px;
    font-size: 0.92rem;
  }

  .game_prize_grid {
    margin: 16px 0;
  }

  .game_prize_card {
    padding: 11px 10px;
  }

  .game_step {
    gap: 9px;
    padding: 8px 10px;
  }

  .game_step p {
    font-size: 0.82rem;
  }

  .game-card {
    align-items: stretch;
  }

  .game-frame {
    width: min(100%, 960px);
    height: min(67vh, 540px);
    aspect-ratio: 16 / 9;
    margin-left: auto;
    padding: 8px;
    border-radius: 10px;
    background:
      linear-gradient(135deg, rgba(41, 169, 203, 0.28), rgba(243, 181, 55, 0.22)),
      linear-gradient(180deg, rgba(238, 253, 255, 0.96), rgba(92, 171, 72, 0.44));
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.42) inset,
      0 14px 34px rgba(19, 98, 118, 0.18),
      0 22px 54px rgba(54, 105, 45, 0.18);
  }

  .game-frame::before {
    inset: 8px;
    border-radius: 6px;
    opacity: 0.18;
  }

  .game-frame::after {
    display: none;
  }

  canvas {
    border-radius: 6px;
  }

  .hud-strip {
    left: 20px;
    right: 20px;
    bottom: 14px;
  }

  .projectile-indicator {
    left: 18px;
    top: 72px;
    max-width: min(410px, calc(100% - 36px));
  }
}

@media (max-width: 960px) {
  .hero-panel,
  .board-grid,
  .ops-grid,
  .panel-head {
    grid-template-columns: 1fr;
  }

  .reward-strip {
    grid-template-columns: 1fr;
  }

  .game_prize_grid {
    grid-template-columns: 1fr;
  }

  .game_info_title h1 {
    max-width: 10ch;
    font-size: clamp(2.35rem, 8vw, 3.5rem);
  }

  .leaderboard_table {
    overflow-x: auto;
  }

  .leaderboard_table table {
    min-width: 620px;
  }
}

@media (max-width: 640px) {
  html, body {
    overflow: hidden;
    height: 100%;
    width: 100%;
    touch-action: none;
  }

  .app-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  /* Hide everything except the game on mobile */
  .hero-copy,
  .board-panel,
  .ops-panel {
    display: none !important;
  }

  /* Fill 100% of whatever container we're in (works inside iframes too) */
  .hero-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #06040f;
    overflow: hidden;
  }

  .game-card {
    width: 100%;
    flex: 1;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .game-frame {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: auto !important;
    flex: 1;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border-radius: 0;
    border: none;
    background: #06040f;
    overflow: hidden;
  }

  /* JS sets exact size — no !important so JS inline styles can override */
  canvas {
    border-radius: 0;
    display: block;
    flex-shrink: 0;
    width: var(--mobile-canvas-width, 100vw);
    height: var(--mobile-canvas-height, calc(100vw * 1.7778));
  }

  /* HUD strip sits directly below the canvas. */
  .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 0 8px;
    border-top: 1px solid rgba(140,90,255,0.22);
    background: rgba(8,4,20,0.99);
  }

  .projectile-indicator {
    left: 8px;
    right: 8px;
    top: 62px;
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: none;
    padding: 6px;
    border-radius: 12px;
  }

  .projectile-current strong,
  .projectile-next strong {
    font-size: 0.8rem;
  }

  .projectile-current small {
    display: block;
    font-size: 0.56rem;
    line-height: 1.05;
  }

  .projectile-next {
    min-width: 60px;
    padding: 6px 7px;
  }

  .projectile-order {
    gap: 3px;
    overflow: hidden;
  }

  .projectile-chip {
    padding: 3px 4px;
    font-size: 0.46rem;
  }

  .home-ui-layer {
    gap: 9px;
    padding: 14px 12px 20px;
  }

  .play-btn-hot {
    min-width: min(360px, 92%);
    min-height: 58px;
    padding: 0 20px;
  }

  .play-btn-hot span {
    font-size: 1.18rem;
  }

  .home-secondary-actions {
    max-width: 340px;
    gap: 7px;
  }

  .home-circle-hot {
    min-width: 76px;
    min-height: 36px;
    padding: 0 10px;
  }

  .home-leaderboard-hot {
    min-width: 92px;
  }

  .home-circle-hot span,
  .website-btn-hot {
    font-size: 0.62rem;
  }

  .website-btn-hot {
    min-height: 32px;
    padding: 0 14px;
  }

  .game-select-overlay {
    align-items: start;
    padding: 10px;
  }

  .game-select-panel {
    width: min(360px, calc(100vw - 20px));
    max-height: calc(var(--mobile-canvas-height, 100vh) - 16px);
    padding: 14px;
    border-radius: 20px;
    text-align: left;
    overflow-y: auto;
  }

  .game-select-back {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 32px;
    margin: 0 0 8px;
    padding: 0 13px;
    font-size: 0.8rem;
  }

  .game-select-kicker {
    font-size: 0.62rem;
    text-align: center;
  }

  .game-select-panel h2 {
    margin: 5px 0;
    font-size: 2rem;
    text-align: center;
  }

  .game-select-intro {
    margin-bottom: 10px;
    font-size: 0.78rem;
    text-align: center;
  }

  .arcade-game-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .arcade-game-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
  }

  .arcade-game-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    font-size: 0.88rem;
  }

  .arcade-game-copy {
    gap: 4px;
  }

  .arcade-game-copy strong {
    font-size: 1rem;
  }

  .arcade-game-copy small {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .arcade-game-copy em {
    padding: 4px 8px;
    font-size: 0.58rem;
  }

  .hud-pill {
    width: 56px;
    min-width: 0;
    padding: 4px 3px;
    border-radius: 8px;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .hud-pill span {
    font-size: 0.50rem;
    letter-spacing: 0.04em;
  }

  .hud-pill strong {
    font-size: 0.78rem;
    margin-top: 1px;
  }

  .pause-btn-pill {
    width: 44px;
    height: 42px;
    padding: 0;
    margin-right: 0;
    border-radius: 14px;
  }

  .restart-menu {
    width: 148px;
    bottom: calc(100% + 6px);
  }

  .start-overlay,
  .game-select-overlay,
  .level-select-overlay,
  .game-over-overlay,
  .level-gate-overlay {
    inset: 0 0 auto;
    width: 100%;
    min-height: calc(var(--mobile-canvas-height, 100vh) + 50px);
    border-radius: 0;
  }

  /* level-select image — grid keeps its absolute position; shrink gap slightly */
  .level-select-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding: 2px;
  }

  .level-card {
    min-height: 0;
  }

  .pause-panel {
    align-items: center;
    padding: 12px;
  }

  .pause-menu {
    width: min(330px, calc(100vw - 28px));
    max-height: calc(var(--mobile-canvas-height, 100vh) - 24px);
    padding: 18px;
    border-radius: 22px;
  }

  .pause-menu h2 {
    font-size: 2.15rem;
  }

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

  .pause-menu-button {
    min-height: 44px;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  .pause-menu-button.primary {
    min-height: 48px;
  }

  .overlay-card {
    padding: 20px;
  }

  .level_complete_panel {
    width: min(340px, calc(100vw - 28px));
    max-height: calc(var(--mobile-canvas-height, 100vh) - 24px);
    padding: 14px;
    border-radius: 22px;
  }

  .level_complete_panel .gate-badge-wrap {
    width: 46px;
    height: 46px;
    margin-bottom: 5px;
  }

  .level_complete_panel .gate-badge-logo {
    width: 22px;
    height: 22px;
  }

  .level_complete_panel h2 {
    margin-bottom: 8px;
    font-size: 1.65rem;
  }

  .complete_score {
    display: block;
    margin: 8px 0 7px;
    padding: 9px;
  }

  .complete_score strong {
    margin-top: 2px;
    font-size: 1.55rem;
  }

  .next_level_card {
    margin: 8px 0;
    padding: 10px;
  }

  .complete_actions {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 8px;
  }

  .complete_button {
    min-height: 40px;
    border-radius: 13px;
    font-size: 0.86rem;
  }

  .run_result_panel {
    width: min(340px, calc(100vw - 28px));
    max-height: calc(var(--mobile-canvas-height, 100vh) - 24px);
    padding: 16px;
    border-radius: 22px;
  }

  .failed_badge {
    width: 50px;
    height: 50px;
    margin-bottom: 7px;
    font-size: 30px;
  }

  .failed_eyebrow {
    font-size: 11px;
  }

  .run_result_panel h2 {
    margin: 6px 0 10px;
    font-size: 1.75rem;
  }

  .failed_score {
    margin: 10px 0;
    padding: 11px;
  }

  .failed_score strong {
    font-size: 1.75rem;
  }

  .run_result_panel .failed_message {
    margin-bottom: 10px;
    font-size: 0.88rem;
  }

  .failed_stats {
    gap: 6px;
    margin: 10px 0;
  }

  .failed_stats div {
    padding: 8px 5px;
    border-radius: 12px;
  }

  .failed_stats span {
    font-size: 8px;
    letter-spacing: 0.5px;
  }

  .failed_stats strong {
    font-size: 0.92rem;
  }

  .failed_actions,
  .run_result_panel .form-actions {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 10px;
  }

  .failed_button {
    min-height: 40px;
    border-radius: 13px;
    font-size: 0.86rem;
  }

  .result_score_form {
    margin-top: 10px;
  }

  .result_score_form label {
    margin-bottom: 8px;
  }

  .result_score_form input {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 124px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
  }
}

/* Final Cave Flight overrides live last so the old helicopter game keeps its earlier look. */
.cave-flight-page {
  color: #dce9ff;
  background:
    radial-gradient(circle at 18% 88%, rgba(19, 105, 145, 0.26), transparent 28%),
    radial-gradient(circle at 80% 8%, rgba(110, 60, 180, 0.28), transparent 34%),
    linear-gradient(180deg, #130d2c 0%, #060613 52%, #071525 100%);
}

.cave-flight-page .hero-panel,
.cave-flight-page .board-panel {
  background:
    radial-gradient(circle at 58% 0%, rgba(75, 35, 140, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(13, 9, 36, 0.96), rgba(7, 6, 20, 0.98));
  border: 1px solid rgba(111, 62, 190, 0.42);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255,255,255,0.06);
}

.cave-flight-page .hero-panel {
  grid-template-columns: minmax(330px, 0.98fr) minmax(360px, 0.82fr);
}

.cave-flight-page h1 {
  max-width: 8ch;
  color: #d9f8ff;
  -webkit-text-stroke: 0;
  text-shadow:
    0 0 22px rgba(77, 217, 255, 0.22),
    0 4px 0 rgba(12, 15, 36, 0.88);
}

.cave-flight-page .eyebrow,
.cave-flight-page .section-label,
.cave-flight-page .reward-label {
  color: #f7d83b;
  text-shadow: none;
}

.cave-flight-page .lede,
.cave-flight-page .feature-list,
.cave-flight-page .board-panel p {
  color: #aebff6;
}

.cave-flight-page .reward-strip div {
  background: linear-gradient(180deg, rgba(15, 24, 54, 0.94), rgba(10, 7, 28, 0.98));
  border-color: rgba(77, 217, 255, 0.28);
}

.cave-flight-page .reward-strip div:nth-child(2) {
  border-color: rgba(167, 83, 255, 0.45);
}

.cave-flight-page .reward-strip strong,
.cave-flight-page .board-panel h2 {
  color: #ffffff;
}

.cave-flight-page .table-shell {
  background: rgba(4, 5, 18, 0.88);
  border-color: rgba(77, 217, 255, 0.16);
}

.cave-flight-page .table-shell th,
.cave-flight-page .table-shell td {
  color: #dce9ff;
}

.cave-flight-page .game-frame {
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(112, 54, 230, 0.56), rgba(35, 21, 102, 0.94)),
    linear-gradient(180deg, rgba(40, 16, 105, 1), rgba(10, 8, 38, 1));
  border: 1px solid rgba(135, 92, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.09) inset,
    0 20px 50px rgba(0,0,0,0.42),
    0 0 34px rgba(84, 57, 210, 0.35);
}

.cave-flight-page canvas {
  border-radius: 20px;
}

.cave-flight-page .start-overlay,
.cave-flight-page .game-over-overlay,
.cave-flight-page .level-gate-overlay {
  border-radius: 30px;
  background: rgba(8, 5, 25, 0.82);
}

.cave-flight-page .overlay-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(77, 217, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(14, 17, 47, 0.96), rgba(8, 6, 26, 0.98));
  border: 1px solid rgba(77, 217, 255, 0.28);
  color: #eef8ff;
}

.cave-flight-page .overlay-card h2 {
  color: #ffffff;
  -webkit-text-stroke: 0;
  text-shadow: 0 3px 0 rgba(6, 9, 28, 0.82), 0 0 18px rgba(77, 217, 255, 0.18);
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas {
    border-radius: 0;
  }

  .cave-flight-page .hud-strip {
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
  }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 126px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 10px);
    bottom: auto;
  }
}

/* Final Cave Flight premium UI overrides - must remain last. */
.cave-flight-page {
  color: #eefdf4;
  background:
    radial-gradient(circle at 14% 84%, rgba(125, 255, 99, 0.20), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 138, 0, 0.16), transparent 30%),
    linear-gradient(180deg, #04181c 0%, #020a0d 56%, #061510 100%);
}

.cave-flight-page .hero-panel,
.cave-flight-page .board-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 255, 99, 0.14), transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(255, 138, 0, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(4, 34, 38, 0.97), rgba(1, 15, 18, 0.99));
  border: 2px solid rgba(115, 255, 78, 0.34);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.12), 0 0 30px rgba(102,255,72,0.12);
}

.cave-flight-page h1 {
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 4px 0 #061c20, 0 7px 0 #1c7f21, 0 12px 24px rgba(0, 0, 0, 0.66);
}

.cave-flight-page .eyebrow,
.cave-flight-page .section-label,
.cave-flight-page .reward-label {
  color: #7dff63;
  text-shadow: 0 0 12px rgba(125,255,99,0.40);
}

.cave-flight-page .lede,
.cave-flight-page .feature-list,
.cave-flight-page .board-panel p {
  color: #dff8ef;
}

.cave-flight-page .game-frame {
  overflow: hidden;
  width: min(100%, 430px) !important;
  height: auto !important;
  aspect-ratio: 9 / 16 !important;
  padding: 12px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(125,255,99,0.18), transparent 28% 74%, rgba(255,138,0,0.18)), linear-gradient(180deg, rgba(3, 44, 51, 1), rgba(1, 13, 18, 1)) !important;
  border: 2px solid rgba(77, 217, 255, 0.36) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 0 0 1px rgba(125,255,99,0.16), 0 24px 58px rgba(0,0,0,0.44), 0 0 36px rgba(77,217,255,0.18), 0 0 26px rgba(125,255,99,0.14) !important;
}

.cave-flight-page .game-frame::before {
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(125,255,99,0.18);
  background: linear-gradient(120deg, rgba(255,255,255,0.12), transparent 18% 76%, rgba(125,255,99,0.06));
  opacity: 0.34;
}

.cave-flight-page .game-frame::after {
  display: block;
  left: 28px;
  right: 28px;
  top: 20px;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(125,255,99,0.82), transparent);
  box-shadow: 0 0 18px rgba(125,255,99,0.62);
}

.cave-flight-page canvas {
  border-radius: 18px;
  background: #031114;
}

.cave-brand-logo {
  position: absolute;
  right: 22px;
  top: 60px;
  z-index: 5;
  width: 34px;
  height: 34px;
  object-fit: contain;
  opacity: 0.68;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.48));
  pointer-events: none;
}

.cave-flight-page .hud-strip {
  left: 24px;
  right: 24px;
  bottom: 22px;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  background: radial-gradient(circle at 15% 0%, rgba(125,255,99,0.12), transparent 42%), linear-gradient(180deg, rgba(8, 46, 49, 0.88), rgba(1, 14, 18, 0.95));
  border: 1px solid rgba(125,255,99,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 12px 24px rgba(0,0,0,0.30), 0 0 20px rgba(125,255,99,0.14);
  backdrop-filter: blur(8px);
}

.cave-flight-page .hud-actions { margin-right: 0; }

.cave-flight-page .hud-pill {
  width: auto;
  min-width: 58px;
  flex: 1 1 0;
  padding: 7px 6px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.cave-flight-page .hud-pill span {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  color: #7dff63;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.cave-flight-page .hud-pill strong {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.42), 0 0 12px rgba(125,255,99,0.22);
}

.cave-flight-page .hud-pill:last-child strong { color: #ffb342; }

.cave-flight-page .pause-btn-pill {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.18), transparent 44%), linear-gradient(180deg, rgba(16, 82, 80, 0.98), rgba(3, 30, 35, 0.98));
  border: 1px solid rgba(125,255,99,0.34);
}

.cave-flight-page .pause-btn-pill::before {
  content: "II";
  font-size: 0.92rem;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.cave-flight-page .cave-fire-btn {
  right: 28px;
  bottom: 106px;
  width: 88px;
  height: 48px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.42), transparent 42%), linear-gradient(180deg, #ffbd45, #ff7300);
  border: 2px solid rgba(255, 220, 115, 0.92);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.36), inset 0 -4px 0 rgba(122,45,0,0.34), 0 9px 16px rgba(0,0,0,0.32), 0 0 22px rgba(255,138,0,0.36);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.cave-flight-page .cave-fire-btn:hover,
.cave-flight-page .cave-fire-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
  outline: 3px solid rgba(255, 186, 59, 0.70);
  outline-offset: 3px;
}

.cave-flight-page .cave-fire-btn:active {
  transform: translateY(2px) scale(0.98);
  background: linear-gradient(180deg, #ff9f1f, #e35f00);
}

@media (max-width: 640px) {
  .cave-flight-page .game-frame {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    padding: 0;
    border-radius: 0;
  }

  .cave-flight-page canvas { border-radius: 0; }

  .cave-brand-logo {
    top: 54px;
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    width: 28px;
    height: 28px;
  }

  .cave-flight-page .hud-strip {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 58px;
    height: 58px;
    padding: 6px 7px;
    border-radius: 0;
  }

  .cave-flight-page .hud-pill {
    min-width: 0;
    padding: 5px 3px;
    border-radius: 10px;
  }

  .cave-flight-page .hud-pill span { font-size: 0.48rem; }
  .cave-flight-page .hud-pill strong { font-size: 0.82rem; }
  .cave-flight-page .pause-btn-pill { width: 48px !important; height: 48px !important; }

  .cave-flight-page .cave-fire-btn {
    top: calc(var(--mobile-canvas-height, 70vh) - 118px);
    right: calc((100vw - var(--mobile-canvas-width, 100vw)) / 2 + 12px);
    bottom: auto;
    width: 78px;
    height: 44px;
    font-size: 0.8rem;
  }
}

/* Mobile playability pass: keep phone browsers tappable and game-first. */
@media (max-width: 640px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  html,
  body {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  body {
    min-height: 100svh;
    min-height: 100dvh;
    touch-action: manipulation !important;
    overscroll-behavior-y: none;
  }

  button,
  a,
  input,
  textarea,
  select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  #game-canvas,
  .game-frame canvas {
    touch-action: none;
  }

  body:not(.cave-flight-page) .app-shell {
    height: 100svh !important;
    height: 100dvh !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .hero-panel,
  body:not(.cave-flight-page) .game-card,
  body:not(.cave-flight-page) .game-frame {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .home-ui-layer {
    padding:
      12px
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
    gap: clamp(7px, 1.5svh, 10px) !important;
  }

  body:not(.cave-flight-page) .play-btn-hot {
    min-width: min(330px, 88vw) !important;
    min-height: clamp(50px, 8svh, 58px) !important;
  }

  body:not(.cave-flight-page) .play-btn-hot span {
    font-size: clamp(1rem, 5vw, 1.2rem) !important;
  }

  body:not(.cave-flight-page) .home-secondary-actions {
    max-width: min(340px, 92vw) !important;
  }

  body:not(.cave-flight-page) .home-circle-hot {
    min-width: clamp(76px, 24vw, 104px) !important;
    min-height: 38px !important;
  }

  body:not(.cave-flight-page) .website-btn-hot {
    min-height: 36px !important;
  }

  body:not(.cave-flight-page) .game-select-overlay {
    place-items: stretch !important;
    align-items: stretch !important;
    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)) !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .game-select-panel {
    width: 100% !important;
    max-height: calc(100svh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 12px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.cave-flight-page) .game-select-panel h2 {
    font-size: clamp(1.8rem, 10vw, 2.5rem) !important;
    line-height: 0.92 !important;
  }

  body:not(.cave-flight-page) .game-select-intro {
    margin-bottom: 8px !important;
  }

  body:not(.cave-flight-page) .arcade-game-grid {
    gap: 8px !important;
  }

  body:not(.cave-flight-page) .arcade-game-card {
    min-height: 128px !important;
    padding: 10px !important;
    gap: 8px !important;
  }

  body:not(.cave-flight-page) .arcade-game-copy strong {
    font-size: clamp(0.96rem, 5.4vw, 1.18rem) !important;
    line-height: 0.96 !important;
  }

  body:not(.cave-flight-page) .projectile-indicator {
    top: max(52px, env(safe-area-inset-top)) !important;
    left: 8px !important;
    right: auto !important;
    width: min(270px, calc(100vw - 126px)) !important;
    max-width: 270px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 7px !important;
  }

  body:not(.cave-flight-page) .targets-left {
    top: max(12px, env(safe-area-inset-top)) !important;
    right: 14px !important;
  }

  body:not(.cave-flight-page) .game-tip {
    max-width: min(330px, 86vw) !important;
    padding: 8px 11px !important;
    font-size: 12px !important;
  }

  .cave-flight-doc,
  .cave-flight-doc body {
    height: auto !important;
    min-height: 100% !important;
    overflow-y: auto !important;
    touch-action: manipulation !important;
  }

  body.cave-flight-page .app-shell.cave-flight-shell {
    width: 100% !important;
    padding: 8px !important;
    overflow: visible !important;
  }

  body.cave-flight-page .hero-panel.cave-flight-hero {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 8px !important;
    overflow: visible !important;
  }

  body.cave-flight-page .cave-flight-game-card {
    order: -2 !important;
  }

  body.cave-flight-page .hero-copy.game_info_card {
    order: 1 !important;
  }

  body.cave-flight-page .board-panel.cave-flight-board {
    order: 2 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100% !important;
    padding: 5px !important;
    border-radius: 16px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    width: calc(100vw - 34px) !important;
    max-width: calc(100vw - 34px) !important;
    height: calc((100vw - 34px) * 0.5625) !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    left: 8px !important;
    right: 8px !important;
    bottom: 7px !important;
    min-height: 44px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    right: 12px !important;
    bottom: 64px !important;
    width: 70px !important;
    height: 40px !important;
  }
}

@media (max-width: 920px) and (max-height: 520px) {
  html,
  body {
    overflow: hidden !important;
    height: 100svh !important;
    height: 100dvh !important;
  }

  body:not(.cave-flight-page) .app-shell,
  body:not(.cave-flight-page) .hero-panel,
  body:not(.cave-flight-page) .game-card,
  body:not(.cave-flight-page) .game-frame {
    width: 100% !important;
    height: 100svh !important;
    height: 100dvh !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .hero-copy,
  body:not(.cave-flight-page) .board-panel,
  body:not(.cave-flight-page) .ops-panel {
    display: none !important;
  }

  body:not(.cave-flight-page) .game-frame canvas {
    width: 100vw !important;
    height: calc(100svh - 56px) !important;
    height: calc(100dvh - 56px) !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .app-shell.cave-flight-shell,
  body.cave-flight-page .hero-panel.cave-flight-hero {
    width: 100% !important;
    height: 100svh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body.cave-flight-page .hero-panel.cave-flight-hero {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.cave-flight-page .hero-copy.game_info_card,
  body.cave-flight-page .board-panel.cave-flight-board {
    display: none !important;
  }

  body.cave-flight-page .cave-flight-game-card,
  body.cave-flight-page .game-frame.cave-flight-frame {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100svh !important;
    height: 100dvh !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    width: min(100vw, calc(100svh * 1.7778)) !important;
    width: min(100vw, calc(100dvh * 1.7778)) !important;
    height: min(100svh, calc(100vw * 0.5625)) !important;
    height: min(100dvh, calc(100vw * 0.5625)) !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
  }
}

/* Mobile home/menu correction: do not crop the landscape homepage artwork into a portrait viewport. */
@media (max-width: 640px) {
  html.arcade-home-mode,
  body.arcade-home-mode {
    height: auto !important;
    min-height: 100svh !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: manipulation !important;
  }

  body.arcade-home-mode {
    overscroll-behavior-y: auto !important;
  }

  body.arcade-home-mode .app-shell {
    width: 100% !important;
    height: auto !important;
    min-height: 100svh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(22px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left)) !important;
    overflow: visible !important;
  }

  body.arcade-home-mode .hero-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px !important;
    border-radius: 20px !important;
    overflow: visible !important;
  }

  body.arcade-home-mode .hero-copy,
  body.arcade-home-mode .board-panel,
  body.arcade-home-mode .ops-panel {
    display: block !important;
  }

  body.arcade-home-mode .hero-copy.game_info_card {
    display: flex !important;
  }

  body.arcade-home-mode .game-card {
    order: -1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex: none !important;
    overflow: visible !important;
  }

  body.arcade-home-mode .game-frame {
    width: 100% !important;
    max-width: 640px !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    display: block !important;
    padding: 4px !important;
    margin: 0 auto !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    background:
      linear-gradient(180deg, rgba(4, 34, 38, 0.98), rgba(1, 15, 18, 0.99));
  }

  body.arcade-home-mode .game-frame::before,
  body.arcade-home-mode .game-frame::after {
    display: none !important;
  }

  body.arcade-home-mode #game-canvas {
    display: none !important;
  }

  body.arcade-home-mode .hud-strip,
  body.arcade-home-mode .projectile-indicator,
  body.arcade-home-mode .targets-left,
  body.arcade-home-mode .pause-btn,
  body.arcade-home-mode .cave-fire-btn {
    display: none !important;
  }

  body.arcade-home-mode .start-overlay {
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #061511 !important;
  }

  body.arcade-home-mode .splash-home {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 14px 14px 0 0 !important;
  }

  body.arcade-home-mode .home-ui-layer {
    position: relative !important;
    inset: auto !important;
    z-index: 3 !important;
    display: flex !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding: 12px !important;
    gap: 9px !important;
    background:
      radial-gradient(circle at 50% 0%, rgba(255, 138, 0, 0.16), transparent 44%),
      linear-gradient(180deg, rgba(5, 38, 39, 0.98), rgba(2, 14, 17, 0.99));
    pointer-events: none;
  }

  body.arcade-home-mode .play-btn-hot {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    padding: 0 18px !important;
  }

  body.arcade-home-mode .play-btn-hot span {
    font-size: clamp(1.05rem, 6vw, 1.35rem) !important;
    white-space: nowrap !important;
  }

  body.arcade-home-mode .home-secondary-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: none !important;
    gap: 8px !important;
  }

  body.arcade-home-mode .home-circle-hot,
  body.arcade-home-mode .website-btn-hot {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 44px !important;
  }

  body.arcade-home-mode .website-btn-hot {
    max-width: 100% !important;
  }

  body.arcade-home-mode .home-circle-hot span,
  body.arcade-home-mode .website-btn-hot {
    font-size: clamp(0.64rem, 3.5vw, 0.78rem) !important;
  }

  body.arcade-home-mode .game_info_card {
    padding: 18px !important;
    border-radius: 22px !important;
  }

  body.arcade-home-mode .game_info_title h1 {
    max-width: none !important;
    font-size: clamp(2.05rem, 12vw, 3.2rem) !important;
  }

  body.arcade-home-mode .leaderboard_panel,
  body.arcade-home-mode .ops-panel {
    margin-top: 12px !important;
  }
}

/* Ink Flight Rush phone portrait: use a vertical, full-screen game frame only on mobile. */
@media (max-width: 700px) and (orientation: portrait) {
  html.cave-flight-doc,
  html.cave-flight-doc body,
  body.cave-flight-page {
    width: 100% !important;
    height: 100svh !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    touch-action: manipulation !important;
    background: #04181c !important;
  }

  body.cave-flight-page .app-shell.cave-flight-shell,
  body.cave-flight-page .hero-panel.cave-flight-hero,
  body.cave-flight-page .cave-flight-game-card,
  body.cave-flight-page .game-frame.cave-flight-frame {
    width: 100vw !important;
    max-width: none !important;
    height: 100svh !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body.cave-flight-page .hero-panel.cave-flight-hero {
    display: block !important;
    background: #04181c !important;
  }

  body.cave-flight-page .hero-copy.game_info_card,
  body.cave-flight-page .board-panel.cave-flight-board {
    display: none !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame {
    position: relative !important;
    background:
      linear-gradient(180deg, rgba(4, 34, 38, 0.98), rgba(1, 15, 18, 0.99)) !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame::before,
  body.cave-flight-page .game-frame.cave-flight-frame::after {
    display: none !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame canvas {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100svh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    object-fit: fill !important;
    touch-action: none !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-strip {
    position: absolute !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 5px 6px !important;
    border-radius: 16px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill {
    min-width: 0 !important;
    padding: 5px 4px !important;
    border-radius: 11px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill span {
    font-size: 0.48rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .hud-pill strong {
    font-size: 0.82rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .pause-btn-pill {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-fire-btn {
    top: auto !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 66px) !important;
    width: 76px !important;
    height: 44px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-brand-logo {
    top: max(58px, calc(env(safe-area-inset-top) + 46px)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    width: 30px !important;
    height: 30px !important;
    opacity: 0.72 !important;
  }

  body.cave-flight-page .cave-level-select-overlay,
  body.cave-flight-page .start-overlay,
  body.cave-flight-page .game-over-overlay,
  body.cave-flight-page .level-gate-overlay,
  body.cave-flight-page .cave-pause-overlay {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 0 !important;
  }

  body.cave-flight-page .cave-level-select-panel,
  body.cave-flight-page .overlay-card,
  body.cave-flight-page .cave-pause-menu {
    width: min(360px, calc(100vw - 24px)) !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
/* Mobile QA polish: larger tap targets and lighter level-select hitbox alignment. */
@media (max-width: 640px) {
  .game-select-back {
    min-height: 48px !important;
    padding: 0 18px !important;
  }

  .level-select-grid {
    left: 18% !important;
    width: 64% !important;
    gap: 6px !important;
  }

  .level-card {
    border-radius: 14px;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-back,
  .cave-flight-page .cave-level-back {
    min-height: 48px !important;
    padding: 0 18px !important;
  }

  body:not(.cave-flight-page) #pause-btn.pause-btn-pill {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }

  body.cave-flight-page .game-frame.cave-flight-frame .cave-level-button,
  .cave-flight-page .cave-level-button {
    min-height: 52px !important;
  }

  body.cave-flight-page .cave-pause-button,
  .cave-flight-page .cave-pause-button {
    min-height: 48px !important;
  }
}

/* Phone landscape still needs the mobile game shell; width-based media queries miss it. */
@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  body:not(.cave-flight-page) .app-shell,
  body:not(.cave-flight-page) .hero-panel,
  body:not(.cave-flight-page) .game-card,
  body:not(.cave-flight-page) .game-frame {
    width: 100% !important;
    height: 100svh !important;
    height: 100dvh !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .hero-copy,
  body:not(.cave-flight-page) .board-panel,
  body:not(.cave-flight-page) .ops-panel {
    display: none !important;
  }

  body:not(.cave-flight-page) .game-frame canvas {
    width: 100vw !important;
    height: calc(100svh - 52px) !important;
    height: calc(100dvh - 52px) !important;
    border-radius: 0 !important;
  }

  body:not(.cave-flight-page) .hud-strip {
    height: 52px !important;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom)) !important;
    gap: 6px !important;
  }

  body:not(.cave-flight-page) .hud-pill {
    min-width: 74px !important;
    min-height: 42px !important;
    padding: 4px 8px !important;
  }

  body:not(.cave-flight-page) .projectile-indicator {
    top: max(8px, env(safe-area-inset-top)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: auto !important;
    width: min(250px, 32vw) !important;
  }

  body:not(.cave-flight-page) .targets-left {
    top: max(8px, env(safe-area-inset-top)) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
  }

  body:not(.cave-flight-page) #pause-btn.pause-btn-pill {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }

  body:not(.cave-flight-page) .start-overlay,
  body:not(.cave-flight-page) .game-select-overlay,
  body:not(.cave-flight-page) .level-select-overlay,
  body:not(.cave-flight-page) .game-over-overlay,
  body:not(.cave-flight-page) .level-gate-overlay {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    border-radius: 0 !important;
  }

  body:not(.cave-flight-page) .level-select-bg {
    object-fit: fill !important;
  }

  body:not(.cave-flight-page) .level-select-grid {
    left: 25.4% !important;
    top: 20.8% !important;
    width: 45.2% !important;
    height: 72.6% !important;
    gap: 5px 8px !important;
  }

  body:not(.cave-flight-page) .level-card strong {
    font-size: clamp(1.05rem, 4.2vw, 1.55rem) !important;
  }

  body:not(.cave-flight-page) .level-lock {
    width: 14px !important;
    height: 14px !important;
  }

  body:not(.cave-flight-page) .level-gate-overlay,
  body:not(.cave-flight-page) .game-over-overlay {
    align-items: center !important;
    justify-items: center !important;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
  }

  body:not(.cave-flight-page) .level_complete_panel,
  body:not(.cave-flight-page) .run_result_panel {
    width: min(660px, calc(100vw - 22px)) !important;
    max-height: calc(100svh - 14px) !important;
    max-height: calc(100dvh - 14px) !important;
    padding: 9px 12px 10px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .level_complete_panel .gate-badge-wrap,
  body:not(.cave-flight-page) .failed_badge {
    width: 32px !important;
    height: 32px !important;
    margin-bottom: 3px !important;
    font-size: 20px !important;
  }

  body:not(.cave-flight-page) .level_complete_panel .gate-badge-logo {
    width: 16px !important;
    height: 16px !important;
  }

  body:not(.cave-flight-page) .complete_eyebrow,
  body:not(.cave-flight-page) .run_result_panel .failed_eyebrow {
    font-size: 9px !important;
    letter-spacing: 0.8px !important;
  }

  body:not(.cave-flight-page) .level_complete_panel h2,
  body:not(.cave-flight-page) .run_result_panel h2 {
    margin: 2px 0 5px !important;
    font-size: clamp(1.35rem, 5.7vw, 2rem) !important;
    line-height: 0.9 !important;
  }

  body:not(.cave-flight-page) .complete_score,
  body:not(.cave-flight-page) .failed_score {
    margin: 5px 0 !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
  }

  body:not(.cave-flight-page) .complete_score span,
  body:not(.cave-flight-page) .complete_bonus_grid span,
  body:not(.cave-flight-page) .failed_score span,
  body:not(.cave-flight-page) .result_prize_summary span,
  body:not(.cave-flight-page) .failed_stats span {
    font-size: 8px !important;
    letter-spacing: 0.7px !important;
  }

  body:not(.cave-flight-page) .complete_score strong,
  body:not(.cave-flight-page) .failed_score strong {
    font-size: 1.25rem !important;
  }

  body:not(.cave-flight-page) .complete_bonus_grid,
  body:not(.cave-flight-page) .result_prize_summary,
  body:not(.cave-flight-page) .failed_stats {
    gap: 6px !important;
    margin: 5px 0 !important;
  }

  body:not(.cave-flight-page) .complete_bonus_grid > div,
  body:not(.cave-flight-page) .result_prize_summary div,
  body:not(.cave-flight-page) .failed_stats div {
    padding: 5px 7px !important;
    border-radius: 10px !important;
  }

  body:not(.cave-flight-page) .complete_bonus_grid strong,
  body:not(.cave-flight-page) .result_prize_summary strong,
  body:not(.cave-flight-page) .failed_stats strong {
    font-size: 0.9rem !important;
  }

  body:not(.cave-flight-page) .next_level_card {
    margin: 5px 0 !important;
    padding: 7px 10px !important;
    border-radius: 11px !important;
  }

  body:not(.cave-flight-page) .next_level_card small {
    font-size: 8px !important;
  }

  body:not(.cave-flight-page) .next_level_card #gate-next-name {
    margin-top: 1px !important;
    font-size: 0.95rem !important;
  }

  body:not(.cave-flight-page) .next_level_card p,
  body:not(.cave-flight-page) .result_rank_message {
    display: none !important;
  }

  body:not(.cave-flight-page) .run_result_panel .failed_message {
    margin: 5px 0 !important;
    font-size: 0.74rem !important;
    line-height: 1.12 !important;
  }

  body:not(.cave-flight-page) .complete_actions,
  body:not(.cave-flight-page) .failed_actions,
  body:not(.cave-flight-page) .run_result_panel .form-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 6px !important;
  }

  body:not(.cave-flight-page) .complete_button.primary,
  body:not(.cave-flight-page) .failed_button.primary {
    grid-column: auto !important;
  }

  body:not(.cave-flight-page) .complete_button,
  body:not(.cave-flight-page) .failed_button {
    min-height: 34px !important;
    padding: 5px 8px !important;
    border-radius: 11px !important;
    font-size: 0.76rem !important;
    line-height: 1.05 !important;
  }

  body:not(.cave-flight-page) .result_score_form {
    margin-top: 6px !important;
  }

  body:not(.cave-flight-page) .result_score_form label {
    margin-bottom: 5px !important;
  }

  body:not(.cave-flight-page) .result_score_form span {
    margin-bottom: 3px !important;
    font-size: 8px !important;
  }

  body:not(.cave-flight-page) .result_score_form input {
    min-height: 30px !important;
    padding: 6px 9px !important;
    border-radius: 10px !important;
  }
}

html.sling-orientation-locked,
body.sling-orientation-locked {
  overflow: hidden !important;
}

html.sling-orientation-locked .sling-orientation-overlay:not(.hidden),
body.sling-orientation-locked .sling-orientation-overlay:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex !important;
}

.sling-orientation-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: auto;
  background:
    radial-gradient(circle at 50% 24%, rgba(91, 255, 118, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(1, 20, 22, 0.88), rgba(0, 7, 10, 0.94));
  backdrop-filter: blur(8px);
}

.sling-orientation-card {
  width: min(330px, 88vw);
  padding: 22px 18px 20px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(5, 49, 48, 0.96), rgba(1, 16, 19, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(255, 179, 66, 0.22), transparent 58%);
  border: 2px solid rgba(87, 255, 99, 0.62);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 28px rgba(80, 255, 109, 0.22);
}

.sling-orientation-kicker {
  margin: 8px 0 5px;
  color: #7dff63;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sling-orientation-card h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 10vw, 2.45rem);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.62), 0 0 18px rgba(87, 255, 99, 0.22);
}

.sling-orientation-card p:last-child {
  margin: 12px auto 0;
  max-width: 260px;
  color: #eafdf1;
  font-weight: 850;
  line-height: 1.35;
}

.sling-orientation-phone {
  width: 82px;
  height: 82px;
  margin: 0 auto;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 179, 66, 0.22), rgba(10, 49, 48, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 24px rgba(255, 179, 66, 0.22);
}

.sling-orientation-phone span {
  width: 54px;
  height: 30px;
  border-radius: 9px;
  border: 4px solid #ffffff;
  background: linear-gradient(180deg, #123d40, #05191b);
  box-shadow: 0 0 0 3px rgba(255, 179, 66, 0.92), 0 0 18px rgba(255, 179, 66, 0.42);
  position: relative;
}

.sling-orientation-phone span::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

/* Slingshot phone landscape polish: compact menus and protect the playfield. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 700px) {
  body:not(.cave-flight-page) .app-shell,
  body:not(.cave-flight-page) .hero-panel,
  body:not(.cave-flight-page) .game-card,
  body:not(.cave-flight-page) .game-frame {
    width: 100vw !important;
    height: 100svh !important;
    height: 100dvh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .game-frame canvas {
    width: 100vw !important;
    height: 100svh !important;
    height: 100dvh !important;
    display: block !important;
  }

  body:not(.cave-flight-page) .game-frame::before,
  body:not(.cave-flight-page) .game-frame::after {
    display: none !important;
  }

  body:not(.cave-flight-page) .hud-strip {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 42px !important;
    padding: 3px max(6px, env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
    gap: 5px !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body:not(.cave-flight-page) .hud-pill {
    width: auto !important;
    min-width: 58px !important;
    min-height: 32px !important;
    padding: 3px 6px !important;
    border-radius: 9px !important;
  }

  body:not(.cave-flight-page) .hud-pill span {
    font-size: 0.42rem !important;
    letter-spacing: 0.07em !important;
  }

  body:not(.cave-flight-page) .hud-pill strong {
    margin-top: 0 !important;
    font-size: 0.76rem !important;
    line-height: 1 !important;
  }

  body:not(.cave-flight-page) #pause-btn.pause-btn-pill {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 12px !important;
  }

  body:not(.cave-flight-page) #pause-btn.pause-btn-pill .pause-icon,
  body:not(.cave-flight-page) #pause-btn.pause-btn-pill svg {
    width: 16px !important;
    height: 18px !important;
  }

  body:not(.cave-flight-page) .projectile-indicator {
    top: max(5px, env(safe-area-inset-top)) !important;
    left: max(5px, env(safe-area-inset-left)) !important;
    right: auto !important;
    width: min(178px, 24vw) !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 5px !important;
    padding: 5px !important;
    border-radius: 12px !important;
  }

  body:not(.cave-flight-page) .projectile-kicker,
  body:not(.cave-flight-page) .projectile-next span {
    font-size: 0.44rem !important;
    letter-spacing: 0.07em !important;
  }

  body:not(.cave-flight-page) .projectile-current strong,
  body:not(.cave-flight-page) .projectile-next strong {
    margin-top: 1px !important;
    font-size: 0.78rem !important;
    line-height: 0.95 !important;
  }

  body:not(.cave-flight-page) .projectile-current small,
  body:not(.cave-flight-page) .projectile-order {
    display: none !important;
  }

  body:not(.cave-flight-page) .projectile-next {
    min-width: 48px !important;
    padding: 4px 5px !important;
    border-radius: 9px !important;
  }

  body:not(.cave-flight-page) .targets-left {
    top: max(5px, env(safe-area-inset-top)) !important;
    right: max(7px, env(safe-area-inset-right)) !important;
    min-height: 30px !important;
    padding: 6px 12px !important;
    border-radius: 11px !important;
    font-size: 0.74rem !important;
  }

  body:not(.cave-flight-page) .level-select-overlay {
    background:
      radial-gradient(circle at 50% 8%, rgba(92, 255, 98, 0.18), transparent 34%),
      linear-gradient(180deg, rgba(4, 36, 34, 0.98), rgba(1, 14, 17, 0.99)) !important;
  }

  body:not(.cave-flight-page) .level-select-bg {
    opacity: 0.26 !important;
    filter: saturate(0.92) brightness(0.72) blur(1px) !important;
    object-fit: cover !important;
  }

  body:not(.cave-flight-page) .level-select-overlay::before {
    content: "CHOOSE LEVEL";
    position: absolute;
    z-index: 2;
    left: 50%;
    top: max(7px, env(safe-area-inset-top));
    transform: translateX(-50%);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 7vh, 2rem);
    font-weight: 1000;
    line-height: 0.9;
    text-transform: uppercase;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.64), 0 0 16px rgba(91, 255, 118, 0.25);
    pointer-events: none;
    white-space: nowrap;
  }

  body:not(.cave-flight-page) .level-select-overlay::after {
    content: "Complete levels to unlock more";
    position: absolute;
    z-index: 2;
    left: 50%;
    top: calc(max(7px, env(safe-area-inset-top)) + 32px);
    transform: translateX(-50%);
    color: #bfffd0;
    font-size: clamp(0.62rem, 2.5vh, 0.82rem);
    font-weight: 900;
    pointer-events: none;
    white-space: nowrap;
  }

  body:not(.cave-flight-page) .level-back-btn-hot {
    left: max(8px, env(safe-area-inset-left)) !important;
    top: max(7px, env(safe-area-inset-top)) !important;
    width: 64px !important;
    height: 32px !important;
    min-width: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #ffbd45, #ff7b00) !important;
    border: 2px solid rgba(255, 233, 151, 0.95) !important;
    box-shadow: 0 4px 0 #9d4200, 0 0 16px rgba(255, 138, 0, 0.35) !important;
  }

  body:not(.cave-flight-page) .level-back-btn-hot::before {
    content: "Back";
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 1000;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.38);
  }

  body:not(.cave-flight-page) .level-select-grid {
    z-index: 2 !important;
    left: 50% !important;
    top: max(56px, calc(env(safe-area-inset-top) + 50px)) !important;
    width: min(570px, calc(100vw - 118px)) !important;
    height: calc(100% - max(66px, calc(env(safe-area-inset-top) + 60px)) - max(8px, env(safe-area-inset-bottom))) !important;
    transform: translateX(-50%) !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px 7px !important;
    padding: 0 !important;
  }

  body:not(.cave-flight-page) .level-card {
    min-height: 0 !important;
    border-radius: 10px !important;
    border-width: 1.5px !important;
  }

  body:not(.cave-flight-page) .level-card::before {
    inset: 3px !important;
    border-radius: 7px !important;
  }

  body:not(.cave-flight-page) .level-card strong {
    font-size: clamp(1rem, 5.2vh, 1.42rem) !important;
    line-height: 0.85 !important;
  }

  body:not(.cave-flight-page) .level-lock {
    width: clamp(11px, 3.2vh, 14px) !important;
    height: clamp(11px, 3.2vh, 14px) !important;
  }

  body:not(.cave-flight-page) .pause-panel {
    align-items: center !important;
    justify-content: center !important;
    padding: max(5px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .pause-menu {
    width: min(350px, calc(100vw - 22px)) !important;
    max-height: calc(100svh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    padding: 10px 12px !important;
    border-radius: 17px !important;
    overflow: hidden !important;
  }

  body:not(.cave-flight-page) .pause-kicker {
    margin-bottom: 3px !important;
    font-size: clamp(0.5rem, 2.4vh, 0.64rem) !important;
    letter-spacing: 0.09em !important;
  }

  body:not(.cave-flight-page) .pause-menu h2 {
    font-size: clamp(1.45rem, 7vh, 2rem) !important;
    line-height: 0.88 !important;
  }

  body:not(.cave-flight-page) .pause-menu-actions {
    gap: 5px !important;
    margin-top: 8px !important;
  }

  body:not(.cave-flight-page) .pause-menu-button {
    min-height: 31px !important;
    padding: 4px 9px !important;
    border-radius: 10px !important;
    font-size: clamp(0.72rem, 3.1vh, 0.84rem) !important;
    line-height: 1 !important;
  }

  body:not(.cave-flight-page) .pause-menu-button.primary {
    min-height: 34px !important;
  }
}
