/* ============================================================
   HEX FLOW: CYBER GRID LOGIC · STYLESHEET
   100% Pure CSS3, Cyber Glassmorphism, Zero External Fonts/Libs,
   Clean Obsidian Deep-Dark (#06080e) Theme, Unobstructed Canvas.
   ============================================================ */

:root {
  --bg-main: #06080e;
  --bg-deep: #06080e;
  --bg-dark: #090d18;
  --bg-card: rgba(14, 20, 36, 0.95);
  --bg-glass: rgba(18, 26, 46, 0.75);

  --cyan: #00f2fe;
  --cyan-bright: #4facfe;
  --cyan-glow: rgba(0, 242, 254, 0.45);
  --cyan-subtle: rgba(0, 242, 254, 0.12);

  --magenta: #ff2a6d;
  --magenta-glow: rgba(255, 42, 109, 0.45);

  --gold: #fbc531;
  --gold-glow: rgba(251, 197, 49, 0.45);

  --emerald: #05ffa1;
  --purple: #b026ff;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 242, 254, 0.35);
  --border-bright: rgba(0, 242, 254, 0.65);

  --white: #ffffff;
  --text-main: #f0f4f8;
  --text-dim: #8b9bb4;
  --text-muted: #576579;

  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 24px var(--cyan-glow);

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::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: hidden;
  background: radial-gradient(circle at 50% 50%, #0d1527 0%, #040508 100%);
  font-family: var(--font-sans);
  color: var(--text-main);
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== APP CONTAINER ==================== */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(0, 242, 254, 0.08);
  border-left: 1px solid rgba(0, 242, 254, 0.12);
  border-right: 1px solid rgba(0, 242, 254, 0.12);
}

/* ==================== PRELOADER ==================== */
#preloader {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 36%, #0d1830 0%, #04060b 80%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow: hidden;
}

.preloader-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: radial-gradient(circle at 50% 50%, var(--cyan) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.preloader-bg-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 242, 254, 0.24) 0%, transparent 70%);
  filter: blur(55px);
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: translateX(-50%) scale(0.85); opacity: 0.35; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 0.7; }
}

/* Sci-Fi HUD Corner Brackets */
.hud-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(0, 242, 254, 0.4);
  border-style: solid;
  pointer-events: none;
}
.hud-tl { top: 14px; left: 14px; border-width: 2px 0 0 2px; }
.hud-tr { top: 14px; right: 14px; border-width: 2px 2px 0 0; }
.hud-bl { bottom: 14px; left: 14px; border-width: 0 0 2px 2px; }
.hud-br { bottom: 14px; right: 14px; border-width: 0 2px 2px 0; }

/* Top Terminal Telemetry Header */
.term-header {
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1px;
  white-space: nowrap;
  z-index: 2;
  margin-top: 4px;
}

.term-sys {
  color: var(--cyan);
  font-weight: 800;
}

.term-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 800;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Center Animated Hex Flow Circuit Display */
.circuit-hero-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  z-index: 2;
}

.circuit-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.28) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.circuit-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.45));
}

.circuit-reticle-spin {
  animation: spinCW 24s linear infinite;
  transform-origin: 100px 100px;
}

.spin-target-ring {
  animation: spinCW 10s linear infinite;
  transform-origin: 74px 146px;
}

.spin-target-ring-ccw {
  animation: spinCCW 10s linear infinite;
  transform-origin: 126px 146px;
}

/* Animated Conduit Dash Line */
.flow-stream {
  stroke-dasharray: 8 6;
  animation: flowDash 0.9s linear infinite;
}
@keyframes flowDash {
  to { stroke-dashoffset: -28; }
}

.flow-stream-gold {
  stroke-dasharray: 8 6;
  animation: flowDashGold 1.1s linear infinite;
}
@keyframes flowDashGold {
  to { stroke-dashoffset: -28; }
}

/* Core Pulsing Animation */
.pulse-core {
  animation: coreBreath 1.8s ease-in-out infinite alternate;
  transform-origin: 100px 56px;
}
@keyframes coreBreath {
  0% { transform: scale(0.92); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 12px #00f2fe); }
}

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

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

/* Preloader Title Box */
.preloader-title-box {
  text-align: center;
  margin-bottom: 8px;
  z-index: 2;
}

.preloader-title {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--white);
  line-height: 1.05;
  text-shadow: 0 0 25px var(--cyan-glow);
}

.preloader-title span {
  color: var(--cyan);
}

.preloader-sub-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.15);
}

/* Segmented Energy Capacitor Tube */
.energy-module {
  width: 100%;
  max-width: 320px;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 2;
  margin-bottom: 6px;
}

.energy-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.meta-phase {
  color: var(--cyan);
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-arrow {
  display: inline-block;
  animation: blink 0.8s infinite;
  color: var(--cyan);
}

.meta-percent {
  color: var(--white);
  background: rgba(0, 242, 254, 0.2);
  border: 1px solid rgba(0, 242, 254, 0.5);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.76rem;
}

.seg-tube {
  display: flex;
  gap: 4px;
  height: 12px;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-bar {
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.seg-bar.lit-cyan {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.seg-bar.lit-gold {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

/* Minimalist Sci-Fi Tactical Intel Strip */
.intel-strip {
  width: 100%;
  max-width: 320px;
  text-align: center;
  font-family: monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
  padding: 4px 0 6px;
  z-index: 2;
}

.intel-prefix {
  color: var(--cyan);
  font-weight: 800;
  margin-right: 4px;
}

/* ==================== TOP SCOREBOARD BAR (Above Game Board) ==================== */
#scoreboard {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(8, 14, 26, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-cyan);
  z-index: 50;
  gap: 8px;
}

.header-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-center-capsule {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.score-level-badge {
  background: rgba(0, 242, 254, 0.2);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--cyan);
  padding: 2px 8px;
  letter-spacing: 0.8px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.score-level-name {
  font-size: 0.80rem;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

.console-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  outline: none;
}

.console-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 242, 254, 0.35);
}

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

.console-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.6));
}

/* ==================== GAME BOARD / CANVAS (100% Clean Stage) ==================== */
#stage {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.05) 0%, rgba(6, 8, 14, 0.98) 75%);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 400;
}

/* ==================== BOTTOM CONTROL CONSOLE (Below Game Board) ==================== */
#bottombar {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(8, 14, 26, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-cyan);
  z-index: 50;
  gap: 10px;
}

.action-dock-btn {
  height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  flex-shrink: 0;
}

.action-dock-btn:hover {
  background: rgba(0, 242, 254, 0.16);
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
}

.action-dock-btn:active {
  transform: scale(0.94);
}

.action-dock-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.6));
}

.action-dock-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.8px;
}

.bottom-status-pod {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: var(--radius-pill);
  height: 42px;
  padding: 0 12px;
}

.hud-stars-box {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hud-star-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(251, 197, 49, 0.4));
}
  object-fit: contain;
}

.status-pod-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.74rem;
}

.score-shots {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== OVERLAYS & MODALS ==================== */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Full Screen Immersive Overlays */
.full-screen-overlay {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: var(--bg-main);
}

/* Pop-up Cards */
.card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  text-align: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay.show .card {
  transform: scale(1) translateY(0);
}

/* ==================== MAIN MENU SCREEN ==================== */
.menu-container {
  width: 90%;
  max-width: 440px;
  height: 100%;
  max-height: 850px;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 32px 16px 24px;
  box-sizing: border-box;
  text-align: center;
}

.menu-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  margin-bottom: 26px;
}

.menu-hex-display {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.menu-glow-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.35) 0%, transparent 70%);
  filter: blur(16px);
  animation: pulseHeroGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseHeroGlow {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

.menu-core-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--cyan-glow));
  animation: floatHex 3s ease-in-out infinite alternate;
}

@keyframes floatHex {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.menu-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--white);
  line-height: 1;
  margin: 0;
  text-shadow: 0 0 25px var(--cyan-glow);
}

.menu-title span {
  color: var(--cyan);
}

.menu-subtitle-pill {
  margin-top: 8px;
  padding: 4px 16px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--cyan);
}

/* MENU BUTTONS STACK (ONLY: play, levels, how to play, setting, sound) */
.menu-btn-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: auto;
}

/* 1. PLAY BUTTON (HERO ACTION) */
.menu-btn-hero {
  width: 100%;
  height: 64px;
  background: linear-gradient(135deg, #00f2fe 0%, #0088ff 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 242, 254, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  position: relative;
  overflow: hidden;
}

.menu-btn-hero:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 242, 254, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.menu-btn-hero:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.35);
}

.btn-hero-icon-box {
  width: 44px;
  height: 44px;
  background: rgba(6, 14, 26, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 3px 8px rgba(0, 0, 0, 0.35);
}

.btn-hero-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin-left: 3px;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}

.btn-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
  padding-left: 14px;
}

.btn-hero-title {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #06080e;
  line-height: 1;
}

.btn-hero-sub {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(6, 8, 14, 0.8);
  margin-top: 2px;
}

.btn-hero-arrow {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-arrow-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.8;
}

/* 2x2 SECONDARY BUTTONS GRID */
.menu-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.menu-btn-card {
  height: 62px;
  background: linear-gradient(145deg, rgba(16, 26, 46, 0.88) 0%, rgba(10, 16, 28, 0.96) 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.24);
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.menu-btn-card:hover {
  background: linear-gradient(145deg, rgba(22, 38, 66, 0.96) 0%, rgba(14, 24, 42, 0.98) 100%);
  border-color: #00f2fe;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.32), inset 0 1px 0 rgba(0, 242, 254, 0.2);
}

.menu-btn-card:active {
  transform: scale(0.95);
}

.btn-card-icon-box {
  width: 36px;
  height: 36px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 9px;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.menu-btn-card:hover .btn-card-icon-box {
  background: rgba(0, 242, 254, 0.16);
  border-color: #00f2fe;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.35);
}

.btn-card-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.5));
}

.btn-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--white);
  white-space: nowrap;
}

.menu-footer-bar {
  padding-top: 10px;
}

.menu-footer-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

/* ==================== SETTINGS MODAL ==================== */
.settings-modal-card {
  max-width: 420px;
  width: 92%;
  padding: 24px 20px;
  border-radius: 24px;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  padding: 0;
}

.modal-close-btn:hover {
  background: rgba(255, 42, 109, 0.2);
  border-color: #ff2a6d;
}

.modal-close-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(12, 18, 32, 0.85);
  border: 1.5px solid rgba(0, 242, 254, 0.18);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.setting-icon-box {
  width: 36px;
  height: 36px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 9px;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setting-icon-box.danger {
  background: rgba(255, 42, 109, 0.12);
  border: 1px solid rgba(255, 42, 109, 0.35);
  box-shadow: 0 0 10px rgba(255, 42, 109, 0.15);
}

.setting-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.4));
}

.setting-labels {
  display: flex;
  flex-direction: column;
}

.setting-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}

.setting-desc {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 2px;
}

.switch-btn {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  position: relative;
  outline: none;
  transition: all 0.25s ease;
  padding: 0;
  flex-shrink: 0;
}

.switch-btn.active {
  background: linear-gradient(135deg, #00f2fe 0%, #0088ff 100%);
  border-color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.45);
}

.switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch-btn.active .switch-thumb {
  transform: translateX(20px);
}

.action-tag-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.action-tag-btn.danger {
  background: rgba(255, 42, 109, 0.15);
  border-color: #ff2a6d;
  color: #ff2a6d;
}

.action-tag-btn.danger:hover {
  background: #ff2a6d;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 42, 109, 0.5);
}

.settings-credits-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.credits-text {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan);
}

.credits-author {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

/* ==================== FULL-SCREEN MODAL LAYOUTS ==================== */
.screen-modal-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow: hidden;
}

.screen-modal-header {
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-cyan);
  background: rgba(8, 12, 22, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.header-left h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 1px;
}

.header-stars-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(251, 197, 49, 0.12);
  border: 1px solid rgba(251, 197, 49, 0.35);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  margin-top: 2px;
}

.header-star-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.close-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
}

/* Chapter / Sector Filter Tabs */
.chapter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(8, 12, 22, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}

.chapter-tabs::-webkit-scrollbar {
  display: none;
}

.chap-tab {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.chap-tab.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* ==================== SECTOR MAP & HEX NODES ==================== */
.sector-modal-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Sector Switcher Banner */
.sector-switcher-banner {
  margin: 10px 14px 6px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(12, 18, 32, 0.85));
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sector-arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  outline: none;
}

.sector-arrow-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(1.08);
}

.sector-info-box {
  text-align: center;
  flex: 1;
}

.sector-tag {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sector-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sector-prog {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 1px;
}

/* Sector Jump Pills */
.sector-pills-nav {
  display: flex;
  gap: 6px;
  padding: 4px 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sector-pills-nav::-webkit-scrollbar { display: none; }

.s-pill {
  flex: 1;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  white-space: nowrap;
  outline: none;
}

.s-pill:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.4);
  color: #fff;
}

.s-pill.active {
  background: rgba(0, 242, 254, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Level Grid Container */
.level-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-cyan) transparent;
}

.level-hex-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  justify-items: center;
  align-items: center;
  padding: 6px 0 16px;
}

/* Unique Hexagonal Node Badge */
.hex-node {
  width: 58px;
  height: 66px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s;
  outline: none;
}

.hex-node:hover {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.7));
}

.hex-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hex-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.hex-number {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.hex-stars {
  display: flex;
  gap: 2.5px;
  margin-top: 4px;
}

.star-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.star-dot.lit {
  background: var(--gold);
  box-shadow: 0 0 4px var(--gold);
}

.hex-node.current {
  filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.9));
  animation: hexPulse 2.2s infinite ease-in-out;
}

@keyframes hexPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.7)); }
  50% { filter: drop-shadow(0 0 16px rgba(0, 242, 254, 1)); }
}

.hex-node.selected svg polygon {
  stroke-width: 3px;
  stroke: #ffffff !important;
}

.hex-node.locked {
  opacity: 0.38;
  cursor: not-allowed;
}

.hex-node.locked:hover {
  transform: none;
  filter: none;
}

.hex-lock-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.75;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.25));
}

/* Tactical Level Detail Strip */
.level-detail-card {
  margin: 6px 14px 14px;
  background: rgba(14, 22, 38, 0.95);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-right: 10px;
}

.detail-lvl-tag {
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.detail-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1px;
}

.play-selected-btn {
  background: linear-gradient(135deg, #00f2fe, #0099ff);
  color: #06080e;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  padding: 9px 16px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.35);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  outline: none;
  white-space: nowrap;
}

.play-selected-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 242, 254, 0.55);
}

.play-selected-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
}

/* ==================== HOW TO PLAY ==================== */
.howto-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto-box {
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.howto-box h3 {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--cyan);
  margin-bottom: 6px;
}

.howto-box p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ==================== WIN & PAUSE MODALS ==================== */
.modal-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-shadow: 0 0 16px var(--cyan-glow);
}

.subtitle {
  font-size: 0.82rem;
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 18px;
}

.win-stars-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.win-star-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lit-star {
  transform: scale(1.18);
  filter: drop-shadow(0 0 10px var(--gold));
  animation: starDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starDrop {
  0% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1.18); opacity: 1; }
}

.win-stats-list {
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.win-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
}

.win-stat-row span:first-child {
  color: var(--text-dim);
}

.win-stat-row span:last-child {
  color: var(--white);
}

.modal-actions-grid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.pill-btn.primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-bright) 100%);
  color: #06080e;
  border: none;
  box-shadow: 0 6px 18px rgba(0, 242, 254, 0.35);
}

.pill-btn.primary:hover {
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.5);
}

.btn-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  pointer-events: none;
}

/* ==================== TOAST ==================== */
.toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(14, 20, 36, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 150;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ==================== RESPONSIVE STYLES ACROSS ALL SCREENS ==================== */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }
  #scoreboard {
    height: 48px;
    padding: 0 12px;
  }
  .score-level-badge {
    font-size: 0.70rem;
    padding: 2px 8px;
  }
  .score-level-name {
    font-size: 0.74rem;
    max-width: 130px;
  }
  .score-shots {
    font-size: 0.72rem;
  }
  #bottombar {
    height: 58px;
    padding: 0 10px;
    gap: 8px;
  }
  .action-dock-btn {
    height: 38px;
    padding: 0 11px;
    gap: 6px;
  }
  .action-dock-label {
    font-size: 0.68rem;
  }
  .bottom-status-pod {
    height: 38px;
    padding: 0 8px;
    gap: 6px;
  }
  .score-shots {
    font-size: 0.68rem;
  }

  .menu-container {
    width: 92%;
    padding: 24px 10px 18px;
  }
  .menu-title {
    font-size: 2.4rem;
    letter-spacing: 4px;
  }
  .menu-subtitle-pill {
    font-size: 0.65rem;
    padding: 3px 12px;
  }
  .menu-btn-hero {
    height: 58px;
    padding: 0 14px;
  }
  .btn-hero-title {
    font-size: 1.05rem;
  }
  .btn-hero-sub {
    font-size: 0.62rem;
  }
  .menu-secondary-grid {
    gap: 10px;
  }
  .menu-btn-card {
    height: 54px;
    padding: 0 10px;
    gap: 8px;
  }
  .btn-card-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.28);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.12);
  }
  .btn-card-icon {
    width: 20px;
    height: 20px;
  }
  .btn-card-title {
    font-size: 0.72rem;
  }
  .modal-card,
  .settings-modal-card {
    padding: 18px 14px;
  }
}

@media (max-width: 360px) {
  .score-level-name {
    max-width: 90px;
  }
  .action-dock-label {
    display: none;
  }
  .action-dock-btn {
    width: 38px;
    padding: 0;
    border-radius: 11px;
  }
  .menu-title {
    font-size: 2.1rem;
    letter-spacing: 3px;
  }
  .btn-card-title {
    font-size: 0.64rem;
    letter-spacing: 0.5px;
  }
}

@media (max-height: 620px) {
  .menu-container {
    padding: 14px 10px;
  }
  .menu-hero {
    margin-bottom: 8px;
  }
  .menu-hex-display {
    width: 68px;
    height: 68px;
    margin-bottom: 4px;
  }
  .menu-title {
    font-size: 2rem;
  }
  .menu-subtitle-pill {
    margin-top: 4px;
    font-size: 0.62rem;
  }
  .menu-btn-stack {
    gap: 8px;
  }
  .menu-btn-hero {
    height: 48px;
    border-radius: 14px;
  }
  .btn-hero-title {
    font-size: 0.95rem;
  }
  .menu-secondary-grid {
    gap: 8px;
  }
  .menu-btn-card {
    height: 46px;
    border-radius: 14px;
  }
  .menu-footer-bar {
    padding-top: 4px;
  }
}
