/* ==========================================================================
   NEON FLIP: ONE TAP CHALLENGE – Futuristic Cyberpunk Theme
   ========================================================================== */

:root {
  --neon-cyan: #00f3ff;
  --neon-purple: #b026ff;
  --neon-magenta: #ff007f;
  --neon-gold: #ffd700;
  --neon-green: #00ff66;
  --dark-bg: #06040e;
  --panel-bg: rgba(18, 12, 34, 0.88);
  --panel-border: rgba(0, 243, 255, 0.35);
  --font-cyber: 'Orbitron', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Rajdhani', monospace, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--dark-bg);
  color: #ffffff;
  font-family: var(--font-cyber);
  position: fixed;
}

/* ==========================================================================
   MAIN VIEWPORT & CANVAS
   ========================================================================== */

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #110825 0%, #05030a 100%);
}

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

/* ==========================================================================
   ADMOB SMART BANNER (TOP)
   ========================================================================== */

#admob-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background: rgba(10, 10, 15, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 25;
  font-family: -apple-system, sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.admob-badge {
  background: #333;
  color: #ffcc00;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.admob-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ccc;
}

.admob-cta {
  background: #1a73e8;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* ==========================================================================
   UI SCREENS & LAYERS
   ========================================================================== */

.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 60px 20px 24px;
  pointer-events: none;
}

.interactive-layer {
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   SPLASH SCREEN
   ========================================================================== */

#splash-screen {
  background: radial-gradient(circle at center, #180936 0%, #06030c 100%);
  pointer-events: auto;
  cursor: pointer;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 25vh;
}

.neon-logo {
  font-size: 44px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-purple);
  letter-spacing: 3px;
  animation: logoPulse 2s infinite ease-in-out;
}

.neon-sublogo {
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  margin-top: 8px;
  font-family: var(--font-mono);
}

.splash-description {
  max-width: 290px;
  margin-top: 18px;
  color: #cfd8dc;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.tap-to-start {
  margin-top: 40px;
  font-size: 15px;
  letter-spacing: 3px;
  color: #ffffff;
  animation: blink 1.2s infinite;
}

/* ==========================================================================
   HEADER STATS BAR
   ========================================================================== */

.stats-bar {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 10, 28, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 243, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: bold;
}

.stat-coins { color: var(--neon-gold); }
.stat-high { color: var(--neon-cyan); }

.vip-badge-tag {
  background: linear-gradient(135deg, #ffd700, #ff8800);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 0 8px #ffd700;
}

/* ==========================================================================
   MAIN MENU SCREEN
   ========================================================================== */

.menu-hero {
  text-align: center;
  margin-top: 15px;
}

.menu-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(to bottom, #ffffff, var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.menu-subtitle {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--neon-magenta);
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.cyber-btn {
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-cyber);
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #ffffff;
  background: rgba(18, 12, 36, 0.85);
  border: 1.5px solid var(--neon-cyan);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cyber-btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

.btn-play-primary {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.3), rgba(176, 38, 255, 0.3));
  border-color: var(--neon-cyan);
  font-size: 18px;
  padding: 16px 20px;
  box-shadow: 0 0 22px rgba(0, 243, 255, 0.4);
}

.btn-daily-accent {
  border-color: var(--neon-gold);
  color: var(--neon-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.menu-grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.cyber-btn-secondary {
  padding: 10px 12px;
  font-size: 12px;
  border-color: rgba(176, 38, 255, 0.6);
  color: #e0d0ff;
  border-radius: 10px;
}

.friend-challenge-alert {
  width: 100%;
  max-width: 340px;
  background: rgba(255, 0, 127, 0.25);
  border: 1px solid var(--neon-magenta);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  text-align: center;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
}

/* ==========================================================================
   GAMEPLAY HUD
   ========================================================================== */

#gameplay-screen {
  padding-top: 55px;
}

.hud-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.hud-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-score-number {
  font-size: 42px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 15px var(--neon-cyan);
  line-height: 1;
}

.hud-combo-badge {
  font-size: 12px;
  color: var(--neon-magenta);
  font-weight: bold;
  letter-spacing: 1px;
  margin-top: 4px;
}

.btn-icon {
  background: rgba(18, 12, 36, 0.8);
  border: 1px solid rgba(0, 243, 255, 0.4);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.hud-challenge-banner {
  background: rgba(0, 243, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
}

.tap-hint {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  animation: blink 1.5s infinite;
  margin-bottom: 30px;
}

/* ==========================================================================
   GAME OVER SCREEN
   ========================================================================== */

.gameover-card {
  width: 100%;
  max-width: 320px;
  background: var(--panel-bg);
  border: 1.5px solid var(--neon-magenta);
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.35);
  margin-top: 30px;
}

.go-title {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
}

.new-high-badge {
  background: linear-gradient(135deg, #ffd700, #ff007f);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-top: 6px;
  box-shadow: 0 0 12px #ffd700;
}

.go-score-large {
  font-size: 54px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 18px var(--neon-cyan);
  margin: 10px 0;
}

.go-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.go-stat-cell {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 4px;
  border-radius: 8px;
}

.cell-label {
  font-size: 9px;
  color: #8e9aaf;
  letter-spacing: 0.5px;
}

.cell-val {
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  margin-top: 2px;
}

.go-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.btn-revive-accent {
  background: linear-gradient(135deg, rgba(0, 255, 102, 0.3), rgba(0, 243, 255, 0.3));
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.3);
}

.btn-share-accent {
  border-color: var(--neon-purple);
  color: #d896ff;
  box-shadow: 0 0 12px rgba(176, 38, 255, 0.25);
}

/* ==========================================================================
   MODALS (SKINS, LEADERBOARD, REWARDS, SETTINGS, SHARE)
   ========================================================================== */

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 2, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 360px;
  max-height: 85vh;
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
}

.btn-close-modal {
  background: none;
  border: none;
  color: #aaa;
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* ==========================================================================
   SKINS GRID
   ========================================================================== */

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

.skin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.skin-card.equipped {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.skin-title {
  font-size: 13px;
  font-weight: bold;
  margin-top: 8px;
}

.skin-rarity {
  font-size: 10px;
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.rarity-common { color: #8e9aaf; }
.rarity-rare { color: var(--neon-cyan); }
.rarity-epic { color: var(--neon-purple); }
.rarity-legendary { color: var(--neon-gold); }
.rarity-exclusive { color: var(--neon-magenta); }

.btn-skin-action {
  width: 100%;
  margin-top: 10px;
  padding: 6px 0;
  font-family: var(--font-cyber);
  font-size: 11px;
  font-weight: bold;
  border-radius: 6px;
  border: 1px solid var(--neon-cyan);
  background: rgba(0, 243, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
}

.btn-skin-action.btn-equipped {
  border-color: #555;
  background: #333;
  color: #888;
}

/* ==========================================================================
   LEADERBOARD & TOURNAMENTS
   ========================================================================== */

.lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.lb-tab {
  flex: 1;
  padding: 8px 0;
  font-family: var(--font-cyber);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #aaa;
  border-radius: 8px;
  cursor: pointer;
}

.lb-tab.active {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 8px;
}

.lb-user-item {
  background: rgba(0, 243, 255, 0.12);
  border-color: var(--neon-cyan);
}

.lb-rank {
  font-size: 12px;
  font-weight: bold;
  width: 50px;
  color: var(--neon-gold);
}

.lb-name {
  flex: 1;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-icon {
  color: var(--neon-cyan);
  font-size: 10px;
}

.lb-score {
  font-size: 14px;
  font-weight: bold;
  color: var(--neon-cyan);
}

/* ==========================================================================
   DAILY CALENDAR GRID
   ========================================================================== */

.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.daily-day-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.daily-day-card.today {
  border-color: var(--neon-gold);
  background: rgba(255, 215, 0, 0.1);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.day-num { font-size: 10px; color: #8e9aaf; }
.day-icon { font-size: 20px; }
.day-reward { font-size: 10px; font-weight: bold; color: #fff; }
.day-status { font-size: 9px; color: var(--neon-green); font-weight: bold; }

.btn-claim-daily {
  width: 100%;
  margin-top: 4px;
  padding: 4px 0;
  font-size: 10px;
  font-weight: bold;
  background: var(--neon-gold);
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ==========================================================================
   ACHIEVEMENTS LIST
   ========================================================================== */

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 10px;
}

.achievement-item.unlocked {
  border-color: var(--neon-green);
}

.ach-icon { font-size: 22px; }
.ach-details { flex: 1; }
.ach-name { font-size: 13px; font-weight: bold; }
.ach-desc { font-size: 10px; color: #8e9aaf; margin-top: 2px; }
.ach-reward { font-size: 12px; font-weight: bold; color: var(--neon-gold); }
.reward-claimed { color: var(--neon-green); }

/* ==========================================================================
   SETTINGS FORM
   ========================================================================== */

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.setting-row input[type="range"] {
  width: 140px;
  accent-color: var(--neon-cyan);
}

.setting-row select {
  background: #110d24;
  color: #fff;
  border: 1px solid var(--neon-cyan);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-cyber);
  font-size: 11px;
}

/* ==========================================================================
   ADMOB REWARDED & INTERSTITIAL MODALS
   ========================================================================== */

.ad-video-mock {
  width: 100%;
  height: 220px;
  background: #000;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #333;
  position: relative;
  overflow: hidden;
}

.ad-video-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffd700;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-video-icon { font-size: 40px; }
.ad-video-title { font-size: 14px; font-weight: bold; margin-top: 8px; color: #fff; }
.ad-video-sub { font-size: 11px; color: #888; }

.ad-progress-wrapper {
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  margin-top: 16px;
  overflow: hidden;
}

.ad-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--neon-cyan);
  transition: width 0.4s ease;
}

/* ==========================================================================
   SCORECARD PREVIEW MODAL
   ========================================================================== */

#scorecard-preview-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px var(--neon-cyan)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 25px var(--neon-purple)); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pulse-glow {
  animation: pulseGlow 1.4s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 8px var(--neon-cyan); }
  100% { box-shadow: 0 0 22px var(--neon-cyan), 0 0 35px var(--neon-purple); }
}

/* Toast */
.achievement-toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(14, 10, 28, 0.95);
  border: 1.5px solid var(--neon-gold);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.toast-icon { font-size: 24px; }
.toast-title { font-size: 10px; color: var(--neon-gold); font-weight: bold; letter-spacing: 1px; }
.toast-name { font-size: 13px; font-weight: bold; color: #ffffff; }
