/* ==========================================================================
   FS BUBBLE POP - STYLE SHEET
   Zero CSS Overrides for Shared Modal classes
   Modular & Responsive Glassmorphism Design
   ========================================================================== */

:root {
  --bg-gradient: radial-gradient(circle at 50% 20%, #0d1a2d 0%, #060a14 60%, #03050a 100%);
  --bubble-glow: rgba(0, 243, 255, 0.4);
  --primary-color: #00f3ff;
  --secondary-color: #ff007f;
  --accent-gold: #ffd700;
  --accent-green: #00e5a3;
  --text-main: #f0f6fc;
  --text-muted: #8b9bb4;
  --glass-bg: rgba(13, 22, 38, 0.75);
  --glass-border: rgba(0, 243, 255, 0.22);
}

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

body {
  font-family: 'Outfit', 'Prompt', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow blobs */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: #00f3ff;
  top: -50px;
  left: 20%;
}

.glow-2 {
  width: 360px;
  height: 360px;
  background: #b000ff;
  bottom: 10%;
  right: 15%;
  animation-delay: -5s;
}

.glow-3 {
  width: 250px;
  height: 250px;
  background: #ff007f;
  top: 40%;
  left: 5%;
  animation-delay: -8s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.15); }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
  z-index: 1;
}

/* Header & Stats */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.glass-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--primary-color);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
  transform: translateY(-1px);
}

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

.back-btn {
  color: var(--primary-color);
}

.title-group h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #00f3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.title-group .subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

/* Top Action Buttons */
.action-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  padding: 0.45rem;
  width: 36px;
  height: 36px;
  justify-content: center;
  border-radius: 10px;
}

.donate-btn {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.35);
}

.donate-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

/* Mode Switch Tabs */
.mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.25), rgba(176, 0, 255, 0.25));
  color: #ffffff;
  border: 1px solid rgba(0, 243, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.25);
}

/* Stats HUD */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 0.4rem 0.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-card.highlight .stat-val {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

.stat-card.combo-card .stat-val {
  color: #ff007f;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
  transition: transform 0.15s ease;
}

.stat-card.timer-card .stat-val {
  color: var(--accent-gold);
}

/* Canvas Wrapper */
.canvas-container {
  flex: 1;
  width: 100%;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 243, 255, 0.06);
  background: rgba(8, 14, 26, 0.6);
  min-height: 480px;
  touch-action: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Canvas Overlays (Menu / Pause / GameOver) */
.canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 15, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 10;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.canvas-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-content {
  background: rgba(13, 22, 38, 0.95);
  border: 1px solid rgba(0, 243, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 243, 255, 0.2);
  border-radius: 20px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  max-width: 380px;
  width: 100%;
}

.glow-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #00f3ff;
  text-shadow: 0 0 16px rgba(0, 243, 255, 0.6);
  margin-bottom: 0.4rem;
}

.overlay-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #d1d9e6;
}

.guide-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.primary-btn {
  background: linear-gradient(135deg, #00f3ff, #0077b6);
  border: none;
  color: #040814;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: 0.75rem 1.75rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
  transition: all 0.2s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(0, 243, 255, 0.6);
}

.primary-btn:active {
  transform: scale(0.98);
}

/* GameOver Scores */
.gameover-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.gameover-card {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gameover-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 0.2rem;
}

.new-record {
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  animation: pulseGold 1s infinite alternate;
}

@keyframes pulseGold {
  from { opacity: 0.7; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.03); }
}

/* Toast */
.global-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(13, 22, 38, 0.95);
  border: 1px solid var(--primary-color);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 243, 255, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

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