/* ==========================================================================
   RIFF BLAST - Arcade Acrylic Shared Components, In-Game HUD & Modals
   Consumes CSS custom properties from webapp/theme.css.
   Main Menu (#screen-main-menu) rules live in webapp/menu.css.
   ========================================================================== */

:root {
  /* Typography & Layout Tokens (from theme.css) */
  --font-rounded: var(--font-ui);

  /* Shared Tactile Acrylic 3D Button Palette (mapped to theme.css) */
  --accent-orange: var(--arcade-orange);
  --accent-orange-lip: #881337;
  --accent-mint: var(--arcade-green);
  --accent-mint-lip: var(--arcade-green-deep);
  --accent-teal: var(--arcade-cyan);
  --accent-teal-lip: var(--arcade-cyan-deep);
  --accent-gold: var(--arcade-gold);
  --accent-gold-lip: var(--arcade-gold-deep);
  --accent-blue: var(--arcade-sky);
  --accent-blue-lip: #172554;
  --accent-navy: #20285e;
  --accent-navy-lip: #080b28;
  --accent-coral: var(--arcade-pink);
  --accent-coral-lip: var(--arcade-pink-deep);
  --accent-danger: #f43f5e;

  /* Default Theme Tokens: Arcade Acrylic (Style C) */
  --bg-page: var(--bg-space-deep);
  --bg-glow: var(--bg-gradient);
  --board-bg: rgba(9, 13, 44, 0.9);
  --board-frame: var(--arcade-cyan);
  --board-frame-glow:
    0 0 0 2px rgba(251, 191, 36, 0.42),
    0 0 26px var(--arcade-cyan-glow),
    0 0 42px rgba(139, 92, 246, 0.28),
    0 16px 36px rgba(4, 6, 26, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 18px rgba(34, 211, 238, 0.16);
  --grid-line: rgba(56, 189, 248, 0.22);
  --text-primary: var(--text-ink);
  --text-muted: var(--text-sub);
  --score-color: #ffffff;
  --score-glow: var(--title-text-shadow);
  --surface-card: var(--glass-bg);
  --surface-card-border: var(--glass-border-cyan);
  --surface-well: var(--glass-well-bg);
  --surface-well-border: rgba(34, 211, 238, 0.48);
  --bar-bg: rgba(10, 13, 44, 0.92);
  --streak-accent: var(--arcade-pink);
  --streak-accent-2: var(--arcade-gold);
}

/* STYLE A (?debug preview): Stadium Pyro & Neon Rock */
body[data-mockup-style="style-a"] {
  --bg-page: #0b0914;
  --bg-glow:
    radial-gradient(circle at 20% 12%, rgba(255, 46, 126, 0.34) 0%, transparent 45%),
    radial-gradient(circle at 85% 22%, rgba(0, 229, 255, 0.22) 0%, transparent 44%),
    radial-gradient(circle at 50% 90%, rgba(255, 190, 46, 0.14) 0%, transparent 50%),
    linear-gradient(180deg, #120e24 0%, #090710 100%);
  --bg-gradient: var(--bg-glow);
  --board-bg: #120f21;
  --board-frame: #ff2e7e;
  --board-frame-glow: 0 0 26px rgba(255, 46, 126, 0.38), 0 12px 30px rgba(0, 0, 0, 0.7);
  --grid-line: rgba(255, 255, 255, 0.08);
  --text-primary: #fff9f0;
  --text-muted: #c2b8e0;
  --score-color: #fff7d6;
  --score-glow: 0 3px 0 #5c122d, 0 0 20px rgba(255, 190, 46, 0.55);
  --surface-card: rgba(25, 19, 46, 0.9);
  --surface-card-border: rgba(255, 190, 46, 0.42);
  --surface-well: #151029;
  --surface-well-border: rgba(0, 229, 255, 0.35);
  --bar-bg: rgba(13, 10, 24, 0.92);
  --accent-orange: #ff5526;
  --accent-orange-lip: #9e2605;
  --accent-navy: #243252;
  --accent-navy-lip: #11182a;
  --streak-accent: #ff2e7e;
  --streak-accent-2: #ffbe2e;
}

/* STYLE B (?debug preview): Brushed Chrome & Heavy Metal */
body[data-mockup-style="style-b"] {
  --bg-page: #10141b;
  --bg-glow:
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 2px,
      transparent 2px,
      transparent 7px
    ),
    radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.18) 0%, transparent 52%),
    linear-gradient(180deg, #212834 0%, #0e1219 100%);
  --bg-gradient: var(--bg-glow);
  --board-bg: #0b0f15;
  --board-frame: #94a3b8;
  --board-frame-glow: 0 0 22px rgba(56, 189, 248, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 32px rgba(0, 0, 0, 0.72);
  --grid-line: rgba(148, 163, 184, 0.14);
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --score-color: #38bdf8;
  --score-glow: 0 2px 0 #082f49, 0 0 18px rgba(56, 189, 248, 0.55);
  --surface-card: linear-gradient(180deg, #27303f 0%, #19202b 100%);
  --surface-card-border: #64748b;
  --surface-well: #11161f;
  --surface-well-border: #475569;
  --bar-bg: rgba(16, 21, 29, 0.94);
  --accent-orange: #38bdf8;
  --accent-orange-lip: #0369a1;
  --accent-navy: #334155;
  --accent-navy-lip: #1e293b;
  --streak-accent: #38bdf8;
  --streak-accent-2: #e2e8f0;
}

/* STYLE C (Locked Production Default): Arcade Acrylic */
body[data-mockup-style="style-c"] {
  --bg-page: var(--bg-space-deep);
  --bg-glow: var(--bg-gradient);
  --board-bg: rgba(9, 13, 44, 0.9);
  --board-frame: var(--arcade-cyan);
  --board-frame-glow:
    0 0 0 2px rgba(251, 191, 36, 0.42),
    0 0 26px var(--arcade-cyan-glow),
    0 0 42px rgba(139, 92, 246, 0.28),
    0 16px 36px rgba(4, 6, 26, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 18px rgba(34, 211, 238, 0.16);
  --grid-line: rgba(56, 189, 248, 0.22);
  --text-primary: var(--text-ink);
  --text-muted: var(--text-sub);
  --score-color: #ffffff;
  --score-glow: var(--title-text-shadow);
  --surface-card: var(--glass-bg);
  --surface-card-border: var(--glass-border-cyan);
  --surface-well: var(--glass-well-bg);
  --surface-well-border: rgba(34, 211, 238, 0.48);
  --bar-bg: rgba(10, 13, 44, 0.92);
  --streak-accent: var(--arcade-pink);
  --streak-accent-2: var(--arcade-gold);
}

body[data-mockup-style="style-c"] .streak-combo-bar {
  box-shadow: var(--glass-glow-cyan), inset 0 2px 0 rgba(255, 255, 255, 0.22);
}

body[data-mockup-style="style-c"] .tray-slot {
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), inset 0 0 12px rgba(34, 211, 238, 0.14);
}

/* Lv.532 Mint Preset Override (when playing Mint 532 mode) */
body.mode-mint532[data-screen="game"] {
  --bg-page: #ccfbf1;
  --bg-glow: linear-gradient(180deg, #d3fff5 0%, #c3f8eb 100%);
  --board-bg: #ebfffa;
  --board-frame: #7fb2aa;
  --board-frame-glow: 0 10px 26px rgba(25, 99, 78, 0.18);
  --grid-line: #cde8e1;
  --text-primary: #14332c;
  --text-muted: #3a695f;
  --score-color: #14332c;
  --score-glow: 0 2px 0 rgba(255, 255, 255, 0.6);
  --surface-card: #ffffff;
  --surface-card-border: #8cc4b9;
  --surface-well: #d9f7ee;
  --surface-well-border: #8cc4b9;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-page);
  background-image: var(--bg-glow);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-weight: 800;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  flex-direction: column;
  transition: background-color 220ms ease;
}

/* ================= SHARED ARCADE ACRYLIC 3D PILL BUTTONS ================= */
.btn-3d {
  position: relative;
  --btn-bg: var(--grad-glass-neutral);
  --btn-lip: var(--accent-navy-lip);
  --btn-rim: var(--arcade-cyan);
  --btn-glow: rgba(34, 211, 238, 0.32);
  --btn-fg: var(--text-ink);
  min-height: 68px;
  min-width: 68px;
  padding: 8px 18px;
  border: 2px solid var(--btn-rim);
  border-radius: 24px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(6, 9, 34, 0.72);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow:
    0 8px 0 var(--btn-lip),
    0 0 18px var(--btn-glow),
    0 12px 22px rgba(4, 6, 26, 0.55),
    inset 0 4px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 0 rgba(4, 6, 26, 0.28);
  transition:
    transform 120ms var(--ease-spring),
    box-shadow 120ms var(--ease-spring),
    filter 120ms ease;
}

/* Glossy top acrylic highlight band on non-menu controls (menu.css uses .acrylic-gloss) */
#screen-in-game .btn-3d,
#modal-card .btn-3d,
.mockup-bar .btn-3d {
  overflow: hidden;
}

#screen-in-game .btn-3d::before,
#modal-card .btn-3d::before,
.mockup-bar .btn-3d::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 6%;
  right: 6%;
  height: 46%;
  border-radius: var(--radius-pill);
  background: var(--acrylic-top-gloss);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

#screen-in-game .btn-3d > *,
#modal-card .btn-3d > *,
.mockup-bar .btn-3d > * {
  position: relative;
  z-index: 1;
}

.btn-3d:hover {
  filter: brightness(1.08);
}

.btn-3d:active {
  transform: translateY(6px) scale(0.96);
  filter: brightness(1.22);
  box-shadow:
    0 2px 0 var(--btn-lip),
    0 0 26px var(--btn-glow),
    0 4px 10px rgba(4, 6, 26, 0.42),
    inset 0 4px 0 rgba(255, 255, 255, 0.52);
}

/* Primary CTA: Orange -> Hot Pink */
.btn-3d.btn-orange {
  --btn-bg: var(--grad-cta-play);
  --btn-lip: #881337;
  --btn-rim: var(--arcade-gold-bright);
  --btn-glow: var(--arcade-orange-glow);
  --btn-fg: #ffffff;
}

/* Secondary CTA: Cyan -> Blue */
.btn-3d.btn-teal {
  --btn-bg: var(--grad-cta-resume);
  --btn-lip: #1e3a8a;
  --btn-rim: var(--arcade-purple-bright);
  --btn-glow: var(--arcade-cyan-glow);
  --btn-fg: #ffffff;
}

/* Emerald Green */
.btn-3d.btn-mint {
  --btn-bg: var(--grad-cta-modes);
  --btn-lip: #14532d;
  --btn-rim: var(--arcade-purple-bright);
  --btn-glow: var(--arcade-green-glow);
  --btn-fg: #ffffff;
}

/* Gold */
.btn-3d.btn-gold {
  --btn-bg: linear-gradient(180deg, var(--block-gold-hi) 0%, var(--arcade-gold) 48%, var(--arcade-gold-deep) 100%);
  --btn-lip: #78350f;
  --btn-rim: var(--arcade-gold-bright);
  --btn-glow: var(--arcade-gold-glow);
  --btn-fg: #2b1700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* Sky -> Blue */
.btn-3d.btn-blue {
  --btn-bg: var(--grad-cta-ranks);
  --btn-lip: #172554;
  --btn-rim: var(--arcade-cyan);
  --btn-glow: rgba(56, 189, 248, 0.5);
  --btn-fg: #ffffff;
}

/* Hot Pink -> Purple */
.btn-3d.btn-coral {
  --btn-bg: linear-gradient(135deg, var(--arcade-pink) 0%, var(--arcade-purple) 100%);
  --btn-lip: var(--arcade-pink-deep);
  --btn-rim: var(--arcade-gold);
  --btn-glow: var(--arcade-pink-glow);
  --btn-fg: #ffffff;
}

/* Neutral Translucent Dark Glass */
.btn-3d.btn-navy {
  --btn-bg: var(--grad-glass-neutral);
  --btn-lip: #070a28;
  --btn-rim: rgba(34, 211, 238, 0.62);
  --btn-glow: rgba(34, 211, 238, 0.28);
  --btn-fg: var(--text-ink);
}

.btn-3d svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.btn-icon-only {
  width: 68px;
  padding: 0;
}

.btn-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.art-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
  pointer-events: none;
}

.btn-svg .art-icon-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating 3-Style Mockup Preview Switcher Bar (hidden in production; ?debug / ?mockup) */
.mockup-bar {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(4px, var(--safe-top)) 6px 8px 6px;
  background: var(--bar-bg);
  border-bottom: 2px solid var(--surface-card-border);
  box-shadow: 0 6px 20px rgba(4, 6, 26, 0.6);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 240;
}

.mockup-bar.debug-visible {
  display: flex;
}

.mockup-bar::-webkit-scrollbar {
  display: none;
}

.mockup-style-btn,
.mockup-nav-btn {
  flex: 1 0 68px;
  min-width: 68px;
  min-height: 68px;
  padding: 4px 6px;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.mockup-style-btn[data-style="style-a"],
.mockup-style-btn[data-style="vfx-a"] {
  --btn-bg: linear-gradient(180deg, #3b1754 0%, #200b31 100%);
  --btn-lip: #12051d;
  --btn-rim: rgba(255, 138, 31, 0.6);
  --btn-glow: rgba(255, 61, 154, 0.3);
  --btn-fg: #ffe4f2;
}

.mockup-style-btn[data-style="style-b"],
.mockup-style-btn[data-style="vfx-b"] {
  --btn-bg: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  --btn-lip: #0f172a;
  --btn-rim: rgba(148, 163, 184, 0.65);
  --btn-glow: rgba(56, 189, 248, 0.25);
  --btn-fg: #e2e8f0;
}

.mockup-style-btn[data-style="style-c"],
.mockup-style-btn[data-style="vfx-c"] {
  --btn-bg: var(--grad-glass-neutral);
  --btn-lip: #070a28;
  --btn-rim: var(--arcade-cyan);
  --btn-glow: var(--arcade-cyan-glow);
  --btn-fg: #bae6fd;
}

.mockup-style-btn.is-selected {
  outline: 2px solid var(--arcade-gold-bright);
  outline-offset: -3px;
  --btn-bg: var(--grad-cta-play);
  --btn-lip: #881337;
  --btn-rim: var(--arcade-gold);
  --btn-glow: var(--arcade-pink-glow);
  --btn-fg: #ffffff;
}

body[data-block-style="vfx-b"] .mockup-style-btn.is-selected {
  outline-color: #e2e8f0;
  --btn-bg: var(--grad-cta-ranks);
  --btn-lip: #075985;
  --btn-rim: var(--arcade-sky);
  --btn-glow: var(--arcade-cyan-glow);
}

body[data-block-style="vfx-c"] .mockup-style-btn.is-selected {
  outline-color: #a5f3fc;
  --btn-bg: var(--grad-cta-resume);
  --btn-lip: #1e3a8a;
  --btn-rim: var(--arcade-cyan);
  --btn-glow: var(--arcade-cyan-glow);
}

.mockup-code {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.mockup-label {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.92;
  white-space: nowrap;
}

/* Main App Container */
.app-shell {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(10px, var(--safe-top)) max(12px, var(--safe-right)) max(8px, var(--safe-bottom)) max(12px, var(--safe-left));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.screen-main-menu[hidden],
.screen-in-game[hidden] {
  display: none !important;
}

/* Main Menu (#screen-main-menu) layout and visuals are owned by webapp/menu.css */

/* ================= SCREEN 2: IN-GAME HUD (25% TOP / 75% BOTTOM) ================= */
.screen-in-game {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

/* Top 25% Info Zone */
.hud-top-zone {
  flex: 0 1 25%;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.hud-bar {
  display: grid;
  grid-template-columns: 68px 1fr 68px;
  align-items: center;
  gap: 8px;
}

.hud-pause-btn {
  --btn-bg: var(--grad-glass-neutral);
  --btn-lip: #070a28;
  --btn-rim: var(--arcade-cyan);
  --btn-glow: var(--arcade-cyan-glow);
}

.hud-center-tracker {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.hud-top-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 100%;
}

.hud-mode-chip {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1.5px solid var(--surface-card-border);
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow:
    0 0 12px rgba(34, 211, 238, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Glossy Classic Best Crown Chip */
.classic-best-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: var(--glass-border-width) solid var(--glass-border-gold);
  box-shadow:
    0 0 14px rgba(251, 191, 36, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.crown-icon-wrap svg,
.crown-icon-wrap .art-icon-img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(251, 191, 36, 0.45));
}

.classic-best-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--text-gold);
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #451a03, 0 0 10px var(--arcade-gold-glow);
}

body.mode-mint532[data-screen="game"] .hud-mode-chip {
  background: var(--surface-card);
  border-color: var(--surface-card-border);
  color: var(--text-primary);
  box-shadow: 0 3px 10px rgba(20, 51, 44, 0.12);
}

body.mode-mint532[data-screen="game"] .classic-best-wrap {
  background: var(--surface-card);
  border-color: #d97706;
  box-shadow: 0 3px 10px rgba(20, 51, 44, 0.12);
}

body.mode-mint532[data-screen="game"] .classic-best-num {
  color: #b45309;
  text-shadow: none;
}

/* Dynamic Scaling Hero Score (Chunky Metallic/White Display Typography) */
.hero-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}

body.mode-mint532 .hero-score-row,
body.mode-adventure .hero-score-row {
  display: none;
}

.hero-score-value {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.4dvh, 52px);
  font-weight: 900;
  line-height: 0.96;
  color: var(--score-color);
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 2px var(--title-stroke-color);
  paint-order: stroke fill;
  text-shadow: var(--score-glow);
  letter-spacing: 0.01em;
  transition: transform 140ms var(--ease-spring), font-size 120ms ease;
}

.hero-score-value.digits-4 {
  font-size: clamp(29px, 4.7dvh, 44px);
}

.hero-score-value.digits-5plus {
  font-size: clamp(25px, 4dvh, 38px);
}

.hero-score-value.score-pop {
  animation: scoreBump 210ms var(--ease-spring);
}

body.mode-mint532[data-screen="game"] .hero-score-value {
  -webkit-text-stroke: 0;
}

.hud-audio-btn {
  flex-direction: column;
  gap: 1px;
  padding: 4px;
}

.audio-haptic-pip {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  opacity: 0.96;
}

/* Connected Score Progress Bar (Mint 532 & Adventure) */
.level-progress-wrap {
  display: none;
  align-items: center;
  width: 100%;
  max-width: 220px;
  position: relative;
  margin-top: 2px;
}

body.mode-mint532 .classic-best-wrap,
body.mode-adventure .classic-best-wrap {
  display: none;
}

body.mode-mint532 .level-progress-wrap,
body.mode-adventure .level-progress-wrap {
  display: flex;
}

.prog-badge-cur {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-cta-resume);
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 14px var(--arcade-cyan-glow), 0 3px 8px rgba(4, 6, 26, 0.45);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.prog-track {
  flex: 1;
  height: 18px;
  margin: 0 -8px;
  background: var(--surface-well);
  border: 2px solid var(--surface-well-border);
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 2px 6px rgba(4, 6, 26, 0.55);
}

.prog-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--arcade-cyan) 0%, var(--arcade-green) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: width 260ms var(--ease-spring);
}

.prog-badge-target {
  min-width: 40px;
  height: 40px;
  padding: 0 5px;
  border-radius: 50%;
  background: var(--surface-well);
  border: 2.5px solid var(--glass-border-gold);
  color: var(--text-gold);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35), 0 3px 8px rgba(4, 6, 26, 0.45);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Adventure Objective Banner */
.adventure-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-card);
  border: var(--glass-border-width) solid var(--surface-card-border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  box-shadow: var(--glass-glow-cyan);
  backdrop-filter: blur(8px);
}

.adventure-banner.visible {
  display: flex;
}

.adv-level-title {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text-primary);
}

.adv-level-sub {
  font-size: 9.5px;
  color: var(--text-muted);
}

.adv-goals {
  display: flex;
  align-items: center;
  gap: 5px;
}

.adv-goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-well);
  border: 1px solid var(--surface-well-border);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.adv-goal-chip.met {
  background: rgba(34, 197, 94, 0.24);
  border-color: var(--arcade-green);
  color: #bbf7d0;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.32);
}

.adv-goal-chip svg {
  width: 16px;
  height: 16px;
}

/* Bottom 75% Interaction Zone */
.hud-interaction-zone {
  flex: 1 1 75%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

/* 8x8 Cyan/Gold Rimmed Recessed Playfield */
.board-stage {
  flex: 1;
  min-height: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.board-chassis {
  position: relative;
  width: min(82vw, 368px, 39dvh);
  aspect-ratio: 1 / 1;
  background: var(--board-bg);
  border: 3px solid var(--board-frame);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--board-frame-glow);
  will-change: transform;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

body[data-screen="game"][data-identity-preset="preset-a"] .arcade-bg-nebula {
  filter: hue-rotate(118deg) saturate(1.42) contrast(1.06);
  opacity: 0.78;
}

body[data-screen="game"][data-identity-preset="preset-b"] .arcade-bg-nebula {
  filter: hue-rotate(-36deg) saturate(1.55);
  opacity: 0.88;
}

body[data-screen="game"][data-identity-preset="preset-c"] .arcade-bg-nebula {
  filter: hue-rotate(-8deg) brightness(1.16) saturate(0.92);
  opacity: 0.78;
}

body[data-screen="game"][data-identity-preset="preset-a"] {
  --board-bg: rgba(24, 9, 26, 0.92);
  --board-frame: #ff731d;
  --board-frame-glow: 0 0 28px rgba(255, 61, 154, 0.42), 0 0 46px rgba(255, 138, 31, 0.28), inset 0 0 18px rgba(255, 174, 0, 0.16);
  --grid-line: rgba(255, 138, 31, 0.24);
  --score-color: #fde047;
  --score-glow: 0 3px 0 #5c122d, 0 0 22px rgba(255, 138, 31, 0.65);
  --surface-card: linear-gradient(180deg, rgba(46, 16, 48, 0.9) 0%, rgba(22, 8, 28, 0.94) 100%);
  --surface-card-border: rgba(255, 138, 31, 0.65);
}

body[data-screen="game"][data-identity-preset="preset-b"] {
  --board-bg: rgba(6, 10, 28, 0.95);
  --board-frame: #00f5d4;
  --board-frame-glow: 0 0 28px rgba(0, 245, 212, 0.46), 0 0 44px rgba(123, 44, 191, 0.36), inset 0 0 18px rgba(254, 228, 64, 0.14);
  --grid-line: rgba(0, 245, 212, 0.24);
  --score-color: #fee440;
  --score-glow: 0 3px 0 #1e1b4b, 0 0 22px rgba(0, 245, 212, 0.62);
  --surface-card: linear-gradient(180deg, rgba(20, 18, 54, 0.92) 0%, rgba(10, 10, 32, 0.96) 100%);
  --surface-card-border: rgba(0, 245, 212, 0.72);
}

body[data-screen="game"][data-identity-preset="preset-c"] {
  --board-bg: rgba(12, 28, 72, 0.84);
  --board-frame: #bae6fd;
  --board-frame-glow: 0 0 30px rgba(186, 230, 253, 0.44), 0 0 46px rgba(56, 189, 248, 0.3), inset 0 0 22px rgba(224, 242, 254, 0.2);
  --grid-line: rgba(224, 242, 254, 0.24);
  --score-color: #f8fafc;
  --score-glow: 0 3px 0 #0c4a6e, 0 0 22px rgba(186, 230, 253, 0.65);
  --surface-card: linear-gradient(180deg, rgba(22, 46, 104, 0.86) 0%, rgba(12, 25, 68, 0.9) 100%);
  --surface-card-border: rgba(186, 230, 253, 0.72);
}

body[data-identity-preset="preset-a"] .board-chassis {
  border-radius: 12px;
  --board-frame: #ff731d;
  --board-frame-glow: 0 0 28px rgba(255, 61, 154, 0.42), inset 0 0 18px rgba(255, 174, 0, 0.16);
}

body[data-identity-preset="preset-b"] .board-chassis {
  border-radius: 5px;
  --board-frame: #00f5d4;
  --board-frame-glow: 0 0 28px rgba(0, 245, 212, 0.46), inset 0 0 18px rgba(123, 44, 191, 0.26);
}

body[data-identity-preset="preset-b"] .board-chassis::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 245, 212, 0.032) 0 1px,
    rgba(123, 44, 191, 0.015) 1px 2px,
    transparent 2px 4px
  );
}

body[data-identity-preset="preset-b"] .streak-combo-bar,
body[data-identity-preset="preset-b"] .tray-dock {
  border-radius: 10px;
}

body[data-identity-preset="preset-c"] .board-chassis {
  border-radius: 20px;
  --board-frame: #bae6fd;
  --board-frame-glow: 0 0 30px rgba(186, 230, 253, 0.44), inset 0 0 22px rgba(224, 242, 254, 0.2);
}

body[data-identity-preset="preset-c"] .streak-combo-bar,
body[data-identity-preset="preset-c"] .tray-dock {
  border-radius: 24px;
}

body[data-identity-preset="preset-a"] .modal-card {
  border-color: #ff8a1f;
  box-shadow: 0 0 0 1px rgba(255, 61, 154, 0.35), 0 0 34px rgba(255, 138, 31, 0.34), inset 0 2px 0 rgba(255, 237, 213, 0.28);
}

body[data-identity-preset="preset-b"] .modal-card {
  border-radius: 14px;
  border-color: #00f5d4;
  background-image:
    repeating-linear-gradient(180deg, rgba(0, 245, 212, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 4px),
    linear-gradient(180deg, rgba(16, 18, 48, 0.94) 0%, rgba(11, 8, 32, 0.97) 100%);
  box-shadow: 0 0 0 1px rgba(123, 44, 191, 0.55), 0 0 36px rgba(0, 245, 212, 0.36), inset 0 2px 0 rgba(254, 228, 64, 0.22);
}

body[data-identity-preset="preset-b"] .modal-eyebrow {
  color: #fee440;
}

body[data-identity-preset="preset-b"] .streak-meter-fill {
  background: linear-gradient(90deg, #00f5d4 0%, #7b2cbf 56%, #fee440 100%);
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.65);
}

body[data-identity-preset="preset-c"] .modal-card {
  border-radius: 28px;
  border-color: #bae6fd;
  box-shadow: 0 0 0 1px rgba(224, 242, 254, 0.38), 0 0 38px rgba(56, 189, 248, 0.36), inset 0 2px 0 rgba(255, 255, 255, 0.36);
}

.board-chassis[data-grace-state="charged"] {
  box-shadow: var(--board-frame-glow), 0 0 20px rgba(34, 211, 238, 0.28);
}

.board-chassis[data-grace-state="grace-2"] {
  border-color: var(--arcade-gold);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.42), inset 0 0 14px rgba(251, 191, 36, 0.16);
}

.board-chassis[data-grace-state="grace-1"] {
  border-color: var(--arcade-pink);
  animation: graceBorderPulse 540ms ease-in-out infinite alternate;
}

body.mode-mint532[data-screen="game"] .board-chassis {
  border: 4px solid #7fb2aa;
  padding: 3px;
  background: #d9f5ee;
  border-radius: 6px;
}

.eq-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.62;
}

.board-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 0;
  background: transparent;
  touch-action: none;
  --bevel: 6px;
  --bevel-b: 7px;
}

.board-cell {
  position: relative;
  background: rgba(255, 255, 255, 0.015);
  box-shadow: inset -1px -1px 0 var(--grid-line);
  transition: transform 110ms var(--ease-spring), filter 100ms ease;
  overflow: visible;
}

/* Drag Ghost Footprint (Valid-Only, zero red invalid flashes) */
.board-cell.ghost-valid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--morph-face, rgba(34, 211, 238, 0.45));
  opacity: 0.54;
  border: 2px solid #ffffff;
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.55),
    0 0 12px var(--morph-face, var(--arcade-cyan-glow));
  z-index: 4;
  pointer-events: none;
}

/* Full Row/Col Predictive Line-Clear Neon Glow (per Block/VFX Style) */
.board-cell.predictive-line-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.34) 0%, rgba(251, 191, 36, 0.28) 100%);
  box-shadow:
    inset 0 0 16px var(--arcade-cyan),
    0 0 10px rgba(34, 211, 238, 0.65);
  z-index: 7;
  pointer-events: none;
  animation: predictivePulse 460ms ease-in-out infinite alternate;
}

body[data-block-style="vfx-a"] .board-cell.predictive-line-glow::before {
  background: radial-gradient(circle, rgba(255, 190, 46, 0.42) 0%, rgba(255, 46, 126, 0.28) 100%);
  box-shadow: inset 0 0 16px rgba(255, 190, 46, 0.95);
}

body[data-block-style="vfx-b"] .board-cell.predictive-line-glow::before {
  background: rgba(56, 189, 248, 0.3);
  box-shadow: inset 0 0 14px rgba(226, 232, 240, 0.95), 0 0 6px rgba(56, 189, 248, 0.65);
}

@keyframes predictivePulse {
  from {
    opacity: 0.62;
    box-shadow: inset 0 0 10px rgba(34, 211, 238, 0.65);
  }
  to {
    opacity: 1;
    box-shadow: inset 0 0 18px #ffffff, 0 0 12px var(--arcade-gold-glow);
  }
}

/* libtask.so Hint Target Highlight */
.board-cell.hint-target::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: rgba(251, 191, 36, 0.34);
  border: 2.5px dashed var(--arcade-gold-bright);
  box-shadow: inset 0 0 12px var(--arcade-gold-glow);
  z-index: 5;
  pointer-events: none;
  animation: hintPulse 900ms ease-in-out infinite alternate;
}

.board-cell.kb-cursor::after {
  content: '';
  position: absolute;
  inset: 1px;
  border: 2.5px dashed var(--arcade-cyan);
  background: rgba(34, 211, 238, 0.18);
  box-shadow:
    inset 0 0 10px rgba(251, 191, 36, 0.55),
    0 0 12px rgba(34, 211, 238, 0.72);
  z-index: 7;
  pointer-events: none;
}

@keyframes hintPulse {
  from { opacity: 0.55; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Authentic Block Blast Line-Clear Color Morphing + Neon Anticipation */
.board-cell.anticipation-clear .tile-block:not(.is-obstacle) {
  --t-face: var(--morph-face, var(--arcade-orange)) !important;
  --t-top: var(--morph-top, #fdba74) !important;
  --t-left: var(--morph-left, #ff964a) !important;
  --t-right: var(--morph-right, #c2410c) !important;
  --t-bottom: var(--morph-bottom, #9a3412) !important;
  --t-seam: var(--morph-seam, #431407) !important;
  filter: brightness(1.16);
  box-shadow:
    0 0 14px var(--morph-top, var(--arcade-cyan)),
    inset 0 0 8px rgba(255, 255, 255, 0.45);
  transform: scale(1.03);
  z-index: 6;
}

.board-cell.anticipation-damage {
  outline: 2.5px dashed var(--arcade-orange);
  outline-offset: -2px;
  box-shadow: inset 0 0 12px var(--arcade-pink-glow);
  z-index: 6;
}

/* Block Shaders & Chiseled 3D Bevels (MT-4: vfx-a Pyro | vfx-b Chrome | vfx-c Acrylic) */
.tile-block,
.piece-mini-cell {
  position: relative;
  background: var(--t-face, #ff7a00);
  border: 1px solid var(--t-seam, #6b2700);
  border-radius: 4px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-block {
  position: absolute;
  inset: 0;
}

.tile-block::before,
.piece-mini-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-style: solid;
  border-width: var(--bevel, 6px) var(--bevel, 6px) var(--bevel-b, 7px) var(--bevel, 6px);
  border-color:
    var(--t-top, #ffad42)
    var(--t-right, #d95b00)
    var(--t-bottom, #9e3b00)
    var(--t-left, #ff9419);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

/* Specular pill highlight across block skins */
.tile-block::after,
.piece-mini-cell::after {
  content: '';
  position: absolute;
  top: 14%;
  left: 14%;
  width: 34%;
  height: 18%;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 2;
}

/* VFX Style A: Stadium Pyro & Ember Shards */
body[data-block-style="vfx-a"] .tile-block,
body[data-block-style="vfx-a"] .piece-mini-cell {
  border-radius: 3px;
  background-image: radial-gradient(circle at 35% 30%, rgba(255, 240, 180, 0.34) 0%, transparent 62%);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.36);
}

body[data-block-style="vfx-a"] .tile-block::after,
body[data-block-style="vfx-a"] .piece-mini-cell::after {
  width: 44%;
  height: 16%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.52), rgba(255, 190, 46, 0.15));
}

/* VFX Style B: Jewel-Cut Chrome & Electric Arc */
body[data-block-style="vfx-b"] .tile-block,
body[data-block-style="vfx-b"] .piece-mini-cell {
  border-radius: 2px;
  background-image:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14) 0px,
      rgba(255, 255, 255, 0.14) 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 5px
    );
}

body[data-block-style="vfx-b"] .tile-block::after,
body[data-block-style="vfx-b"] .piece-mini-cell::after {
  top: 22%;
  left: 22%;
  width: 56%;
  height: 56%;
  border-radius: 2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.05) 55%, transparent 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* VFX Style C: Tactile 3D Arcade Acrylic */
body[data-block-style="vfx-c"] .tile-block,
body[data-block-style="vfx-c"] .piece-mini-cell {
  border-radius: 5px;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.28) 0%, transparent 52%, rgba(0, 0, 0, 0.16) 100%);
}

.tile-block.is-obstacle::before,
.tile-block.is-obstacle::after,
.piece-mini-cell.empty::before,
.piece-mini-cell.empty::after {
  display: none;
}

.tile-block.is-obstacle {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.tile-block.just-placed {
  animation: popIn 90ms var(--ease-spring);
}

.tile-obstacle-svg {
  width: 90%;
  height: 90%;
  position: relative;
  z-index: 2;
}

.hp-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  z-index: 3;
  background: rgba(10, 15, 60, 0.9);
  border: 1px solid var(--arcade-cyan);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 5px;
}

/* FX Layer & 60fps 2D Canvas Shatter Overlay */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 20;
}

.vfx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 21;
}

.clear-particle {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  pointer-events: none;
  animation: particleBurst 440ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.floating-callout {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  padding: 10px 22px;
  border-radius: var(--radius-card);
  background: var(--glass-bg);
  border: 2px solid var(--arcade-cyan);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow: 0 2px 0 #091021, 0 4px 10px rgba(0, 0, 0, 0.65);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    0 5px 0 #080b28,
    0 0 22px var(--arcade-cyan-glow);
  z-index: 24;
  animation: calloutFloat 900ms var(--ease-spring) forwards;
}

.floating-callout.callout-tier-2 {
  font-size: 20px;
  background: linear-gradient(180deg, rgba(66, 18, 62, 0.94) 0%, rgba(28, 10, 38, 0.96) 100%);
  border-color: var(--arcade-gold);
  color: #fff4cc;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    0 5px 0 #701a45,
    0 0 26px var(--arcade-pink-glow);
}

.floating-callout.callout-tier-3 {
  font-size: 21px;
  background: linear-gradient(180deg, rgba(16, 42, 82, 0.94) 0%, rgba(9, 17, 42, 0.96) 100%);
  border-color: var(--arcade-sky);
  color: #e0f2fe;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 #0369a1,
    0 0 28px var(--arcade-cyan-glow);
}

.floating-callout.callout-tier-4 {
  font-size: 23px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--arcade-pink) 0%, var(--arcade-purple) 52%, var(--arcade-sky) 100%);
  border-color: var(--arcade-gold-bright);
  color: #ffffff;
  text-shadow: 0 2px 0 #3b0764, 0 4px 12px rgba(0, 0, 0, 0.7);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    0 6px 0 #581c87,
    0 0 34px var(--arcade-gold-glow);
}

body[data-block-style="vfx-a"] .floating-callout {
  border-color: #ffbe2e;
}

body[data-block-style="vfx-b"] .floating-callout {
  border-color: #38bdf8;
}

.board-chassis.shake-light {
  animation: boardShakeLight 220ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.board-chassis.shake-heavy {
  animation: boardShakeHeavy 320ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* STREAK & COMBO BAR (Acrylic Glass Frame Between Grid & Dock) */
.streak-combo-bar {
  flex: 0 0 auto;
  width: 100%;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: var(--glass-border-width) solid var(--surface-card-border);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    var(--glass-glow-cyan),
    inset 0 2px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  transition: transform 180ms var(--ease-spring), border-color 180ms ease, box-shadow 180ms ease;
}

.streak-combo-bar.streak-tier-1 {
  border-color: var(--glass-border-gold);
  box-shadow: var(--glass-glow-gold), inset 0 2px 0 rgba(255, 255, 255, 0.26);
}

.streak-combo-bar.streak-tier-2 {
  border-color: var(--streak-accent);
  box-shadow:
    0 0 22px var(--arcade-pink-glow),
    0 8px 20px rgba(4, 6, 26, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.28);
  animation: streakPulse 1s var(--ease-spring) infinite alternate;
}

.streak-combo-bar.streak-tier-3 {
  border-color: var(--arcade-gold-bright);
  box-shadow:
    0 0 26px var(--arcade-pink-glow),
    0 0 14px var(--arcade-cyan-glow),
    inset 0 2px 0 rgba(255, 255, 255, 0.34);
  animation: streakOverdrive 560ms var(--ease-spring) infinite alternate;
}

.streak-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.combo-mini-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.streak-label-group {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.streak-tier-label {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--streak-accent-2);
  white-space: nowrap;
}

.streak-count-tag {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
}

.streak-meter-track {
  flex: 1;
  min-width: 48px;
  height: 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-well);
  border: 1.5px solid var(--surface-well-border);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(4, 6, 26, 0.6);
}

.streak-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--arcade-cyan) 0%, var(--streak-accent-2) 55%, var(--streak-accent) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.48), 0 0 10px var(--arcade-cyan-glow);
  transition: width 240ms var(--ease-spring);
}

.streak-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.streak-mult-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-well);
  border: 1.5px solid var(--surface-well-border);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.grace-dots {
  display: flex;
  gap: 3px;
}

.grace-dot {
  width: 9px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 180ms ease;
}

body.mode-mint532[data-screen="game"] .grace-dot {
  background: rgba(20, 51, 44, 0.22);
}

.grace-dot.active {
  background: var(--arcade-cyan);
  box-shadow: 0 0 8px var(--arcade-cyan-glow);
}

.grace-dot.warning {
  background: var(--arcade-pink);
  box-shadow: 0 0 8px var(--arcade-pink-glow);
  animation: graceDotPulse 480ms ease-in-out infinite alternate;
}

/* Glossy Acrylic Bottom 3-Slot Piece Dock (0.55x scale, touch-action: none) */
.tray-dock {
  flex: 0 0 auto;
  background: var(--surface-card);
  border: var(--glass-border-width) solid var(--surface-card-border);
  border-radius: var(--radius-card);
  padding: 6px 8px;
  box-shadow:
    var(--glass-glow-cyan),
    inset 0 2px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  height: clamp(82px, 12dvh, 112px);
  overflow: visible;
  touch-action: none;
}

body.mode-mint532[data-screen="game"] .tray-dock {
  box-shadow: 0 8px 20px rgba(25, 99, 78, 0.14), inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.tray-slot {
  position: relative;
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 48, 0.56);
  border: 1.5px solid rgba(34, 211, 238, 0.36);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 12px rgba(34, 211, 238, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  overflow: visible;
  --bevel: 3.5px;
  --bevel-b: 4.5px;
  filter: drop-shadow(0 5px 2px rgba(6, 9, 34, 0.42));
  transition: transform 140ms var(--ease-spring), opacity 120ms ease, filter 160ms ease, border-color 140ms ease;
}

body.mode-mint532[data-screen="game"] .tray-slot {
  background: rgba(217, 247, 238, 0.65);
  border-color: var(--surface-well-border);
}

.tray-slot.empty {
  cursor: default;
  opacity: 0.28;
  background: rgba(8, 11, 38, 0.3);
  border-color: rgba(139, 92, 246, 0.22);
  box-shadow: none;
}

.tray-slot.selected {
  outline: 2.5px solid var(--arcade-gold-bright);
  border-color: var(--arcade-gold);
  background: rgba(251, 191, 36, 0.16);
  box-shadow:
    0 0 16px var(--arcade-gold-glow),
    inset 0 2px 0 rgba(255, 255, 255, 0.32);
}

.tray-slot.dragging {
  opacity: 0.14;
}

.tray-slot.unplaceable {
  opacity: 0.45;
  filter: grayscale(0.55);
}

.tray-slot.deadlock-red {
  opacity: 0.64;
  filter: saturate(1.4) drop-shadow(0 0 12px rgba(244, 63, 94, 0.78));
  background: rgba(244, 63, 94, 0.2);
  border-color: #fb7185;
  outline: 2px solid rgba(251, 113, 133, 0.8);
}

.tray-slot.deadlock-red .piece-mini-cell:not(.empty) {
  --t-face: #d6334c !important;
  --t-top: #ff6b81 !important;
  --t-left: #eb4760 !important;
  --t-right: #9e1f34 !important;
  --t-bottom: #6e1020 !important;
  --t-seam: #450610 !important;
}

/* Stage 2 Deadlock Banner ("NO MOVES LEFT") */
.no-moves-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  padding: 12px 24px;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(159, 18, 57, 0.95) 0%, rgba(88, 11, 37, 0.97) 100%);
  border: 2.5px solid #fda4af;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow: 0 2px 0 #4c0519;
  box-shadow:
    0 0 26px var(--arcade-pink-glow),
    0 12px 32px rgba(4, 6, 26, 0.68),
    inset 0 2px 0 rgba(255, 255, 255, 0.32);
  pointer-events: none;
  animation: modalIn 180ms var(--ease-spring);
}

.no-moves-banner[hidden] {
  display: none;
}

.piece-render {
  display: grid;
  gap: 0;
  pointer-events: none;
}

.piece-mini-cell.empty {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.piece-mini-cell.empty::before {
  display: none;
}

/* Drag Ghost Layer (60ms scale pickup, 180ms spring return) */
.drag-overlay {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 100;
  transform-origin: top left;
  will-change: transform;
  display: none;
  --bevel: 6px;
  --bevel-b: 7px;
  filter: drop-shadow(0 12px 16px rgba(4, 6, 26, 0.55));
}

.drag-overlay.visible {
  display: block;
}

.drag-piece-scale {
  transform-origin: center center;
  transition: transform 60ms var(--ease-spring);
  will-change: transform;
}

/* libtask.so C++ Trace Footer (hidden unless ?debug in URL) */
.telemetry-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--glass-well-bg);
  border: 1.5px solid rgba(34, 211, 238, 0.35);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 10.5px;
  color: #dbeafe;
  cursor: pointer;
}

.telemetry-bar.debug-visible {
  display: flex;
}

.telemetry-log {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 10px;
}

.telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.telemetry-chip strong {
  color: #ffffff;
}

.telemetry-badge {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.18);
  color: #67e8f9;
  font-weight: 900;
  font-size: 9.5px;
  white-space: nowrap;
}

.telemetry-badge.warn {
  color: var(--arcade-gold-bright);
  background: rgba(251, 191, 36, 0.18);
}

/* ================= ARCADE ACRYLIC MODALS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 34, 0.78);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    max(14px, var(--safe-top))
    max(14px, var(--safe-right))
    max(14px, var(--safe-bottom))
    max(14px, var(--safe-left));
  z-index: 200;
}

body.dev-bar-visible .modal-backdrop {
  padding-top: calc(84px + var(--safe-top));
}

.modal-backdrop.visible {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 416px;
  max-height: calc(100dvh - 30px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  background: var(--glass-bg);
  border: var(--glass-border-width) solid var(--glass-border-cyan);
  color: var(--text-ink);
  border-radius: var(--radius-modal);
  padding: 16px 16px 20px;
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.22),
    var(--glass-glow-cyan),
    0 0 38px rgba(139, 92, 246, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  animation: modalIn 220ms var(--ease-spring);
}

body.dev-bar-visible .modal-card {
  max-height: calc(100dvh - 102px);
}

/* MT-6 Style A (?debug preview): Stadium Pyro Encore */
body[data-gameover-style="go-a"] .modal-card {
  background: radial-gradient(circle at 50% 0%, #3e124f 0%, #170822 58%, #0e0516 100%);
  border: 2.5px solid #ffbe2e;
  box-shadow: inset 0 2px 0 rgba(255, 224, 130, 0.35), 0 0 38px rgba(255, 46, 126, 0.45), 0 24px 48px rgba(0, 0, 0, 0.65);
}

body[data-gameover-style="go-a"] .modal-title {
  color: #ffe180;
  text-shadow: 0 2px 0 #4a0526, 0 0 18px rgba(255, 46, 126, 0.65);
}

body[data-gameover-style="go-a"] .modal-stat {
  background: rgba(34, 11, 50, 0.9);
  border: 1.5px solid rgba(255, 190, 46, 0.45);
}

/* MT-6 Style B (?debug preview): Brushed Chrome & LED Scoreboard */
body[data-gameover-style="go-b"] .modal-card {
  background: linear-gradient(180deg, #273242 0%, #171f2b 52%, #0f151e 100%);
  border: 2.5px solid #64748b;
  border-radius: 18px;
  box-shadow: inset 0 2px 0 rgba(241, 245, 249, 0.28), inset 0 -4px 0 #090d14, 0 0 32px rgba(56, 189, 248, 0.26), 0 24px 48px rgba(0, 0, 0, 0.65);
}

body[data-gameover-style="go-b"] .modal-title {
  color: #e2e8f0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #090e17;
}

body[data-gameover-style="go-b"] .modal-stat {
  background: #0b111c;
  border: 1.5px solid #334155;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

body[data-gameover-style="go-b"] .score-value {
  font-family: var(--font-mono);
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

/* MT-6 Style C (Locked Production Default): Arcade Acrylic Glass Modal */
body[data-gameover-style="go-c"] .modal-card {
  background: var(--glass-bg);
  border: var(--glass-border-width) solid var(--glass-border-cyan);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.24),
    var(--glass-glow-cyan),
    0 0 38px rgba(139, 92, 246, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.34);
}

body[data-gameover-style="go-c"] .modal-stat {
  background: var(--glass-well-bg);
  border: 1.5px solid rgba(34, 211, 238, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 10px rgba(34, 211, 238, 0.14),
    0 0 12px rgba(34, 211, 238, 0.18);
}

body[data-gameover-style="go-c"] .modal-stat-hero {
  border: var(--glass-border-width) solid var(--glass-border-gold) !important;
  box-shadow:
    var(--glass-glow-gold),
    inset 0 1px 0 rgba(254, 240, 138, 0.28);
}

body[data-gameover-style="go-c"] .modal-stat-hero .score-value {
  color: var(--text-gold);
  text-shadow: 0 2px 0 #451a03, 0 0 14px var(--arcade-gold-glow);
}

body[data-gameover-style="go-c"] .gameover-badge-pill {
  background: rgba(34, 211, 238, 0.16);
  border: 1.5px solid var(--arcade-cyan);
  color: #a5f3fc;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.36);
}

body[data-gameover-style="go-c"] .revive-radar-wrap {
  border-color: var(--glass-border-cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.26);
}

.gameover-badge-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.gameover-badge-pill,
.gameover-count-pill,
.new-best-pill {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gameover-badge-pill {
  background: rgba(34, 211, 238, 0.16);
  border: 1.5px solid var(--arcade-cyan);
  color: #bae6fd;
}

body[data-gameover-style="go-a"] .gameover-badge-pill {
  background: rgba(255, 46, 126, 0.2);
  border-color: #ffbe2e;
  color: #ffe180;
}

body[data-gameover-style="go-b"] .gameover-badge-pill {
  background: rgba(56, 189, 248, 0.14);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.gameover-count-pill {
  background: rgba(255, 61, 154, 0.2);
  border: 1.5px solid var(--arcade-pink);
  color: #fbcfe8;
  box-shadow: 0 0 12px rgba(255, 61, 154, 0.3);
}

.new-best-pill {
  background: linear-gradient(180deg, var(--arcade-gold-bright) 0%, var(--arcade-gold) 100%);
  color: #2b1700;
  border: 1.5px solid #fef9c3;
  box-shadow: 0 0 16px var(--arcade-gold-glow);
}

/* 3-Row Encore Blast Preview Mini-Radar */
.revive-radar-wrap {
  width: 100%;
  background: var(--glass-well-bg);
  border: var(--glass-border-width) solid var(--glass-border-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

body[data-gameover-style="go-a"] .revive-radar-wrap {
  border-color: rgba(255, 190, 46, 0.45);
}

body[data-gameover-style="go-b"] .revive-radar-wrap {
  border-color: rgba(56, 189, 248, 0.45);
}

.revive-radar-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-sub);
}

.radar-rows-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 61, 154, 0.24);
  color: #fbcfe8;
  border: 1px solid var(--arcade-pink);
}

.revive-radar-grid {
  display: grid;
  grid-template-columns: repeat(8, 13px);
  grid-template-rows: repeat(8, 13px);
  gap: 2px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(6, 9, 34, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

.radar-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.radar-cell.filled {
  background: #475569;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.radar-cell.target-row {
  background: rgba(255, 61, 154, 0.26);
  outline: 1px solid rgba(255, 61, 154, 0.58);
}

.radar-cell.filled.target-row {
  background: var(--arcade-orange);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), 0 0 8px var(--arcade-orange-glow);
}

body[data-gameover-style="go-b"] .radar-cell.filled.target-row {
  background: #38bdf8;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.65), 0 0 8px rgba(56, 189, 248, 0.85);
}

body[data-gameover-style="go-c"] .radar-cell.filled.target-row {
  background: var(--arcade-green);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.55), 0 0 8px var(--arcade-green-glow);
}

.revive-radar-foot {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}

.modal-stat-grid-4 .modal-stat {
  padding: 8px 10px;
}

.modal-stat-hero {
  border-color: var(--glass-border-gold) !important;
}

.modal-hero-svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(34, 211, 238, 0.36));
}

.modal-hero-svg .art-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 3dvh, 25px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--text-ink);
  text-shadow: var(--title-text-shadow);
}

.modal-sub {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  line-height: 1.36;
}

.modal-stat-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.modal-stat {
  background: var(--glass-well-bg);
  border: 1.5px solid rgba(34, 211, 238, 0.45);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.score-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.score-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-ink);
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-bottom: 4px;
}

.modal-actions.is-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modal-actions .btn-3d {
  width: 100%;
}

.modal-actions.is-grid .btn-3d {
  min-height: 52px;
  min-width: 68px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.15;
  gap: 6px;
  border-radius: 18px;
}

.modal-actions.is-grid .btn-3d.is-full-span {
  grid-column: 1 / -1;
}

.modal-actions .btn-3d .art-icon-img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Identity Preset Switcher & Android Audition Lab */
.identity-preset-panel {
  width: 100%;
  background: var(--glass-well-bg);
  border: 1.5px solid rgba(34, 211, 238, 0.36);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.identity-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.identity-bpm-pill {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(34, 211, 238, 0.16);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.identity-preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.identity-preset-btn {
  min-height: 50px;
  min-width: 68px;
  padding: 5px 6px;
  border-radius: 16px;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
  font-size: 11px;
}

.identity-preset-btn .preset-code {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.identity-preset-btn .preset-sub {
  font-size: 9.5px;
  font-weight: 800;
  opacity: 0.9;
  white-space: nowrap;
}

.identity-preset-btn:not(.is-active) {
  --btn-bg: var(--grad-glass-neutral);
  --btn-lip: #070a28;
  --btn-rim: rgba(148, 163, 184, 0.44);
  --btn-glow: transparent;
  --btn-fg: #cbd5e1;
  opacity: 0.78;
}

.identity-preset-btn.is-active {
  outline: 2px solid var(--arcade-gold-bright);
  outline-offset: -3px;
  box-shadow:
    0 5px 0 var(--btn-lip),
    0 0 18px var(--arcade-gold-glow),
    inset 0 3px 0 rgba(255, 255, 255, 0.5);
}

.modal-backdrop.is-audition-mode {
  align-items: flex-end;
  background: rgba(4, 6, 26, 0.34);
  backdrop-filter: none;
}

.modal-card.audition-sheet {
  max-height: min(64dvh, 500px);
  padding: 10px 12px 12px;
  gap: 6px;
}

.modal-card.audition-sheet .modal-hero-svg,
.modal-card.audition-sheet .modal-sub {
  display: none;
}

.modal-card.audition-sheet .modal-title {
  font-size: 17px;
}

.audition-axis-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.audition-axis-btn {
  min-height: 48px;
  min-width: 68px;
  padding: 4px 6px;
  border-radius: 14px;
  font-size: 10.5px;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.audition-events-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.audition-test-btn {
  min-height: 50px;
  min-width: 68px;
  padding: 5px 6px;
  border-radius: 16px;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  line-height: 1.1;
}

.audition-test-btn .test-sub {
  font-size: 9px;
  opacity: 0.88;
}

.stars-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.stars-row svg {
  width: 44px;
  height: 44px;
}

.level-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 6px;
}

.level-btn {
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  text-align: center;
}

.level-btn-meta {
  font-size: 11px;
  opacity: 0.88;
}

.mini-stars {
  display: flex;
  gap: 2px;
}

.mini-stars svg {
  width: 16px;
  height: 16px;
}

.cpp-trace-box {
  width: 100%;
  background: var(--glass-well-bg);
  border: 1.5px solid rgba(139, 92, 246, 0.48);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  color: #a5f3fc;
  word-break: break-word;
  box-shadow: inset 0 2px 8px rgba(4, 6, 26, 0.55);
}

/* ================= KEYFRAMES ================= */
@keyframes popIn {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes graceBorderPulse {
  0% {
    border-color: var(--arcade-pink);
    box-shadow: 0 0 18px rgba(255, 61, 154, 0.45), inset 0 0 12px rgba(255, 61, 154, 0.18);
  }
  100% {
    border-color: var(--arcade-orange);
    box-shadow: 0 0 32px rgba(255, 138, 31, 0.72), inset 0 0 20px rgba(255, 61, 154, 0.32);
  }
}

@keyframes graceDotPulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.16); opacity: 1; }
}

@keyframes boardShakeLight {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-2px, 2px, 0); }
  50% { transform: translate3d(2px, -2px, 0); }
  75% { transform: translate3d(-1px, 1px, 0); }
}

@keyframes boardShakeHeavy {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  20% { transform: translate3d(-4px, 3px, 0) scale(1.01); }
  45% { transform: translate3d(4px, -3px, 0) scale(1.01); }
  70% { transform: translate3d(-2px, 2px, 0); }
}

@keyframes heroFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes streakPulse {
  from { transform: scale(1); }
  to { transform: scale(1.015); }
}

@keyframes streakOverdrive {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.022) translateY(-1px); }
}

@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(140deg);
    opacity: 0;
  }
}

@keyframes calloutFloat {
  0% {
    transform: translate(-50%, -25%) scale(0.7);
    opacity: 0;
  }
  25% {
    transform: translate(-50%, -55%) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -95%) scale(1);
    opacity: 0;
  }
}

@keyframes modalIn {
  0% {
    transform: scale(0.88) translateY(18px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ================= RESPONSIVE VIEWPORT GUARDS (360x800, 390x844, 430x932 & short) ================= */
@media (max-width: 440px) {
  #screen-in-game .btn-3d:not(.btn-icon-only),
  #modal-card .btn-3d:not(.btn-icon-only),
  .mockup-bar .btn-3d {
    font-size: 13px;
    padding: 6px 12px;
  }
  .telemetry-chip {
    display: none;
  }
}

@media (max-width: 375px) {
  .board-stage {
    padding: 0 8px;
  }
  .hud-mode-chip {
    padding: 3px 7px;
    font-size: 9px;
  }
  .classic-best-wrap {
    padding: 2px 8px 2px 5px;
  }
  .classic-best-num {
    font-size: 15px;
  }
}

@media (max-height: 670px) {
  .board-chassis {
    width: min(80vw, 310px, 37dvh);
  }
  .streak-combo-bar {
    min-height: 38px;
    padding: 4px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .board-cell.predictive-line-glow::before,
  .board-cell.hint-target::after,
  .streak-combo-bar.streak-tier-2,
  .streak-combo-bar.streak-tier-3,
  .board-chassis[data-grace-state="grace-1"],
  .grace-dot.warning {
    animation: none !important;
  }
}
