/* ==========================================================================
   PRISM DRIFT — STYLESHEET
   Futuristic Optical Arcade Glassmorphic Design System
   ========================================================================== */

:root {
  --primary-cyan: #00f0ff;
  --primary-cyan-glow: rgba(0, 240, 255, 0.45);
  --primary-cyan-dim: rgba(0, 240, 255, 0.15);
  
  --accent-amber: #ffb703;
  --accent-amber-glow: rgba(255, 183, 3, 0.45);
  
  --accent-magenta: #f72585;
  --accent-magenta-glow: rgba(247, 37, 133, 0.45);

  --accent-violet: #7209b7;
  --accent-emerald: #10b981;
  
  --bg-deep: #080d19;
  --panel-bg: rgba(14, 21, 37, 0.76);
  --panel-bg-heavy: rgba(11, 16, 29, 0.92);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-glow: rgba(0, 240, 255, 0.3);
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Grotesk', monospace;
  
  --nav-height: 68px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  
  --shadow-panel: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.08);
  --shadow-glow: 0 0 16px var(--primary-cyan-glow);
  --shadow-btn: 0 6px 20px rgba(0, 240, 255, 0.35);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-deep);
  font-family: var(--font-main);
  color: var(--text-primary);
  touch-action: manipulation;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: url('bg.jpg') center/cover no-repeat;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

@media (max-width: 480px) {
  .app-container {
    width: 100%;
    margin: 0;
    box-shadow: none;
  }
}

/* Glassmorphism Panel Helper */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px 16px;
  background: rgba(8, 13, 25, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 10px var(--primary-cyan-glow);
}

.brand-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-cyan);
}

.header-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.header-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.14);
}

/* Views Management */
.views-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  overflow-y: auto;
  overflow-x: hidden;
}

.view-screen {
  display: none !important;
  width: 100%;
  flex-direction: column;
  animation: fadeInView 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-screen.active {
  display: flex !important;
}

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

/* Typography & General Buttons */
h1, h2, h3, h4, h5 {
  font-weight: 800;
  line-height: 1.2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #00a8e8 100%);
  color: #060e1d;
  box-shadow: var(--shadow-btn);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-block {
  width: 100%;
}

.btn-large {
  min-height: 56px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.glow-btn {
  box-shadow: 0 0 25px var(--primary-cyan-glow);
}

/* 1. WELCOME SCREEN */
.welcome-content {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-gem-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-gem-img {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 35px var(--primary-cyan-glow);
}

.gem-ring-1, .gem-ring-2 {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.35);
  animation: rotateRing 15s linear infinite;
}

.gem-ring-1 {
  width: 160px;
  height: 160px;
}

.gem-ring-2 {
  width: 190px;
  height: 190px;
  border-style: dotted;
  border-color: rgba(255, 183, 3, 0.3);
  animation-duration: 25s;
  animation-direction: reverse;
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-title {
  font-family: var(--font-mono);
  font-size: 32px;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.welcome-tagline {
  color: var(--text-secondary);
  font-size: 15px;
}

.tutorial-card {
  width: 100%;
  padding: 20px;
}

.tutorial-card-title {
  font-size: 17px;
  color: var(--accent-amber);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.tutorial-step {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.tutorial-step:last-child {
  margin-bottom: 0;
}

.step-num {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--primary-cyan-dim);
  border: 1px solid var(--primary-cyan);
  color: var(--primary-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 14px;
}

.step-text strong {
  display: block;
  font-size: 15px;
  color: #ffffff;
  margin-bottom: 2px;
}

.step-text p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.welcome-actions {
  width: 100%;
  margin-top: 8px;
}

/* 2. HOME SCREEN */
.home-scroll {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-hero-card {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: linear-gradient(135deg, rgba(14, 21, 37, 0.9) 0%, rgba(20, 31, 55, 0.75) 100%);
}

.hero-visual {
  position: relative;
  width: 84px;
  height: 84px;
  min-width: 84px;
}

.home-gem-img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 0 20px var(--primary-cyan-glow);
}

.hero-details {
  flex: 1;
}

.hero-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-amber);
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.hero-heading {
  font-size: 20px;
  margin: 2px 0 4px 0;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.hero-subtext {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.hero-play-btn {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 14px;
  width: 100%;
}

/* Stats Quick Bar */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.stat-val {
  display: block;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

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

/* Menu Actions List */
.menu-action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-action-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.menu-action-card:active {
  transform: scale(0.98);
  border-color: var(--primary-cyan);
}

.card-glow-edge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-cyan);
}

.menu-icon-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.menu-icon-box.cyan { background: rgba(0, 240, 255, 0.15); border: 1px solid rgba(0, 240, 255, 0.3); }
.menu-icon-box.magenta { background: rgba(247, 37, 133, 0.15); border: 1px solid rgba(247, 37, 133, 0.3); }
.menu-icon-box.amber { background: rgba(255, 183, 3, 0.15); border: 1px solid rgba(255, 183, 3, 0.3); }
.menu-icon-box.violet { background: rgba(114, 9, 183, 0.15); border: 1px solid rgba(114, 9, 183, 0.3); }

.menu-card-body {
  flex: 1;
}

.menu-card-body h3 {
  font-size: 16px;
  margin-bottom: 2px;
  color: #ffffff;
}

.menu-card-body p {
  font-size: 12px;
  color: var(--text-secondary);
}

.menu-card-arrow {
  color: var(--text-muted);
  font-size: 16px;
  transition: transform 0.2s ease;
}

.menu-action-card:active .menu-card-arrow {
  transform: translateX(4px);
  color: var(--primary-cyan);
}

/* Loadout Pill */
.loadout-pill {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loadout-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.loadout-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.loadout-tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--primary-cyan);
  font-family: var(--font-mono);
}

/* 3. LEVEL SELECT SCREEN */
.levels-header-bar {
  padding: 16px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.levels-title-group h2 {
  font-size: 20px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
}

.levels-stars-tally {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-amber);
}

.sector-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.sector-tab {
  flex: 1;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sector-tab.active {
  background: var(--primary-cyan);
  color: #060e1d;
  font-weight: 800;
}

.levels-grid-scroll {
  padding: 10px 16px 20px 16px;
  overflow-y: auto;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.level-tile {
  aspect-ratio: 1 / 1.15;
  background: rgba(14, 21, 37, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
  position: relative;
}

.level-tile:active {
  transform: scale(0.93);
}

.level-tile.unlocked {
  border-color: rgba(0, 240, 255, 0.4);
}

.level-tile.current {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px var(--primary-cyan-glow);
  background: rgba(0, 240, 255, 0.15);
}

.level-tile.locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(8, 12, 22, 0.7);
}

.tile-number {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.tile-stars {
  display: flex;
  gap: 2px;
  font-size: 9px;
  margin-top: 4px;
}

.tile-star {
  color: #475569;
}

.tile-star.earned {
  color: var(--accent-amber);
  text-shadow: 0 0 5px var(--accent-amber-glow);
}

.tile-lock-icon {
  font-size: 15px;
  color: #64748b;
}

/* 4. GAME SCREEN */
#viewGame {
  height: calc(100vh - 64px - var(--nav-height));
  height: calc(100dvh - 64px - var(--nav-height));
  overflow: hidden;
}

.game-hud {
  margin: 10px 12px 6px 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

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

.hud-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

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

.hud-level-info {
  text-align: center;
}

.hud-level-title {
  display: block;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 15px;
  color: var(--primary-cyan);
  letter-spacing: 1px;
}

.hud-level-desc {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.hud-right-actions {
  display: flex;
  gap: 6px;
}

.hud-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-stat-pill, .hud-target-pill {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.stat-number, .stat-targets {
  font-weight: 800;
  color: #ffffff;
}

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

.hud-stars-pill {
  display: flex;
  gap: 4px;
  font-size: 16px;
}

.hud-star {
  color: #334155;
  transition: color 0.2s ease, transform 0.2s ease;
}

.hud-star.active {
  color: var(--accent-amber);
  text-shadow: 0 0 8px var(--accent-amber-glow);
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  position: relative;
  margin: 4px 12px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(6, 11, 22, 0.72);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 240, 255, 0.1);
}

#gameCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  border-radius: 14px;
}

.touch-hint-overlay {
  position: absolute;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--primary-cyan);
  pointer-events: none;
  opacity: 0.85;
  font-family: var(--font-mono);
}

/* Game Bottom Controls */
.game-footer-bar {
  margin: 6px 12px 10px 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mirror-tool-info {
  display: flex;
  flex-direction: column;
}

.tool-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.tool-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-cyan);
}

.mirror-tools {
  display: flex;
  gap: 8px;
}

.tool-btn {
  min-height: 42px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 5. SKIN SHOP SCREEN */
.shop-header {
  padding: 16px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-header h2 {
  font-size: 20px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
}

.shop-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.shop-nav-tabs {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.shop-tab {
  flex: 1;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shop-tab.active {
  background: var(--accent-magenta);
  color: #ffffff;
  font-weight: 800;
}

.shop-items-scroll {
  padding: 10px 16px 20px 16px;
  overflow-y: auto;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shop-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  border: 1px solid var(--panel-border);
  position: relative;
}

.shop-card.equipped {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 15px var(--primary-cyan-glow);
}

.shop-preview-box {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.shop-item-name {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

.shop-item-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
}

.shop-card-btn {
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 12px;
}

/* 6. ACHIEVEMENTS SCREEN */
.achievements-header {
  padding: 16px 16px 10px 16px;
}

.achievements-header h2 {
  font-size: 20px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
}

.achievements-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.achievements-list-scroll {
  padding: 10px 16px 20px 16px;
  overflow-y: auto;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--panel-border);
}

.achieve-icon-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: rgba(255, 183, 3, 0.15);
  border: 1px solid rgba(255, 183, 3, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.achieve-info {
  flex: 1;
}

.achieve-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: #ffffff;
}

.achieve-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.achieve-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.achieve-progress-fill {
  height: 100%;
  background: var(--accent-amber);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.achieve-action-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.achieve-reward-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-cyan);
}

.achieve-btn {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 11px;
}

/* FIXED BOTTOM NAVIGATION BAR */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(8, 13, 25, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 80;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  height: 100%;
  padding-top: 6px;
  transition: color 0.2s ease, transform 0.15s ease;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--primary-cyan);
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-play-btn {
  position: relative;
  top: -8px;
}

.nav-play-inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #0099ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--primary-cyan-glow);
  border: 3px solid rgba(8, 13, 25, 0.9);
  transition: transform 0.2s ease;
}

.nav-play-btn:active .nav-play-inner {
  transform: scale(0.92);
}

.nav-icon-play {
  font-size: 22px;
  color: #060e1d;
  font-weight: 900;
}

/* MODALS & BOTTOM SHEETS */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  max-height: 88dvh;
  border-radius: 28px 28px 0 0;
  border-bottom: none;
  padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 24px) 20px;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg-heavy);
  animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow-y: auto;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  margin: 0 auto 16px auto;
}

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

.modal-title-row h3 {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 1px;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

/* Victory Sheet */
.victory-sheet {
  text-align: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.victory-confetti-canvas-box {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#victoryConfettiCanvas {
  width: 100%;
  height: 100%;
}

.victory-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-cyan);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.victory-title {
  font-size: 26px;
  font-family: var(--font-mono);
  color: #ffffff;
  margin-bottom: 16px;
}

.victory-stars {
  display: flex;
  gap: 12px;
  font-size: 40px;
  margin-bottom: 20px;
}

.victory-star {
  color: #334155;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.victory-star.active {
  color: var(--accent-amber);
  text-shadow: 0 0 20px var(--accent-amber-glow);
  transform: scale(1.15);
}

.victory-rewards-card {
  width: 100%;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reward-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
}

.reward-row strong {
  color: #ffffff;
  font-family: var(--font-mono);
}

.cyan-text {
  color: var(--primary-cyan) !important;
}

.victory-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 12px;
}

/* Settings Items */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-info strong {
  display: block;
  font-size: 15px;
  color: #ffffff;
}

.setting-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  min-width: 50px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s ease;
  border-radius: 34px;
}

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

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

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #060e1d;
}

.settings-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.version-tag {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 10px;
}

/* About & Rate Modals */
.about-hero {
  text-align: center;
  margin-bottom: 16px;
}

.about-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 0 20px var(--primary-cyan-glow);
  margin-bottom: 8px;
}

.about-hero h4 {
  font-family: var(--font-mono);
  font-size: 18px;
}

.about-hero p {
  font-size: 12px;
  color: var(--text-secondary);
}

.about-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.support-box {
  padding: 16px;
}

.support-box h5 {
  font-size: 15px;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.support-box p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.support-form textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 16px;
  resize: none;
  margin-bottom: 10px;
}

.support-form textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
}

.rate-content {
  text-align: center;
  padding: 10px 0;
}

.rate-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.star-rating-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 38px;
  margin-bottom: 14px;
}

.rate-star {
  color: #334155;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.rate-star.active {
  color: var(--accent-amber);
  text-shadow: 0 0 12px var(--accent-amber-glow);
}

.rate-star:active {
  transform: scale(1.25);
}

.rating-feedback-note {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-cyan);
  margin-bottom: 20px !important;
}

/* Legal Modal */
.legal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.legal-tab {
  flex: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.legal-tab.active {
  background: var(--primary-cyan);
  color: #060e1d;
  font-weight: 800;
}

.legal-scroll-body {
  max-height: 50vh;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-right: 6px;
}

.legal-scroll-body h4 {
  color: #ffffff;
  margin: 12px 0 4px 0;
  font-size: 14px;
}

.legal-scroll-body p {
  margin-bottom: 8px;
}

/* Optical Guide Modal */
.guide-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.guide-card strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 2px;
}

.guide-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toast */
.toast-notification {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(14, 21, 37, 0.95);
  border: 1px solid var(--primary-cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-cyan-glow);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  z-index: 200;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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