* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #070a14;
  --obsidian: #0c1020;
  --panel: #12182d;
  --cyan: #64f4ff;
  --gold: #f5cf54;
  --gold-bright: #ffe67a;
  --crimson: #e83b54;
  --text: #f3f6fc;
  --muted: #98abc9;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: radial-gradient(circle at 50% 20%, #121830 0%, #05070e 82%);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Full-bleed responsive 16:9 Cinema Frame */
#arcade-shell {
  position: relative;
  width: min(98vw, calc(96vh * 16 / 9));
  aspect-ratio: 16 / 9;
  display: flex;
}

.stage-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.82);
  background: #080b16;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Falling Duo Rain Layer sits strictly BEHIND modals */
.duo-rain-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 8;
}

.falling-duo {
  position: absolute;
  top: -54px;
  width: 42px;
  height: 42px;
  background-image: url("assets/sprites/mediastorm_props.png?v=6");
  background-size: 336px 42px;
  background-position: 0 0;
  image-rendering: pixelated;
  animation: duoFall linear forwards;
  filter: drop-shadow(0 4px 10px rgba(255, 225, 69, 0.45));
}

@keyframes duoFall {
  0% { transform: translateY(0) rotate(0deg) scale(0.85); opacity: 0.9; }
  85% { opacity: 0.85; }
  100% { transform: translateY(620px) rotate(360deg) scale(1.0); opacity: 0; }
}

/* Whisper-quiet Monochrome SVG Studio Utility Bar (bottom-right) */
.float-tools {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  gap: 5px;
  z-index: 20;
  opacity: 0.38;
  transition: opacity 0.18s ease;
}

.float-tools:hover {
  opacity: 1;
}

.tool-dot {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 14, 28, 0.84);
  color: #dce6fa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.tool-dot:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  color: #ffffff;
}

.tool-dot.active {
  background: var(--cyan);
  color: #091020;
  border-color: #ffffff;
}

.tool-dot.muted {
  color: #ff6b81;
  border-color: rgba(255, 107, 129, 0.55);
}

.tool-dot.muted .vol-wave {
  opacity: 0.18;
}

.tool-dot.accent {
  border-color: rgba(245, 207, 84, 0.55);
  color: var(--gold);
}

/* Compact Popover Controls Guide */
.help-popover {
  position: absolute;
  right: 12px;
  bottom: 46px;
  background: rgba(11, 15, 30, 0.96);
  border: 1.5px solid rgba(245, 207, 84, 0.45);
  border-radius: 6px;
  padding: 12px 14px;
  z-index: 24;
  display: none;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
}

.help-popover.open {
  display: flex;
}

.help-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 5px;
  margin-bottom: 2px;
}

.help-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e4ecff;
}

.help-row span {
  color: var(--muted);
}

kbd {
  display: inline-block;
  background: #1b2340;
  color: var(--gold-bright);
  border: 1px solid rgba(245, 207, 84, 0.35);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-family: "Courier New", monospace;
  font-weight: 800;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 12;
}

.overlay.visible {
  display: flex;
}

.overlay.modal-backdrop {
  background: rgba(5, 8, 18, 0.56);
  backdrop-filter: blur(3px);
  padding: 20px;
}

/* Minimal Cinema Loading Screen */
.loading-box {
  background: rgba(10, 14, 28, 0.95);
  border: 1.5px solid rgba(245, 207, 84, 0.35);
  border-radius: 6px;
  padding: 26px 34px;
  text-align: center;
  width: min(340px, 84%);
}

.loading-kicker {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 4px;
}

.loading-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--gold-bright);
}

.progress-track {
  margin: 14px 0 8px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  transition: width 0.15s ease;
}

#load-text {
  font-size: 11px;
  font-family: "Courier New", monospace;
  color: var(--muted);
}

/* =====================================================================
   FULL-BLEED CONSOLE-INDIE TITLE SCREEN (Zero blurry dark web card!)
   ===================================================================== */
.overlay.title-mode {
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 18px 34px 12px;
}

.title-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(6, 10, 24, 0.92), 0 1px 0 #0a0d1c;
}

.arcade-stamp {
  color: rgba(235, 244, 255, 0.88);
}

.arcade-score {
  color: #dce6fa;
}

.arcade-score strong {
  color: var(--gold-bright);
  margin-left: 6px;
}

.title-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 16px;
  margin: auto 0;
  padding: 0 10px;
}

.title-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.title-logo-img {
  display: block;
  width: min(410px, 95%);
  height: auto;
  margin-left: -8px;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 22px rgba(6, 10, 26, 0.72));
  animation: logoFloat 3.4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.title-tagline {
  margin: 6px 0 20px 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(5, 8, 22, 0.95), 0 1px 0 #0a0e20;
}

/* Crisp Nintendo/Arcade Command Menu */
.arcade-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(290px, 90%);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 5px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.menu-btn.primary {
  padding: 12px 26px;
  font-size: 16px;
  letter-spacing: 2px;
  color: #141022;
  background: linear-gradient(180deg, #ffed78 0%, #f0b229 100%);
  border: 2px solid #181326;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 4px 0 #8a5009, 0 12px 26px rgba(0, 0, 0, 0.45);
}

.menu-btn.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.menu-btn.primary:active {
  transform: translateY(1px);
}

.menu-caret {
  font-size: 12px;
  animation: caretPulse 1.1s ease-in-out infinite;
}

@keyframes caretPulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

.menu-subrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.menu-btn.secondary {
  padding: 9px 14px;
  font-size: 13px;
  letter-spacing: 1px;
  color: #f0f5ff;
  background: rgba(11, 16, 34, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 3px 0 rgba(6, 9, 20, 0.9), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.menu-btn.secondary:hover,
.menu-btn.secondary.open {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  background: rgba(16, 23, 46, 0.94);
  transform: translateY(-1px);
}

/* Collapsible Stage Drawer (hidden until "关卡选择" is clicked!) */
.stage-drawer {
  margin-top: 10px;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(10, 14, 28, 0.9);
  border: 1.5px solid rgba(245, 207, 84, 0.45);
  border-radius: 5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  max-width: 440px;
}

.stage-drawer.open {
  display: flex;
}

.stage-chip {
  background: rgba(28, 36, 66, 0.9);
  color: #e2ecff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.stage-chip:hover {
  background: var(--gold);
  color: #131120;
  border-color: var(--gold-bright);
}

.stage-chip.boss {
  border-color: rgba(232, 59, 84, 0.65);
  color: #ff9eac;
}

.stage-chip.boss:hover {
  background: var(--crimson);
  color: #ffffff;
}

.title-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-art {
  width: 100%;
  max-width: 310px;
  image-rendering: pixelated;
  filter: drop-shadow(0 16px 26px rgba(6, 10, 24, 0.65));
  animation: heroFloat 2.8s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-0.8deg); }
  50% { transform: translateY(-7px) rotate(0.8deg); }
}

.title-bottom-hint {
  text-align: center;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(240, 245, 255, 0.92);
  text-shadow: 0 1px 4px rgba(5, 8, 20, 0.95);
  margin-bottom: 2px;
  animation: hintBlink 2.2s ease-in-out infinite;
}

@keyframes hintBlink {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.45; }
}

/* =====================================================================
   COLLECTOR-CARD VICTORY & GAME OVER MODALS (Cohesive Console Cinema UI)
   ===================================================================== */
.collector-card {
  background: #0b0f1e;
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 18px 24px 20px;
  text-align: center;
  width: min(550px, 90%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: duoSlamIn 0.34s cubic-bezier(0.16, 1.2, 0.36, 1) both;
}

.collector-card.caught {
  border-color: var(--crimson);
}

@keyframes duoSlamIn {
  0% { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.card-header-tag {
  display: inline-block;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--gold);
  margin-bottom: 10px;
}

.collector-card.caught .card-header-tag {
  color: #ff7a8f;
}

.splash-frame {
  display: inline-block;
  padding: 4px;
  background: #141b33;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  margin-bottom: 12px;
}

.tim-duo-splash {
  width: min(360px, 74vw);
  max-height: 204px;
  object-fit: contain;
  border-radius: 3px;
  image-rendering: pixelated;
  display: block;
}

.splash-quote {
  font-size: clamp(15.5px, 2.1vw, 19px);
  font-weight: 900;
  color: var(--gold-bright);
  line-height: 1.38;
  margin-bottom: 6px;
}

.splash-sub {
  font-size: 12.5px;
  color: #c2d2ee;
  margin: 0 auto 14px;
  max-width: 470px;
  line-height: 1.5;
}

.mini-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 9px 14px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-item span {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.stat-item strong {
  color: #ffffff;
  font-size: 15px;
  font-family: "Courier New", "Microsoft YaHei", monospace;
}

.stat-item strong.rank-text {
  color: var(--gold-bright);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cta-row.center {
  justify-content: center;
}

.action-btn {
  border-radius: 4px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease, background 0.12s ease;
}

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

.action-btn.gold {
  background: linear-gradient(180deg, #ffea74 0%, #eab02a 100%);
  color: #141022;
  border: 1.5px solid #181326;
  box-shadow: 0 3px 0 #8a5009;
}

.action-btn.accent {
  background: #232d54;
  color: var(--gold-bright);
  border: 1.5px solid var(--gold);
}

.action-btn.accent:hover {
  background: #2e3b6d;
}

.action-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #d2def5;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.action-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* =====================================================================
   PRO STUDIO DIRECTOR CONSOLE DRAWER (F9)
   ===================================================================== */
.director-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 46px;
  width: 244px;
  background: rgba(11, 15, 29, 0.96);
  border: 1.5px solid rgba(245, 207, 84, 0.45);
  border-radius: 6px;
  padding: 12px;
  z-index: 25;
  overflow-y: auto;
  transform: translateX(280px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.director-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.dir-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
}

.icon-close {
  background: none;
  border: none;
  color: #c2d0ea;
  font-size: 14px;
  cursor: pointer;
}

.icon-close:hover {
  color: #ffffff;
}

.dir-section {
  margin-bottom: 12px;
}

.dir-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.dir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.dir-btn {
  background: #1a223d;
  color: #e6eefc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 6px 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dir-btn:hover {
  border-color: var(--gold);
}

.dir-btn.active {
  background: var(--gold);
  color: #111424;
  border-color: var(--gold-bright);
}

.dir-btn.hot {
  background: rgba(232, 59, 84, 0.16);
  border-color: rgba(232, 59, 84, 0.55);
  color: #ffb8c3;
}

.dir-btn.hot:hover {
  background: rgba(232, 59, 84, 0.28);
}

.dir-btn.full {
  grid-column: 1 / -1;
}

.dir-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3.5px 0;
  cursor: pointer;
  color: #dce6fa;
}


/* =====================================================================
   ERGONOMIC DUAL-MODE MOBILE TOUCH DECK (Hidden on pure desktop!)
   ===================================================================== */
.touch-deck {
  display: none;
  touch-action: none;
}

.touch-portrait-bar {
  display: none;
}

.touch-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 18px;
}

.touch-left-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.touch-dpad {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(11, 16, 34, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
}

.tpad-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(25, 34, 66, 0.88);
  color: #f4f7ff;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  transition: transform 0.06s ease, background 0.08s ease, border-color 0.08s ease;
}

.tpad-btn.pressed {
  transform: scale(0.92);
  background: var(--cyan);
  color: #081022;
  border-color: #ffffff;
}

.tact-mini {
  padding: 6px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: rgba(14, 20, 42, 0.76);
  color: #c8d6f2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  touch-action: none;
}

.tact-mini.pressed {
  background: var(--gold);
  color: #141022;
  border-color: #ffffff;
}

.touch-right-zone {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
}

.touch-aux-col,
.touch-main-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tact-btn {
  border-radius: 50%;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  cursor: pointer;
  touch-action: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transition: transform 0.06s ease, filter 0.08s ease;
}

.tact-btn.pressed {
  transform: scale(0.90);
  filter: brightness(1.18);
}

.tact-btn.jump {
  width: 74px;
  height: 74px;
  font-size: 18px;
  color: #141022;
  background: linear-gradient(180deg, #ffed78 0%, #eab02a 100%);
  border: 2.5px solid #ffffff;
}

.tact-btn.dash {
  width: 58px;
  height: 58px;
  font-size: 14px;
  color: #061322;
  background: linear-gradient(180deg, #98fbff 0%, #36d5ff 100%);
  border: 2px solid #ffffff;
}

.tact-btn.gadget {
  width: 60px;
  height: 60px;
  font-size: 13px;
  color: #fff6dc;
  background: rgba(24, 30, 62, 0.90);
  border: 2px solid var(--gold);
}

.tact-btn.burst {
  width: 48px;
  height: 48px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(14, 18, 38, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  opacity: 0.45;
}

.tact-btn.burst.ready {
  opacity: 1;
  color: #071222;
  background: linear-gradient(180deg, #ffe875 0%, #64f4ff 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 18px rgba(100, 244, 255, 0.75);
}

/* =====================================================================
   MOBILE PORTRAIT: HANDHELD CONSOLE MODE (16:9 Screen Top + Pad Bottom!)
   ===================================================================== */
@media (max-width: 900px) and (orientation: portrait) {
  body {
    align-items: stretch;
    justify-content: flex-start;
    background: #070a14;
  }

  #arcade-shell {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    flex-direction: column;
  }

  .stage-frame {
    width: 100vw;
    height: auto;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  }

  .touch-deck {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #0d1224 0%, #070a15 100%);
    padding: 12px 10px max(22px, env(safe-area-inset-bottom));
  }

  .touch-portrait-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
  }

  .touch-brand {
    color: var(--gold);
    letter-spacing: 1px;
  }

  .touch-tip {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    padding: 3px 9px;
    border-radius: 999px;
  }

  .touch-controls-row {
    margin: auto 0;
    padding: 0 10px;
  }

  /* Compact Portrait Title Screen inside 16:9 Top Stage */
  .overlay.title-mode { padding: 8px 14px 6px; }
  .title-topbar { font-size: 10px; letter-spacing: 1px; }
  .title-hero-grid { grid-template-columns: 1.25fr 0.75fr; gap: 6px; padding: 0; }
  .title-logo-img { width: 88%; margin-left: -4px; }
  .title-tagline { font-size: 11px; margin: 2px 0 8px 2px; }
  .arcade-menu { width: 100%; max-width: 210px; gap: 5px; }
  .menu-btn.primary { padding: 7px 14px; font-size: 13px; }
  .menu-btn.secondary { padding: 6px 8px; font-size: 11px; }
  .title-bottom-hint { display: none; }
  .hero-art { max-width: 145px; }
  .stage-drawer { max-width: 100%; padding: 5px 6px; gap: 4px; }
  .stage-chip { padding: 3px 7px; font-size: 10px; }

  /* Portrait Modals: break free onto full screen so Tim iPhone Duo card is spacious & crystal clear! */
  .overlay.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    padding: 16px;
    background: rgba(5, 8, 18, 0.84);
  }
  .collector-card {
    width: min(420px, 94vw);
    max-height: 90dvh;
    overflow-y: auto;
    padding: 16px 18px 18px;
  }
  .tim-duo-splash { max-height: 170px; }
}

/* =====================================================================
   MOBILE LANDSCAPE & TOUCH TABLET: FULLSCREEN + TRANSLUCENT FLOATING PAD
   ===================================================================== */
@media (pointer: coarse) and (orientation: landscape), (max-height: 540px) and (orientation: landscape) {
  body {
    background: #05070e;
  }

  #arcade-shell {
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
    aspect-ratio: 16 / 9;
  }

  .stage-frame {
    border-radius: 0;
    border: none;
  }

  body.mode-playing .touch-deck {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    align-items: flex-end;
    padding: 0 max(14px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
  }

  .touch-controls-row {
    align-items: flex-end;
    padding: 0 6px;
  }

  .touch-dpad {
    background: rgba(10, 14, 28, 0.45);
    padding: 6px;
    gap: 10px;
  }

  .tpad-btn { width: 54px; height: 54px; font-size: 20px; opacity: 0.82; }
  .tact-btn.jump { width: 64px; height: 64px; font-size: 16px; opacity: 0.84; }
  .tact-btn.dash { width: 52px; height: 52px; font-size: 13px; opacity: 0.84; }
  .tact-btn.gadget { width: 54px; height: 54px; font-size: 12px; opacity: 0.84; }
  .tact-btn.burst { width: 44px; height: 44px; font-size: 12px; }
  .tact-mini { padding: 4px 14px; font-size: 11px; opacity: 0.78; }

  .float-tools {
    top: auto;
    bottom: 6px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) scale(0.86);
    opacity: 0.45;
  }
  .overlay.title-mode { padding: 10px 22px 8px; }
  .title-logo-img { width: min(320px, 84%); }
  .title-tagline { font-size: 12px; margin: 4px 0 10px 2px; }
  .menu-btn.primary { padding: 9px 18px; font-size: 14px; }
  .menu-btn.secondary { padding: 7px 10px; font-size: 12px; }
  .hero-art { max-width: 220px; }
  .collector-card { max-height: 92dvh; overflow-y: auto; padding: 12px 18px; }
  .tim-duo-splash { max-height: 126px; }
}
