/* ============================================
   BULLET STORM RUNNER - Premium Game Styles
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a1a;
  --bg-card: rgba(15, 15, 35, 0.92);
  --bg-glass: rgba(20, 20, 50, 0.85);
  --accent-cyan: #00d4ff;
  --accent-orange: #ff6b00;
  --accent-red: #ff2244;
  --accent-green: #00ff88;
  --accent-gold: #ffd700;
  --accent-purple: #aa44ff;
  --accent-pink: #ff44aa;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.6);
  --text-dim: rgba(255,255,255,0.3);
  --border-glow: rgba(0, 212, 255, 0.3);
  --shadow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-orange: 0 0 20px rgba(255, 107, 0, 0.3);
  --font-title: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* === GAME CONTAINER === */
#game-container {
  position: relative;
  width: 100vw; height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-dark);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

#gameCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

/* === SCREENS === */
.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  animation: fadeIn 0.3s ease;
}

.screen.hidden { display: none; }

/* The JS hides plenty of non-.screen elements with this same class (#hud,
   #boss-alert, buttons); without a general rule they stayed on screen.
   !important is needed because several of them set display on an id. */
.hidden { display: none !important; }

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0,212,255,0.3); }
  50% { box-shadow: 0 0 25px rgba(0,212,255,0.6), 0 0 50px rgba(0,212,255,0.2); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes countPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); opacity: 1; }
}

/* Height of the AdMob banner, set at runtime from bannerAdSizeChanged. */
:root { --banner-h: 0px; }

.screen-inner {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* The banner overlays the WebView, so screens reserve room for it
   instead of letting it cover buttons. */
body.banner-visible .screen-inner {
  padding-bottom: calc(20px + var(--banner-h));
}

body.banner-visible .screen-inner.scrollable {
  padding-bottom: calc(10px + var(--banner-h));
}

.screen-inner.scrollable {
  height: 100%;
  overflow-y: auto;
  justify-content: flex-start;
  padding-top: 10px;
  -webkit-overflow-scrolling: touch;
}

.screen-inner.center-content {
  justify-content: center;
}

/* === LOGO === */
.logo-container {
  text-align: center;
  margin-bottom: 20px;
  animation: slideUp 0.6s ease;
}

.logo-icon {
  font-size: 64px;
  animation: float 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0,212,255,0.5));
}

.logo-title {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 3px;
  line-height: 1.1;
}

.logo-sub {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-orange);
  letter-spacing: 12px;
  margin-top: 4px;
}

.logo-icon-sm {
  font-size: 32px;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 10px rgba(0,212,255,0.5));
  position: absolute;
  left: -38px;
  top: 50%;
  transform: translateY(-70%);
}

.menu-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  position: relative;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.menu-subtitle {
  display: block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 10px;
  background: linear-gradient(135deg, var(--accent-orange), #ff4400);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 2px;
}

.menu-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* === SIGN-IN SCREEN === */
.signin-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  animation: slideUp 0.8s ease;
}

.signin-icon {
  font-size: 48px;
  text-align: center;
}

.signin-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
}

.signin-note {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
  text-align: center;
}

.btn-small-text {
  font-size: 13px;
  padding: 10px 20px;
}

/* === USERNAME SCREEN === */
.username-box {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.8s ease;
}

.username-box label {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  text-align: center;
}

#username-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-glow);
  border-radius: 12px;
  background: rgba(0,0,0,0.5);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 18px;
  text-align: center;
  outline: none;
  transition: all 0.3s;
}

#username-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-cyan);
}

.error-text {
  color: var(--accent-red);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* === BUTTONS === */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0088cc);
  color: white;
  box-shadow: 0 4px 15px rgba(0,212,255,0.4);
}

.btn-primary:hover { box-shadow: 0 6px 25px rgba(0,212,255,0.6); }

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

.btn-secondary:hover { border-color: var(--accent-cyan); }

.btn-premium {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: #1a0a00;
  font-weight: 900;
  box-shadow: 0 4px 15px rgba(255,215,0,0.4);
}

.btn-premium::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s infinite;
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red), #aa0022);
  color: white;
  margin-top: 20px;
}

.btn-large { padding: 18px 40px; font-size: 20px; }

.btn-small { padding: 8px 16px; font-size: 12px; width: auto; }

.btn-icon {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  position: absolute;
  top: 42px;
  right: 14px;
  z-index: 15;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}
.btn-icon:active {
  transform: scale(0.9);
  background: rgba(0,212,255,0.2);
  border-color: var(--accent-cyan);
}

.pulse-anim { animation: pulse 2s ease-in-out infinite; }

.btn-back {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 22px;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
}

/* === MENU === */
.menu-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-name {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--accent-cyan);
}

.level-badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.menu-currency {
  display: flex;
  gap: 20px;
  padding: 10px 20px;
  background: var(--bg-glass);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

.currency-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 18px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
  margin-top: 10px;
}

.menu-footer { margin-top: 16px; }

/* === SHOP === */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 10px;
}

.screen-header h2 {
  font-family: var(--font-title);
  font-size: 20px;
}

.header-currency {
  display: flex;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
}

.shop-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 12px;
}

.shop-tab {
  flex: 1;
  padding: 10px 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-tab.active {
  background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,212,255,0.05));
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.shop-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-glass);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  transition: all 0.2s;
}

.shop-item:active { transform: scale(0.98); }

.shop-item-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
}

.shop-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shop-item-name {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
}

.shop-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.shop-item-level {
  font-size: 11px;
  color: var(--accent-cyan);
}

.shop-item-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.shop-item-btn.coin-btn {
  background: linear-gradient(135deg, var(--accent-gold), #cc9900);
  color: #1a0a00;
}

.shop-item-btn.gem-btn {
  background: linear-gradient(135deg, var(--accent-purple), #6600cc);
  color: white;
}

.shop-item-btn.owned {
  background: rgba(0,255,136,0.2);
  color: var(--accent-green);
  cursor: default;
}

.shop-item-btn.equipped {
  background: rgba(0,212,255,0.2);
  color: var(--accent-cyan);
  cursor: default;
}

.shop-item-btn:disabled {
  background: rgba(255,255,255,0.1);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* === LEADERBOARD === */
.lb-my-rank {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(170,68,255,0.15));
  border: 1px solid var(--accent-cyan);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  margin-bottom: 12px;
}

.lb-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 20px;
}

.lb-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-glass);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.lb-entry.top1 { border-color: #ffd700; background: rgba(255,215,0,0.08); }
.lb-entry.top2 { border-color: #c0c0c0; background: rgba(192,192,192,0.06); }
.lb-entry.top3 { border-color: #cd7f32; background: rgba(205,127,50,0.06); }

.lb-rank {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 900;
  width: 36px;
  text-align: center;
}

.lb-rank.gold { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-name { flex: 1; font-weight: 600; font-size: 15px; }
.lb-level {
  font-family: var(--font-title);
  font-size: 13px;
  color: var(--accent-cyan);
  background: rgba(0,212,255,0.1);
  padding: 4px 10px;
  border-radius: 8px;
}

/* === SETTINGS === */
.settings-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-glass);
  border-radius: 12px;
  font-size: 16px;
}

.account-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-glass);
  border-radius: 12px;
  font-size: 16px;
}

.account-status {
  font-size: 14px;
  color: var(--accent-cyan);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 28px;
  transition: 0.3s;
}

.toggle .slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .slider {
  background: var(--accent-cyan);
}

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

/* === LEVEL INTRO === */
.intro-label {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 6px;
  color: var(--text-secondary);
  animation: slideUp 0.4s ease;
}

.intro-number {
  font-family: var(--font-title);
  font-size: 80px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.6s ease;
}

.intro-info {
  font-size: 16px;
  color: var(--text-secondary);
  animation: slideUp 0.8s ease;
}

.intro-boss {
  font-family: var(--font-title);
  font-size: 20px;
  color: var(--accent-red);
  animation: pulse 1s ease-in-out infinite;
}

.intro-countdown {
  font-family: var(--font-title);
  font-size: 60px;
  font-weight: 900;
  color: var(--accent-cyan);
  margin-top: 20px;
  animation: countPulse 1s ease-in-out infinite;
}

/* === HUD === */
#hud {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  z-index: 12;
  pointer-events: none;
}

#hud button { pointer-events: auto; }

#hud-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}

.btn-pause-hud {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  line-height: 1;
}
.btn-pause-hud:active {
  transform: scale(0.9);
  background: rgba(0,212,255,0.2);
  border-color: var(--accent-cyan);
}

#hud-hp-container {
  flex: 1;
  height: 22px;
  background: rgba(0,0,0,0.6);
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

#hud-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #00cc66);
  border-radius: 11px;
  transition: width 0.3s;
  width: 100%;
}

#hud-hp-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

#hud-level {
  font-family: var(--font-title);
  font-size: 14px;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

#hud-coins {
  font-family: var(--font-title);
  font-size: 14px;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

#hud-boss-bar {
  padding: 0 14px;
  margin-top: 4px;
}

#hud-boss-name {
  font-family: var(--font-title);
  font-size: 12px;
  color: var(--accent-red);
  text-align: center;
  margin-bottom: 3px;
}

#hud-boss-hp-container {
  height: 10px;
  background: rgba(0,0,0,0.6);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255,0,0,0.3);
}

#hud-boss-hp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
  border-radius: 5px;
  transition: width 0.2s;
  width: 100%;
}

#hud-wave {
  position: absolute;
  top: 42px;
  left: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

#hud-combo {
  position: absolute;
  top: 44px;
  right: 14px;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  animation: pulse 0.5s ease-in-out;
}

/* === LEVEL COMPLETE === */
.complete-title {
  font-family: var(--font-title);
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.4s ease;
}

.stars-display {
  font-size: 40px;
  animation: slideUp 0.6s ease;
}

.reward-list {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  background: var(--bg-glass);
  border-radius: 14px;
  animation: slideUp 0.8s ease;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 18px;
}

/* === GAME OVER === */
.gameover-title {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--accent-red);
  animation: slideUp 0.4s ease;
}

.gameover-info {
  font-size: 16px;
  color: var(--text-secondary);
  animation: slideUp 0.6s ease;
}

/* === AD SCREEN === */
.ad-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
}

.ad-label {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.ad-content {
  text-align: center;
  color: var(--text-secondary);
}

.ad-placeholder { font-size: 80px; margin-bottom: 20px; }

.ad-timer {
  font-family: var(--font-title);
  font-size: 24px;
  margin-top: 30px;
  color: var(--accent-cyan);
}

/* === LANGUAGE SELECTOR === */
.lang-selector {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}

.lang-btn {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
  display: none;
}

.lang-dropdown.show { display: block; }

.lang-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s;
}

.lang-option:hover { background: rgba(255,255,255,0.1); }
.lang-option.active { color: var(--accent-cyan); }

/* === RESPONSIVE === */
@media (max-height: 600px) {
  .logo-title { font-size: 32px; }
  .logo-icon { font-size: 48px; }
  .intro-number { font-size: 60px; }
  .btn { padding: 10px 24px; font-size: 14px; }
}

@media (min-width: 481px) {
  #game-container {
    border-left: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
  }
}

/* Scrollbar */
.scrollable::-webkit-scrollbar { width: 4px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }
.scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* === BOSS ALERT OVERLAY === */
#boss-alert {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: bossFlash 2s ease forwards;
}
#boss-alert .boss-text {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 900;
  color: var(--accent-red);
  text-shadow: 0 0 30px rgba(255,0,0,0.8), 0 0 60px rgba(255,0,0,0.4);
  animation: bossTextPulse 0.4s ease-in-out 3;
}
@keyframes bossFlash {
  0% { background: rgba(255,0,0,0.3); }
  50% { background: rgba(255,0,0,0.1); }
  100% { background: transparent; opacity: 0; }
}
@keyframes bossTextPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* === LEVEL SELECT === */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  padding: 10px 0;
}
.level-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid rgba(255,255,255,0.1);
  background: var(--bg-glass);
}
.level-cell.unlocked {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.level-cell.unlocked:hover {
  background: rgba(0,212,255,0.15);
  transform: scale(1.05);
}
.level-cell.locked {
  opacity: 0.3;
  cursor: not-allowed;
}
.level-cell.current {
  background: linear-gradient(135deg, rgba(0,212,255,0.3), rgba(170,68,255,0.3));
  border-color: var(--accent-purple);
  animation: glow 2s ease-in-out infinite;
}

/* === ACHIEVEMENTS === */
.ach-list { width: 100%; display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }
.ach-item {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--bg-glass); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; transition: all 0.2s;
}
.ach-item.unlocked { border-color: var(--accent-gold); background: rgba(255,215,0,0.05); }
.ach-item.claimed { opacity: 0.5; }
.ach-icon { font-size: 28px; width: 44px; text-align: center; }
.ach-info { flex: 1; }
.ach-name { font-family: var(--font-title); font-size: 14px; font-weight: 700; }
.ach-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ach-reward { font-size: 11px; color: var(--accent-gold); margin-top: 3px; }
.ach-claim-btn {
  padding: 8px 14px; border: none; border-radius: 10px;
  font-family: var(--font-title); font-size: 11px; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: #1a0a00;
}
.ach-claim-btn:disabled { background: rgba(255,255,255,0.1); color: var(--text-dim); cursor: default; }

/* === ACHIEVEMENT TOAST === */
.ach-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: rgba(10,10,30,0.95);
  border: 2px solid var(--accent-gold); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(255,215,0,0.3);
  animation: toastSlide 0.4s ease;
}
.ach-toast.hidden { display: none; }
.ach-toast-icon { font-size: 32px; }
.ach-toast-title { font-family: var(--font-title); font-size: 14px; color: var(--accent-gold); }
.ach-toast-desc { font-size: 12px; color: var(--text-secondary); }
@keyframes toastSlide {
  from { transform: translateX(-50%) translateY(-60px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Tutorial Overlay */
.tutorial-overlay {
  background: rgba(0,10,30,0.9);
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  animation: tutorialFade 0.5s ease-out;
}
.tutorial-overlay.hidden { display: none; }
.tutorial-item {
  font-family: var(--font-body);
  font-size: 13px;
  color: #ddeeff;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tutorial-item:last-child { border-bottom: none; }
.tutorial-item strong { color: var(--accent-cyan); }
@keyframes tutorialFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === EXIT CONFIRMATION DIALOG === */
.exit-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}
.exit-overlay.hidden { display: none; }
.exit-dialog {
  background: linear-gradient(145deg, rgba(20, 20, 50, 0.95), rgba(10, 10, 30, 0.98));
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 28px 24px;
  min-width: 280px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.3);
  animation: dialogSlideIn 0.25s ease-out;
}
.exit-dialog-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.exit-dialog-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}
.exit-dialog-text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.exit-dialog-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.exit-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.exit-btn-yes {
  background: linear-gradient(135deg, #ff2244, #cc0022);
  color: white;
  box-shadow: 0 0 15px rgba(255, 34, 68, 0.3);
}
.exit-btn-yes:active {
  transform: scale(0.95);
  box-shadow: 0 0 25px rgba(255, 34, 68, 0.5);
}
.exit-btn-no {
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  color: white;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}
.exit-btn-no:active {
  transform: scale(0.95);
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
}
@keyframes dialogSlideIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === BACK TOAST === */
.back-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 50, 0.9);
  border: 1px solid var(--border-glow);
  border-radius: 25px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  z-index: 9998;
  animation: toastSlide 0.3s ease-out;
  pointer-events: none;
}
.back-toast.hidden { display: none; }
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === LIVES SYSTEM === */
.menu-lives {
  width: 100%;
  text-align: center;
  padding: 8px 0;
}
.lives-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  border: 1px solid rgba(255,50,50,0.2);
}
.lives-hearts {
  font-size: 16px;
  letter-spacing: 2px;
}
.lives-count {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #ff4466;
}
.lives-timer {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  animation: pulse 2s ease-in-out infinite;
}
.vip-badge {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.15));
  border: 1px solid rgba(255,215,0,0.4);
  padding: 2px 8px;
  border-radius: 6px;
  text-shadow: 0 0 6px rgba(255,215,0,0.4);
}

/* === NO LIVES POPUP === */
.no-lives-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}
.no-lives-overlay.hidden { display: none; }
.no-lives-dialog {
  background: linear-gradient(145deg, rgba(30, 10, 20, 0.97), rgba(15, 5, 15, 0.99));
  border: 1px solid rgba(255, 50, 80, 0.3);
  border-radius: 18px;
  padding: 28px 22px;
  min-width: 290px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 50, 80, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.4);
  animation: dialogSlideIn 0.3s ease-out;
}
.no-lives-icon {
  font-size: 48px;
  margin-bottom: 10px;
  animation: heartbreak 0.6s ease;
}
@keyframes heartbreak {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.8); }
  100% { transform: scale(1); }
}
.no-lives-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  color: #ff4466;
  margin-bottom: 8px;
}
.no-lives-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.no-lives-timer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
  font-family: var(--font-title);
  font-size: 14px;
  color: var(--text-secondary);
}
.no-lives-timer-box #no-lives-timer {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 18px;
}
.no-lives-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.no-lives-btn-ad {
  background: linear-gradient(135deg, #00d4ff, #0088cc) !important;
  color: white !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
  animation: pulse 2s ease-in-out infinite;
}
.no-lives-btn-ad:active {
  transform: scale(0.95);
}
.no-lives-btn-vip {
  background: linear-gradient(135deg, #ffd700, #ff8c00) !important;
  color: #1a0a00 !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}
.no-lives-btn-vip:active {
  transform: scale(0.95);
}
.no-lives-btn-close {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text-secondary) !important;
  padding: 10px 20px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}

/* Username input wrapper with random name button */
.username-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.username-input-wrapper input {
  flex: 1;
  min-width: 0;
}
.btn-random-name {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: none;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
.btn-random-name:active {
  transform: scale(0.9) rotate(180deg);
}

/* VIP Badge in leaderboard */
.vip-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-title);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  animation: vipShine 2s ease-in-out infinite;
}
@keyframes vipShine {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.7); }
}

/* VIP active state in shop */
.shop-item.vip-active {
  border: 1px solid var(--accent-gold) !important;
  background: rgba(255, 215, 0, 0.05) !important;
}
.shop-item.vip-active .shop-item-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00) !important;
  color: #000 !important;
}

/* Level Select - Locked numbers (dim) */
.locked-num {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-title);
}

/* Level Select - Zone colors */
.level-cell.zone-rising.unlocked,
.level-cell.zone-rising.current {
  border-color: rgba(0, 180, 255, 0.4);
}
.level-cell.zone-rising.locked {
  border-color: rgba(0, 180, 255, 0.1);
}

.level-cell.zone-hellfire.unlocked,
.level-cell.zone-hellfire.current {
  border-color: rgba(255, 100, 0, 0.5);
  box-shadow: inset 0 0 6px rgba(255, 100, 0, 0.15);
}
.level-cell.zone-hellfire.locked {
  border-color: rgba(255, 100, 0, 0.12);
}
.level-cell.zone-hellfire .locked-num {
  color: rgba(255, 100, 0, 0.2);
}

.level-cell.zone-legendary.unlocked,
.level-cell.zone-legendary.current {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: inset 0 0 8px rgba(255, 215, 0, 0.15);
}
.level-cell.zone-legendary.locked {
  border-color: rgba(255, 215, 0, 0.12);
}
.level-cell.zone-legendary .locked-num {
  color: rgba(255, 215, 0, 0.2);
}

/* Boss levels */
.level-cell.boss-level.unlocked,
.level-cell.boss-level.current {
  background: rgba(255, 0, 100, 0.15) !important;
  border-color: rgba(255, 0, 100, 0.5) !important;
  box-shadow: 0 0 8px rgba(255, 0, 100, 0.2);
}
.level-cell.boss-level.locked {
  background: rgba(255, 0, 100, 0.04) !important;
  border-color: rgba(255, 0, 100, 0.12) !important;
}
.level-cell.boss-level .locked-num {
  color: rgba(255, 0, 100, 0.25);
}
