/* ==========================================================================
   TRAFFIC ESCAPE: GRIDLOCK PUZZLE - STYLESHEET
   Design System: Casual Modern Dark Arcade / Polished Glassmorphism
   ========================================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-surface: #1E293B;
  --bg-surface-elevated: #283548;
  --bg-glass: rgba(30, 41, 59, 0.75);
  
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-glow: rgba(59, 130, 246, 0.4);

  --accent-amber: #F59E0B;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-purple: #8B5CF6;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-light: rgba(255, 255, 255, 0.1);
  --border-active: rgba(59, 130, 246, 0.5);

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app-container {
  width: 100%;
  height: 100%;
  max-height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 20%, #172554 0%, #0B0F19 80%);
}

/* ==========================================================================
   SCREENS
   ========================================================================== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
  z-index: 10;
}

/* ==========================================================================
   SCREEN 1: MAIN MENU
   ========================================================================== */
#screen-menu {
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 1.5rem;
}

.menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.logo-container {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.traffic-light-badge {
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  margin-bottom: 0.75rem;
}

.traffic-light-badge .light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.light.red { background: #EF4444; box-shadow: 0 0 8px #EF4444; }
.light.yellow { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }
.light.green { background: #10B981; box-shadow: 0 0 8px #10B981; }

.game-logo {
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(135deg, #FFFFFF 30%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.4));
}

.game-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: #38BDF8;
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.menu-hero-visual {
  width: 100%;
  height: 90px;
  background: #1E293B;
  border-radius: 16px;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

/* ---- Color Park hero grid ---- */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
  width: 100%;
  height: 100%;
}

.hero-cell {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255,255,255,0.04);
}

.hero-spot {
  border: 2.5px dashed;
  background: transparent;
  animation: spotPulse 2s ease-in-out infinite alternate;
}

.hero-car-block {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  animation: carBounce 2s ease-in-out infinite alternate;
  font-size: 1.2rem;
}

.hero-car-block:nth-child(2) { animation-delay: 0.3s; }
.hero-car-block:nth-child(3) { animation-delay: 0.6s; }
.hero-car-block:nth-child(6) { animation-delay: 0.9s; }

@keyframes carBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

@keyframes spotPulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes carFloat {
  0% { transform: translateX(0); }
  100% { transform: translateX(6px); }
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.menu-footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 48px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-large {
  padding: 0.95rem 1.5rem;
  font-size: 1.15rem;
  border-radius: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: #DC2626;
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.2);
}

.glow-effect {
  position: relative;
  overflow: hidden;
}

.glow-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
  transform: rotate(30deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { transform: translateX(-150%) rotate(30deg); }
  30%, 100% { transform: translateX(150%) rotate(30deg); }
}

.btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-circle:hover {
  background: var(--bg-surface-elevated);
}

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

/* ==========================================================================
   SCREEN HEADERS
   ========================================================================== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.screen-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header-placeholder {
  width: 44px;
}

/* ==========================================================================
   SCREEN 2: LEVEL SELECT
   ========================================================================== */
.tier-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.4);
  scrollbar-width: none;
}
.tier-tabs::-webkit-scrollbar { display: none; }

.tier-tab-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.tier-tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: #60A5FA;
}

.levels-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.85rem;
  align-content: start;
}

.level-card {
  aspect-ratio: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.3rem;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.level-card.unlocked:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.level-card .level-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.level-card .level-stars {
  display: flex;
  gap: 2px;
  margin-top: 3px;
}

.level-stars .star {
  font-size: 0.75rem;
  color: #475569;
}

.level-stars .star.filled {
  color: #FBBF24;
  filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.5));
}

.level-card .level-lock-icon {
  font-size: 1.1rem;
}

.level-card .level-title-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ==========================================================================
   SCREEN 3: HOW TO PLAY
   ========================================================================== */
.tutorial-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tutorial-cards-list {
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tutorial-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}

.tutorial-card-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.tutorial-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.tutorial-card-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.tutorial-icon-preview {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.tutorial-actions {
  margin-top: 1.5rem;
  max-width: 520px;
  width: 100%;
}

/* ==========================================================================
   SCREEN 4: GAMEPLAY SCREEN & HUD
   ========================================================================== */
#screen-game {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 20;
}

.game-hud.hidden {
  display: none;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-hud {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-icon-hud:active {
  transform: scale(0.92);
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  font-weight: 700;
}

.hud-level-badge .hud-label {
  font-size: 0.7rem;
  color: #38BDF8;
}

.hud-level-badge .hud-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.hud-remaining-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.hud-remaining-badge .hud-val {
  font-family: var(--font-mono);
}

.hud-adaptive-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  border: 1px solid #f472b6;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(219, 39, 119, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hud-adaptive-pill:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.55);
}

.v-calc-row {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

.hud-stat-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.hud-stat-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #F8FAFC;
}

/* Hint Banner */
.hint-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(245, 158, 11, 0.9);
  color: #0F172A;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  z-index: 15;
  animation: slideDown 0.25s ease;
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Canvas Wrapper */
.canvas-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

#game-canvas {
  display: block;
  touch-action: none;
}

/* Bottom Action Bar */
.game-action-bar {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  z-index: 20;
}

.action-btn {
  flex: 1;
  max-width: 120px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.action-btn:active {
  transform: scale(0.94);
  background: var(--bg-surface-elevated);
}

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

.action-btn .action-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.action-hint {
  border-color: rgba(245, 158, 11, 0.3);
}
.action-hint:hover {
  background: rgba(245, 158, 11, 0.15);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.75rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Victory Modal Specifics */
.victory-card {
  border-color: rgba(16, 185, 129, 0.5);
  background: radial-gradient(circle at 50% 10%, #1E3A5F 0%, #1E293B 70%);
}

.victory-ribbon {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: #10B981;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.victory-stars {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

.complete-star {
  color: #334155;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.complete-star.active {
  color: #FBBF24;
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
}

.victory-stats {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.v-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.v-stat-label {
  color: var(--text-muted);
}

.v-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #F8FAFC;
}

.secondary-btn-row {
  display: flex;
  gap: 0.5rem;
}

.secondary-btn-row .btn {
  flex: 1;
}

/* Settings Modal Specifics */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

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

.settings-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.settings-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.5rem 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 28px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   RESPONSIVE DESIGN (ALL ORIENTATIONS & VIEWPORTS)
   ========================================================================== */

/* Landscape Orientation (Phones, Tablets & Desktops) */
@media (orientation: landscape) and (max-height: 580px) {
  #screen-game {
    flex-direction: row;
  }

  .game-hud {
    flex-direction: column;
    justify-content: space-around;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
    width: 90px;
    padding: 0.5rem;
  }

  .hud-group {
    flex-direction: column;
  }

  .hud-pill {
    padding: 0.2rem 0.5rem;
  }

  .game-action-bar {
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-left: 1px solid var(--border-light);
    width: 90px;
    padding: 0.5rem;
  }

  .action-btn {
    max-width: none;
    width: 100%;
    min-height: 44px;
  }

  .canvas-wrapper {
    flex: 1;
    height: 100%;
  }

  /* Compact Menu in Short Landscape */
  .menu-hero-visual {
    height: 55px;
    margin-bottom: 0.8rem;
  }

  .game-logo {
    font-size: 1.8rem;
  }

  .menu-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu-buttons .btn {
    flex: 1 1 45%;
    min-height: 42px;
  }
}

/* Ultra-wide / Large Desktop Screens */
@media (min-width: 900px) {
  .canvas-wrapper {
    max-width: 900px;
    margin: 0 auto;
  }

  .game-hud {
    padding: 0.75rem 2rem;
  }

  .game-action-bar {
    padding: 1rem 2rem;
    gap: 1.5rem;
  }

  .action-btn {
    max-width: 150px;
    min-height: 54px;
  }
}

/* Mobile Viewports (Phones & Compact Screens) */
@media (max-width: 600px) {
  .game-hud {
    padding: 0.35rem 0.5rem;
    gap: 4px;
  }
  .hud-adaptive-pill {
    font-size: 0.65rem;
    padding: 0.25rem 0.45rem;
  }
  .hud-adaptive-pill span {
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .btn-icon-hud {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .hud-pill {
    padding: 0.2rem 0.45rem;
    font-size: 0.8rem;
  }
  .hud-stat-box {
    align-items: center;
  }
  .hud-stat-label {
    font-size: 0.52rem;
  }
  .hud-stat-val {
    font-size: 0.78rem;
  }
  .game-action-bar {
    padding: 0.4rem 0.8rem;
    gap: 0.5rem;
  }
  .action-btn {
    min-height: 42px;
    font-size: 0.8rem;
  }
}

@media (max-width: 380px) {
  #btn-hud-prev, #btn-hud-next {
    display: none;
  }
  .hud-group {
    gap: 0.2rem;
  }
  .hud-adaptive-pill span {
    max-width: 105px;
  }
}
