/* ==========================================================================
   STOCK MARGIN MANIA - DEFINITIVE STYLESHEET
   Stockbit Dark Theme | 1600x900 True Uniform Scaling Architecture
   Zero-Dead-Space Accessibility | High Legibility | Full SRS Compliance
   ========================================================================== */

:root {
  /* Authentic Stockbit Mobile Dark Mode Palette (No fuzzy transparent glows) */
  --bg-app: #121312;             /* Deep matte dark gray-black */
  --bg-card: #181919;            /* Slightly elevated card surface */
  --bg-card-secondary: #202222;  /* Button & widget secondary surface */
  --bg-card-hover: #282a2a;      /* Hover surface */
  --bg-input: #151616;           /* Input field background */
  --border-subtle: #242626;      /* Crisp matte border */
  --border-bright: #323535;      /* Elevated crisp border */
  --border-highlight: #1aae7a;

  --color-green: #1aae7a;        /* Stockbit Bull Green (exact TLKM/Buy button) */
  --color-green-neon: #1aae7a;
  --color-green-glow: transparent; /* No fuzzy glowing */
  --color-red: #ff3922;          /* Stockbit Bear Red (exact Sell/loss red) */
  --color-red-glow: transparent;
  --color-red-dark: #b82313;
  --color-gold: #fff841;         /* Stockbit Watchlist Star Yellow */
  --color-gold-glow: transparent;
  --color-cyan: #22d3ee;
  --color-purple: #c084fc;

  --text-primary: #FFFFFF;       /* Crisp White Text */
  --text-secondary: #9ea4aa;     /* Clean secondary neutral gray */
  --text-muted: #646a70;         /* Muted labels */

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  color: var(--text-primary);
}

/* ==========================================================================
   1. TRUE UNIFORM 16:9 SCALING ENGINE (1600x900 Base Resolution)
   ========================================================================== */
#game-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-container {
  width: 1600px;
  height: 900px;
  min-width: 1600px;
  min-height: 900px;
  max-width: 1600px;
  max-height: 900px;
  position: absolute;
  transform-origin: center center;
  background-color: var(--bg-app);
  overflow: hidden;
  , 0 0 0 1px var(--border-subtle);
}

/* Screen Views */
.screen-view {
  display: none;
  width: 1600px;
  height: 900px;
  position: absolute;
  top: 0;
  left: 0;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.screen-view.active {
  display: flex;
  opacity: 1;
}

/* Utility Colors & Text */
.text-green { color: var(--color-green-neon) !important; }
.text-red { color: var(--color-red) !important; }
.text-gold { color: var(--color-gold) !important; }

/* ==========================================================================
   2. STATE A: MAIN MENU & PROFILE ENGINE (Stockbit Dark Flat Mode)
   ========================================================================== */
#mainMenuScreen {
  background: var(--bg-app);
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.menu-ambient-glow {
  display: none; /* No fuzzy ambient light spread */
}

.main-menu-card {
  position: relative;
  width: 1380px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 38px 56px 44px 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.menu-top-utilities {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: -12px;
}

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.lang-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-cyan);
  
}

.menu-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stockbit-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  background: rgba(26, 174, 122, 0.12);
  border: 1px solid rgba(26, 174, 122, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-green-neon);
  text-transform: uppercase;
}

.live-beacon {
  width: 9px;
  height: 9px;
  background-color: var(--color-green-neon);
  border-radius: 50%;
  
  animation: beaconPulse 1.4s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.main-game-title {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #FFFFFF;
}

.main-game-desc {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Active Profile Panel */
.menu-profile-panel {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 22px 34px;
}

.profile-avatar-display {
  width: 90px;
  height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-emoji {
  font-size: 50px;
}

.profile-info-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-top-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-handle {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.player-rank-tag {
  background: rgba(255, 248, 65, 0.15);
  border: 1px solid rgba(255, 248, 65, 0.4);
  color: var(--color-gold);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.profile-metrics-line {
  display: flex;
  gap: 26px;
}

.pm-box {
  background: rgba(24, 25, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.pm-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pm-val {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 800;
}

/* Action Buttons */
.menu-action-buttons {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.btn-giant {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 20px 30px;
  border-radius: 16px;
  font-family: var(--font-main);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-giant:hover {
  transform: translateY(-2px);
}

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

.primary-glow {
  background: var(--color-green);
  color: #FFFFFF;
}

.primary-glow:hover {
  background: #148f64;
}

.secondary-dark {
  background: var(--bg-card-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.secondary-dark:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.3);
}

.danger-btn {
  background: var(--color-red);
  color: #FFFFFF;
}

.danger-btn:hover {
  background: #d92b18;
}

/* Profile Toolbar */
.profile-toolbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 22px;
}

.toolbar-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 15.5px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.toolbar-btn.danger-hover:hover {
  background: rgba(255, 57, 34, 0.15);
  color: var(--color-red);
  border-color: rgba(255, 57, 34, 0.4);
}

/* ==========================================================================
   3. STATE B: HISTORICAL LORE INTRO (59-Candle Simulation)
   No Meta-Text, Authentic Lore Framing
   ========================================================================== */
#introScreen {
  background: #121312;
  padding: 34px 50px;
}

.intro-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intro-top-banner {
  text-align: center;
}

.alert-tag {
  display: inline-block;
  background: rgba(255, 57, 34, 0.15);
  border: 1px solid rgba(255, 57, 34, 0.4);
  color: var(--color-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.intro-headline {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.intro-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.intro-canvas-frame {
  position: relative;
  flex: 1;
  background: #181919;
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  overflow: hidden;
  
  cursor: crosshair;
}

#introCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Interactive Hover Tooltip for Candles / Scrubbing (Enlarged & Floating Above) */
.intro-chart-tooltip {
  position: absolute;
  display: none;
  background: rgba(24, 25, 25, 0.96);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 30;
  
  transform: translate(-50%, -100%);
  white-space: nowrap;
}

/* GUARANTEED NON-COLLIDING BADGE: STRICTLY ANCHORED IN BOTTOM-LEFT */
.intro-floating-hud.intro-hud-bottom-left {
  position: absolute;
  bottom: 24px;
  left: 24px;
  top: auto;
  right: auto;
  background: rgba(24, 25, 25, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  
  pointer-events: none;
  z-index: 10;
}

.hud-badge-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.hud-badge-price {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1px;
}

.hud-badge-date {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Intro Controls & Junction */
.intro-bottom-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.intro-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #fff841, #ff3922);
  transition: width 0.1s linear;
}

.intro-junction-bar {
  display: none;
  gap: 20px;
  justify-content: center;
}

.intro-junction-bar.visible {
  display: flex;
  animation: fadeInPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.junction-btn {
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 17px;
  font-weight: 800;
  padding: 15px 32px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.junction-btn:hover {
  background: var(--bg-card-secondary);
  border-color: rgba(255, 255, 255, 0.3);
}

.junction-btn.cta-green {
  background: var(--color-green);
  color: #FFFFFF;
  border: none;
}

.junction-btn.cta-green:hover {
  background: #148f64;
  transform: translateY(-2px);
}

/* ==========================================================================
   4. STATE C: ACTIVE GAMEPLAY (50/50 Split Viewport)
   ========================================================================== */
#gameplayScreen {
  background: var(--bg-app);
}

/* Top Stockbit Header */
.gameplay-header {
  height: 68px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  flex-shrink: 0;
}

.hdr-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ihsg-logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(26, 174, 122, 0.12);
  border: 1px solid rgba(26, 174, 122, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green-neon);
}

.ihsg-logo-icon svg {
  width: 24px;
  height: 24px;
}

.ihsg-titles {
  display: flex;
  flex-direction: column;
}

.ihsg-ticker {
  font-size: 19px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pill {
  background: rgba(26, 174, 122, 0.15);
  color: var(--color-green-neon);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-green {
  width: 6px;
  height: 6px;
  background-color: var(--color-green-neon);
  border-radius: 50%;
  animation: beaconPulse 1.2s infinite;
}

.ihsg-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.bursa-clock-badge {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-bright);
  padding: 7px 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bursa-day {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.bursa-tag {
  background: rgba(0, 229, 255, 0.12);
  color: var(--color-cyan);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
}

.bursa-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--color-gold);
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-pause-header {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pause-header:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-icon-square {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  color: var(--text-primary);
}

/* Split Workspace: Expanded Left Chart Panel & Snug Right Board Panel (Zero Empty Space) */
.split-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  min-height: 0;
}

/* ==========================================================================
   LEFT PANEL: THE MARKET
   ========================================================================== */
.panel-market {
  background: var(--bg-app);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 12px 18px 10px 18px;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
}

.market-top-metrics {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.giant-ihsg-price {
  font-family: var(--font-mono);
  font-size: 50px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
}

/* STRICT SINGLE-LINE ARROW AND PERCENTAGE */
.ihsg-delta-line {
  display: flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}

.ihsg-delta-line.positive { color: var(--color-green-neon); }
.ihsg-delta-line.negative { color: var(--color-red); }

.delta-label {
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.market-hud-grid {
  display: flex;
  gap: 12px;
}

.hud-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.chart-options-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-mode-buttons {
  display: flex;
  gap: 8px;
}

.mode-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn svg {
  width: 15px;
  height: 15px;
}

.mode-btn.active {
  background: rgba(26, 174, 122, 0.15);
  color: var(--color-green-neon);
  border-color: rgba(26, 174, 122, 0.4);
}

.chart-canvas-wrapper {
  position: relative;
  flex: 1;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

#liveChartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-bg-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 100px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.02);
  pointer-events: none;
  letter-spacing: 6px;
}

/* Margin Health Box */
.margin-health-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.3s ease;
}

/* 30-SECOND PROMINENT PULSATING HIGHLIGHT */
.margin-health-box.critical-pulsing {
  border-color: #ff3922 !important;
}

@keyframes marginCriticalPulsing {
  0% {
    border-color: #ff3922;
  }
  100% {
    border-color: #b82313;
  }
}

.margin-health-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m-status-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.m-status-pct {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.margin-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.margin-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff3922 0%, #fff841 40%, #1aae7a 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   RIGHT PANEL: THE BOARD (Enlarged 8x8 Match-3 Grid - Zero Empty Space)
   ========================================================================== */
.panel-board {
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  padding: 8px 18px 8px 18px;
  gap: 0;
  justify-content: space-between;
  align-items: center;
  transition: opacity 0.25s ease;
  min-height: 0;
  overflow: hidden;
  height: 100%;
  flex-shrink: 0;
  width: 690px;
}

/* ANTI-CHEAT: Hide board completely when paused */
.panel-board.paused-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.board-top-bar {
  width: 654px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
}

.combo-meter-box {
  flex: 1;
  max-width: 510px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.flame-symbol {
  font-size: 24px;
}

.combo-info {
  display: flex;
  flex-direction: column;
}

.combo-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-cyan);
  letter-spacing: 0.8px;
}

.combo-mult {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-gold);
  line-height: 1.1;
}

.combo-decay-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
}

/* STRICTLY LINEAR MULTIPLIER BAR - NO JIGGLE OR SHAKE */
.combo-decay-fill {
  width: 0%;
  height: 100%;
  background: var(--color-gold);
  transition: width 0.05s linear;
}

.btn-tool-shuffle {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool-shuffle:hover {
  background: var(--bg-card-hover);
}

/* ==========================================================================
   DEDICATED MARKET EVENT SLOT (Directly below Margin Health Box in Left Panel)
   Blank minimalist card when idle; dynamic glowing emergency alert when active!
   ========================================================================== */
.market-event-slot {
  width: 100%;
  height: 52px;
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.market-event-slot .mes-idle-view {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  opacity: 0.65;
}

.market-event-slot .mes-idle-dot {
  font-size: 13px;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.market-event-slot .mes-idle-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.market-event-slot .mes-active-view {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

/* Active State: Vibrant Attention-Grabbing Glowing Banner */
.market-event-slot.active {
  border-style: solid;
  border-color: rgba(255, 57, 34, 0.75);
  background: linear-gradient(135deg, rgba(255, 57, 34, 0.22), rgba(255, 248, 65, 0.18));
  
  animation: eventPulse 1.2s infinite alternate ease-in-out;
}

@keyframes eventPulse {
  0% {  }
  100% {  }
}

.market-event-slot.active .mes-idle-view {
  display: none;
}

.market-event-slot.active .mes-active-view {
  display: flex;
}

.rev-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.rev-icon {
  font-size: 24px;
  flex-shrink: 0;
}

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

.rev-title {
  font-size: 13px;
  font-weight: 900;
  color: #fff841;
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rev-desc {
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rev-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  margin-left: 12px;
  flex-shrink: 0;
}

.rev-timer {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-gold);
}

.rev-bar {
  width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.rev-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff3922, #fff841);
  transition: width 0.1s linear;
}

/* Massive 8x8 Grid Frame - Scaled to fill vertical space */
.board-grid-frame {
  position: relative;
  width: 654px;
  height: 590px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.grid-board {
  width: 638px;
  height: 574px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 5px;
  padding: 2px;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

/* NON-PLAYABLE BOARD (Istirahat, Halts, Suspend): Black & White + Disabled */
.board-grid-frame.non-playable {
  pointer-events: none !important;
}

.board-grid-frame.non-playable .grid-board {
  filter: grayscale(100%);
  opacity: 0.35;
  pointer-events: none !important;
}

/* BOARD DIMMED FOR 10-SECOND IDLE HINT SYSTEM */
.board-grid-frame.board-dimmed .grid-board > div:not(.hint-highlight) {
  opacity: 0.32;
  filter: grayscale(30%);
  transition: opacity 0.3s ease;
}

/* HINT HIGHLIGHT ANIMATION */
.grid-board > div.hint-highlight {
  animation: hintGlowPulse 0.75s infinite alternate ease-in-out;
  border-color: var(--color-green) !important;
  z-index: 25;
}

@keyframes hintGlowPulse {
  0% { transform: scale(1); border-color: var(--color-green); }
  100% { transform: scale(1.04); border-color: #ffffff; }
}

/* Tiles */
.grid-board > div {
  width: 100%;
  height: 100%;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.grid-board > div:hover {
  transform: scale(1.03);
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  z-index: 2;
}

.grid-board > div.selected {
  border-color: var(--color-green);
  border-width: 2px;
  transform: scale(1.04);
  z-index: 3;
}

.grid-board > div.matched {
  animation: popDisappear 0.22s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popDisappear {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.8; }
  100% { transform: scale(0.1); opacity: 0; }
}

.grid-board > div.invalid-shake {
  animation: invalidShake 0.26s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  border-color: var(--color-red) !important;
}

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

.grid-board > div svg {
  width: 78%;
  height: 78%;
  pointer-events: none;
}

/* UNIFIED SINGLE-SLOT NOTIFICATION BAR DIRECTLY BELOW MATCH-3 TILES (Clamped to 1 text, never shifts tiles) */
.board-notification-bar {
  width: 654px;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  margin-top: 0;
  margin-bottom: 0;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.board-notification-bar .bnb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.board-notification-bar .bnb-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.board-notification-bar .bnb-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-notification-bar .bnb-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-card-secondary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Notification Types (Matte & Clean Stockbit Styling) */
.board-notification-bar.notif-buff {
  border-color: var(--color-green);
  background: rgba(26, 174, 122, 0.12);
}
.board-notification-bar.notif-buff .bnb-text { color: var(--color-green); }
.board-notification-bar.notif-buff .bnb-tag { background: rgba(26, 174, 122, 0.2); color: var(--color-green); }

.board-notification-bar.notif-nerf {
  border-color: var(--color-red);
  background: rgba(255, 57, 34, 0.12);
  animation: notifShake 0.3s ease;
}
.board-notification-bar.notif-nerf .bnb-text { color: var(--color-red); }
.board-notification-bar.notif-nerf .bnb-tag { background: rgba(255, 57, 34, 0.2); color: var(--color-red); }

.board-notification-bar.notif-ach {
  border-color: var(--color-gold);
  background: rgba(255, 248, 65, 0.1);
}
.board-notification-bar.notif-ach .bnb-text { color: var(--color-gold); }
.board-notification-bar.notif-ach .bnb-tag { background: rgba(255, 248, 65, 0.2); color: var(--color-gold); }

@keyframes notifShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

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

/* Board Status Overlay for Halts & Istirahat */
.board-status-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(18, 19, 18, 0.88);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.board-status-overlay.active {
  display: flex;
  animation: fadeInPop 0.25s ease;
}

.bso-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px;
}

.bso-tag {
  background: rgba(255, 57, 34, 0.2);
  border: 1px solid rgba(255, 57, 34, 0.5);
  color: var(--color-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 999px;
}

.bso-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.bso-sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.4;
}

.bso-timer {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 900;
  color: var(--color-gold);
  margin-top: 4px;
}

/* Screen Flash Overlay */
.screen-flash-overlay {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 20;
}

.screen-flash-overlay.green {
  background: radial-gradient(circle, rgba(26, 174, 122, 0.3) 0%, transparent 80%);
  opacity: 1;
}

.screen-flash-overlay.red {
  background: radial-gradient(circle, rgba(255, 57, 34, 0.45) 0%, transparent 80%);
  opacity: 1;
}

/* Footer Stream Ticker (Full Width, Exactly 3 Concurrent Comments - Expanded for 3-4 lines) */
.gameplay-footer {
  height: 118px;
  background: #121312;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ticker-label {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--color-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-viewport {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: 100px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.ticker-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  height: 92px;
  overflow: hidden;
  
  transition: all 0.25s ease;
}

.ticker-card.animate-slide {
  animation: slideFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideFadeIn {
  0% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.ticker-card .user-avatar {
  font-size: 26px;
  line-height: 1.1;
  margin-top: 2px;
  flex-shrink: 0;
}

.ticker-card .ticker-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.ticker-card .user-name {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--color-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-card .user-quote {
  color: #D6E4FF;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* ==========================================================================
   CANVAS PAN & ZOOM HUD OVERLAYS
   ========================================================================== */
.canvas-zoom-hud {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
  background: rgba(18, 19, 18, 0.90);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 10px;
  pointer-events: auto;
  
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.zoom-btn:hover {
  background: var(--color-green-neon);
  color: #121312;
  border-color: var(--color-green-neon);
}

.zoom-btn.zoom-reset {
  width: auto;
  height: 38px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
}

.translated-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 6px;
  opacity: 0.75;
}

.live-zoom-hud {
  top: 10px;
  right: 10px;
}

/* Pause Menu Language Toggle Button */
.pause-lang-btn {
  padding: 8px 16px;
  font-size: 13.5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pause-lang-btn:hover {
  background: rgba(26, 174, 122, 0.18);
  border-color: var(--color-green-neon);
}

/* ==========================================================================
   5. MODALS & OVERLAYS - ELIMINATING DEAD SPACE (MASSIVE SIZING)
   ========================================================================== */
.modal-backdrop-blur {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(18, 19, 18, 0.88);
  backdrop-filter: blur(16px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop-blur.active {
  display: flex;
  opacity: 1;
}

.btn-close-modal {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 57, 34, 0.2);
  color: var(--color-red);
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-text {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Comparison Ledger Styling */
.comparison-ledger {
  background: #151616;
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ledger-header {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.ledger-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.ledger-col {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.col-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.col-val {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 800;
}

/* PAUSE MENU: PINNED AT TOP WITH LEDGER FIRST */
.pause-card-container {
  width: 960px;
  background: rgba(24, 25, 25, 0.94);
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: 42px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  
}

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

.pill-paused {
  background: rgba(255, 248, 65, 0.15);
  border: 1px solid rgba(255, 248, 65, 0.4);
  color: var(--color-gold);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.pause-headline {
  font-size: 32px;
  font-weight: 900;
  margin-top: 6px;
}

.pause-top-ledger {
  background: #181919;
}

.pause-button-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* DAILY RECAP MODAL WITH EMBEDDED MINI CANVAS */
.recap-card {
  width: 1200px;
  max-height: 840px;
  background: rgba(24, 25, 25, 0.95);
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: 34px 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  
  overflow-y: auto;
}

.modal-top-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-green-neon);
}

.recap-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.recap-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.r-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.r-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.r-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--color-cyan);
}

/* Embedded Mini Chart in Recap */
.recap-chart-container {
  background: #151616;
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.rch-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.recap-chart-toggle {
  display: flex;
  gap: 6px;
}

.recap-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.recap-toggle-btn.active {
  background: rgba(26, 174, 122, 0.2);
  color: var(--color-green-neon);
  border-color: rgba(26, 174, 122, 0.5);
}

.recap-canvas-wrapper {
  width: 100%;
  height: 150px;
  background: #151616;
  border-radius: 10px;
  overflow: hidden;
}

#recapChartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.recap-actions-split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-top: 4px;
}

/* RESET PROFILE CONFIRMATION MODAL */
.danger-confirm-card {
  width: 820px;
  background: #181919;
  border: 2px solid rgba(255, 57, 34, 0.4);
  border-radius: 24px;
  padding: 46px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  
}

.danger-icon-circle {
  width: 82px;
  height: 82px;
  background: rgba(255, 57, 34, 0.15);
  border: 2px solid rgba(255, 57, 34, 0.4);
  border-radius: 50%;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.danger-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.danger-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 660px;
}

.danger-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: 100%;
  margin-top: 10px;
}

/* EDIT PROFILE MODAL (EXACTLY 50 AVATARS IN A 5-COLUMN GRID) */
.profile-edit-card {
  width: 1100px;
  background: #181919;
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: 36px 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.giant-input {
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 15px 22px;
  font-family: var(--font-main);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.giant-input:focus {
  border-color: var(--color-green-neon);
  
}

/* STRICTLY 5 AVATARS PER ROW, SCROLLABLE, HIDDEN SCROLLBAR */
.avatar-50-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px;
}

.avatar-50-grid::-webkit-scrollbar {
  display: none;
}

.avatar-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 34px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.avatar-cell:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.avatar-cell.active {
  background: rgba(26, 174, 122, 0.16);
  border-color: var(--color-green-neon);
  
  transform: scale(1.04);
}

.av-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

/* ACHIEVEMENTS MODAL (100 ACHIEVEMENTS ENGINE) */
.achievements-card-full {
  width: 1400px;
  max-height: 840px;
  background: rgba(24, 25, 25, 0.95);
  border: 1px solid var(--border-bright);
  border-radius: 24px;
  padding: 32px 46px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  
  overflow-y: auto;
}

.ach-counter-text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--color-cyan);
}

.ach-subtitle-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

.ach-category-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.ach-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ach-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ach-tab-btn.active {
  background: rgba(26, 174, 122, 0.15);
  border-color: var(--color-green-neon);
  color: var(--color-green-neon);
}

.achievements-clean-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 4px;
}

.achievements-clean-grid::-webkit-scrollbar {
  display: none;
}

.ach-clean-card {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: center;
  min-height: 125px;
}

.ach-clean-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ach-clean-card.unlocked {
  border-color: rgba(26, 174, 122, 0.4);
  background: rgba(26, 174, 122, 0.05);
}

.ach-clean-card.unlocked:hover {
  border-color: var(--color-green-neon);
  
}

.ach-clean-icon {
  font-size: 42px;
  line-height: 1;
}

.ach-clean-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.ach-clean-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 11px;
}

/* ACHIEVEMENT DETAIL POP-UP MODAL */
.ach-detail-card {
  width: 680px;
  background: #181919;
  border: 2px solid var(--border-highlight);
  border-radius: 24px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  
  animation: fadeInPop 0.25s ease;
}

.ach-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ach-detail-icon-halo {
  width: 84px;
  height: 84px;
  background: rgba(26, 174, 122, 0.12);
  border: 2px solid rgba(26, 174, 122, 0.35);
  border-radius: 50%;
  font-size: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  
}

.ach-detail-badge {
  display: inline-block;
  background: rgba(255, 248, 65, 0.15);
  border: 1px solid rgba(255, 248, 65, 0.4);
  color: var(--color-gold);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.ach-detail-badge.unlocked {
  background: rgba(26, 174, 122, 0.15);
  border-color: rgba(26, 174, 122, 0.4);
  color: var(--color-green-neon);
}

.ach-detail-title {
  font-size: 25px;
  font-weight: 900;
  margin-bottom: 8px;
}

.ach-detail-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.ach-guide-box {
  background: #151616;
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ag-lbl {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-cyan);
}

.ag-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* GAME OVER LIQUIDATION MODAL */
.gameover-card {
  width: 960px;
  background: rgba(24, 25, 25, 0.96);
  border: 2px solid var(--color-red);
  border-radius: 24px;
  padding: 42px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  
  animation: fadeInPop 0.3s ease;
}

.siren-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.siren-blinker {
  font-size: 46px;
  animation: sirenFlash 0.6s infinite alternate;
}

@keyframes sirenFlash {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 20px #ff3922); }
}

.go-title {
  font-size: 44px;
  font-weight: 900;
  color: var(--color-red);
  letter-spacing: -1px;
}

.go-badge {
  background: rgba(255, 57, 34, 0.15);
  border: 1px solid rgba(255, 57, 34, 0.4);
  color: var(--color-red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 999px;
}

.go-continuation-banner {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.gcb-icon {
  font-size: 24px;
}

.gcb-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-cyan);
  line-height: 1.4;
}

.go-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

/* ==========================================================================
   CREDITS & ATTRIBUTIONS MODAL (KULIAH TPG 2026)
   ========================================================================== */
.credits-card {
  width: 90%;
  max-width: 860px;
  max-height: 85vh;
  background: #181919;
  border: 2px solid var(--border-bright);
  border-radius: 20px;
  
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.credits-header {
  padding: 24px 32px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credits-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--color-cyan);
}

.credits-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.credits-course-line {
  font-size: 15px;
  color: var(--color-gold);
  font-weight: 700;
}

.credits-scrollable-body {
  padding: 24px 32px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.credits-scrollable-body::-webkit-scrollbar {
  display: none;
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.credit-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.credit-item .ci-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.credit-item .ci-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credit-item .ci-role {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.credit-item .ci-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--color-green-neon);
}

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

.credits-license-box {
  background: rgba(0, 229, 255, 0.05);
  border: 1px dashed rgba(0, 229, 255, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credits-license-box .cl-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--color-cyan);
}

.credits-license-box .cl-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.credits-footer-bar {
  padding: 18px 32px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  justify-content: flex-end;
}

/* Top-right popup toasts completely removed in compliance with SRS */

/* Audio Settings Floating Popover */
.audio-settings-popover {
  position: absolute;
  z-index: 9999;
  width: 270px;
  background: #181919;
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7);
  display: none;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(8px);
}

.audio-settings-popover.active {
  display: flex;
  animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.asp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.asp-title {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.asp-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.asp-close-btn:hover {
  color: var(--text-primary);
}

.asp-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.asp-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asp-label-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.asp-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-green);
}

.asp-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.asp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-green);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(26, 174, 122, 0.6);
  transition: transform 0.1s;
}

.asp-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Pause Header Actions */
.pause-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pause-sound-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pause-sound-btn:hover {
  background: rgba(26, 174, 122, 0.18);
  border-color: var(--color-green);
}
