﻿/* ==========================================================================
   قطار الأحلام 3D (Dream Express 3D V7.0.0 Production Gold)
   Modern Sleek Mobile Game UI — Glassmorphism & Minimalist HUD (60 FPS)
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/Cairo-Bold.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../assets/fonts/Cairo-Bold-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url('../assets/fonts/Cairo-Black.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url('../assets/fonts/Cairo-Black-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-obsidian: #060911;
  --bg-dark: #0A0F1D;
  --bg-glass: rgba(15, 23, 42, 0.62);
  --bg-glass-heavy: rgba(11, 15, 25, 0.78);
  --bg-glass-card: rgba(20, 29, 49, 0.68);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-glass-bright: rgba(56, 189, 248, 0.42);

  --cyan-neon: #06B6D4;
  --cyan-bright: #38BDF8;
  --gold-molten: #F59E0B;
  --gold-bright: #FACC15;
  --crimson-hazard: #EF4444;
  --emerald-power: #10B981;
  --emerald-bright: #34D399;
  --purple-vip: #9333EA;

  --text-light: #F8FAFC;
  --text-silver: #CBD5E1;
  --text-muted: #94A3B8;

  --sector-accent: #10B981;
  --sector-glow: rgba(16, 185, 129, 0.25);

  --font-main: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 10%, #111827 0%, #04070E 90%);
  font-family: var(--font-main);
  color: var(--text-light);
  direction: rtl;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[dir="ltr"],
html[dir="ltr"] body {
  direction: ltr;
}

html[dir="ltr"] .action-text-wrap,
html[dir="ltr"] .station-meta,
html[dir="ltr"] .sel-level-meta {
  text-align: left;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

button:active:not(:disabled) {
  transform: scale(0.94);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==================== APP SHELL & SECTOR AMBIENT THEMES ==================== */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding-top: max(10px, env(safe-area-inset-top, 10px));
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 0%, var(--sector-glow) 0%, transparent 60%),
    linear-gradient(180deg, #070B14 0%, #0F172A 55%, #060911 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: background 0.5s ease;
}

.app-shell[data-sector-theme="1"]  { --sector-accent: #10B981; --sector-glow: rgba(16, 185, 129, 0.22); }
.app-shell[data-sector-theme="2"]  { --sector-accent: #F59E0B; --sector-glow: rgba(245, 158, 11, 0.22); }
.app-shell[data-sector-theme="3"]  { --sector-accent: #06B6D4; --sector-glow: rgba(6, 182, 212, 0.24); }
.app-shell[data-sector-theme="4"]  { --sector-accent: #38BDF8; --sector-glow: rgba(56, 189, 248, 0.24); }
.app-shell[data-sector-theme="5"]  { --sector-accent: #EC4899; --sector-glow: rgba(236, 72, 153, 0.22); }
.app-shell[data-sector-theme="6"]  { --sector-accent: #D97706; --sector-glow: rgba(217, 119, 6, 0.22); }
.app-shell[data-sector-theme="7"]  { --sector-accent: #0284C7; --sector-glow: rgba(2, 132, 199, 0.24); }
.app-shell[data-sector-theme="8"]  { --sector-accent: #A855F7; --sector-glow: rgba(168, 85, 247, 0.24); }
.app-shell[data-sector-theme="9"]  { --sector-accent: #EF4444; --sector-glow: rgba(239, 68, 68, 0.24); }
.app-shell[data-sector-theme="10"] { --sector-accent: #FACC15; --sector-glow: rgba(250, 204, 21, 0.25); }

/* Hide Global Top Bar during active gameplay so the 3D viewport gets 80%+ screen space */
.app-shell[data-active-screen="screen-game"] .global-topbar {
  display: none;
}

/* ==================== SLEEK GLASSMORPHIC GLOBAL TOP BAR ==================== */
.global-topbar {
  height: auto;
  min-height: 46px;
  width: 100%;
  padding: 6px 8px;
  background: rgba(9, 13, 22, 0.94);
  color: var(--text-light);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 25;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
.global-topbar::-webkit-scrollbar {
  display: none;
}

.topbar-right-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mini {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

.brand-mini-icon {
  font-size: 0.95rem;
}

.topbar-progress-pill {
  display: none;
}

.topbar-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.62rem;
  line-height: 1;
}

.tp-label {
  color: var(--text-muted);
  font-weight: 700;
}

.topbar-progress-meta strong {
  color: var(--cyan-bright);
  font-weight: 900;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(7, 11, 20, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-track-mini {
  height: 4px;
  border: none;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06B6D4, #10B981, #FACC15);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.65);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar-stats {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  color: var(--text-light);
  padding: 3px 6px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.68rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.stat-stars {
  border-color: rgba(250, 204, 21, 0.4);
  color: #FEF08A;
}

.stat-coins {
  border-color: rgba(245, 158, 11, 0.5);
  color: #FEF08A;
}

.stat-hints {
  border-color: rgba(6, 182, 212, 0.45);
  color: #E0F2FE;
}

.stat-plus {
  background: var(--gold-molten);
  color: #090D16;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

@media (max-width: 440px) {
  .global-topbar {
    padding: 5px 5px;
    gap: 3px;
    min-height: 42px;
  }
  .topbar-right-group {
    gap: 3px;
  }
  .brand-mini {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 8px;
  }
  .brand-mini-icon {
    font-size: 0.84rem;
  }
  .topbar-stats {
    gap: 3px;
  }
  .stat-pill {
    padding: 2px 5px;
    gap: 2px;
    font-size: 0.62rem;
  }
  .stat-plus {
    width: 12px;
    height: 12px;
    font-size: 0.62rem;
  }
  .icon-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 8px;
    font-size: 0.76rem;
  }
}

@media (max-width: 380px) {
  .global-topbar {
    padding: 4px 4px;
    gap: 2px;
    min-height: 40px;
  }
  .topbar-right-group {
    gap: 2px;
  }
  .brand-mini {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }
  .brand-mini-icon {
    font-size: 0.76rem;
  }
  .topbar-stats {
    gap: 2px;
  }
  .stat-pill {
    padding: 2px 4px;
    gap: 2px;
    font-size: 0.56rem;
  }
  .stat-plus {
    width: 11px;
    height: 11px;
    font-size: 0.56rem;
  }
  .icon-btn {
    width: 23px;
    height: 23px;
    min-width: 23px;
    border-radius: 7px;
    font-size: 0.70rem;
  }
}

/* ==================== SMOOTH SCREEN TRANSITIONS ==================== */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 10px;
  gap: 8px;
  min-height: 0;
}

.screen.active {
  display: flex;
  animation: screenFadeSlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes screenFadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================== SCREEN 1: MODERN 3D MAIN MENU ==================== */
#screen-menu {
  padding: 8px 10px 10px;
}

.menu-hero-card {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #16243E 0%, #070B14 100%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 16px 18px;
}

.menu-3d-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.menu-hero-card.has-3d-showcase .menu-sky-bg {
  display: none;
}

.menu-sky-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.cyber-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.menu-sun-glow {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, rgba(245, 158, 11, 0.15) 55%, transparent 75%);
  filter: blur(12px);
}

.menu-cinematic-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 9, 17, 0.76) 0%, rgba(6, 9, 17, 0.12) 34%, rgba(6, 9, 17, 0.14) 58%, rgba(6, 9, 17, 0.88) 100%);
}

/* Upper-Third Modern Logo */
.menu-logo-badge {
  position: relative;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.logo-crown-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(126, 34, 206, 0.90);
  color: #FEF08A;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.65);
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4);
}

.logo-modern-emblem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.28);
}

.emblem-glow-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

.emblem-3d-chip {
  background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 0.74rem;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.game-title {
  font-size: 2.25rem;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 4px 20px rgba(6, 182, 212, 0.65), 0 2px 6px rgba(0, 0, 0, 0.9);
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.game-subtitle {
  display: inline-block;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-silver);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.menu-studio-credit {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #FACC15;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(250, 204, 21, 0.38);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ==================== GENERAL BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-light);
  background: rgba(30, 41, 59, 0.94);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Bottom Glassmorphic 3-Button Action Dock */
.menu-actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  width: 100%;
}

.btn.btn-glass-hero,
.btn-glass-hero {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.95) 0%, rgba(16, 185, 129, 0.94) 100%);
  border: 1.5px solid rgba(167, 243, 208, 0.8);
  color: #FFFFFF;
  box-shadow:
    0 10px 28px rgba(6, 182, 212, 0.42),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.btn-hero-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 13px;
  background: rgba(9, 13, 22, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.btn-text-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  line-height: 1.25;
}

.btn-main-label {
  font-size: clamp(0.82rem, 3.6vw, 0.98rem);
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  line-height: 1.25;
}

.btn-sub-label {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn-hero-chevron {
  font-size: 1.05rem;
  opacity: 0.9;
}

.menu-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.btn.btn-glass-secondary,
.btn-glass-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 10px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.90);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn.btn-glass-secondary.btn-glass-gold,
.btn-glass-secondary.btn-glass-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.36) 0%, rgba(15, 23, 42, 0.92) 100%);
  border-color: rgba(250, 204, 21, 0.55);
  color: #FEF08A;
}

.btn-sec-icon {
  font-size: 1.15rem;
}

.btn-sec-label {
  font-weight: 900;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.78rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%);
  border-color: rgba(103, 232, 249, 0.65);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.3);
  color: #E2E8F0;
}

.btn-gold {
  background: linear-gradient(135deg, #FACC15 0%, #D97706 100%);
  border-color: #FEF08A;
  color: #090D16;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.btn-rewarded {
  background: linear-gradient(135deg, #A855F7 0%, #7E22CE 100%);
  border-color: #E9D5FF;
  color: #FFFFFF;
}

.btn-rewarded-green {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #6EE7B7;
  color: #FFFFFF;
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  padding: 6px 12px;
  color: var(--text-silver);
}

.pulse-btn {
  animation: gentlePulse 2.2s infinite ease-in-out;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ==================== SCREEN 2: HORIZONTAL SWIPEABLE SECTOR & LEVEL SELECTION ==================== */
.screen-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 7px 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 5px 11px;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--text-light);
}

.subheader-title-wrap {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.screen-title {
  font-size: 0.94rem;
  font-weight: 900;
  color: var(--text-light);
}

.map-total-stars {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--gold-bright);
}

/* Quick-Switch Sector Pills Bar (1..10) */
.sector-tabs-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(11, 15, 25, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.sector-tab-pill {
  height: 32px;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sector-tab-pill.unlocked {
  color: var(--text-silver);
  background: rgba(30, 41, 59, 0.82);
}

.sector-tab-pill.active {
  background: linear-gradient(135deg, var(--cyan-neon) 0%, #2563EB 100%);
  border-color: rgba(255, 255, 255, 0.45);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
  transform: scale(1.05);
}

/* Horizontal Swipeable Sector Carousel */
.sectors-carousel-shell {
  position: relative;
  flex: 1;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.carousel-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  z-index: 15;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.carousel-arrow-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.9);
}

.carousel-arrow-btn.arrow-prev {
  right: 4px;
}

.carousel-arrow-btn.arrow-next {
  left: 4px;
}

.sectors-carousel-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  touch-action: pan-y;
}

.sectors-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.sector-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
}

/* Luxury Centered Glassmorphic Sector Card */
.station-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(18, 26, 44, 0.94);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Bespoke Sector Card Ambient Gradients & Signature Biome Accent Variables */
.station-card.sector-card-1  { --card-accent: #10B981; --card-accent-glow: rgba(16, 185, 129, 0.34); --card-completed-bg: linear-gradient(145deg, rgba(16, 185, 129, 0.38) 0%, rgba(6, 78, 59, 0.82) 100%); background: linear-gradient(165deg, rgba(6, 95, 70, 0.56) 0%, rgba(11, 15, 25, 0.88) 100%); border-color: rgba(16, 185, 129, 0.48); }
.station-card.sector-card-2  { --card-accent: #F59E0B; --card-accent-glow: rgba(245, 158, 11, 0.34); --card-completed-bg: linear-gradient(145deg, rgba(245, 158, 11, 0.38) 0%, rgba(120, 53, 15, 0.84) 100%); background: linear-gradient(165deg, rgba(146, 64, 14, 0.58) 0%, rgba(11, 15, 25, 0.88) 100%); border-color: rgba(245, 158, 11, 0.48); }
.station-card.sector-card-3  { --card-accent: #06B6D4; --card-accent-glow: rgba(6, 182, 212, 0.34); --card-completed-bg: linear-gradient(145deg, rgba(6, 182, 212, 0.38) 0%, rgba(12, 74, 110, 0.84) 100%); background: linear-gradient(165deg, rgba(3, 105, 161, 0.56) 0%, rgba(11, 15, 25, 0.88) 100%); border-color: rgba(6, 182, 212, 0.48); }
.station-card.sector-card-4  { --card-accent: #38BDF8; --card-accent-glow: rgba(56, 189, 248, 0.36); --card-completed-bg: linear-gradient(145deg, rgba(56, 189, 248, 0.40) 0%, rgba(7, 89, 133, 0.84) 100%); background: linear-gradient(165deg, rgba(2, 132, 199, 0.56) 0%, rgba(15, 23, 42, 0.88) 100%); border-color: rgba(56, 189, 248, 0.52); }
.station-card.sector-card-5  { --card-accent: #EC4899; --card-accent-glow: rgba(236, 72, 153, 0.36); --card-completed-bg: linear-gradient(145deg, rgba(236, 72, 153, 0.38) 0%, rgba(88, 28, 135, 0.84) 100%); background: linear-gradient(165deg, rgba(157, 23, 77, 0.56) 0%, rgba(15, 12, 36, 0.90) 100%); border-color: rgba(236, 72, 153, 0.50); }
.station-card.sector-card-6  { --card-accent: #D97706; --card-accent-glow: rgba(217, 119, 6, 0.36); --card-completed-bg: linear-gradient(145deg, rgba(217, 119, 6, 0.40) 0%, rgba(113, 63, 18, 0.84) 100%); background: linear-gradient(165deg, rgba(180, 83, 9, 0.56) 0%, rgba(18, 14, 10, 0.88) 100%); border-color: rgba(251, 146, 60, 0.48); }
.station-card.sector-card-7  { --card-accent: #0284C7; --card-accent-glow: rgba(2, 132, 199, 0.36); --card-completed-bg: linear-gradient(145deg, rgba(14, 165, 233, 0.38) 0%, rgba(15, 118, 110, 0.82) 100%); background: linear-gradient(165deg, rgba(14, 116, 144, 0.56) 0%, rgba(11, 15, 25, 0.88) 100%); border-color: rgba(56, 189, 248, 0.48); }
.station-card.sector-card-8  { --card-accent: #A855F7; --card-accent-glow: rgba(168, 85, 247, 0.38); --card-completed-bg: linear-gradient(145deg, rgba(168, 85, 247, 0.40) 0%, rgba(59, 7, 100, 0.84) 100%); background: linear-gradient(165deg, rgba(107, 33, 168, 0.58) 0%, rgba(14, 10, 32, 0.90) 100%); border-color: rgba(168, 85, 247, 0.52); }
.station-card.sector-card-9  { --card-accent: #EF4444; --card-accent-glow: rgba(239, 68, 68, 0.38); --card-completed-bg: linear-gradient(145deg, rgba(239, 68, 68, 0.40) 0%, rgba(127, 29, 29, 0.86) 100%); background: linear-gradient(165deg, rgba(153, 27, 27, 0.60) 0%, rgba(20, 12, 12, 0.90) 100%); border-color: rgba(239, 68, 68, 0.52); }
.station-card.sector-card-10 { --card-accent: #FACC15; --card-accent-glow: rgba(250, 204, 21, 0.38); --card-completed-bg: linear-gradient(145deg, rgba(250, 204, 21, 0.36) 0%, rgba(49, 46, 129, 0.86) 100%); background: linear-gradient(165deg, rgba(30, 27, 75, 0.72) 0%, rgba(9, 13, 22, 0.92) 100%); border-color: rgba(250, 204, 21, 0.55); }

.station-card-banner {
  position: relative;
  overflow: hidden;
  padding: 13px 15px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px solid var(--card-accent, rgba(255, 255, 255, 0.14));
  background: rgba(9, 13, 22, 0.52);
}

.station-banner-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.44;
}

.station-banner-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.station-card-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(9, 13, 22, 0.88) 0%, rgba(9, 13, 22, 0.48) 52%, rgba(9, 13, 22, 0.86) 100%);
}

.station-icon-badge {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.84);
  border: 1.5px solid var(--card-accent, rgba(255, 255, 255, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.58rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 0 12px var(--card-accent-glow, rgba(16, 185, 129, 0.25));
}

.station-meta {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
}

.station-sector-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--card-accent, var(--cyan-bright));
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  display: block;
}

.station-meta h3 {
  font-size: clamp(0.88rem, 3.8vw, 1.04rem);
  font-weight: 900;
  color: #FFFFFF;
  white-space: normal;
  line-height: 1.22;
  overflow: visible;
  text-overflow: clip;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.station-color-pill {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: rgba(9, 13, 22, 0.82);
  border: 1.5px solid var(--card-accent, rgba(56, 189, 248, 0.45));
  color: var(--card-accent, var(--cyan-bright));
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  min-width: 62px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.station-color-pill strong {
  display: block;
  font-size: 0.92rem;
  color: #FFFFFF;
}

/* Connected Railway Track Path & 10 Large Balanced Level Nodes (2x5 Vertical Grid) */
.sector-railway-board {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 12px 36px;
  min-height: 0;
}

.railway-nodes-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.railway-track-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.station-levels-row {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, 1fr);
  column-gap: 16px;
  row-gap: 10px;
  align-items: stretch;
  justify-items: stretch;
  direction: ltr;
}

/* Large Balanced Level Node Button Filling the Sector Card */
.level-node-btn {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 52px;
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid rgba(148, 163, 184, 0.42);
  border-radius: 16px;
  padding: 8px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.level-node-btn.completed {
  background: var(--card-completed-bg, linear-gradient(145deg, rgba(16, 185, 129, 0.36) 0%, rgba(6, 78, 59, 0.78) 100%));
  border-color: var(--card-accent, #34D399);
  box-shadow: 0 6px 16px var(--card-accent-glow, rgba(16, 185, 129, 0.28));
}

.level-node-btn.current {
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.5) 0%, rgba(3, 105, 161, 0.85) 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.6);
  animation: gentlePulse 1.6s infinite;
}

.level-node-btn.selected {
  transform: scale(1.03);
  border-color: #FFFFFF;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.85);
}

.level-node-btn.locked {
  background: rgba(15, 23, 42, 0.82);
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  opacity: 0.94;
}

.level-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.level-node-btn.locked .level-num {
  color: #F8FAFC;
}

.level-stars-mini {
  font-size: 0.82rem;
  line-height: 1;
  letter-spacing: 0px;
}

/* Selected Level Reveal Dock */
.sector-selected-dock {
  margin: 0 14px 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(9, 13, 22, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sel-level-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sel-level-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan-bright);
}

.sel-level-title {
  font-size: 0.84rem;
  font-weight: 900;
  color: #FFFFFF;
  white-space: normal;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
}

.btn-launch-selected {
  padding: 9px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
  border: 1px solid rgba(167, 243, 208, 0.7);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 0.84rem;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

/* ==================== SCREEN 3: MINIMALIST IN-GAME HUD (85%+ 3D VIEWPORT) ==================== */
#screen-game {
  position: relative;
  padding: 4px 6px 6px;
  gap: 4px;
}

/* Single Compact Floating Top Bar */
.game-hud.glass-floating-bar {
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(9, 13, 24, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.hud-icon-back {
  width: 30px;
  height: 30px;
  min-width: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 900;
}

.hud-level-info {
  flex: 1 0 auto;
  min-width: max-content;
  display: flex;
  padding: 0;
}

.hud-level-title {
  width: 100%;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.69rem;
  font-weight: 900;
  color: #FEF08A;
  background: rgba(30, 41, 59, 0.88);
  border: 1.5px solid rgba(56, 189, 248, 0.48);
  border-radius: 999px;
  padding: 0 7px;
  white-space: nowrap;
  overflow: visible;
}

.hud-metrics {
  flex: 2 1 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: max-content;
}

.hud-capsule {
  position: relative;
  height: 32px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.94) 0%, rgba(12, 18, 34, 0.96) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.72rem;
  overflow: visible;
  white-space: nowrap;
}

.game-hud .hud-capsule {
  flex: 1 0 auto;
  min-width: max-content;
  justify-content: center;
  padding: 0 6px;
  height: 32px;
  overflow: visible;
  white-space: nowrap;
}

#hud-sparks-pill .cap-label {
  display: none !important;
}

.game-hud .hud-capsule .cap-label {
  display: inline-block;
  font-size: 0.61rem;
  font-weight: 800;
  opacity: 0.95;
}

@media (max-width: 400px) {
  .game-hud .hud-capsule .cap-label {
    display: none;
  }
}

.cap-icon {
  font-size: 0.73rem;
}

.cap-label {
  font-size: 0.61rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cap-val {
  font-size: 0.75rem;
  font-weight: 900;
  color: #FFFFFF;
}

#hud-moves-pill,
.moves-pill {
  height: 32px;
  padding: 0 6px;
  border: 2px solid #34D399;
  background: rgba(6, 78, 59, 0.85);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

#hud-sparks-pill,
.sparks-pill {
  height: 32px;
  padding: 0 6px;
}

.moves-pill .cap-label {
  color: #A7F3D0;
  font-weight: 800;
}
#hud-moves-count,
.moves-pill .cap-val {
  font-size: 0.80rem;
  font-weight: 900;
  color: #FEF08A;
}

.moves-pill.moves-warn {
  background: rgba(124, 45, 18, 0.88);
  border-color: #F97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
  animation: gentlePulse 1.1s infinite ease-in-out;
}
.moves-pill.moves-warn .cap-label {
  color: #FED7AA;
}
.moves-pill.moves-warn .cap-val {
  color: #FDBA74;
}

.moves-pill.moves-danger {
  background: rgba(127, 29, 29, 0.92);
  border-color: #EF4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.65);
  animation: dangerPulse 0.7s infinite;
}
.moves-pill.moves-danger .cap-label {
  color: #FECACA;
}
.moves-pill.moves-danger .cap-val {
  color: #FCA5A5;
}

@keyframes dangerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

#storm-timer-strip,
.timer-pill {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  min-width: max-content;
  overflow: visible;
}

.timer-pill.timer-frozen {
  border-color: #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
}

.combo-pill {
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: var(--gold-bright);
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 900;
  flex-shrink: 0;
}

.combo-pill.combo-active {
  background: rgba(245, 158, 11, 0.35);
  border-color: var(--gold-bright);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

@media (max-width: 380px) {
  .game-hud.glass-floating-bar {
    gap: 3px;
    padding: 4px;
  }
  .hud-icon-back {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 0.80rem;
  }
  .hud-level-info {
    flex: 1 1 auto;
    min-width: 0;
  }
  .hud-level-title {
    font-size: 0.62rem;
    padding: 0 5px;
    gap: 2px;
  }
  .hud-metrics {
    gap: 2px;
  }
  .game-hud .hud-capsule,
  #hud-moves-pill,
  #hud-sparks-pill,
  #storm-timer-strip {
    padding: 0 5px;
    gap: 2px;
    font-size: 0.68rem;
  }
  .cap-icon {
    font-size: 0.68rem;
  }
  .cap-val,
  #hud-moves-count,
  .moves-pill .cap-val {
    font-size: 0.72rem;
  }
  .combo-pill {
    padding: 0 3px;
    font-size: 0.60rem;
  }
}

.storm-bar-wrap {
  position: absolute;
  bottom: 1px;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}

.storm-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #EF4444, #F59E0B, #06B6D4);
  transform-origin: left center;
  will-change: transform;
  transition: transform 0.3s linear;
}

/* ==================== 80%+ 3D PLAY AREA (BORDERLESS SLEEK VIEWPORT) ==================== */
.board-stage-wrapper {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.board-frame {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 4px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #080D1A;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

/* Top-Left Camera & Cryo Controls (Single Non-Wrapping Row Directly below Top Bar, Zero Board Overlap & Zero Dispatch Jump) */
.floating-side-controls {
  position: relative;
  z-index: 15;
  container: hud-toolbar / inline-size;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: safe center;
  justify-content: flex-start;
  align-self: stretch;
  min-block-size: 28px;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-inline: max(3px, env(safe-area-inset-left, 0px)) max(3px, env(safe-area-inset-right, 0px));
  pointer-events: auto;
}

.floating-side-controls::-webkit-scrollbar {
  display: none;
}

.floating-side-controls .btn-circle-float {
  flex: 0 0 auto;
  min-inline-size: 0;
  justify-content: center;
}

.btn-circle-float[hidden] {
  display: none !important;
}

.btn-circle-float {
  min-block-size: 27px;
  padding: 3px 4px;
  white-space: nowrap;
  flex: 0 0 auto;
  min-inline-size: 0;
  font-size: 0.56rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.94) 0%, rgba(12, 18, 34, 0.96) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  color: #F8FAFC;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.btn-circle-float:active {
  transform: scale(0.94);
}

.btn-circle-cryo {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(2, 132, 199, 0.42);
}

.btn-circle-garage {
  border-color: rgba(250, 204, 21, 0.62);
  background: rgba(180, 83, 9, 0.36);
}
.btn-circle-garage .float-sub {
  color: #FEF08A;
}

.float-icon {
  font-size: clamp(0.56rem, 1.75cqi, 0.64rem);
  flex-shrink: 0;
}

.float-sub {
  font-size: 0.54rem;
  font-size: clamp(0.46rem, 2.05cqi, 0.56rem);
  font-weight: 800;
  color: var(--cyan-bright);
  margin-top: 0;
}

@media (max-width: 390px) {
  .floating-side-controls {
    gap: 1.5px;
    padding-inline: 2px;
  }
  .btn-circle-float {
    min-block-size: 25px;
    padding: 2px 3px;
    gap: 1.5px;
  }
  .float-icon {
    font-size: 0.54rem;
  }
  .float-sub {
    font-size: 0.45rem;
  }
  .carousel-arrow-btn {
    width: 28px;
    height: 28px;
    font-size: 0.74rem;
  }
  .carousel-arrow-btn.arrow-prev {
    right: 2px;
  }
  .carousel-arrow-btn.arrow-next {
    left: 2px;
  }
  .sector-railway-board {
    padding: 12px 32px;
  }
}

.board-frame.screen-shake {
  animation: boardShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}

.board-fog-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, transparent 55%, rgba(7, 11, 20, 0.35) 100%);
  z-index: 3;
}

.board-color-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.85) 0%, rgba(250, 204, 21, 0.55) 50%, transparent 75%);
}

.board-color-wave.burst {
  animation: colorWaveBurst 1s ease-out forwards;
}

@keyframes colorWaveBurst {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(28); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(34); opacity: 0; }
}

/* CRITICAL: direction: ltr so col=0 is West (Left) and col=Cols-1 is East (Right) */
.puzzle-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 4px;
  direction: ltr;
}

.puzzle-grid.grid-4x4 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
.puzzle-grid.grid-5x4 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(5, 1fr); }
.puzzle-grid.grid-6x4 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(6, 1fr); }
.puzzle-grid.grid-7x4 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(7, 1fr); }
.puzzle-grid.grid-5x5 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); }
.puzzle-grid.grid-6x5 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 1fr); gap: 3px; }
.puzzle-grid.grid-7x5 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(7, 1fr); gap: 3px; }
.puzzle-grid.grid-8x5 { grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(8, 1fr); gap: 3px; }
.puzzle-grid.grid-6x6 { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); gap: 3px; }
.puzzle-grid.grid-7x6 { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(7, 1fr); gap: 2.5px; }
.puzzle-grid.grid-8x6 { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(8, 1fr); gap: 2.5px; }
.puzzle-grid.grid-9x6 { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(9, 1fr); gap: 2.5px; }
.puzzle-grid.grid-7x7 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 2.5px; }
.puzzle-grid.grid-8x7 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(8, 1fr); gap: 2px; }
.puzzle-grid.grid-9x7 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(9, 1fr); gap: 2px; }
.puzzle-grid.grid-10x7 { grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(10, 1fr); gap: 2px; }
.puzzle-grid.grid-8x8 { grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); gap: 2px; }

/* When Three.js WebGL 2.5D/3D Engine is active, the 3D canvas handles rendering & raycasting */
.board-frame.mode-3d-active .puzzle-grid,
.board-frame.mode-3d-active .train-canvas {
  opacity: 0;
  pointer-events: none;
}

.board-3d-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  z-index: 4;
  border-radius: 20px;
  cursor: pointer;
}

/* Fallback 2D Grid Cell */
.grid-cell {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border: 1.5px solid #334155;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-rotator {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.tile-rotator svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cell-spark-marker {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}

.cell-spark-marker svg {
  width: 44%;
  height: 44%;
}

.train-canvas {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  pointer-events: none;
  z-index: 5;
}

/* ==================== FLOATING SLEEK BOTTOM CONTROL BAR (4-COLUMN SINGLE ROW, ZERO BLUR LAG) ==================== */
.game-action-bar.glass-floating-dock {
  display: grid;
  grid-template-columns: 0.68fr 0.72fr 1.12fr 1.25fr;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(11, 15, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 20;
  align-items: center;
}

.btn-action {
  height: 44px;
  padding: 0 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.btn-reset {
  background: rgba(15, 23, 42, 0.76);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  color: var(--text-light);
}

.btn-hint {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.94) 0%, rgba(217, 119, 6, 0.94) 100%);
  border: 1.5px solid #FEF08A;
  color: #090D16;
}

.action-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.action-label {
  font-size: 0.78rem;
  font-weight: 900;
}

.action-badge {
  font-size: 0.58rem;
  background: rgba(9, 13, 22, 0.85);
  color: #FEF08A;
  padding: 1px 6px;
  border-radius: 999px;
  margin-top: 2px;
}

#btn-launch-train,
.btn-launch {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  border: 1.5px solid rgba(254, 240, 138, 0.72);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.42);
}

#btn-launch-train.path-ready-pulse,
.btn-launch.path-ready-pulse {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  border-color: #FEF08A;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  animation: launchReadyPulse 1.15s infinite ease-in-out;
}

@keyframes launchReadyPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.btn-launch.turbo-mode {
  background: linear-gradient(135deg, #F97316 0%, #DC2626 100%);
  border-color: #FDE047;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.8);
}

/* ==================== ADMOB BANNER SLOT ==================== */
.admob-banner-slot {
  height: 40px;
  min-height: 40px;
  background: rgba(5, 8, 17, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

html.has-native-admob #admob-banner-slot {
  display: none !important;
}

.admob-banner-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #CBD5E1;
  font-size: 0.7rem;
}

.ad-tag {
  background: var(--gold-molten);
  color: #090D16;
  font-weight: 900;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-banner-copy {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.ad-banner-cta {
  background: var(--cyan-neon);
  color: #090D16;
  font-weight: 900;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ==================== OPAQUE HIGH-CONTRAST MODALS ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.98) 0%, rgba(10, 15, 28, 0.99) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 24px;
  padding: 18px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  text-align: center;
  color: var(--text-light);
  animation: modalPop 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.92) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  color: var(--text-light);
}

.daily-login-modal-card .shop-header,
.lang-modal-card .modal-title {
  padding-inline: 36px;
}

.modal-avatar-header {
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  border-radius: 18px;
  background: #0B1324;
  border: 1.5px solid var(--cyan-neon);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
  overflow: hidden;
}

.modal-avatar-header svg,
.modal-avatar-header canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-silver);
  line-height: 1.45;
  margin-bottom: 14px;
}

.modal-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Visual Novel Tactical Dialogue Modal */
.dialogue-modal-card {
  padding: 16px;
  text-align: start;
}

.dialogue-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dialogue-chapter-badge {
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid var(--cyan-neon);
  color: var(--cyan-bright);
  font-weight: 800;
  font-size: 0.74rem;
  padding: 2px 10px;
  border-radius: 999px;
}

.btn-skip-dialogue {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.8);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dialogue-scene-banner {
  position: relative;
  min-height: 158px;
  padding: 8px 10px 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 50% 36%, #1E293B 0%, #090D16 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.dialogue-portrait-box {
  width: 118px;
  height: 118px;
  border-radius: 18px;
  background: #0B1324;
  border: 1.5px solid var(--cyan-neon);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.30);
  overflow: hidden;
  flex-shrink: 0;
}

.dialogue-portrait-box svg,
.dialogue-portrait-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dialogue-speaker-tag {
  position: relative;
  bottom: auto;
  right: auto;
  background: rgba(9, 13, 22, 0.92);
  color: var(--gold-bright);
  padding: 2px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.78rem;
  border: 1px solid var(--gold-molten);
}

.dialogue-body {
  background: rgba(11, 15, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  min-height: 76px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.dialogue-text {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text-light);
}

.dialogue-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialogue-dots {
  display: flex;
  gap: 5px;
}

.dialogue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
}

.dialogue-dot.active {
  background: var(--cyan-neon);
  width: 18px;
  border-radius: 999px;
}

/* Victory Modal */
.victory-header-ribbon {
  display: inline-block;
  background: linear-gradient(90deg, #06B6D4, #10B981);
  color: #FFF;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.victory-stars-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 8px;
}

.v-star {
  font-size: 2.2rem;
  filter: grayscale(100%) opacity(0.3);
  transform: scale(0.75);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.35s ease;
}

.v-star.earned {
  filter: grayscale(0%) drop-shadow(0 0 10px rgba(250, 204, 21, 0.8));
  transform: scale(1.1);
}

.victory-perf-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan-bright);
  margin-bottom: 10px;
}

.victory-color-box,
.victory-coins-box {
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 9px;
}

.victory-color-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.coins-earned-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.94rem;
  font-weight: 900;
  color: var(--gold-bright);
}

.coins-formula {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.victory-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}

/* Shop Modal */
.shop-modal-card {
  text-align: start;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.shop-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.shop-vip-card {
  background: linear-gradient(135deg, rgba(46, 16, 101, 0.85) 0%, rgba(76, 29, 149, 0.75) 55%, rgba(9, 13, 22, 0.9) 100%);
  color: #FFF;
  border: 1.5px solid var(--gold-bright);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}

.vip-badge-top {
  display: inline-block;
  background: var(--gold-bright);
  color: #090D16;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.shop-vip-card h4 {
  font-size: 0.94rem;
  color: #FEF08A;
  margin-bottom: 5px;
}

.vip-perks-list {
  list-style: none;
  font-size: 0.72rem;
  line-height: 1.5;
  margin-bottom: 9px;
}

.shop-section {
  margin-top: 8px;
}

.shop-section-title {
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--cyan-bright);
}

.shop-item-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 10px;
  background: rgba(11, 15, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.shop-item-row.is-equipped {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14) 0%, rgba(11, 15, 25, 0.85) 100%);
}

.shop-skin-preview {
  width: 84px;
  height: 54px;
  min-width: 84px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, #1E293B 0%, #090D16 100%);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.shop-loco-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shop-item-info {
  flex: 1 1 calc(100% - 98px);
  width: calc(100% - 98px);
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shop-item-info strong {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.shop-item-info small {
  font-size: 0.70rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.shop-skins-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Ad Simulator Overlay */
.ad-sim-backdrop {
  z-index: 80;
}

.ad-sim-card {
  background: rgba(9, 13, 22, 0.92);
  border-color: var(--gold-bright);
}

.ad-sim-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ad-sim-badge {
  background: #7E22CE;
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.ad-sim-timer {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--gold-bright);
}

.ad-sim-stage {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.ad-sim-train-icon {
  font-size: 2.4rem;
  margin-bottom: 4px;
}

.ad-sim-stage h4 {
  color: var(--cyan-bright);
  margin-bottom: 4px;
}

.ad-sim-stage p {
  font-size: 0.76rem;
  color: var(--text-silver);
  margin-bottom: 10px;
}

.ad-sim-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Toast Notification (V12.1: Positioned at bottom: 108px, pointer-events: none — NEVER covers top HUD buttons!) */
.ui-toast {
  position: absolute;
  top: auto;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 13, 22, 0.94);
  color: var(--cyan-bright);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  z-index: 90;
  max-width: min(92%, 380px);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  pointer-events: none !important;
}

/* ==================== V5.6: ACHIEVEMENTS MODAL, PERKS & UPGRADES ==================== */
.ach-top-btn {
  position: relative;
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
}

.ach-notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #EF4444;
  color: #FFF;
  font-size: 0.62rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
}

.ach-summary-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.ach-summary-banner strong {
  color: var(--gold-bright);
  font-size: 0.92rem;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline-end: 2px;
}

.ach-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(71, 85, 105, 0.65);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: start;
}

.ach-card.ach-ready {
  border-color: #FACC15;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.22);
}

.ach-card.ach-claimed {
  border-color: rgba(16, 185, 129, 0.55);
  opacity: 0.86;
}

.ach-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ach-icon-box {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.ach-meta {
  flex: 1;
  min-width: 0;
}

.ach-meta strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text-light);
}

.ach-meta small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-silver);
}

.ach-reward-pill {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold-bright);
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.ach-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ach-progress-row .progress-track {
  flex: 1;
  height: 8px;
}

.ach-progress-text {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--cyan-bright);
  min-width: 44px;
  text-align: end;
}

/* Locomotive Shop Perks & Upgrade Controls */
.skin-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.skin-level-badge {
  font-size: 0.66rem;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #38BDF8;
  white-space: nowrap;
}

.skin-perk-chip {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #FDE047;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 6px;
  padding: 2px 6px;
}

.skin-actions-col {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.linked-gear-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.58rem;
  font-weight: 900;
  color: #FDE047;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.65);
  border-radius: 6px;
  padding: 0 3px;
  pointer-events: none;
  z-index: 5;
}

.btn-circle-autoplay {
  border-color: rgba(16, 185, 129, 0.72) !important;
  background: linear-gradient(145deg, rgba(6, 95, 70, 0.88), rgba(15, 23, 42, 0.92)) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-circle-autoplay:hover {
  border-color: #34D399 !important;
  transform: scale(1.06);
}

.lang-top-btn {
  min-width: 34px;
  padding: 0 7px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(15, 23, 42, 0.85);
}

.lang-top-btn:hover {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.18);
}

html[dir="ltr"] .btn-hero-chevron {
  transform: scaleX(-1);
}

html[dir="ltr"] .hud-icon-back span,
html[dir="ltr"] .btn-back span:first-child {
  display: inline-block;
  transform: scaleX(-1);
}

/* ==================== V5.8 MONETIZATION, RETENTION & VIRAL GROWTH UI ==================== */
.menu-daily-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.btn-daily-challenge {
  position: relative;
  overflow: visible;
  flex: 1.35;
  border-color: rgba(16, 185, 129, 0.58) !important;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.72), rgba(15, 23, 42, 0.85)) !important;
}

.btn-daily-streak {
  position: relative;
  overflow: visible;
  flex: 1;
  border-color: rgba(250, 204, 21, 0.58) !important;
  background: linear-gradient(135deg, rgba(161, 98, 7, 0.65), rgba(15, 23, 42, 0.85)) !important;
}

.btn-circle-rent {
  border-color: rgba(250, 204, 21, 0.82) !important;
  background: linear-gradient(145deg, rgba(180, 83, 9, 0.90), rgba(15, 23, 42, 0.94)) !important;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.38);
}

.btn-circle-rent:hover {
  border-color: #FDE047 !important;
  transform: scale(1.06);
}

.victory-chest-box {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(250, 204, 21, 0.42);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.victory-chest-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #FDE047;
  margin-bottom: 6px;
}

#victory-chest-box #btn-open-mystery-chest {
  margin-top: 8px;
  font-size: 0.82rem;
  padding: 9px 10px;
}

.btn-share-victory {
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #E0F2FE !important;
}

.daily-login-modal-card {
  max-width: 410px;
}

.daily-streak-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}

.daily-day-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.daily-day-card.day-7-grand {
  grid-column: span 3;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(161, 98, 7, 0.42), rgba(15, 23, 42, 0.88));
  border-color: rgba(250, 204, 21, 0.65);
}

.daily-day-card.day-claimed {
  opacity: 0.65;
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.35);
}

.daily-day-card.day-today {
  border: 2px solid #FACC15;
  background: linear-gradient(145deg, rgba(234, 179, 8, 0.25), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
}

.daily-day-num {
  font-size: 0.70rem;
  font-weight: 800;
  color: #94A3B8;
}

.daily-day-icon {
  font-size: 1.25rem;
}

.daily-day-reward {
  font-size: 0.76rem;
  font-weight: 900;
  color: #FDE047;
}

/* ==================== V6.0 UPGRADES: BOOT LOADER, STAR MILESTONE ROAD, BOSS BANNER & TUTORIAL HAND ==================== */
.boot-loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 250;
  background: radial-gradient(circle at 50% 38%, #13233F 0%, #070B14 78%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.boot-loader-overlay[hidden] {
  display: none !important;
}

.boot-loader-overlay.boot-loader-fadeout {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.boot-loader-card {
  width: 100%;
  max-width: 340px;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid rgba(56, 189, 248, 0.48);
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.22);
}

.boot-loader-emblem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 10px;
}

.boot-loader-icon {
  font-size: 1.65rem;
}

.boot-loader-chip {
  font-size: 0.72rem;
  font-weight: 900;
  color: #FACC15;
  letter-spacing: 0.5px;
}

.boot-loader-title {
  font-size: 1.38rem;
  font-weight: 900;
  color: #FFFFFF;
  margin-bottom: 4px;
  text-shadow: 0 2px 10px rgba(56, 189, 248, 0.5);
}

.boot-loader-subtitle {
  font-size: 0.76rem;
  color: #CBD5E1;
  margin-bottom: 14px;
}

.boot-loader-bar-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-bottom: 8px;
}

.boot-loader-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06B6D4 0%, #10B981 55%, #FACC15 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75);
  transition: width 0.16s ease-out;
}

.boot-loader-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #94A3B8;
}

.boot-loader-meta strong {
  color: #FACC15;
  font-size: 0.82rem;
  font-weight: 900;
}

.boot-studio-badge {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #38BDF8;
  margin-top: 10px;
  opacity: 0.92;
}

/* Star Milestone Road (Screen Map) */
.star-milestone-road {
  padding: 6px 10px 8px;
  border-radius: 14px;
  background: rgba(11, 15, 25, 0.80);
  border: 1px solid rgba(250, 204, 21, 0.36);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.star-road-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.70rem;
}

.star-road-title {
  font-weight: 800;
  color: #FDE047;
}

.star-road-prog-text {
  font-weight: 900;
  color: #38BDF8;
}

.star-road-track-wrap {
  position: relative;
  padding: 2px 2px 0;
}

.star-road-bar-bg {
  position: absolute;
  top: 15px;
  left: 14px;
  right: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.95);
  z-index: 1;
  overflow: hidden;
}

.star-road-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #FACC15, #10B981);
  transition: width 0.35s ease;
}

.star-road-nodes {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.star-milestone-btn {
  min-width: 0;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(148, 163, 184, 0.38);
  border-radius: 10px;
  padding: 3px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #CBD5E1;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.star-milestone-btn:active {
  transform: scale(0.93);
}

.star-milestone-btn .sm-icon {
  font-size: 0.88rem;
  line-height: 1.1;
}

.star-milestone-btn .sm-stars {
  font-size: 0.60rem;
  font-weight: 900;
  color: #F8FAFC;
  line-height: 1;
}

.star-milestone-btn .sm-reward {
  font-size: 0.45rem;
  font-weight: 800;
  color: #94A3B8;
  line-height: 1.1;
  white-space: normal;
  text-align: center;
  word-break: break-word;
}

.star-milestone-btn.sm-ready {
  border-color: #FACC15;
  background: linear-gradient(145deg, rgba(234, 179, 8, 0.35), rgba(15, 23, 42, 0.95));
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.65);
  animation: gentlePulse 1.2s infinite;
}

.star-milestone-btn.sm-ready .sm-stars {
  color: #FEF08A;
}

.star-milestone-btn.sm-claimed {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(6, 78, 59, 0.48);
  opacity: 0.88;
}

.star-milestone-btn.sm-claimed .sm-stars {
  color: #6EE7B7;
}

/* Tactical Boss Stage Banner (V12.2 Centered Non-Overlapping Pill Above Top Grid Edge) */
.boss-stage-banner {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 16;
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.90) 0%, rgba(180, 83, 9, 0.90) 100%);
  border: 1.2px solid #FACC15;
  border-radius: 999px;
  padding: 3px 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #FEF08A;
  font-size: 0.68rem;
  font-weight: 900;
  max-width: 94%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.48);
  animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.boss-stage-banner[hidden] {
  display: none !important;
}

/* Level 1 Interactive Tutorial Hand Pointer */
.tutorial-hand-pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  animation: tutorialHandBounce 0.95s infinite ease-in-out;
}

.tutorial-hand-pointer[hidden] {
  display: none !important;
}

.tutorial-hand-emoji {
  font-size: 1.95rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.85));
}

.tutorial-hand-label {
  background: rgba(9, 13, 22, 0.92);
  border: 1.5px solid #FACC15;
  color: #FEF08A;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
}

@keyframes tutorialHandBounce {
  0%, 100% {
    transform: translate(-50%, -44%) scale(1);
  }
  50% {
    transform: translate(-50%, -62%) scale(1.12);
  }
}

/* ==========================================================================
   V12.3 ZERO-STUTTER 60 FPS WEBGL COMPOSITOR OPTIMIZATION
   All surfaces use opaque/high-contrast gradients without per-frame FBO blur
   readbacks over live 3D WebGL canvases (#screen-game & #screen-menu).
   ========================================================================== */
#screen-game .btn-circle-cryo {
  background: linear-gradient(180deg, rgba(3, 105, 161, 0.86) 0%, rgba(12, 74, 110, 0.92) 100%);
}

#screen-game .btn-circle-garage {
  background: linear-gradient(180deg, rgba(180, 83, 9, 0.84) 0%, rgba(120, 53, 15, 0.92) 100%);
}

#screen-game .game-action-bar.glass-floating-dock {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(9, 13, 24, 0.96) 100%);
}

/* ============================================================================
   V8.0 WORLD-CLASS STANDALONE BADGE, CONTENT-VISIBILITY & REDUCED MOTION
   ============================================================================ */
.owner-build-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  max-width: 94%;
  gap: 6px;
  margin: 4px auto 3px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.71rem;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #1E1B08;
  background: linear-gradient(135deg, #FDE047 0%, #FACC15 55%, #F59E0B 100%);
  border: 1.5px solid #FEF08A;
  box-shadow: 0 3px 14px rgba(250, 204, 21, 0.42);
}

.owner-build-pill[hidden] {
  display: none !important;
}

.modal-backdrop[hidden] {
  content-visibility: hidden;
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.12s !important;
  }
  .pulse-btn {
    animation: none !important;
  }
}

/* ============================================================================
   V8.5 GLOBAL MASTER EDITION — MOBILE SECTOR OVERLAP FIX, MECHANIC CARDS,
   UNDO CONTROL, ENDLESS MARATHON, STATION EMPIRE, STARTER PACK & 8 LANGUAGES
   ============================================================================ */

/* 1. Fix Sector Map Mission #7/#8 Overlap on 412x915 Portrait Phones */
.station-card {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}
.sector-railway-board {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 14px !important;
}
.railway-nodes-stage {
  min-height: 250px;
  height: auto !important;
  padding-bottom: 8px;
}
.station-levels-row {
  row-gap: 8px;
}
.level-node-btn {
  min-height: 43px;
  padding: 6px 12px;
}
.sector-selected-dock {
  flex-shrink: 0;
  margin: 6px 12px 10px;
  position: relative;
  z-index: 6;
  background: rgba(9, 13, 24, 0.95);
}

/* 2. Fix LTR Punctuation Alignment in Bottom Promo Slot */
html[dir="ltr"] .admob-banner-inner,
html[dir="ltr"] .ad-banner-copy {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* 3. Main Menu Endless Marathon & Station Empire Row */
.menu-global-modes-row {
  margin-top: 6px;
}
.btn-endless-mode {
  border-color: rgba(168, 85, 247, 0.65) !important;
  background: linear-gradient(145deg, rgba(88, 28, 135, 0.72), rgba(15, 23, 42, 0.92)) !important;
}
.btn-station-empire {
  position: relative;
  border-color: rgba(52, 211, 153, 0.65) !important;
  background: linear-gradient(145deg, rgba(6, 95, 70, 0.72), rgba(15, 23, 42, 0.92)) !important;
}

/* 4. Non-Blocking 3.8s Visual Mechanic Discovery Banner */
.mechanic-discovery-card {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  margin-inline: auto;
  z-index: 28;
  width: min(92%, 356px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.96));
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #F8FAFC;
  cursor: pointer;
  animation: modalPop 0.24s ease-out;
}
.boss-stage-banner:not([hidden]) ~ .mechanic-discovery-card {
  top: 36px;
}
.mechanic-discovery-card[hidden] {
  display: none !important;
}
.mechanic-card-icon {
  font-size: 1.55rem;
  flex-shrink: 0;
}
.mechanic-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mechanic-card-body strong {
  font-size: 0.82rem;
  color: #38BDF8;
}
.mechanic-card-body small {
  font-size: 0.72rem;
  color: #E2E8F0;
  line-height: 1.3;
}

/* 5. Undo Button & Relaxed Tactical Speed-Bonus Timer Styling */
.btn-undo {
  min-width: 60px;
  padding: 6px 10px !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
}
.btn-undo:disabled {
  opacity: 0.42;
}
.timer-pill.timer-relaxed {
  border-color: rgba(52, 211, 153, 0.55) !important;
}
.timer-pill.timer-storm-rush {
  border-color: rgba(245, 158, 11, 0.82) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.28);
}

/* 6. Starter Conductor Welcome Pack Card ($0.99 / 3.99 SAR) */
.shop-starter-card {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.52) 0%, rgba(14, 116, 144, 0.52) 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.72);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.20);
}
.starter-badge-top {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.28);
  color: #A7F3D0;
  margin-bottom: 4px;
}
.shop-starter-card h4 {
  margin: 2px 0 4px;
  font-size: 0.92rem;
  color: #FFFFFF;
}
.starter-pack-desc {
  margin: 0 0 8px;
  font-size: 0.74rem;
  color: #E2E8F0;
}

/* 7. 8-Language Global Selector Grid */
.lang-modal-card {
  max-width: 370px;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.lang-opt-btn {
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 800;
  justify-content: center;
}
.lang-opt-btn.active-lang {
  border-color: #38BDF8 !important;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.65), rgba(15, 23, 42, 0.95)) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

/* ==================== V9.0 ULTIMATE GLOBAL EDITION: RANK, LIVE DISPATCH BAR & GARAGE STATS ==================== */
.conductor-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px auto 2px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  color: #FDE68A;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(250, 204, 21, 0.62);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.btn-next-3star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 900;
  color: #FEF08A;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.92), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(52, 211, 153, 0.72);
  cursor: pointer;
  white-space: nowrap;
}
.btn-next-3star:active {
  transform: scale(0.95);
}

@media (max-width: 380px) {
  .screen-subheader {
    gap: 4px;
    padding: 6px 8px;
  }
  .btn-back {
    padding: 4px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-next-3star {
    padding: 4px 7px;
    font-size: 0.68rem;
    flex-shrink: 0;
  }
  .map-total-stars {
    padding: 3px 7px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .screen-title {
    font-size: 0.78rem;
  }
}

.live-dispatch-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  max-width: 96%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.94);
  border: 1.5px solid rgba(56, 189, 248, 0.72);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}
.live-dispatch-bar[hidden],
.dispatch-pill-btn[hidden] {
  display: none !important;
}
.live-dispatch-title {
  font-size: 0.74rem;
  font-weight: 900;
  color: #E2E8F0;
  padding: 0 4px;
  white-space: nowrap;
}
.dispatch-pill-btn {
  min-width: 28px;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  color: #CBD5E1;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.42);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease;
}
.dispatch-pill-btn:active {
  transform: scale(0.92);
}
.dispatch-pill-btn.active {
  color: #0F172A;
  background: linear-gradient(135deg, #38BDF8, #22D3EE);
  border-color: #BAE6FD;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}
.dispatch-cam-btn.active {
  color: #0F172A;
  background: linear-gradient(135deg, #FACC15, #F59E0B);
  border-color: #FEF08A;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55);
}

.skin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px;
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.skin-stat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.skin-stat-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.64rem;
  font-weight: 800;
  color: #CBD5E1;
}
.skin-stat-bar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.85);
  overflow: hidden;
}
.skin-stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8, #10B981);
}
.shop-whistle-btn {
  font-size: 0.70rem !important;
  padding: 4px 8px !important;
}

.shop-modal-card .shop-header {
  position: sticky;
  top: -18px;
  z-index: 14;
  background: rgb(15, 23, 42);
  margin: -18px -16px 10px;
  padding: 16px 16px 10px;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}
.shop-header .modal-close-btn {
  position: static;
  flex-shrink: 0;
}
.settings-modal-card .shop-header {
  gap: 10px;
  text-align: start;
  align-items: flex-start;
}
html[dir="ltr"] .shop-modal-card {
  text-align: left;
}

.modal-avatar-header svg {
  width: 58px !important;
  height: 58px !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 0 auto;
}

/* ==================== V12.0 COMPLETE STUDIO OVERHAUL: 8 AAA PORTRAITS, 4-STEP COACH, SPEED PILL & SETTINGS ==================== */
.v12-character-portrait-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #1E293B 0%, #090D16 100%);
  border: 2.5px solid rgba(56, 189, 248, 0.78);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35), inset 0 0 12px rgba(15, 23, 42, 0.7);
  animation: v12PortraitPulse 2.8s ease-in-out infinite;
}
.v12-character-portrait-wrap[data-speaker="fouad"]  { border-color: rgba(250, 204, 21, 0.88); box-shadow: 0 0 18px rgba(250, 204, 21, 0.42); }
.v12-character-portrait-wrap[data-speaker="amal"]   { border-color: rgba(56, 189, 248, 0.88); box-shadow: 0 0 18px rgba(56, 189, 248, 0.42); }
.v12-character-portrait-wrap[data-speaker="rabie"]  { border-color: rgba(52, 211, 153, 0.88); box-shadow: 0 0 18px rgba(52, 211, 153, 0.42); }
.v12-character-portrait-wrap[data-speaker="tariq"]  { border-color: rgba(245, 158, 11, 0.88); box-shadow: 0 0 18px rgba(245, 158, 11, 0.42); }
.v12-character-portrait-wrap[data-speaker="siraj"]  { border-color: rgba(34, 211, 238, 0.88); box-shadow: 0 0 18px rgba(34, 211, 238, 0.42); }
.v12-character-portrait-wrap[data-speaker="layla"]  { border-color: rgba(103, 232, 249, 0.88); box-shadow: 0 0 18px rgba(103, 232, 249, 0.42); }
.v12-character-portrait-wrap[data-speaker="burhan"] { border-color: rgba(192, 132, 252, 0.88); box-shadow: 0 0 18px rgba(192, 132, 252, 0.42); }
.v12-character-portrait-wrap[data-speaker="saffar"] { border-color: rgba(249, 115, 22, 0.88); box-shadow: 0 0 18px rgba(249, 115, 22, 0.45); }

.v12-character-portrait-wrap picture,
.v12-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  border-radius: 50%;
}
.v12-portrait-svg-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.v12-portrait-svg-fallback svg {
  width: 100% !important;
  height: 100% !important;
}
.modal-avatar-header .v12-character-portrait-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 4px;
}
#menu-train-preview .v12-character-portrait-wrap {
  width: 100%;
  height: 100%;
}
@keyframes v12PortraitPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.028); }
}

/* Single Permanent Ready Speed + Chase Camera Bar ([1] [2] [3] [🎥 Chase]) unified above */

/* Garage Live Sound & Engine Preview Button */
.shop-whistle-btn {
  font-size: 0.71rem !important;
  padding: 5px 9px !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #E0F2FE !important;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.45), rgba(15, 23, 42, 0.92)) !important;
  white-space: nowrap;
}
.shop-whistle-btn.is-previewing {
  border-color: #FACC15 !important;
  color: #FEF08A !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.52);
}

/* 4-Step Interactive Spotlight Coach (Mission 1) */
.tutorial-spotlight-coach {
  position: fixed;
  inset: 0;
  z-index: 42;
  pointer-events: none;
}
.tutorial-spotlight-coach[hidden] {
  display: none !important;
}
.tutorial-spotlight-ring {
  position: fixed;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  border: 3px solid #FACC15;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.45), 0 0 24px rgba(250, 204, 21, 0.85);
  pointer-events: none;
  transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
  animation: v12SpotlightPulse 1.25s ease-in-out infinite;
}
@keyframes v12SpotlightPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.88; }
}
.tutorial-coach-card {
  position: fixed;
  left: 50%;
  top: 98px;
  transform: translateX(-50%);
  width: min(92vw, 390px);
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(11, 17, 32, 0.96);
  border: 1.5px solid rgba(250, 204, 21, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.78);
  pointer-events: auto;
  color: #F8FAFC;
}
.tutorial-coach-card.dock-above-bottom {
  top: auto;
  bottom: 92px;
}
.tutorial-coach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.tutorial-step-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 900;
  color: #0F172A;
  background: linear-gradient(135deg, #FACC15, #38BDF8);
  direction: ltr;
}
.tutorial-coach-title {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 900;
  color: #FEF08A;
}
.btn-tutorial-skip {
  padding: 3px 9px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  color: #CBD5E1;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.45);
  cursor: pointer;
}
.tutorial-coach-desc {
  margin: 0;
  font-size: 0.80rem;
  line-height: 1.5;
  color: #E2E8F0;
}
.tutorial-coach-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.tutorial-coach-actions[hidden] {
  display: none !important;
}

/* Dedicated Audio & Graphics Settings Modal (#modal-settings) */
.settings-modal-card {
  max-width: 400px;
}
.settings-section {
  margin: 10px 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.24);
}
.settings-slider-row + .settings-slider-row {
  margin-top: 12px;
}
.settings-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 800;
  color: #F1F5F9;
  margin-bottom: 6px;
}
.settings-slider-header strong {
  color: #38BDF8;
  font-size: 0.84rem;
}
.settings-range-slider {
  width: 100%;
  height: 8px;
  accent-color: #38BDF8;
  cursor: pointer;
}
.settings-quality-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.qual-opt-btn {
  justify-content: center;
  padding: 8px 6px !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
}
.qual-opt-btn.active {
  color: #0F172A !important;
  background: linear-gradient(135deg, #38BDF8, #34D399) !important;
  border-color: #BAE6FD !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.48);
}
.settings-bottom-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* ==================== V12.2 8-LANGUAGE CJK TYPOGRAPHY & VICTORY BUTTON WRAPPING POLISH ==================== */
html[lang="ja"],
html[lang="ko"],
html[lang="ja"] body,
html[lang="ko"] body {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.victory-bottom-row,
#modal-victory .btn,
.victory-modal-card .btn,
.victory-bottom-row .btn {
  white-space: normal;
}

.victory-bottom-row .btn,
#modal-victory .modal-actions-col .btn {
  height: auto;
  min-height: 44px;
  line-height: 1.28;
  padding: 8px 10px;
  text-align: center;
  flex-wrap: wrap;
}

.skin-actions-col {
  flex-wrap: wrap;
  gap: 6px;
}

.shop-upgrade-btn {
  white-space: nowrap;
  font-size: 0.72rem !important;
  padding: 5px 10px !important;
  unicode-bidi: plaintext;
}

#app-shell[data-active-screen="screen-game"] .ui-toast {
  bottom: 148px;
}


