/**
 * Move the Money Across Africa
 * Mini-Games Styling (Direct Settlement, Routes, Rails, Liquidity Pools)
 *
 * DESIGN SYSTEM: "Obsidian & Ember"
 * - Canvas: #0C0D12
 * - Elevated Cards: #131722 / #14161F
 * - Hairline borders: rgba(255, 255, 255, 0.08)
 * - Electric Burnt Orange: #E85D22 (and brand #DD5A20, #EE772A)
 * - Glow Orange: #F97316
 * - Emerald: #10B981, Crimson: #EF4444, Cyan: #06B6D4 / #22D3EE, Amber: #F59E0B
 *
 * MOBILE-FIRST PRIMARY ARCHITECTURE (375px–430px Portrait Base)
 * With Progressive Enhancement for Desktop / 55" Exhibition Kiosk (min-width: 1024px)
 */

/* =========================================================================
   ZERO-SCROLL VIEWPORT LOCK
   ========================================================================= */
#view-mini_game,
#view-mini_game .stage-right-content {
  overflow-y: hidden !important;
}


/* =========================================================================
   1. COMMON MINI-GAME HUD (Mobile-First Base)
   ========================================================================= */

/* Unified Compact Arcade HUD (Zero Scroll Mobile Base)
   - Clean compact vertical rhythm with prominent map view */
.game-arcade-hud {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.liquidity-mobile-hud {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; /* rounded-2xl */
  padding: 10px 12px;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.arcade-hud-top-bar,
.liquidity-hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.arcade-hud-center,
.liquidity-hud-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

/* Scenario tag in orange/ember uppercase, subtext */
.arcade-hud-tag,
.liquidity-hud-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #E85D22;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arcade-hud-sub,
.liquidity-hud-sub {
  font-size: 0.65rem;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 1-Line Ticker Strip:
   background #131722, border rgba(232, 93, 34, 0.3), rounded-xl (12px) */
.arcade-ticker-strip,
.liquidity-demand-ticker-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #131722;
  border: 1px solid rgba(232, 93, 34, 0.3);
  border-left: 3px solid #E85D22;
  border-radius: 12px; /* rounded-xl */
  padding: 4px 10px;
  width: 100%;
  box-sizing: border-box;
}

.arcade-pill-badge,
.demand-pill-badge {
  font-size: 0.65rem;
  font-weight: 900;
  color: #F97316;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.arcade-pill-badge.active {
  color: #10B981;
}

.arcade-pill-badge.alert {
  color: #EF4444;
  animation: timerPulse 0.5s infinite alternate;
}

.arcade-ticker-text,
.demand-ticker-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: #FFFFFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.arcade-mini-counts,
.demand-mini-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.66rem;
  color: #94A3B8;
  flex-shrink: 0;
}

.arcade-mini-counts strong,
.demand-mini-counts strong {
  color: #FFFFFF;
  font-weight: 800;
}

.game-header-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #E85D22;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.game-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.2;
  color: #ffffff;
}

.game-instruction {
  font-size: 0.8rem;
  color: #94A3B8;
  line-height: 1.35;
  margin-bottom: 8px;
  display: block;
}

/* Status Board (Timer + Score) - Compact Mobile Strip */
.game-status-board {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

/* Circular countdown timer ring with orange progress stroke (#E85D22) and clear digits in center */
.timer-radial-wrap {
  width: 42px;
  height: 42px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.radial-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}

.radial-progress {
  fill: none;
  stroke: #E85D22;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
}

.radial-progress.hurry {
  stroke: #EF4444;
  animation: timerPulse 0.5s infinite alternate;
}

@keyframes timerPulse {
  from { filter: drop-shadow(0 0 4px #EF4444); }
  to { filter: drop-shadow(0 0 12px #EF4444); }
}

.radial-value {
  position: absolute;
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

.radial-value.hurry {
  color: #EF4444;
}

/* Score Display */
.score-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-val {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: #FFFFFF;
}

.score-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748B;
  text-transform: uppercase;
}

/* Total score and streak multiplier badge pill:
   e.g. X1.0 STREAK in bg #E85D22/15 border #E85D22/30 text #F97316 */
.streak-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 7px;
  background: rgba(232, 93, 34, 0.15);
  border: 1px solid rgba(232, 93, 34, 0.3);
  color: #F97316;
  border-radius: 9999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Mini Metrics */
.game-mini-metrics {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  color: #94A3B8;
  margin-top: 2px;
}

.game-mini-metrics strong {
  color: #FFFFFF;
}


/* =========================================================================
   2. MINI-GAME 1: NANA — DIRECT FX SETTLEMENT (Mobile-First Base)
   ========================================================================= */

/* Currency Coin Dock:
   Container background #131722, border rgba(255, 255, 255, 0.08), rounded-2xl (16px), padding 10px */
.coin-dock-container,
#minigame-dock {
  display: none !important;
  position: fixed !important;
  bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: calc(100% - 16px) !important;
  max-width: 420px !important;
  padding: 10px !important;
  background: #131722 !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important; /* rounded-2xl */
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.85), 0 0 20px rgba(232, 93, 34, 0.2) !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
}

#app-viewport.screen-stage_1 #minigame-dock:not(:empty),
#app-viewport[class*="screen-stage_1"] #minigame-dock:not(:empty),
#app-viewport.state-mini_game #minigame-dock:not(:empty) {
  display: flex !important;
}

.coin-dock-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.coin-dock-container:empty,
#minigame-dock:empty {
  display: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: none !important;
}

/* Ergonomic 4+3 tactile coin buttons (.coin-item, .coin-dock-btn, .currency-coin):
   - Metallic solid orange coins with crisp white dashed borders
   - Currency symbol (₦, CFA, KSh, E£ / R, FRw, K) and code
   - Solid STARKS orange (#DD5A20), highlighted state in glowing #E85D22 with shadow and ring */
.currency-coin,
.coin-item,
.coin-dock-btn {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 50% !important;
  background: #DD5A20 !important;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 2px rgba(0, 0, 0, 0.25) !important;
  outline: 1px dashed rgba(255, 255, 255, 0.5) !important;
  outline-offset: -4px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, outline 0.15s ease !important;
  color: #ffffff !important;
  user-select: none !important;
  flex-shrink: 0 !important;
}

.currency-coin:active,
.coin-item:active,
.coin-dock-btn:active {
  transform: scale(0.92) !important;
}

/* Highlighted state in glowing #E85D22 with shadow and ring */
.currency-coin.selected,
.currency-coin.coin-selected,
.coin-item.selected,
.coin-item.coin-selected,
.coin-dock-btn.selected,
.coin-dock-btn.coin-selected {
  outline: 3px solid #E85D22 !important;
  outline-offset: 2px !important;
  transform: translateY(-4px) scale(1.08) !important;
  box-shadow: 0 0 25px rgba(232, 93, 34, 0.95), 0 8px 16px rgba(0, 0, 0, 0.6) !important;
  z-index: 25 !important;
  position: relative !important;
}

.currency-coin.dragging,
.coin-item.dragging,
.coin-dock-btn.dragging {
  opacity: 0.25;
  transform: scale(0.9);
}

/* Floating drag coin with 40px upward finger offset */
.floating-drag-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  margin: 0 !important;
  transform: translate3d(var(--drag-x, 0px), calc(var(--drag-y, 0px) - 40px), 0) scale(1.18) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(232, 93, 34, 0.9) !important;
  transition: none !important;
  will-change: transform;
}

.coin-symbol {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  white-space: nowrap;
}

/* Proportional scaling for 3-letter currency symbols (GH₵, CFA, FRw, KSh, USh, TSh) */
.coin-item[data-currency="GHS"] .coin-symbol,
.coin-item[data-currency="XOF"] .coin-symbol,
.coin-item[data-currency="RWF"] .coin-symbol,
.coin-item[data-currency="KES"] .coin-symbol,
.coin-item[data-currency="UGX"] .coin-symbol,
.coin-item[data-currency="TZS"] .coin-symbol,
.currency-coin[data-currency="GHS"] .coin-symbol,
.currency-coin[data-currency="XOF"] .coin-symbol,
.currency-coin[data-currency="RWF"] .coin-symbol,
.currency-coin[data-currency="KES"] .coin-symbol,
.currency-coin[data-currency="UGX"] .coin-symbol,
.currency-coin[data-currency="TZS"] .coin-symbol {
  font-size: 0.95rem !important;
  letter-spacing: -0.035em !important;
}

.coin-code {
  font-size: 0.52rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  opacity: 0.95;
  margin-top: 1px;
  line-height: 1 !important;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Active Settlement Demand Banner */
.active-demand-banner {
  background: #131722;
  border: 1px solid rgba(232, 93, 34, 0.3);
  border-left: 3px solid #E85D22;
  border-radius: 12px;
  padding: 4px 10px;
  margin-top: 4px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.demand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #F97316;
  background: rgba(232, 93, 34, 0.15);
  border: 1px solid rgba(232, 93, 34, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.demand-text {
  font-size: 0.74rem;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.25;
}

.demand-text strong {
  color: #E85D22;
}

/* Map Particle Beam Animation */
.settlement-beam-anim {
  animation: beamDash 0.3s linear infinite;
}

@keyframes beamDash {
  to { stroke-dashoffset: -20; }
}


/* =========================================================================
   3. MINI-GAME 2: ALI — ROUTE OPTIMIZATION (Mobile-First Base)
   ========================================================================= */

.current-payment-banner {
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-icon {
  color: #E85D22;
  font-size: 1.1rem;
}

.route-cards-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
}

/* Stage 2 (Ali) Route Selection Cards:
   - Cards in #131722 with border white/[0.08], rounded-2xl (14px), compact clean list spacing */
.route-selection-card {
  background: #131722 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important; /* rounded-xl */
  padding: 6px 12px !important;
  min-height: 48px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease !important;
  user-select: none !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.route-selection-card:active {
  transform: scale(0.97);
}

.route-selection-card.card-highlighted {
  border-color: #F97316 !important;
  background: rgba(249, 115, 22, 0.12) !important;
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.25);
}

/* Route B (STARKS Direct Rail) highlighted with orange glow border (border-orange-500/60) and Saves pill */
.route-selection-card.optimal {
  border: 1.5px solid rgba(249, 115, 22, 0.6) !important;
  background: linear-gradient(90deg, rgba(232, 93, 34, 0.15) 0%, #131722 100%) !important;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.25) !important;
}

.route-selection-card.optimal-selected {
  border-color: #10B981 !important;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.25) 0%, #131722 100%) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

/* Detour Warning Route */
.route-selection-card.detour {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #131722 !important;
}

.route-selection-card.detour:active {
  border-color: #EF4444 !important;
}

/* Route letter badges (A, B, C): A rose, B orange, C cyan */
.route-badge {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem !important;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.route-selection-card.optimal .route-badge,
.route-badge.route-badge-starks,
.route-badge.badge-b {
  background-color: #E85D22 !important; /* STARKS Orange */
}

.route-selection-card.detour-us .route-badge,
.route-badge.route-badge-us,
.route-badge.badge-a {
  background-color: #EF4444 !important; /* Rose / Red Detour */
}

.route-selection-card.detour-eu .route-badge,
.route-badge.route-badge-eu,
.route-badge.badge-c {
  background-color: #06B6D4 !important; /* Cyan Detour */
}

.route-info {
  flex: 1;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.route-tag-title {
  font-size: 0.88rem !important;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-fee-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.route-breadcrumb {
  font-size: 0.68rem;
  color: #94A3B8;
  letter-spacing: 0.02em;
}

/* Toll skimmed pills (-$8,520 Toll Skimmed 7.1%, $480 fee 0.4%, -$6,840 Toll Skimmed 5.7%) */
.route-fee-pill {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-block;
  white-space: nowrap;
}

.route-fee-pill.optimal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10B981;
}

.route-fee-pill.detour {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

/* "Saves $8,040" pill */
.route-savings-highlight {
  font-size: 0.68rem;
  font-weight: 800;
  color: #10B981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 6px;
  border-radius: 9999px;
  display: inline-block;
  white-space: nowrap;
}

/* SELECT buttons on right */
.btn-select-route {
  background: #1A202E !important;
  border: 1px solid rgba(232, 93, 34, 0.35) !important;
  color: #F97316 !important;
  padding: 4px 12px !important;
  min-height: 32px !important;
  height: 32px !important;
  min-width: 58px !important;
  border-radius: 12px !important; /* rounded-xl */
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  touch-action: manipulation;
  flex-shrink: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-select-route.recommended,
.route-selection-card.optimal .btn-select-route {
  background: #E85D22 !important;
  border: 1px solid #F97316 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(232, 93, 34, 0.35) !important;
}

.route-selection-card:active .btn-select-route,
.btn-select-route:active {
  transform: scale(0.95);
}

/* SVG Route Lines & Animations */
.route-path-line {
  fill: none;
  stroke-linecap: round;
  transition: stroke-width 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.route-starks-direct {
  stroke: #E85D22 !important;
  stroke-width: 4.5px !important;
  stroke-dasharray: 10, 6;
  animation: starksStrokeFlow 1.1s linear infinite;
  filter: drop-shadow(0 0 6px rgba(232, 93, 34, 0.85));
}

@keyframes starksStrokeFlow {
  to { stroke-dashoffset: -32; }
}

.route-detour-line {
  stroke-width: 3px !important;
  stroke-dasharray: 6, 4;
  opacity: 0.85;
}

.route-path-line.route-highlighted {
  stroke-width: 6.5px !important;
  filter: drop-shadow(0 0 10px currentColor) !important;
  opacity: 1 !important;
}

.route-map-badge {
  cursor: pointer;
  transition: transform 0.18s ease;
  pointer-events: auto !important;
}

.route-map-badge:hover,
.route-map-badge.badge-highlighted {
  transform: scale(1.25);
}

.route-map-badge circle.badge-hitarea {
  pointer-events: all !important;
}

/* Card Shake on Detour Error */
.shake-error {
  animation: cardShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cardShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Floating Banner Toast in HUD */
.route-toll-toast {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: toastPop 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  white-space: nowrap;
}

.route-toll-toast.success {
  background: linear-gradient(135deg, #F97316, #E85D22);
  color: #ffffff;
  border: 1.5px solid #FDBA74;
}

.route-toll-toast.error {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  color: #ffffff;
  border: 1.5px solid #F87171;
}

@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.85); }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  75% { opacity: 1; transform: translate(-50%, -3px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -14px) scale(0.95); }
}


/* =========================================================================
   4. MINI-GAME 3: JEAN-PAUL — CONNECTED RAILS (Mobile-First Base)
   ========================================================================= */

.rail-counters-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.rail-stat {
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 8px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rail-stat .stat-num {
  font-size: 1.25rem !important;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}

.rail-stat .stat-name {
  font-size: 0.65rem !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94A3B8;
  text-transform: uppercase;
}

.stat-delivered .stat-num { color: #10B981; }
.stat-piling .stat-num { color: #F59E0B; }
.stat-late .stat-num { color: #EF4444; }

/* 4 Corridor cards (TZS, KES, ETB, ZMW):
   Connected rail cards in #131722 with status subtext and CONNECTED pill.
   Broken rail card in rose-950/25 with border rose-500/50 and RECONNECT button (gradient rose-500 to orange-500, rounded-xl).
   Zero collision and zero clipping layout! */
.rail-dispatch-deck,
.rails-dispatch-deck {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  width: 100% !important;
}

.rail-dispatch-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 44px !important;
  height: auto !important;
  background: #131722 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important; /* rounded-xl */
  padding: 5px 10px !important;
  box-sizing: border-box !important;
  touch-action: manipulation !important;
  user-select: none !important;
  gap: 8px !important;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease !important;
}

.rail-dispatch-card:active {
  transform: scale(0.98) !important;
}

/* Connected rail card in #131722 */
.rail-dispatch-card.active-stream {
  background: #131722 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Broken rail card in rose-950/25 with border rose-500/50 */
.rail-dispatch-card.is-broken,
.rail-dispatch-card.broken,
.rail-dispatch-card.critical {
  background: rgba(76, 5, 25, 0.25) !important; /* rose-950/25 */
  border: 1px solid rgba(244, 63, 94, 0.5) !important; /* border rose-500/50 */
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2) !important;
}

@keyframes hazardStripeAnim {
  0% { opacity: 0.95; }
  100% { opacity: 1; }
}

.rail-meta-pillar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.rail-flag {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #E2E8F0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  letter-spacing: 0.05em !important;
  flex-shrink: 0 !important;
}

.rail-text-info {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 !important;
  gap: 2px !important;
}

.rail-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
}

.rail-corridor-title,
.rail-corridor-name {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.rail-corridor-curr {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  color: #94A3B8 !important;
  flex-shrink: 0 !important;
}

.rail-status-line {
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.rail-status-line.active {
  color: #10B981 !important;
}

.rail-status-line.broken {
  color: #FB7185 !important;
}

.rail-corridor-sub {
  font-size: 0.62rem !important;
  color: #94A3B8 !important;
}

.rail-conduit-wrap {
  flex: 1;
  margin: 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.rail-track-line {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.rail-track-line.active {
  background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.rail-track-line.broken {
  background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.rail-status-text {
  font-size: 0.64rem;
  font-weight: 700;
  margin-top: 2px;
}

.rail-status-text.ok {
  color: #10B981;
}

.rail-status-text.demurrage {
  color: #EF4444;
  font-weight: 800;
}

/* Buttons in Rail Dispatch Deck (Responsive clamp(72px, 20vw, 100px) width, zero overflow) */
.rail-dispatch-card .btn-rail-reconnect {
  min-width: clamp(72px, 20vw, 100px) !important;
  max-width: clamp(72px, 20vw, 100px) !important;
  width: clamp(72px, 20vw, 100px) !important;
  min-height: 32px !important;
  height: 32px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  border-radius: 12px !important; /* rounded-xl */
  padding: 4px 6px !important;
  flex-shrink: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #94A3B8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  transition: transform 0.1s ease, filter 0.15s ease !important;
}

/* Connected pill styling */
.rail-dispatch-card.active-stream .btn-rail-reconnect,
.rail-dispatch-card .btn-connected {
  min-width: clamp(72px, 20vw, 100px) !important;
  max-width: clamp(72px, 20vw, 100px) !important;
  width: clamp(72px, 20vw, 100px) !important;
  min-height: 32px !important;
  height: 32px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  border-radius: 12px !important; /* rounded-xl */
  padding: 4px 6px !important;
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #10B981 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* RECONNECT button (gradient rose-500 to orange-500, rounded-xl) */
.rail-dispatch-card .btn-rail-reconnect.urgent,
.rail-dispatch-card.is-broken .btn-rail-reconnect {
  background: linear-gradient(135deg, #F43F5E 0%, #E85D22 100%) !important;
  border: 1px solid #FB7185 !important;
  color: #ffffff !important;
  border-radius: 12px !important; /* rounded-xl */
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35) !important;
  animation: reconnectPulse 0.7s infinite alternate !important;
}

@keyframes reconnectPulse {
  from { transform: scale(0.97); }
  to { transform: scale(1.03); }
}

.rail-dispatch-card .btn-rail-reconnect:active {
  transform: scale(0.92) !important;
  background: #EF4444 !important;
}

/* Standalone Deck Reconnect Button (Test-suite compliant touch target) */
.btn-deck-reconnect {
  min-height: 54px !important;
  height: 54px !important;
  width: 100% !important;
  background: linear-gradient(135deg, #F43F5E 0%, #E85D22 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #FB7185 !important;
  border-radius: 12px !important; /* rounded-xl */
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.6) !important;
  touch-action: manipulation !important;
  user-select: none !important;
  transition: transform 0.08s ease, filter 0.15s ease !important;
}

.btn-deck-reconnect:active {
  transform: scale(0.97) !important;
  filter: brightness(1.2) !important;
}

/* 5px Neon Rail Tracks */
.rail-track {
  fill: none;
  stroke-width: 5px !important;
  stroke-linecap: round;
  transition: stroke 0.3s ease, filter 0.3s ease;
}

.rail-track.active {
  stroke: #06B6D4 !important;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.8)) !important;
}

.rail-track.broken {
  stroke: #EF4444 !important;
  stroke-dasharray: 8 6 !important;
  animation: brokenJitter 0.3s infinite !important;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.9)) !important;
}

/* 7px Glowing Payment Packets */
.streaming-packet {
  r: 7px !important;
  fill: #06B6D4;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.9));
  transition: fill 0.2s ease, filter 0.2s ease;
}

.streaming-packet.stalled {
  fill: #F59E0B !important;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.95)) !important;
}

.streaming-packet.surging {
  fill: #10B981 !important;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 1)) !important;
}

/* 60px Midpoint Hotspot */
.rail-break-badge {
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
}

.rail-pulse-hit-area {
  r: 30px !important;
  fill: rgba(239, 68, 68, 0.25) !important;
  stroke: #EF4444 !important;
  stroke-width: 2px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  animation: pulseAlertGlow 0.8s infinite alternate ease-in-out !important;
}

@keyframes pulseAlertGlow {
  from { opacity: 0.6; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 8px #EF4444); }
}


/* =========================================================================
   5. MINI-GAME 4: SELAM — LIQUIDITY POOLS (Mobile-First Base)
   ========================================================================= */

/* Inverted Mobile Layout: Top 15% compact HUD, Bottom 85% Liquidity Deck */
#app-viewport.game-liquidity-active .stage-split {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}

#app-viewport.game-liquidity-active #minigame-hud-content {
  order: 1 !important;
  width: 100% !important;
  height: auto !important;
  max-height: 16vh !important;
  flex: 0 0 auto !important;
  padding: 6px 12px 4px 12px !important;
  overflow: visible !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #0C0D12 !important;
  backdrop-filter: blur(8px) !important;
  z-index: 25 !important;
}

#app-viewport.game-liquidity-active #minigame-left-canvas {
  order: 2 !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-evenly !important;
  padding: 4px 8px 10px 8px !important;
  z-index: 20 !important;
}

/* 5 Currency Conduits (KES, NGN, GHS, ZAR, EGP) in Thumb Zone */
.liquidity-tanks-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  height: 100%;
  justify-content: space-evenly;
  padding: 2px 4px;
  box-sizing: border-box;
}

/* Liquidity Pool Cards in #131722 with border white/[0.08], rounded-2xl (16px) */
.liquidity-conduit-card,
.liquidity-pool-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 56px;
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; /* rounded-2xl */
  padding: 4px 10px 6px 10px;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  cursor: pointer;
  position: relative;
}

.liquidity-conduit-card:active {
  transform: scale(0.985);
}

.liquidity-conduit-card.critical {
  border-color: #EF4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5) !important;
  animation: criticalPulse 0.6s infinite alternate !important;
}

.liquidity-conduit-card.refill-flash {
  border-color: #06B6D4 !important;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.8) !important;
}

@keyframes criticalPulse {
  from { border-color: #EF4444; }
  to { border-color: #FF8888; }
}

/* Integrated top draw progress header for active trades when urgent */
.conduit-ticket-slot {
  height: 20px;
  min-height: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  overflow: visible;
}

.inline-trade-ticket {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(232, 93, 34, 0.2);
  border: 1px solid rgba(232, 93, 34, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.inline-trade-ticket.slide-in {
  animation: ticketSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes ticketSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.inline-trade-ticket.settled {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.25) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5) !important;
}

.inline-trade-ticket.stockout {
  border-color: #EF4444 !important;
  background: rgba(239, 68, 68, 0.3) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
}

.trade-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.66rem;
  font-weight: 800;
  color: #ffffff;
}

.trade-bolt {
  color: #E85D22;
  font-size: 0.72rem;
  margin-right: 4px;
}

.trade-amt-code {
  letter-spacing: 0.02em;
}

.trade-status-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.inline-trade-ticket.settled .trade-status-label {
  color: #10B981;
}

.inline-trade-ticket.stockout .trade-status-label {
  color: #EF4444;
}

.trade-drain-meter {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.trade-drain-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #FA9A60 0%, #E85D22 100%);
  border-radius: 2px;
}

/* Conduit Main Row */
.conduit-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

/* Pool Meta Pillar (Left: Flag, Code, Country, Level Badge) */
.pool-meta-pillar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 78px;
  max-width: 82px;
  flex-shrink: 0;
}

.pool-flag-icon {
  font-size: 0.70rem;
  font-weight: 800;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 5px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  line-height: 1;
}

.pool-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pool-code-text {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.pool-country-text {
  font-size: 0.58rem;
  color: #94A3B8;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.pool-pct-badge {
  font-size: 0.64rem;
  font-weight: 800;
  margin-top: 2px;
  display: inline-block;
  line-height: 1;
}

.pool-pct-badge.high { color: #10B981; }
.pool-pct-badge.medium { color: #F97316; }
.pool-pct-badge.low { color: #EF4444; }

/* Glassmorphic Tubular Conduit (Center) */
.pool-conduit-wrap {
  flex: 1;
  margin: 0 4px;
  position: relative;
  display: flex;
  align-items: center;
}

.tank-vessel-horizontal {
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Smooth progress gauge with gradient from orange-600 via orange-500 to amber-300 */
.tank-liquid-fill-horizontal {
  height: 100%;
  background: linear-gradient(90deg, #EA580C 0%, #F97316 60%, #FCD34D 100%) !important;
  border-radius: 13px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.5);
  position: relative;
}

/* Wave Surface Physics Glow on Fluid Meniscus */
.wave-surface-horizontal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  box-shadow: 0 0 8px #ffffff;
  animation: waveGlow 1.2s infinite ease-in-out alternate;
}

@keyframes waveGlow {
  from { opacity: 0.5; filter: blur(0px); }
  to { opacity: 1; filter: blur(1px); }
}

.conduit-crit-warn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #EF4444;
  animation: warningPulse 0.5s infinite alternate ease-in-out;
  pointer-events: none;
  z-index: 5;
}

@keyframes warningPulse {
  from { opacity: 0.6; transform: translateY(-50%) scale(0.9); }
  to { opacity: 1; transform: translateY(-50%) scale(1.15); filter: drop-shadow(0 0 6px #EF4444); }
}

/* Tactile + INJECT button in orange-500/15 border orange-500/45 text-orange-300 rounded-xl (Right Rail: 74px x 46px) */
.pool-inject-wrap {
  flex-shrink: 0;
}

.btn-tank-inject {
  min-width: 74px !important;
  max-width: 74px !important;
  width: 74px !important;
  height: 46px !important;
  border-radius: 12px !important; /* rounded-xl */
  background: rgba(249, 115, 22, 0.15) !important;
  border: 1.5px solid rgba(249, 115, 22, 0.45) !important;
  color: #FDBA74 !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1px !important;
  touch-action: manipulation !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.2) !important;
  flex-shrink: 0 !important;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease !important;
  cursor: pointer !important;
  padding: 0 2px !important;
}

.btn-tank-inject:active {
  transform: scale(0.92) !important;
  background: #E85D22 !important;
  color: #0C0D12 !important;
}

.btn-tank-inject.bonus-active {
  background: #E85D22 !important;
  color: #0C0D12 !important;
  border-color: #F97316 !important;
  box-shadow: 0 0 16px rgba(232, 93, 34, 0.75) !important;
  animation: bonusPulse 0.8s infinite alternate ease-in-out !important;
}

@keyframes bonusPulse {
  from { filter: brightness(1); transform: scale(1); }
  to { filter: brightness(1.15); transform: scale(1.02); }
}

.btn-bonus-tag {
  font-size: 0.54rem !important;
  font-weight: 900 !important;
  color: #0C0D12 !important;
  letter-spacing: 0.02em !important;
  line-height: 1 !important;
}

.btn-tank-inject.is-full {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #94A3B8 !important;
  cursor: default !important;
  box-shadow: none !important;
}

/* Screen Shake Effect for Stockout Penalty */
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-0.5deg); }
  40% { transform: translateX(6px) rotate(0.5deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake-screen {
  animation: screenShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}


/* =========================================================================
   6. FLOATING DOM SCORE CALLOUTS
   ========================================================================= */

.floating-dom-score-text {
  position: fixed;
  pointer-events: none;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  z-index: 99999;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  animation: floatUpFade 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

@keyframes floatUpFade {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -48px) scale(1.1);
  }
}


/* =========================================================================
   6. DYNAMIC DENSITY MODES: SHORT & NARROW MOBILE VIEWPORTS
   ========================================================================= */

/* -------------------------------------------------------------------------
   6A. Short Viewports (max-height: 720px)
   ------------------------------------------------------------------------- */
@media screen and (max-height: 720px) {
  /* Common Arcade HUD Compact Density */
  .game-arcade-hud {
    gap: 4px !important;
  }

  .arcade-hud-top-bar {
    gap: 6px !important;
  }

  .arcade-hud-tag {
    font-size: 0.68rem !important;
  }

  .arcade-hud-sub {
    font-size: 0.60rem !important;
  }

  .arcade-ticker-strip {
    padding: 3px 8px !important;
    gap: 6px !important;
    min-height: 22px !important;
  }

  .arcade-pill-badge {
    font-size: 0.60rem !important;
  }

  .arcade-ticker-text {
    font-size: 0.68rem !important;
  }

  .arcade-mini-counts {
    font-size: 0.60rem !important;
    gap: 6px !important;
  }

  /* Stage 1 (Nana): Coin dock padding, gaps, and clamp(40px, 10.5vw, 54px) */
  .coin-dock-container,
  #minigame-dock {
    bottom: max(6px, env(safe-area-inset-bottom, 6px)) !important;
    padding: clamp(6px, 1.6vh, 8px) clamp(6px, 2vw, 8px) !important;
    gap: clamp(4px, 1.2vh, 6px) !important;
  }

  .coin-dock-row {
    gap: clamp(4px, 1.5vw, 8px) !important;
  }

  .currency-coin,
  .coin-item,
  .coin-dock-btn {
    width: clamp(40px, 10.5vw, 54px) !important;
    height: clamp(40px, 10.5vw, 54px) !important;
    min-width: clamp(40px, 10.5vw, 54px) !important;
    min-height: clamp(40px, 10.5vw, 54px) !important;
  }

  .coin-symbol {
    font-size: clamp(0.95rem, 2.8vw, 1.15rem) !important;
    line-height: 1 !important;
  }

  .coin-code {
    font-size: clamp(0.48rem, 1.6vw, 0.54rem) !important;
    letter-spacing: 0.05em !important;
  }

  /* Stage 2 (Ali): Route selection cards responsive min-height & HUD fitting */
  .route-cards-list {
    gap: clamp(3px, 0.8vh, 5px) !important;
  }

  .route-selection-card {
    min-height: clamp(38px, 6vh, 46px) !important;
    height: auto !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
  }

  .route-badge {
    width: clamp(28px, 4.5vh, 32px) !important;
    height: clamp(28px, 4.5vh, 32px) !important;
    font-size: clamp(0.78rem, 2.2vh, 0.88rem) !important;
  }

  .route-info {
    margin-left: 8px !important;
    gap: 1px !important;
    min-width: 0 !important;
  }

  .route-tag-title {
    font-size: clamp(0.74rem, 2vh, 0.82rem) !important;
    line-height: 1.15 !important;
  }

  .route-fee-row {
    gap: 3px !important;
  }

  .route-fee-pill {
    padding: 1px 5px !important;
    font-size: clamp(0.60rem, 1.6vh, 0.68rem) !important;
    line-height: 1.2 !important;
  }

  .route-savings-highlight {
    padding: 1px 5px !important;
    font-size: clamp(0.58rem, 1.5vh, 0.65rem) !important;
    line-height: 1.2 !important;
  }

  .btn-select-route {
    min-width: clamp(50px, 14vw, 54px) !important;
    height: clamp(26px, 4.2vh, 30px) !important;
    min-height: clamp(26px, 4.2vh, 30px) !important;
    padding: 2px 6px !important;
    font-size: clamp(0.64rem, 1.8vh, 0.70rem) !important;
    border-radius: 8px !important;
  }

  /* Stage 3 (Jean-Paul): Rail dispatch cards & responsive reconnect buttons */
  .rails-dispatch-deck {
    gap: clamp(3px, 0.7vh, 4px) !important;
  }

  .rail-dispatch-card {
    min-height: clamp(36px, 5.5vh, 42px) !important;
    height: auto !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
    gap: 6px !important;
  }

  .rail-meta-pillar {
    gap: 6px !important;
    min-width: 0 !important;
  }

  .rail-flag {
    font-size: clamp(0.60rem, 1.8vw, 0.68rem) !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
  }

  .rail-text-info {
    gap: 1px !important;
    min-width: 0 !important;
  }

  .rail-corridor-title,
  .rail-corridor-name {
    font-size: clamp(0.66rem, 2.2vw, 0.72rem) !important;
    line-height: 1.15 !important;
  }

  .rail-corridor-curr {
    font-size: clamp(0.56rem, 1.8vw, 0.62rem) !important;
  }

  .rail-status-line {
    font-size: clamp(0.56rem, 1.7vw, 0.60rem) !important;
    line-height: 1.15 !important;
  }

  .rail-dispatch-card .btn-rail-reconnect,
  .rail-dispatch-card .btn-connected {
    min-width: clamp(72px, 20vw, 100px) !important;
    max-width: clamp(72px, 20vw, 100px) !important;
    width: clamp(72px, 20vw, 100px) !important;
    min-height: clamp(26px, 4.2vh, 30px) !important;
    height: clamp(26px, 4.2vh, 30px) !important;
    font-size: clamp(0.58rem, 1.8vw, 0.64rem) !important;
    padding: 2px 4px !important;
    border-radius: 8px !important;
  }

  /* Stage 4 (Selam): Compact conduits (min-height clamp(34px, 5vh, 42px)), 16px ticket slot */
  #app-viewport.game-liquidity-active #minigame-left-canvas {
    padding: 2px 6px 4px 6px !important;
  }

  #app-viewport.game-liquidity-active .stage-right-content {
    max-height: 105px !important;
    padding: 4px 8px !important;
  }

  .liquidity-mobile-hud {
    padding: 6px 10px !important;
    gap: 4px !important;
    border-radius: 12px !important;
  }

  .liquidity-hud-top-bar {
    gap: 6px !important;
  }

  .liquidity-hud-tag {
    font-size: 0.65rem !important;
  }

  .liquidity-hud-sub {
    font-size: 0.58rem !important;
  }

  .liquidity-demand-ticker-strip {
    padding: 2px 8px !important;
    border-radius: 8px !important;
  }

  .demand-pill-badge {
    font-size: 0.58rem !important;
  }

  .demand-ticker-text {
    font-size: 0.66rem !important;
  }

  .demand-mini-counts {
    font-size: 0.60rem !important;
    gap: 6px !important;
  }

  .liquidity-tanks-container {
    gap: clamp(2px, 0.6vh, 4px) !important;
    padding: 2px 4px !important;
    justify-content: space-evenly !important;
  }

  .liquidity-conduit-card,
  .liquidity-pool-card {
    min-height: clamp(34px, 5vh, 42px) !important;
    height: auto !important;
    padding: 2px 8px 3px 8px !important;
    border-radius: 10px !important;
  }

  .conduit-ticket-slot {
    height: 16px !important;
    min-height: 16px !important;
    margin-bottom: 1px !important;
  }

  .trade-ticket-top {
    font-size: 0.58rem !important;
  }

  .inline-trade-ticket {
    padding: 1px 4px !important;
    border-radius: 6px !important;
  }

  .conduit-main-row {
    gap: clamp(4px, 1.2vw, 6px) !important;
  }

  .pool-meta-pillar {
    min-width: clamp(62px, 18vw, 74px) !important;
    max-width: clamp(62px, 18vw, 74px) !important;
    gap: 4px !important;
  }

  .pool-flag-icon {
    font-size: clamp(0.60rem, 1.8vw, 0.66rem) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
  }

  .pool-code-text {
    font-size: clamp(0.70rem, 2vw, 0.78rem) !important;
    line-height: 1.1 !important;
  }

  .pool-country-text {
    font-size: clamp(0.50rem, 1.4vw, 0.54rem) !important;
  }

  .pool-pct-badge {
    font-size: clamp(0.56rem, 1.6vw, 0.60rem) !important;
    margin-top: 1px !important;
  }

  .tank-vessel-horizontal {
    height: clamp(20px, 3vh, 26px) !important;
    border-radius: 10px !important;
  }

  .btn-tank-inject {
    min-width: clamp(56px, 16vw, 68px) !important;
    max-width: clamp(56px, 16vw, 68px) !important;
    width: clamp(56px, 16vw, 68px) !important;
    height: clamp(28px, 4.4vh, 36px) !important;
    font-size: clamp(0.60rem, 1.8vw, 0.68rem) !important;
    border-radius: 8px !important;
    padding: 0 1px !important;
  }

  .btn-bonus-tag {
    font-size: clamp(0.42rem, 1.3vw, 0.48rem) !important;
  }
}

/* -------------------------------------------------------------------------
   6B. Ultra-Short Viewports (max-height: 670px / available height <= 260px)
   ------------------------------------------------------------------------- */
@media screen and (max-height: 670px) {
  /* Stage 1 (Nana): Ultra-compact dock */
  .coin-dock-container,
  #minigame-dock {
    bottom: max(4px, env(safe-area-inset-bottom, 4px)) !important;
    padding: 6px 6px !important;
    gap: 4px !important;
  }

  .coin-dock-row {
    gap: clamp(4px, 1.2vw, 6px) !important;
  }

  .currency-coin,
  .coin-item,
  .coin-dock-btn {
    width: clamp(38px, 10vw, 48px) !important;
    height: clamp(38px, 10vw, 48px) !important;
    min-width: clamp(38px, 10vw, 48px) !important;
    min-height: clamp(38px, 10vw, 48px) !important;
  }

  .coin-symbol {
    font-size: clamp(0.88rem, 2.5vw, 1.05rem) !important;
  }

  .coin-code {
    font-size: clamp(0.44rem, 1.3vw, 0.50rem) !important;
  }

  /* Stage 2 (Ali): Ultra-compact route list */
  .route-cards-list {
    gap: 3px !important;
  }

  .route-selection-card {
    min-height: clamp(36px, 5.5vh, 42px) !important;
    padding: 3px 8px !important;
  }

  .route-badge {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.78rem !important;
  }

  .route-tag-title {
    font-size: 0.72rem !important;
  }

  .route-fee-pill,
  .route-savings-highlight {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
  }

  .btn-select-route {
    min-width: 50px !important;
    height: 26px !important;
    min-height: 26px !important;
    font-size: 0.62rem !important;
    padding: 2px 4px !important;
  }

  /* Stage 3 (Jean-Paul): Ultra-compact rails deck */
  .rails-dispatch-deck {
    gap: 3px !important;
  }

  .rail-dispatch-card {
    min-height: clamp(34px, 5vh, 38px) !important;
    padding: 3px 6px !important;
    gap: 4px !important;
  }

  .rail-dispatch-card .btn-rail-reconnect,
  .rail-dispatch-card .btn-connected {
    min-height: 26px !important;
    height: 26px !important;
    font-size: 0.58rem !important;
    padding: 2px 3px !important;
  }

  /* Stage 4 (Selam): All 5 tanks guaranteed to fit in <= 260px available height */
  #app-viewport.game-liquidity-active #minigame-left-canvas {
    padding: 1px 4px 2px 4px !important;
  }

  #app-viewport.game-liquidity-active .stage-right-content {
    max-height: 90px !important;
    padding: 2px 6px !important;
  }

  .liquidity-mobile-hud {
    padding: 4px 6px !important;
    gap: 2px !important;
  }

  .liquidity-tanks-container {
    gap: 2px !important;
    padding: 1px 2px !important;
  }

  .liquidity-conduit-card,
  .liquidity-pool-card {
    min-height: clamp(30px, 4.6vh, 36px) !important;
    padding: 1px 6px 2px 6px !important;
    border-radius: 8px !important;
  }

  .conduit-ticket-slot {
    height: 14px !important;
    min-height: 14px !important;
    margin-bottom: 1px !important;
  }

  .trade-ticket-top {
    font-size: 0.54rem !important;
  }

  .tank-vessel-horizontal {
    height: clamp(16px, 2.5vh, 20px) !important;
    border-radius: 8px !important;
  }

  .btn-tank-inject {
    min-width: clamp(52px, 15vw, 62px) !important;
    max-width: clamp(52px, 15vw, 62px) !important;
    width: clamp(52px, 15vw, 62px) !important;
    height: clamp(24px, 3.8vh, 30px) !important;
    font-size: 0.58rem !important;
    border-radius: 6px !important;
  }
}

/* -------------------------------------------------------------------------
   6C. Narrow Viewports (max-width: 375px)
   ------------------------------------------------------------------------- */
@media screen and (max-width: 375px) {
  /* Stage 1 (Nana): Coin dock flex-shrink & padding reduced to fit 4 coins at 320px */
  .coin-dock-container,
  #minigame-dock {
    width: calc(100% - 10px) !important;
    padding: 6px 4px !important;
    gap: 4px !important;
  }

  .coin-dock-row {
    gap: clamp(3px, 1.2vw, 6px) !important;
    justify-content: center !important;
  }

  .currency-coin,
  .coin-item,
  .coin-dock-btn {
    flex-shrink: 1 !important;
    width: clamp(36px, 10.5vw, 48px) !important;
    height: clamp(36px, 10.5vw, 48px) !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .coin-symbol {
    font-size: clamp(0.82rem, 2.6vw, 1rem) !important;
  }

  .coin-code {
    font-size: clamp(0.42rem, 1.3vw, 0.48rem) !important;
    letter-spacing: 0.02em !important;
  }

  /* Stage 2 (Ali): Prevent text wrapping, proportional badges and buttons */
  .route-selection-card {
    padding: 4px 6px !important;
  }

  .route-badge {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.80rem !important;
    flex-shrink: 0 !important;
  }

  .route-info {
    margin-left: 6px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .route-tag-title {
    font-size: 0.74rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .route-fee-row {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    gap: 2px !important;
  }

  .route-fee-pill {
    font-size: 0.58rem !important;
    padding: 1px 3px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .route-savings-highlight {
    font-size: 0.56rem !important;
    padding: 1px 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .btn-select-route {
    min-width: 48px !important;
    max-width: 52px !important;
    padding: 2px 4px !important;
    font-size: 0.62rem !important;
    flex-shrink: 0 !important;
  }

  /* Stage 3 (Jean-Paul): Rail text & reconnect buttons responsive */
  .rail-dispatch-card {
    padding: 3px 6px !important;
    gap: 4px !important;
  }

  .rail-meta-pillar {
    gap: 4px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .rail-flag {
    padding: 1px 3px !important;
    font-size: 0.60rem !important;
  }

  .rail-text-info {
    gap: 1px !important;
    min-width: 0 !important;
  }

  .rail-title-row {
    gap: 2px !important;
  }

  .rail-corridor-title,
  .rail-corridor-name {
    font-size: clamp(0.60rem, 2.4vw, 0.68rem) !important;
    letter-spacing: -0.01em !important;
  }

  .rail-corridor-curr {
    font-size: 0.54rem !important;
  }

  .rail-status-line {
    font-size: 0.54rem !important;
  }

  .rail-dispatch-card .btn-rail-reconnect,
  .rail-dispatch-card .btn-connected {
    min-width: clamp(66px, 20vw, 84px) !important;
    max-width: clamp(66px, 20vw, 84px) !important;
    width: clamp(66px, 20vw, 84px) !important;
    font-size: 0.56rem !important;
    padding: 2px 3px !important;
  }

  /* Stage 4 (Selam): Inject button and flag responsive */
  .pool-meta-pillar {
    min-width: 56px !important;
    max-width: 64px !important;
    gap: 3px !important;
  }

  .pool-flag-icon {
    font-size: 0.60rem !important;
    padding: 1px 3px !important;
  }

  .pool-code-text {
    font-size: 0.70rem !important;
  }

  .pool-country-text {
    font-size: 0.48rem !important;
    max-width: 38px !important;
  }

  .pool-pct-badge {
    font-size: 0.56rem !important;
  }

  .btn-tank-inject {
    min-width: 54px !important;
    max-width: 58px !important;
    width: 58px !important;
    font-size: 0.60rem !important;
    padding: 0 1px !important;
  }

  .btn-bonus-tag {
    font-size: 0.40rem !important;
    letter-spacing: -0.01em !important;
  }
}


/* =========================================================================
   7. PROGRESSIVE ENHANCEMENT FOR DESKTOP & 55" KIOSK (min-width: 1024px)
   ========================================================================= */

@media screen and (min-width: 1024px) {
  /* Expand HUD Elements */
  .game-header-tag {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }

  .game-title {
    font-size: 2.5rem;
    margin-bottom: 12px;
  }

  .game-instruction {
    font-size: 1.1rem;
    margin-bottom: 24px;
    display: block !important;
  }

  .game-status-board {
    gap: 32px;
    margin-bottom: 26px;
  }

  .timer-radial-wrap {
    width: 80px;
    height: 80px;
  }

  .radial-value {
    font-size: 1.85rem;
  }

  .score-val {
    font-size: 2.8rem;
  }

  .score-label {
    font-size: 0.85rem;
  }

  /* Stage 1: Expand Coin Dock horizontally on map canvas */
  .coin-dock-container,
  #minigame-dock {
    position: absolute !important;
    bottom: 24px !important;
    left: 26% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: none !important;
    flex-direction: row !important;
    border-radius: 9999px !important;
    padding: 10px 22px !important;
  }

  .coin-dock-row {
    gap: 14px;
  }

  .currency-coin,
  .coin-item,
  .coin-dock-btn {
    width: 66px !important;
    height: 66px !important;
  }

  .coin-symbol {
    font-size: 1.35rem !important;
  }

  /* Stage 2: Expand Route Cards */
  .route-selection-card {
    min-height: 68px !important;
    padding: 14px 20px !important;
  }

  .route-badge {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
  }

  .route-tag-title {
    font-size: 1.05rem !important;
  }

  /* Stage 3: Expand Rail Counters */
  .rail-counters-row {
    gap: 16px !important;
    margin-bottom: 20px !important;
  }

  .rail-stat {
    padding: 14px !important;
  }

  .rail-stat .stat-num {
    font-size: 1.8rem !important;
  }

  /* Stage 4: High-Tech Full-Width Horizontal Liquidity Console on Desktop */
  .liquidity-mobile-hud {
    padding: 14px 24px !important;
    border-radius: 20px !important;
    gap: 10px !important;
  }

  .liquidity-hud-top-bar {
    gap: 16px !important;
  }

  .liquidity-hud-tag {
    font-size: 0.95rem !important;
    letter-spacing: 0.1em !important;
  }

  .liquidity-hud-sub {
    font-size: 0.80rem !important;
  }

  .liquidity-demand-ticker-strip {
    padding: 6px 16px !important;
    border-radius: 14px !important;
  }

  .demand-pill-badge {
    font-size: 0.72rem !important;
  }

  .demand-ticker-text {
    font-size: 0.85rem !important;
  }

  .demand-mini-counts {
    font-size: 0.78rem !important;
    gap: 14px !important;
  }

  .liquidity-tanks-container {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 1060px !important;
    margin: 0 auto !important;
    gap: 10px !important;
    height: auto !important;
  }

  .liquidity-pool-card,
  .liquidity-conduit-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    padding: 10px 20px !important;
    border-radius: 18px !important;
    background: #14161F !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-sizing: border-box !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
  }

  .liquidity-conduit-card:hover {
    border-color: rgba(232, 93, 34, 0.4) !important;
    background: #181C28 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(232, 93, 34, 0.15) !important;
  }

  .conduit-main-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 18px !important;
  }

  .pool-meta-pillar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    min-width: 170px !important;
    max-width: 190px !important;
    gap: 10px !important;
  }

  .pool-flag-icon {
    font-size: 0.95rem !important;
    padding: 3px 7px !important;
    border-radius: 7px !important;
  }

  .pool-code-text {
    font-size: 1.05rem !important;
  }

  .pool-country-text {
    font-size: 0.74rem !important;
  }

  .pool-pct-badge {
    font-size: 0.85rem !important;
  }

  .pool-conduit-wrap {
    flex: 1 !important;
    min-width: 220px !important;
    height: 36px !important;
    margin: 0 !important;
    width: auto !important;
  }

  .tank-vessel-horizontal {
    height: 100% !important;
    width: 100% !important;
    border-radius: 18px !important;
    background: rgba(8, 9, 14, 0.92) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7) !important;
  }

  .tank-liquid-fill-horizontal {
    height: 100% !important;
    position: relative !important;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .pool-inject-wrap {
    flex-shrink: 0 !important;
  }

  .btn-tank-inject {
    min-width: 110px !important;
    max-width: 130px !important;
    width: 120px !important;
    height: 46px !important;
    font-size: 0.82rem !important;
    border-radius: 14px !important;
  }
}

/* =========================================================================
   8. TABLET RESPONSIVE MINI-GAMES (768px - 1023px)
   ========================================================================= */

@media screen and (min-width: 768px) and (max-width: 1023px) {
  /* Expand HUD Elements for Tablet */
  .game-arcade-hud {
    padding: 4px 8px !important;
    gap: 8px !important;
  }

  .arcade-hud-top-bar {
    gap: 12px !important;
  }

  .arcade-hud-tag {
    font-size: 0.85rem !important;
  }

  .arcade-hud-sub {
    font-size: 0.75rem !important;
  }

  .arcade-ticker-strip {
    padding: 6px 14px !important;
  }

  .arcade-ticker-text {
    font-size: 0.82rem !important;
  }

  /* Stage 1: Tablet Centered Coin Dock */
  .coin-dock-container,
  #minigame-dock {
    max-width: 540px !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 12px 20px !important;
    border-radius: 20px !important;
    gap: 10px !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    display: flex !important;
  }

  .coin-dock-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .currency-coin,
  .coin-item,
  .coin-dock-btn {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  .coin-symbol {
    font-size: 1.3rem !important;
  }

  /* Stage 2: Route Cards on Tablet */
  .route-selection-card {
    min-height: 62px !important;
    padding: 12px 16px !important;
    border-radius: 14px !important;
  }

  .route-tag-title {
    font-size: 0.95rem !important;
  }

  /* Stage 3: Rail Cards on Tablet */
  .rail-card-item {
    min-height: 52px !important;
    padding: 8px 14px !important;
  }

  /* Stage 4: Liquidity Deck on Tablet */
  #liquidity-tanks-board {
    max-width: 680px !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  .liquidity-conduit-card {
    padding: 8px 14px !important;
    min-height: 58px !important;
  }
}

/* =========================================================================
   9. THEME SUPPORT: LIGHT MODE & DARK MODE SPECIFIC STYLING
   ========================================================================= */

/* -------------------------------------------------------------------------
   9A. General HUD & Common Elements (Light Mode)
   ------------------------------------------------------------------------- */
[data-theme="light"] .game-arcade-hud,
[data-theme="light"].game-arcade-hud {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(60, 60, 60, 0.12);
  color: #040404;
}

[data-theme="light"] .arcade-ticker-strip,
[data-theme="light"].arcade-ticker-strip {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(60, 60, 60, 0.12) !important;
  border-left: 3px solid #DD5A20 !important;
  color: #040404 !important;
}

[data-theme="light"] .arcade-ticker-text {
  color: #040404 !important;
}

[data-theme="light"] .arcade-hud-sub {
  color: #555555 !important;
}

[data-theme="light"] .score-val,
[data-theme="light"] .radial-value,
[data-theme="light"] .game-title {
  color: #040404 !important;
}

[data-theme="light"] .score-label {
  color: #64748B !important;
}

[data-theme="light"] .radial-track {
  stroke: rgba(60, 60, 60, 0.12) !important;
}

[data-theme="light"] .arcade-mini-counts {
  color: #64748B !important;
}

[data-theme="light"] .arcade-mini-counts strong {
  color: #040404 !important;
}

[data-theme="light"] .game-instruction {
  color: #555555 !important;
}

/* -------------------------------------------------------------------------
   9B. Stage 1: Nana Direct FX (Light Mode)
   ------------------------------------------------------------------------- */
[data-theme="light"] .direct-card,
[data-theme="light"] .dock-container,
[data-theme="light"] .swap-container,
[data-theme="light"] .coin-dock-container,
[data-theme="light"] #minigame-dock {
  background: #FAF9FB !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  color: #040404 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 16px rgba(221, 90, 32, 0.08) !important;
}

[data-theme="light"] .currency-coin,
[data-theme="light"] .coin-item,
[data-theme="light"] .coin-dock-btn {
  background: #DD5A20 !important;
  border: 2px solid #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(221, 90, 32, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.5), inset 0 -1px 2px rgba(180, 60, 10, 0.25) !important;
  outline: 1px dashed rgba(255, 255, 255, 0.65) !important;
  outline-offset: -4px !important;
  color: #FFFFFF !important;
}

[data-theme="light"] .currency-coin .coin-symbol,
[data-theme="light"] .coin-item .coin-symbol,
[data-theme="light"] .coin-dock-btn .coin-symbol {
  color: #FFFFFF !important;
  text-shadow: 0 1px 2px rgba(140, 40, 5, 0.6) !important;
}

[data-theme="light"] .currency-coin .coin-code,
[data-theme="light"] .coin-item .coin-code,
[data-theme="light"] .coin-dock-btn .coin-code {
  color: #FFF2EA !important;
  text-shadow: 0 1px 1px rgba(140, 40, 5, 0.5) !important;
  font-weight: 800 !important;
}

[data-theme="light"] .currency-coin.selected,
[data-theme="light"] .currency-coin.coin-selected,
[data-theme="light"] .coin-item.selected,
[data-theme="light"] .coin-item.coin-selected,
[data-theme="light"] .coin-dock-btn.selected,
[data-theme="light"] .coin-dock-btn.coin-selected {
  outline: 3px solid #DD5A20 !important;
  outline-offset: 2px !important;
  transform: translateY(-4px) scale(1.08) !important;
  box-shadow: 0 0 22px rgba(221, 90, 32, 0.8), 0 8px 16px rgba(221, 90, 32, 0.3) !important;
  z-index: 25 !important;
  position: relative !important;
}

[data-theme="light"] .floating-dom-score-text {
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .direct-card .label,
[data-theme="light"] .dock-container .label,
[data-theme="light"] .swap-container .label,
[data-theme="light"] .direct-card-label,
[data-theme="light"] .dock-label {
  color: #3C3C3C !important;
}

[data-theme="light"] .active-demand-banner {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  border-left: 3px solid #DD5A20 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .demand-text {
  color: #3C3C3C !important;
}

[data-theme="light"] .badge-warmup {
  color: #065F46 !important;
  background: #D1FAE5 !important;
  border: 1px solid #34D399 !important;
}

[data-theme="light"] .streak-badge {
  color: #C2410C !important;
  background: #FFEDD5 !important;
  border: 1px solid #FDBA74 !important;
}

[data-theme="light"] .req-curr-badge {
  color: #0369A1 !important;
  background: #E0F2FE !important;
  border: 1.5px solid #7DD3FC !important;
}

[data-theme="light"] .demand-badge {
  color: #C2410C !important;
  background: #FFEDD5 !important;
  border: 1px solid #FDBA74 !important;
}

/* -------------------------------------------------------------------------
   9C. Stage 2: Ali Routes (Light Mode)
   ------------------------------------------------------------------------- */
[data-theme="light"] .routes-card,
[data-theme="light"] .comparison-card,
[data-theme="light"] .route-option,
[data-theme="light"] .route-selection-card,
[data-theme="light"] .current-payment-banner {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  color: #040404 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .route-tag-title {
  color: #040404 !important;
}

[data-theme="light"] .route-breadcrumb {
  color: #555555 !important;
}

/* Direct route card: border #DD5A20, background rgba(221, 90, 32, 0.06) */
[data-theme="light"] .route-selection-card.optimal,
[data-theme="light"] .routes-card.direct-route,
[data-theme="light"] .route-option.direct-route {
  border: 1.5px solid #DD5A20 !important;
  background: rgba(221, 90, 32, 0.06) !important;
  box-shadow: 0 2px 10px rgba(221, 90, 32, 0.12) !important;
}

/* Detour card: background rgba(239, 68, 68, 0.06) */
[data-theme="light"] .route-selection-card.detour,
[data-theme="light"] .route-selection-card.detour-us,
[data-theme="light"] .route-selection-card.detour-eu,
[data-theme="light"] .routes-card.detour,
[data-theme="light"] .route-option.detour {
  background: rgba(239, 68, 68, 0.06) !important;
  border: 1px solid rgba(239, 68, 68, 0.22) !important;
}

[data-theme="light"] .btn-select-route {
  background: #FAF9FB !important;
  border: 1px solid rgba(60, 60, 60, 0.18) !important;
  color: #DD5A20 !important;
}

[data-theme="light"] .btn-select-route.recommended,
[data-theme="light"] .route-selection-card.optimal .btn-select-route {
  background: #DD5A20 !important;
  border: 1px solid #DD5A20 !important;
  color: #FFFFFF !important;
}

/* -------------------------------------------------------------------------
   9D. Stage 3: Jean-Paul Rails (Light Mode)
   ------------------------------------------------------------------------- */
[data-theme="light"] .rail-dispatch-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  color: #040404 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .rail-dispatch-card.active-stream {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
}

[data-theme="light"] .rail-dispatch-card.is-broken,
[data-theme="light"] .rail-dispatch-card.broken,
[data-theme="light"] .rail-dispatch-card.critical {
  background: rgba(239, 68, 68, 0.06) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12) !important;
}

[data-theme="light"] .rail-corridor-title,
[data-theme="light"] .rail-corridor-name {
  color: #040404 !important;
}

[data-theme="light"] .rail-corridor-curr,
[data-theme="light"] .rail-corridor-sub {
  color: #555555 !important;
}

[data-theme="light"] .rail-flag {
  color: #3C3C3C !important;
  background: rgba(60, 60, 60, 0.06) !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
}

[data-theme="light"] .rail-track-line {
  background: rgba(60, 60, 60, 0.1) !important;
}

[data-theme="light"] .rail-dispatch-card .btn-rail-reconnect,
[data-theme="light"] .rail-dispatch-card .btn-connected {
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  background: rgba(60, 60, 60, 0.06) !important;
  color: #555555 !important;
}

[data-theme="light"] .rail-dispatch-card.active-stream .btn-rail-reconnect,
[data-theme="light"] .rail-dispatch-card .btn-connected {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #059669 !important;
}

/* Live ticker strip in Stage 3 Rails: background #FAF9FB, text #3C3C3C */
[data-theme="light"] #view-mini_game.screen-stage_3 .arcade-ticker-strip,
[data-theme="light"] .screen-stage_3 .arcade-ticker-strip,
[data-theme="light"] .rails-dispatch-deck ~ .arcade-ticker-strip,
[data-theme="light"] .game-arcade-hud .arcade-ticker-strip {
  background: #FAF9FB !important;
  border: 1px solid rgba(60, 60, 60, 0.12) !important;
  border-left: 3px solid #DD5A20 !important;
}

[data-theme="light"] #view-mini_game.screen-stage_3 .arcade-ticker-text,
[data-theme="light"] .screen-stage_3 .arcade-ticker-text {
  color: #3C3C3C !important;
}

[data-theme="light"] .rail-stat {
  background: #FAF9FB !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  color: #040404 !important;
}

[data-theme="light"] .rail-stat .stat-name {
  color: #64748B !important;
}

/* -------------------------------------------------------------------------
   9E. Stage 4: Selam Liquidity (Light Mode)
   ------------------------------------------------------------------------- */
[data-theme="light"] .liquidity-pool-card,
[data-theme="light"] .liquidity-conduit-card {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* Pool labels #040404 */
[data-theme="light"] .pool-code-text {
  color: #040404 !important;
}

[data-theme="light"] .pool-country-text {
  color: #555555 !important;
}

[data-theme="light"] .pool-flag-icon {
  color: #3C3C3C !important;
  background: rgba(60, 60, 60, 0.06) !important;
  border: 1px solid rgba(60, 60, 60, 0.14) !important;
}

/* Conduit pipes: visible on light background */
[data-theme="light"] .tank-vessel-horizontal {
  background: rgba(60, 60, 60, 0.06) !important;
  border: 1.5px solid rgba(60, 60, 60, 0.18) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Tactile inject buttons: crisp contrast */
[data-theme="light"] .btn-tank-inject {
  background: rgba(221, 90, 32, 0.1) !important;
  border: 1.5px solid rgba(221, 90, 32, 0.5) !important;
  color: #C2410C !important;
  box-shadow: 0 2px 6px rgba(221, 90, 32, 0.15) !important;
}

[data-theme="light"] .btn-tank-inject:active {
  background: #DD5A20 !important;
  color: #FFFFFF !important;
}

[data-theme="light"] .btn-tank-inject.bonus-active {
  background: #DD5A20 !important;
  color: #FFFFFF !important;
  border-color: #DD5A20 !important;
}

[data-theme="light"] .btn-tank-inject.is-full {
  background: rgba(60, 60, 60, 0.06) !important;
  border-color: rgba(60, 60, 60, 0.14) !important;
  color: #888888 !important;
}

[data-theme="light"] .liquidity-mobile-hud {
  background: #FFFFFF !important;
  border: 1px solid rgba(60, 60, 60, 0.12) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] #app-viewport.game-liquidity-active #minigame-hud-content {
  background: #FAF9FB !important;
  border-bottom: 1px solid rgba(60, 60, 60, 0.12) !important;
}

[data-theme="light"] .liquidity-demand-ticker-strip {
  background: #FAF9FB !important;
  border: 1px solid rgba(60, 60, 60, 0.12) !important;
  border-left: 3px solid #DD5A20 !important;
}

[data-theme="light"] .demand-ticker-text {
  color: #3C3C3C !important;
}

[data-theme="light"] .liquidity-hud-sub {
  color: #555555 !important;
}

/* Desktop progressive enhancement overrides for light mode */
@media screen and (min-width: 1024px) {
  [data-theme="light"] .liquidity-pool-card,
  [data-theme="light"] .liquidity-conduit-card {
    background: #FFFFFF !important;
    border: 1px solid rgba(60, 60, 60, 0.14) !important;
  }

  [data-theme="light"] .liquidity-conduit-card:hover {
    background: #F8F7FA !important;
    border-color: rgba(221, 90, 32, 0.4) !important;
  }
}

/* -------------------------------------------------------------------------
   9F. Dark Mode Explicit Reinforcement (100% Retaining Existing Dark Values)
   ------------------------------------------------------------------------- */
[data-theme="dark"] .game-arcade-hud {
  color: #FFFFFF;
}

[data-theme="dark"] .arcade-ticker-strip,
[data-theme="dark"] .active-demand-banner,
[data-theme="dark"] .liquidity-demand-ticker-strip {
  background: #131722 !important;
  border-color: rgba(232, 93, 34, 0.3) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .coin-dock-container,
[data-theme="dark"] #minigame-dock {
  background: #131722 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .route-selection-card,
[data-theme="dark"] .current-payment-banner,
[data-theme="dark"] .routes-card,
[data-theme="dark"] .comparison-card,
[data-theme="dark"] .route-option {
  background: #131722 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .route-selection-card.optimal {
  border: 1.5px solid rgba(249, 115, 22, 0.6) !important;
  background: linear-gradient(90deg, rgba(232, 93, 34, 0.15) 0%, #131722 100%) !important;
}

[data-theme="dark"] .rail-dispatch-card {
  background: #131722 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

[data-theme="dark"] .rail-dispatch-card.is-broken,
[data-theme="dark"] .rail-dispatch-card.broken,
[data-theme="dark"] .rail-dispatch-card.critical {
  background: rgba(76, 5, 25, 0.25) !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
}

[data-theme="dark"] .liquidity-pool-card,
[data-theme="dark"] .liquidity-conduit-card,
[data-theme="dark"] .liquidity-mobile-hud {
  background: #131722 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .tank-vessel-horizontal {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .btn-tank-inject {
  background: rgba(249, 115, 22, 0.15) !important;
  border: 1.5px solid rgba(249, 115, 22, 0.45) !important;
  color: #FDBA74 !important;
}

[data-theme="dark"] .currency-coin,
[data-theme="dark"] .coin-item,
[data-theme="dark"] .coin-dock-btn {
  background: #DD5A20 !important;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 2px rgba(0, 0, 0, 0.3) !important;
  outline: 1px dashed rgba(255, 255, 255, 0.45) !important;
  outline-offset: -4px !important;
  color: #ffffff !important;
}

[data-theme="dark"] .currency-coin .coin-symbol,
[data-theme="dark"] .coin-item .coin-symbol,
[data-theme="dark"] .coin-dock-btn .coin-symbol {
  color: #ffffff !important;
  text-shadow: none !important;
}

[data-theme="dark"] .currency-coin .coin-code,
[data-theme="dark"] .coin-item .coin-code,
[data-theme="dark"] .coin-dock-btn .coin-code {
  color: rgba(255, 255, 255, 0.8) !important;
  text-shadow: none !important;
}



/*    ASHENGO 60-SECOND IN-GAME ARENA (Figure 2 / Starks Design System)
   ========================================================================= */

/* Hide standard top header during 60s in-game challenge to eliminate double header */
#app-viewport.state-mini_game > .app-header,
#app-viewport[class*="state-mini_game"] > .app-header,
#app-viewport[class*="screen-stage_"] > .app-header {
  display: none !important;
}

#app-viewport.state-mini_game .main-stage,
#app-viewport[class*="screen-stage_"] .main-stage {
  height: 100% !important;
  max-height: 100% !important;
}

#view-mini_game {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
  z-index: 10 !important;
}

/* TOP HUD (Figure 2: items 1, 5, 6 + Sound & Theme Toggle Buttons · Strict 1-Line) */
.game-hud-bar {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  background: var(--bg-secondary, #FFFFFF);
  border-bottom: 1px solid var(--border-color, rgba(60, 60, 60, 0.12));
  color: var(--text-primary, #040404);
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 clamp(12px, 2vw, 24px) !important;
  gap: 12px !important;
  flex-shrink: 0;
  z-index: 30;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .game-hud-bar {
  background: var(--bg-secondary, #131722);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #f5f3f7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Left: Wallet Section (Strict Single Horizontal Line) */
.hud-wallet-section {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.hud-wallet-section .hud-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-muted, #6A6478);
  text-transform: uppercase;
}

.wallet-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #040404);
  font-family: monospace, var(--font-mono);
}

[data-theme="dark"] .wallet-amount {
  color: var(--text-primary, #f5f3f7);
}

.wallet-bar-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
}

.delivered-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--starks-orange, #DD5A20);
  font-family: monospace, var(--font-mono);
}

.wallet-track {
  width: 90px;
  height: 6px;
  background: var(--border-color, rgba(60, 60, 60, 0.15));
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="dark"] .wallet-track {
  background: rgba(255, 255, 255, 0.12);
}

.wallet-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--starks-orange, #DD5A20), var(--starks-gold, #EE772A));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Center: Phase, Score, Streak (Strict Single Horizontal Line) */
.hud-center-section {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#phase-indicator,
.phase-badge,
.badge-warmup,
.badge-busy,
.badge-rush {
  display: none !important;
}

.score-streak-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px !important;
}

.hud-stat-pill {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 5px !important;
}

.hud-stat-pill .hud-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted, #6A6478);
  text-transform: uppercase;
}

.score-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary, #040404);
  font-family: monospace, var(--font-mono);
}

[data-theme="dark"] .score-val {
  color: var(--text-primary, #f5f3f7);
}

.streak-badge {
  font-size: 14px;
  font-weight: 800;
  color: var(--starks-orange, #DD5A20);
  font-family: monospace, var(--font-mono);
}

.streak-badge.streak-active {
  color: var(--starks-gold, #EE772A);
  text-shadow: 0 0 10px rgba(238, 119, 42, 0.5);
}

.streak-text {
  font-size: 11px;
  color: var(--text-muted, #6A6478);
}

/* Right: Timer + Sound + Theme Buttons (Strict Single Horizontal Line) */
.hud-right-section {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.hud-timer-section {
  display: flex !important;
  align-items: center !important;
}

.timer-ring-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--border-color, rgba(60, 60, 60, 0.15));
  stroke-width: 5;
}

[data-theme="dark"] .timer-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.timer-meter {
  fill: none;
  stroke: var(--starks-cyan, #00d2ff);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s;
}

.timer-meter.ring-urgency {
  stroke: var(--starks-red, #ef4444);
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.timer-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  font-family: monospace, var(--font-mono);
  color: var(--text-primary, #040404);
}

[data-theme="dark"] .timer-num {
  color: var(--text-primary, #f5f3f7);
}

.hud-controls-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
}

.hud-controls-group .btn-circle-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  background: var(--bg-card, #FFFFFF) !important;
  border: 1px solid var(--border-color, rgba(60, 60, 60, 0.15)) !important;
  color: var(--text-primary, #040404) !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .hud-controls-group .btn-circle-btn {
  background: #1e2230 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #f5f3f7 !important;
}

.hud-controls-group .btn-circle-btn:hover {
  border-color: var(--starks-orange, #DD5A20) !important;
  color: var(--starks-orange, #DD5A20) !important;
  transform: scale(1.05) !important;
}

/* Selected Coin Notice Banner (Disabled for pure drag-and-drop gameplay) */
.selected-coin-banner,
.selected-coin-banner.visible {
  display: none !important;
}

.selected-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary, #040404);
}

[data-theme="dark"] .selected-coin-pill {
  color: var(--text-primary, #f5f3f7);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--starks-orange, #DD5A20);
  animation: pulse-scale 1s infinite alternate;
}

.pulse-dot.gold {
  background: var(--starks-gold, #EE772A);
}

.clear-select-btn {
  background: rgba(60, 60, 60, 0.15);
  border: none;
  color: var(--text-primary, #040404);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .clear-select-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Center Arena Grid */
.game-arena-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

@media screen and (min-width: 1024px) {
  .game-arena-grid {
    grid-template-columns: 1fr 320px !important;
    max-width: 1360px !important;
    margin: 0 auto !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* Map Viewport */
.map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#app-viewport #touchscreen-map-container .map-container-root,
#touchscreen-map-container .map-container-root,
.map-viewport .map-container-root {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 10 !important;
}

#app-viewport #touchscreen-map-container .africa-svg-root,
#touchscreen-map-container .africa-svg-root,
.map-viewport .africa-svg-root {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Right Sidebar: Last Transfers Feed */
.game-feed-panel {
  background: var(--bg-secondary, #FFFFFF);
  border-left: 1px solid var(--border-color, rgba(60, 60, 60, 0.12));
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  overflow: hidden;
  z-index: 20;
  width: 320px;
  flex-shrink: 0;
}

[data-theme="dark"] .game-feed-panel {
  background: var(--bg-secondary, #131722);
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.feed-header {
  border-bottom: 1px solid var(--border-color, rgba(60, 60, 60, 0.12));
  padding-bottom: 6px;
  margin-bottom: 8px;
}

[data-theme="dark"] .feed-header {
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.feed-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted, #6A6478);
}

.feed-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.feed-placeholder {
  color: var(--text-muted, #6A6478);
  font-size: 12px;
  text-align: center;
  margin-top: 24px;
  font-style: italic;
}

.transfer-log-item {
  background: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-color, rgba(60, 60, 60, 0.1));
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .transfer-log-item {
  background: var(--bg-card, #14161F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  box-shadow: none;
}

.log-success .log-icon-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--starks-green, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.log-error .log-icon-cross {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: var(--starks-red, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.log-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.log-country {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary, #040404);
}

[data-theme="dark"] .log-country {
  color: var(--text-primary, #f5f3f7);
}

.log-details {
  font-size: 10.5px;
  color: var(--text-muted, #6A6478);
}

.log-details.error-text {
  color: var(--starks-red, #ef4444);
}

.log-fast {
  color: var(--starks-cyan, #00d2ff);
  font-weight: 700;
}

.log-badge-gold {
  background: var(--starks-gold, #EE772A);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.log-points {
  font-size: 13px;
  font-weight: 800;
  color: var(--starks-green, #10b981);
  font-family: monospace, var(--font-mono);
  flex-shrink: 0;
}

.feed-footer {
  border-top: 1px solid var(--border-color, rgba(60, 60, 60, 0.12));
  padding-top: 8px;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted, #6A6478);
}

[data-theme="dark"] .feed-footer {
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.feed-counter {
  color: var(--starks-orange, #DD5A20);
  font-size: 13px;
  font-weight: 800;
}

/* Bottom: Coin Tray (Single Clean Tray) */
.game-tray-footer {
  background: var(--bg-secondary, #FFFFFF);
  border-top: 1px solid var(--border-color, rgba(60, 60, 60, 0.12));
  padding: 8px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  z-index: 30;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
  overflow: visible !important;
}

[data-theme="dark"] .game-tray-footer {
  background: var(--bg-secondary, #131722);
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.coin-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tray-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted, #6A6478);
}

.tray-helper {
  font-size: 10.5px;
  color: var(--text-muted, #6A6478);
}

#coin-tray,
.coin-tray-items,
.coin-dock-row {
  max-width: 100% !important;
  overflow: visible !important;
}

.coin-tray-items {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 6px 0 2px !important;
  gap: 6px !important;
  overflow: visible !important;
}

.coin-tray-items .coin-dock-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(6px, 1.2vw, 10px) !important;
  width: auto !important;
  max-width: 100% !important;
  overflow: visible !important;
  padding: 4px 6px !important;
}

.coin-tray-items .coin-item,
.coin-tray-items .currency-coin,
.coin-tray-items .coin-dock-btn {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  padding: 3px 4px !important;
  box-sizing: border-box !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

@media screen and (min-width: 768px) {
  .coin-tray-items .coin-item,
  .coin-tray-items .currency-coin,
  .coin-tray-items .coin-dock-btn {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    padding: 4px 6px !important;
  }
}

@media screen and (min-width: 1440px) {
  .coin-tray-items .coin-item,
  .coin-tray-items .currency-coin,
  .coin-tray-items .coin-dock-btn {
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
    padding: 6px 8px !important;
  }
}

.coin-key-badge {
  display: none !important;
  pointer-events: none;
  background: rgba(4, 4, 4, 0.5);
  padding: 1px 3.5px;
  border-radius: 4px;
}

.coin-drag-avatar {
  position: fixed !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  transform: translate(-50%, -50%) scale(1.18) !important;
  width: 54px !important;
  height: 54px !important;
  border-radius: 50% !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(221, 90, 32, 0.6) !important;
}

/* Floating HTML Request Cards on Map */
.map-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.req-card {
  position: absolute;
  pointer-events: auto;
  background: var(--bg-card, #FFFFFF);
  color: var(--text-primary, #040404);
  border-radius: 10px;
  padding: 7px 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  min-width: 160px;
  border: 1.5px solid var(--border-color, rgba(60, 60, 60, 0.14));
  transform: translate(-50%, -100%);
  user-select: none;
}

[data-theme="dark"] .req-card {
  background: var(--bg-card, #14161F);
  color: var(--text-primary, #f5f3f7);
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.12));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.req-card-pointer {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--bg-card, #FFFFFF);
}

[data-theme="dark"] .req-card-pointer {
  border-top-color: var(--bg-card, #14161F);
}

.req-card-gold {
  border-color: var(--starks-gold, #EE772A);
}

.req-card-gold .req-card-pointer {
  border-top-color: var(--starks-gold, #EE772A);
}

.card-targeted {
  border-color: var(--starks-orange, #DD5A20) !important;
  box-shadow: 0 0 16px rgba(221, 90, 32, 0.5) !important;
}

.card-targeted .req-card-pointer {
  border-top-color: var(--starks-orange, #DD5A20) !important;
}

.card-drag-hover {
  transform: translate(-50%, -100%) scale(1.08) !important;
  border-color: var(--starks-green, #10b981) !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6) !important;
}

.card-drag-warning {
  transform: translate(-50%, -100%) scale(1.04) !important;
  border-color: var(--starks-red, #ef4444) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
}

/* Flipped Card Popup when positioned below beacon to prevent top clipping */
.req-card.card-flip-below {
  transform: translate(-50%, 0) !important;
}

.req-card.card-flip-below.card-drag-hover {
  transform: translate(-50%, 0) scale(1.08) !important;
}

.req-card.card-flip-below.card-drag-warning {
  transform: translate(-50%, 0) scale(1.04) !important;
}

.req-card.card-flip-below .req-card-pointer {
  top: -6px !important;
  bottom: auto !important;
  border-top: none !important;
  border-bottom: 6px solid var(--bg-card, #FFFFFF) !important;
}

[data-theme="dark"] .req-card.card-flip-below .req-card-pointer {
  border-bottom-color: var(--bg-card, #14161F) !important;
}

.req-card-gold.card-flip-below .req-card-pointer {
  border-bottom-color: var(--starks-gold, #EE772A) !important;
}

.card-targeted.card-flip-below .req-card-pointer {
  border-bottom-color: var(--starks-orange, #DD5A20) !important;
}

.req-card-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.req-card-left {
  display: flex;
  flex-direction: column;
}

.req-country-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.req-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.req-country-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #040404);
}

[data-theme="dark"] .req-country-name {
  color: var(--text-primary, #f5f3f7);
}

.req-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--starks-orange, #DD5A20);
  font-family: monospace, var(--font-mono);
}

.req-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.req-curr-badge {
  background: var(--bg-card, #FFFFFF);
  color: var(--starks-cyan, #00d2ff);
  border: 1px solid var(--starks-cyan, #00d2ff);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: monospace, var(--font-mono);
  white-space: nowrap;
}

[data-theme="dark"] .req-curr-badge {
  background: #040404;
}

.badge-gold {
  background: var(--starks-gold, #EE772A);
  color: #ffffff;
  border-color: var(--starks-gold, #EE772A);
}

.badge-hidden {
  background: var(--text-muted, #6A6478);
  color: #ffffff;
  border-color: transparent;
  padding: 2px 10px;
}

.req-timer-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted, #6A6478);
}

.req-timer-bar-track {
  width: 100%;
  height: 3.5px;
  background: var(--border-color, rgba(60, 60, 60, 0.15));
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.req-timer-bar-fill {
  height: 100%;
  background: var(--starks-cyan, #00d2ff);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.bar-gold {
  background: var(--starks-gold, #EE772A);
}

.req-gold-star {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--starks-gold, #EE772A);
  text-align: center;
  margin-top: 2px;
}

/* Map Country Target & Beacon animations */
.country-beacon {
  cursor: pointer;
}

.beacon-pulse-ring {
  animation: beacon-radar 1.8s infinite ease-out;
}

.beacon-gold .gold-beacon-pulse {
  animation: beacon-gold-radar 1.5s infinite ease-out;
}

@keyframes beacon-radar {
  0% { r: 14; opacity: 1; stroke-width: 2.2; }
  100% { r: 38; opacity: 0; stroke-width: 0.8; }
}

@keyframes beacon-gold-radar {
  0% { r: 16; opacity: 1; }
  100% { r: 48; opacity: 0; }
}

@keyframes card-appear {
  0% { transform: translate(-50%, -80%) scale(0.6); opacity: 0; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

@keyframes coin-pulse {
  0% { box-shadow: 0 0 14px rgba(221, 90, 32, 0.5); }
  100% { box-shadow: 0 0 24px rgba(221, 90, 32, 0.9); }
}

@keyframes hint-glow {
  0% { box-shadow: 0 0 8px rgba(0, 210, 255, 0.4); border-color: var(--starks-cyan, #00d2ff); }
  100% { box-shadow: 0 0 20px rgba(0, 210, 255, 0.9); border-color: #ffffff; }
}

@keyframes pulse-scale {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* Responsive Breakpoints */
@media screen and (max-width: 1023px) {
  .game-arena-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    width: 100% !important;
    height: 100% !important;
  }
  .game-feed-panel {
    display: none !important;
  }
  .map-viewport {
    width: 100% !important;
    height: 100% !important;
  }
}

/* Tablet HUD Adaptation (768px - 1023px): Fluid single line with zero overflow */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .game-hud-bar {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 16px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    overflow: hidden !important;
  }
  .hud-wallet-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .wallet-amount {
    font-size: 14px !important;
    font-weight: 800 !important;
  }
  .wallet-bar-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .wallet-track {
    width: clamp(50px, 8vw, 75px) !important;
  }
  .delivered-label {
    font-size: 10px !important;
  }
  .hud-center-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
  }
  .score-streak-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
  }
  .score-val {
    font-size: 15px !important;
    font-weight: 800 !important;
  }
  .streak-badge {
    font-size: 12px !important;
    font-weight: 800 !important;
  }
  .streak-text {
    display: none !important;
  }
  .hud-right-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .timer-ring-wrapper {
    width: 36px !important;
    height: 36px !important;
  }
  .hud-controls-group {
    display: flex !important;
    gap: 6px !important;
  }
  .hud-controls-group .btn-circle-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }
}

/* Mobile HUD Adaptation (<= 767px): Polished 2-Tier Modular HUD with Zero Collisions */
@media screen and (max-width: 767px) {
  .game-hud-bar {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    padding: 6px 12px !important;
    row-gap: 4px !important;
    column-gap: 10px !important;
    height: auto !important;
    min-height: 52px !important;
    max-height: none !important;
    align-items: center !important;
    background: var(--bg-secondary, #FFFFFF) !important;
    border-bottom: 1px solid var(--border-color, rgba(60, 60, 60, 0.12)) !important;
    box-sizing: border-box !important;
    z-index: 30 !important;
  }

  /* Left Column (Row 1-2): Wallet & Progress stacked into 2 clean lines */
  .hud-wallet-section {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .hud-wallet-section .hud-label {
    font-size: 8.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    color: var(--text-muted, #6A6478) !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    display: inline-block !important;
    margin-right: 4px !important;
  }

  .wallet-amount {
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    display: inline-block !important;
  }

  .wallet-bar-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0 !important;
  }

  .wallet-track {
    width: clamp(38px, 11vw, 55px) !important;
    height: 4px !important;
    border-radius: 2px !important;
    flex-shrink: 0 !important;
  }

  .delivered-label {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: var(--starks-orange, #DD5A20) !important;
  }

  /* Right Column Row 1: Timer + Controls */
  .hud-right-section {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }

  .timer-ring-wrapper {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }

  .timer-num {
    font-size: 11.5px !important;
    font-weight: 800 !important;
  }

  .hud-controls-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .hud-controls-group .btn-circle-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
  }

  .hud-controls-group .btn-circle-btn svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* Right Column Row 2: Score + Streak */
  .hud-center-section {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .score-streak-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .hud-stat-pill {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 3px !important;
  }

  .hud-stat-pill .hud-label {
    font-size: 8px !important;
    letter-spacing: 0.6px !important;
    line-height: 1 !important;
    color: var(--text-muted, #6A6478) !important;
  }

  .score-val {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }

  .streak-badge {
    font-size: 11px !important;
    line-height: 1 !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
  }

  .streak-text {
    display: none !important;
  }
}

/* Ultra-compact screens (<= 340px, e.g. iPhone SE 1st gen 320px) */
@media screen and (max-width: 340px) {
  .hud-wallet-section .hud-label {
    display: none !important;
  }
  .wallet-track {
    width: 38px !important;
  }
  .hud-stat-pill .hud-label {
    display: none !important;
  }
}


