/* ==========================================================================
   阿蛋俱乐部 · 群友街机厅 (DC889 4-in-1 60FPS Real-Time Arcade)
   Aesthetic: Precision Arcade Cabinet × OLED CRT Bezel (Dark & Light Chassis)
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-canvas: #06080f;
  --bg-surface: #0c111d;
  --bg-elevated: #131b2e;
  --bg-subtle: rgba(255, 255, 255, 0.035);
  --bg-topbar: rgba(6, 8, 15, 0.92);
  --border-hairline: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.19);
  --border-accent: rgba(245, 184, 65, 0.48);

  --text-primary: #f1f5f9;
  --text-strong: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-gold: #f5b841;
  --accent-gold-bright: #fde047;
  --accent-gold-bg: rgba(245, 184, 65, 0.13);
  --accent-cyan: #38bdf8;
  --accent-cyan-bg: rgba(56, 189, 248, 0.13);
  --accent-purple: #c084fc;
  --accent-purple-bg: rgba(192, 132, 252, 0.14);
  --warn-amber: #f59e0b;
  --warn-amber-bg: rgba(245, 158, 11, 0.14);

  /* Market Up/Down Convention (Intl Green-Up / Red-Down by default) */
  --up-color: #10b981;
  --up-bg: rgba(16, 185, 129, 0.14);
  --up-border: rgba(16, 185, 129, 0.4);
  --down-color: #ef4444;
  --down-bg: rgba(239, 68, 68, 0.14);
  --down-border: rgba(239, 68, 68, 0.4);

  /* Invariant Game Status Semantics (Do NOT flip under CN red-up mode) */
  --sem-pass: #10b981;
  --sem-pass-bg: rgba(16, 185, 129, 0.14);
  --sem-pass-border: rgba(16, 185, 129, 0.4);
  --sem-fail: #ef4444;
  --sem-fail-bg: rgba(239, 68, 68, 0.14);
  --sem-fail-border: rgba(239, 68, 68, 0.4);

  --bezel-bg: #05070d;
  --bezel-rim: rgba(56, 189, 248, 0.24);
  --card-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.72);
  --radius-sm: 6px;
  --radius-md: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
}

html[data-color-mode="cn"] {
  --up-color: #ef4444;
  --up-bg: rgba(239, 68, 68, 0.14);
  --up-border: rgba(239, 68, 68, 0.4);
  --down-color: #10b981;
  --down-bg: rgba(16, 185, 129, 0.14);
  --down-border: rgba(16, 185, 129, 0.4);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #eef2f6;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-subtle: #f8fafc;
  --bg-topbar: rgba(255, 255, 255, 0.94);
  --border-hairline: #cbd5e1;
  --border-strong: #94a3b8;
  --border-accent: rgba(180, 110, 0, 0.45);

  --text-primary: #0f172a;
  --text-strong: #090d16;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-gold: #b45309;
  --accent-gold-bright: #9a3412;
  --accent-gold-bg: rgba(217, 119, 6, 0.11);
  --accent-cyan: #0369a1;
  --accent-cyan-bg: rgba(3, 105, 161, 0.1);
  --accent-purple: #6d28d9;
  --accent-purple-bg: rgba(109, 40, 217, 0.1);
  --warn-amber: #b45309;
  --warn-amber-bg: rgba(180, 83, 9, 0.12);

  --up-color: #059669;
  --up-bg: rgba(5, 150, 105, 0.11);
  --up-border: rgba(5, 150, 105, 0.36);
  --down-color: #dc2626;
  --down-bg: rgba(220, 38, 38, 0.1);
  --down-border: rgba(220, 38, 38, 0.36);

  --sem-pass: #059669;
  --sem-pass-bg: rgba(5, 150, 105, 0.11);
  --sem-pass-border: rgba(5, 150, 105, 0.36);
  --sem-fail: #dc2626;
  --sem-fail-bg: rgba(220, 38, 38, 0.1);
  --sem-fail-border: rgba(220, 38, 38, 0.36);

  /* Keep OLED arcade CRT bezel dark & crisp inside sleek light chassis */
  --bezel-bg: #070b14;
  --bezel-rim: #334155;
  --card-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.14);
}

html[data-theme="light"][data-color-mode="cn"] {
  --up-color: #dc2626;
  --up-bg: rgba(220, 38, 38, 0.1);
  --up-border: rgba(220, 38, 38, 0.36);
  --down-color: #059669;
  --down-bg: rgba(5, 150, 105, 0.11);
  --down-border: rgba(5, 150, 105, 0.36);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.txt-up { color: var(--up-color) !important; }
.txt-down { color: var(--down-color) !important; }
.txt-pass { color: var(--sem-pass) !important; }
.txt-fail { color: var(--sem-fail) !important; }
.txt-warn { color: var(--warn-amber) !important; }
.txt-gold { color: var(--accent-gold-bright) !important; }
.txt-neutral { color: var(--text-strong) !important; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-seal {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-bg);
  border: 1px solid var(--border-accent);
  color: var(--accent-gold-bright);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.brand-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

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

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.08s ease;
  white-space: nowrap;
}

.ctrl-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

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

.ctrl-btn.gold {
  border-color: var(--border-accent);
  background: var(--accent-gold-bg);
  color: var(--accent-gold-bright);
  font-weight: 700;
}

.ctrl-btn.gold:hover {
  background: rgba(245, 184, 65, 0.22);
}

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

.cdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.cdot.up { background: var(--up-color); }
.cdot.down { background: var(--down-color); }

/* ==========================================================================
   Main Container & Lobby View
   ========================================================================== */
.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

.hall-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--card-shadow);
}

.hall-hero-left {
  min-width: 260px;
  flex: 1;
}

.hall-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.hall-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}

.hall-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.hall-score-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hstat {
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  border-left: 2px solid var(--border-hairline);
}

.hstat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.hstat-val {
  font-size: 18px;
  font-weight: 800;
}

.hall-btns {
  display: flex;
  gap: 8px;
}

/* 2x2 Arcade Cabinets Grid */
.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cabinet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: var(--card-shadow);
}

.cabinet-card:hover,
.cabinet-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  outline: none;
}

.cab-screen-wrap {
  position: relative;
  width: 100%;
  height: 176px;
  background: #050811;
  border-bottom: 1px solid var(--border-hairline);
  overflow: hidden;
}

.cab-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cab-code-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(6, 9, 18, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
}

.cab-best-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(6, 9, 18, 0.84);
  border: 1px solid rgba(245, 184, 65, 0.42);
  color: #fde047;
  font-size: 11px;
  font-weight: 700;
}

.cab-body {
  padding: 13px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cab-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cab-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.cab-genre-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.cab-genre-tag.amber { background: var(--warn-amber-bg); color: var(--warn-amber); }
.cab-genre-tag.emerald { background: var(--sem-pass-bg); color: var(--sem-pass); }
.cab-genre-tag.cyan { background: var(--accent-cyan-bg); color: var(--accent-cyan); }
.cab-genre-tag.purple { background: var(--accent-purple-bg); color: var(--accent-purple); }

.cab-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.cab-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cab-ctrl-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.cab-play-cta {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-bg);
  border: 1px solid var(--border-accent);
  color: var(--accent-gold-bright);
  font-size: 12.5px;
  font-weight: 800;
  transition: background 0.14s ease;
}

.cabinet-card:hover .cab-play-cta {
  background: var(--accent-gold);
  color: #080b12;
}

/* ==========================================================================
   Active Cabinet Shell & Cartridge Switcher
   ========================================================================== */
.cabinet-shell {
  position: relative;
}

.cartridge-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.back-hall-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.back-hall-btn:hover {
  border-color: var(--border-accent);
}

.back-count {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-gold-bg);
  color: var(--accent-gold-bright);
}

.cartridge-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cart-pill {
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cart-pill:hover {
  color: var(--text-strong);
  background: var(--bg-subtle);
}

.cart-pill.active {
  background: var(--accent-gold-bg);
  border-color: var(--border-accent);
  color: var(--accent-gold-bright);
}

.cartridge-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Stage HUD & Bezels
   ========================================================================== */
.stage-hud-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 10px;
}

.stage-hud-bar.wide-hud {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.shud-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.shud-lbl {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.shud-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-preview-cell {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#mergeNextCanvas {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.arcade-select {
  margin-top: 2px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
  max-width: 100%;
}

.canvas-bezel {
  position: relative;
  background: var(--bezel-bg);
  border: 2px solid var(--bezel-rim);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.8), var(--card-shadow);
}

.canvas-bezel canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

/* Game 01 Layout */
.merge-layout {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.merge-bezel {
  max-width: 440px;
  margin: 0 auto;
}

.skill-dock {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.skill-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-strong);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.skill-btn.ready {
  border-color: var(--border-accent);
  background: var(--accent-gold-bg);
}

.skill-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.skill-name {
  font-size: 12.5px;
  font-weight: 800;
}

.skill-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.side-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.side-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
}

.side-card-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-gold-bg);
  color: var(--accent-gold-bright);
}

.side-card-tip {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.evo-chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}

.evo-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  opacity: 0.52;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.evo-node.unlocked {
  opacity: 1;
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.evo-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

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

.evo-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

.evo-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Wide Stage Panel (Games 02, 03, 04) */
.wide-stage-panel {
  max-width: 960px;
  margin: 0 auto;
}

.wide-bezel {
  width: 100%;
}

.mobile-action-bar {
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.m-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.m-hint strong {
  color: var(--text-strong);
}

.compact-skill {
  padding: 7px 14px;
  border-color: var(--border-accent);
  background: var(--accent-gold-bg);
}

/* ==========================================================================
   Game Over / Settlement Modal
   ========================================================================== */
.arcade-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.arcade-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.go-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.08em;
}

.go-rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 14px;
}

.go-rank-badge {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--accent-gold-bg);
  border: 2px solid var(--border-accent);
  color: var(--accent-gold-bright);
  font-size: 24px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.go-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-strong);
}

.go-record-tag {
  display: inline-block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--sem-pass);
}

.go-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.go-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.go-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.go-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  margin-top: 2px;
}

.go-comment {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-gold);
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.go-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.big-cta {
  height: 36px;
  padding: 0 16px;
  font-size: 13.5px;
}

/* Footer & Toast */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 14px 16px 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 300;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive Mobile Optimization (390px iPhone & Tablets)
   ========================================================================== */
@media (max-width: 860px) {
  .cabinet-grid {
    grid-template-columns: 1fr;
  }

  .merge-layout {
    grid-template-columns: 1fr;
  }

  .stage-hud-bar.wide-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .track-picker-cell {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .topbar-inner {
    padding: 0 8px;
    gap: 4px;
  }

  .brand {
    gap: 6px;
  }

  .brand-seal {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .brand-title {
    font-size: 13px;
  }

  .brand-sub,
  .hide-xs {
    display: none;
  }

  .topbar-right {
    gap: 4px;
  }

  .ctrl-btn {
    height: 27px;
    padding: 0 6px;
    font-size: 10.5px;
    gap: 3px;
  }

  .container {
    padding: 10px 10px 22px;
  }

  .hall-title {
    font-size: 17px;
  }

  .cartridge-tabs {
    width: 100%;
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-pill {
    font-size: 12px;
    padding: 0 6px;
  }

  .stage-hud-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .go-stats-grid {
    grid-template-columns: 1fr;
  }
}
