/* ============================================================
   LASER PUCK: RICOCHET ARENA · TOTAL UI REDESIGN
   Sleek Cyber Glassmorphism, Dynamic Floating HUD Island,
   Full-Screen Campaign Map, High-Tech Puck Armory & Fluid Polish.
   ============================================================ */

:root {
  --bg-main: #06080e;
  --bg-deep: #06080e;
  --bg-dark: #090d18;
  --bg-card: rgba(15, 22, 38, 0.85);
  --bg-card-hover: rgba(24, 34, 58, 0.92);
  --bg-glass: rgba(18, 26, 46, 0.72);
  
  --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);
  
  --lime: #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.65);
  --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: var(--bg-main);
  font-family: var(--font-sans);
  color: var(--text-main);
  touch-action: none;
}

/* ==================== APP CONTAINER ==================== */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 460px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 242, 254, 0.08);
}

/* ==================== PRELOADER ==================== */
#preloader {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #111a2f 0%, #06080e 85%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-bg-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.85); opacity: 0.3; }
  100% { transform: scale(1.15); opacity: 0.65; }
}

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

.logo-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 242, 254, 0.4);
  animation: spinSlow 12s linear infinite;
}

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

.logo-puck-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px var(--cyan-glow));
  animation: logoFloat 3s ease-in-out infinite alternate;
}

@keyframes logoFloat {
  0% { transform: translateY(-4px) scale(0.97); }
  100% { transform: translateY(4px) scale(1.03); }
}

.glow-title {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ffffff 30%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px var(--cyan-glow));
  margin-bottom: 6px;
}

.preloader-sub-badge {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold);
  background: rgba(251, 197, 49, 0.12);
  border: 1px solid rgba(251, 197, 49, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

#preloadText {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 24px;
  min-height: 20px;
}

.bar-track {
  width: 230px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright), var(--magenta));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.05s linear;
}

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

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

.score-level-badge {
  background: rgba(0, 242, 254, 0.15);
  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.25);
}

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

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

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

.hud-star-img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.score-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
}

.score-shots {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-dim);
}

.score-bank-pill {
  background: rgba(251, 197, 49, 0.2);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-size: 0.64rem;
  font-weight: 800;
  color: var(--gold);
  padding: 1px 7px;
  box-shadow: 0 0 8px rgba(251, 197, 49, 0.35);
  animation: pulseGold 1.2s infinite alternate;
}

@keyframes pulseGold {
  from { transform: scale(0.96); }
  to { transform: scale(1.04); }
}

/* ==================== GAME BOARD / ARENA (100% Clean Canvas) ==================== */
#stage {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-main);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

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

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

.console-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.console-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: var(--cyan);
}

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

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

.console-hint-capsule {
  flex: 1;
  min-width: 0;
  max-width: 190px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: dotPulse 1.5s infinite;
  flex-shrink: 0;
}

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

#bottomHint {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== OVERLAYS & MODALS ==================== */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s 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;
}

/* 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;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: cardPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.25);
}

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

.subtitle {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-top: -6px;
}

/* ==================== 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-hologram-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.menu-holo-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.menu-holo-ring.outer {
  inset: -8px;
  border: 2px dashed rgba(0, 242, 254, 0.35);
  animation: spinSlow 14s linear infinite;
}

.menu-holo-ring.inner {
  inset: 6px;
  border: 1px dotted rgba(255, 42, 109, 0.35);
  animation: spinSlow 9s linear infinite reverse;
}

.menu-logo-hero {
  width: 95px;
  height: 95px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px var(--cyan-glow));
  animation: logoHover 3.2s ease-in-out infinite alternate;
}

@keyframes logoHover {
  0% { transform: translateY(-4px) scale(0.98); }
  100% { transform: translateY(4px) scale(1.02); }
}

.menu-title {
  font-size: 2.7rem;
  font-weight: 900;
  letter-spacing: 4px;
  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;
  font-family: inherit;
}

.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.25rem;
  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: 3px;
}

.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;
  font-family: inherit;
}

.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: 10px;
  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.18);
  border-color: #00f2fe;
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
}

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

.btn-card-title {
  font-size: 0.8rem;
  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;
  width: 100%;
}

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

.modal-title-icon-box {
  width: 32px;
  height: 32px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--border-cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--white);
  margin: 0;
}

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

.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);
  width: 100%;
}

.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: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.4));
}

.setting-icon.puck-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.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;
  font-family: inherit;
}

.action-tag-btn.cyan {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.action-tag-btn.cyan:hover {
  background: var(--cyan);
  color: #06080e;
  box-shadow: 0 0 14px var(--cyan-glow);
}

.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);
  width: 100%;
}

.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);
}

/* ==================== SCREEN MODAL CONTENT (For Armory & Howto) ==================== */
.screen-modal-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  padding: 16px 16px 20px;
  overflow: hidden;
}

.screen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.header-stars-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(251, 197, 49, 0.1);
  border: 1px solid rgba(251, 197, 49, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--gold);
  width: fit-content;
}

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

.close-btn {
  background: rgba(255, 255, 255, 0.06);
}

/* ==================== 50-LEVELS SELECT SCREEN ==================== */
.level-grid-container {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.4) transparent;
}

.level-grid-container::-webkit-scrollbar {
  width: 5px;
}

.level-grid-container::-webkit-scrollbar-track {
  background: transparent;
}

.level-grid-container::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.35);
  border-radius: 4px;
}

.level-grid-container::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* Individual Stage Button */
.level-btn {
  aspect-ratio: 1;
  width: 100%;
  font-family: inherit;
  background: rgba(18, 28, 48, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--white);
  padding: 4px 2px;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.level-btn.unlocked:hover {
  background: rgba(26, 42, 72, 0.95);
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 242, 254, 0.35);
}

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

.level-btn.current {
  border-color: var(--cyan);
  background: rgba(0, 242, 254, 0.16);
  box-shadow: 0 0 16px var(--cyan-glow);
  animation: levelCurrentPulse 2s infinite alternate ease-in-out;
}

@keyframes levelCurrentPulse {
  0% {
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
    border-color: rgba(0, 242, 254, 0.6);
  }
  100% {
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.95);
    border-color: var(--cyan-bright);
  }
}

.level-btn.locked {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(10, 14, 24, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.level-btn.shake {
  animation: levelShake 0.35s ease-in-out;
}

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

.lvl-num {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
  letter-spacing: -0.5px;
}

.level-btn.current .lvl-num {
  color: var(--cyan-bright);
  text-shadow: 0 0 10px var(--cyan);
}

.level-btn.locked .lvl-num {
  color: var(--text-dim);
  font-size: 1rem;
  opacity: 0.7;
}

.lvl-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 12px;
}

.lvl-star-icon {
  width: 10px;
  height: 10px;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(251, 197, 49, 0.5));
}

.lvl-lock-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.7;
}

/* ==================== PUCK ARMORY SCREEN ==================== */
.armory-showcase-pedestal {
  background: var(--bg-card);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.pedestal-hologram {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.pedestal-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 242, 254, 0.4);
  animation: spinSlow 10s linear infinite;
}

.pedestal-puck-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--cyan-glow));
  animation: logoHover 2.8s ease-in-out infinite alternate;
}

.pedestal-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 4px;
}

.pedestal-desc {
  font-size: 0.76rem;
  color: var(--text-dim);
  max-width: 280px;
  line-height: 1.35;
  margin-bottom: 12px;
}

.armory-equip-hero-btn {
  background: linear-gradient(135deg, var(--cyan), #00b4d8);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 28px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #06080e;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--cyan-glow);
  transition: all 0.15s ease;
}

.armory-equip-hero-btn.equipped {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  box-shadow: none;
  cursor: default;
}

.puck-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.puck-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.puck-card:hover {
  background: var(--bg-card-hover);
}

.puck-card.selected {
  border-color: var(--cyan);
  background: rgba(0, 242, 254, 0.1);
  box-shadow: 0 0 16px var(--cyan-glow);
}

.puck-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.puck-img-preview {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.4));
}

.puck-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.puck-meta strong {
  font-size: 0.95rem;
  color: var(--white);
}

.puck-meta span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cyan);
}

.puck-card.locked .puck-meta span {
  color: var(--text-dim);
}

.puck-lock-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.7;
}

/* ==================== HOW TO PLAY SCREEN ==================== */
.howto-cards-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.howto-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
}

.step-num-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.45));
}

.step-body {
  flex: 1;
}

.step-body strong {
  display: block;
  font-size: 0.92rem;
  color: var(--white);
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.full-w-btn {
  justify-content: center;
  flex-shrink: 0;
  min-height: 52px;
}

/* ==================== PAUSE MODAL ==================== */
.pause-card {
  max-width: 340px;
}

.pause-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ==================== LEVEL CLEAR / WIN MODAL ==================== */
.win-card {
  max-width: 390px;
  padding: 24px 20px;
}

.win-trophy-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-trophy-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 197, 49, 0.4) 0%, transparent 70%);
  animation: pulseGold 2s infinite alternate;
}

.over-trophy-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(251, 197, 49, 0.7));
  animation: logoHover 2.5s ease-in-out infinite alternate;
}

.win-level-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cyan);
  margin-top: -8px;
}

.win-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 8px;
}

.modal-star-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(251, 197, 49, 0.6));
  transform: scale(0);
  animation: starDrop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.4) forwards;
}

@keyframes starDrop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  70% { transform: scale(1.22) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.modal-star-img.dim-star {
  filter: grayscale(0.8) opacity(0.4);
}

.win-stats-card {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.win-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.win-stat-value {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--white);
}

.win-stat-value.gold {
  color: var(--gold);
}

.win-stat-value.cyan {
  color: var(--cyan);
}

.divider-row {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.win-btns {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

/* ==================== BUTTONS & UTILITIES ==================== */
.cta {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan), #00b4d8);
  border: none;
  color: #06080e;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px var(--cyan-glow);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cta:hover { filter: brightness(1.1); }
.cta:active { transform: scale(0.97); }

.cta.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-cyan);
  color: var(--white);
  box-shadow: none;
}

.cta.secondary:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--cyan);
}

.pill-btn {
  flex: 1;
  min-height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-cyan);
  color: var(--white);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.pill-btn.primary {
  flex: 1.4;
  background: linear-gradient(135deg, var(--cyan), #00b4d8);
  color: #06080e;
  border: none;
  box-shadow: 0 4px 18px var(--cyan-glow);
}

.pill-btn:hover { background: rgba(0, 242, 254, 0.15); }
.pill-btn.primary:hover { filter: brightness(1.1); }
.pill-btn:active { transform: scale(0.96); }

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

/* ==================== TOAST ==================== */
.toast {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(14, 20, 34, 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.8rem;
  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 TUNING ==================== */
@media (max-width: 480px) {
  .screen-modal-content {
    padding: 12px 10px 16px;
  }
  .levels-grid {
    gap: 8px;
  }
  .lvl-num {
    font-size: 1.15rem;
  }
  .menu-container {
    width: 94%;
    padding: 24px 10px 18px;
  }
  .menu-title {
    font-size: 2.3rem;
    letter-spacing: 3px;
  }
  .menu-btn-hero {
    height: 58px;
    padding: 0 14px;
    border-radius: 16px;
  }
  .btn-hero-title {
    font-size: 1.15rem;
  }
  .menu-secondary-grid {
    gap: 8px;
  }
  .menu-btn-card {
    height: 56px;
    padding: 0 10px;
    gap: 8px;
    border-radius: 14px;
  }
  .btn-card-icon-box {
    width: 32px;
    height: 32px;
  }
  .btn-card-icon {
    width: 18px;
    height: 18px;
  }
  .btn-card-title {
    font-size: 0.74rem;
  }
  .settings-modal-card {
    padding: 18px 14px;
  }
}

@media (max-width: 380px) {
  .levels-grid {
    gap: 6px;
  }
  .level-btn {
    border-radius: 9px;
  }
  .lvl-num {
    font-size: 1.05rem;
  }
  .lvl-star-icon {
    width: 8px;
    height: 8px;
  }
  .lvl-lock-img {
    width: 12px;
    height: 12px;
  }
  .menu-title {
    font-size: 2rem;
    letter-spacing: 2px;
  }
  .menu-logo-hero {
    width: 80px;
    height: 80px;
  }
  .menu-hologram-wrap {
    width: 100px;
    height: 100px;
    margin-bottom: 8px;
  }
}

@media (max-width: 390px) {
  #topbar {
    left: 8px;
    right: 8px;
    top: 8px;
  }
  .hud-left-group,
  .hud-right-group {
    gap: 4px;
  }
  .hud-circle-btn {
    width: 34px;
    height: 34px;
  }
  .hud-icon-img {
    width: 16px;
    height: 16px;
  }
}

@media (max-height: 620px) {
  .menu-container {
    padding: 14px 10px;
  }
  .menu-hero {
    margin-bottom: 8px;
  }
  .menu-hologram-wrap {
    width: 85px;
    height: 85px;
    margin-bottom: 4px;
  }
  .menu-logo-hero {
    width: 70px;
    height: 70px;
  }
  .menu-title {
    font-size: 2rem;
  }
  .menu-btn-stack {
    gap: 8px;
  }
  .menu-btn-hero {
    height: 52px;
  }
  .menu-btn-card {
    height: 50px;
  }
}
