/* ── BubblePop Frenzy — style.css ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f0fdf4;
  --surface:  #ffffff;
  --primary:  #6366f1;
  --accent:   #f472b6;
  --gold:     #f59e0b;
  --danger:   #ef4444;
  --text:     #1e293b;
  --muted:    #64748b;
  --radius:   14px;
  --shadow:   0 4px 24px rgba(0,0,0,0.12);
}

html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #e0f2fe 0%, #fdf4ff 50%, #f0fdf4 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Nav ── */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(99,102,241,0.15);
  position: sticky; top: 0; z-index: 100; flex-wrap: wrap; gap: 6px;
}
.nav-logo { font-size: 1.3rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); text-decoration: none; transition: all .2s;
}
.nav-link:hover, .nav-link.active { background: var(--primary); color: #fff; }
.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  padding: 5px 9px; border-radius: 8px; border: 1.5px solid rgba(99,102,241,0.3);
  background: transparent; font-size: 0.75rem; font-weight: 700; cursor: pointer;
  color: var(--muted); transition: all .2s;
}
.lang-btn.active, .lang-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Game wrapper ── */
.game-wrapper { max-width: 520px; margin: 0 auto; padding: 12px 12px 20px; }

/* ── Header ── */
.game-header { text-align: center; margin-bottom: 10px; }
.game-title { font-size: 2rem; font-weight: 900; color: var(--primary); letter-spacing: -1px; }
.game-title span { color: var(--accent); }
.game-subtitle { font-size: 0.9rem; color: var(--muted); margin-top: 2px; }

/* ── HUD ── */
.hud-bar {
  display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}
.hud-cell {
  flex: 1; min-width: 60px; background: rgba(255,255,255,0.9);
  border-radius: 10px; padding: 6px 8px; text-align: center;
  border: 1.5px solid rgba(99,102,241,0.15); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.hud-label { display: block; font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.hud-value { display: block; font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.hud-cell.hud-combo .hud-value { color: var(--accent); font-size: 1.3rem; }
.hud-cell.hud-lives .hud-value { font-size: 0.9rem; }

/* ── Canvas ── */
.canvas-container {
  position: relative; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  border: 2px solid rgba(99,102,241,0.2);
}
#gameCanvas { display: block; width: 100%; touch-action: none; }

/* ── Toast ── */
.toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 6px 16px;
  border-radius: 20px; font-size: 0.9rem; font-weight: 700;
  pointer-events: none; opacity: 0; transition: opacity .2s;
  white-space: nowrap; z-index: 10;
}
.toast.show { opacity: 1; }

/* ── Overlays ── */
.overlay {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(6px); z-index: 20;
}
.overlay.show { display: flex; }
.overlay-card {
  background: #fff; border-radius: 20px; padding: 28px 24px;
  text-align: center; max-width: 320px; width: 90%;
  box-shadow: 0 8px 40px rgba(99,102,241,0.18);
  border: 2px solid rgba(99,102,241,0.15);
}
.overlay-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.overlay-title { font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.overlay-title.pink { color: var(--accent); }
.overlay-subtitle { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }
.start-desc { font-size: 0.88rem; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.overlay-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ── Score table ── */
.score-table { background: #f8fafc; border-radius: 12px; padding: 12px; margin: 12px 0; }
.score-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.9rem; border-bottom: 1px solid #e2e8f0; }
.score-row:last-child { border-bottom: none; }
.score-row.total .label, .score-row.total .value { font-weight: 800; font-size: 1.05rem; color: var(--primary); }
.score-row .value { font-weight: 700; color: var(--accent); }

/* ── Buttons ── */
.btn {
  padding: 13px 20px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; transition: all .15s; width: 100%;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #818cf8); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.35); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: #f1f5f9; color: var(--muted); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,0.35); }

/* ── Controls ── */
.touch-controls {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; gap: 8px;
}
.pause-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(99,102,241,0.3);
  background: rgba(255,255,255,0.9); font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: all .15s;
}
.pause-btn:active { transform: scale(0.93); }
.tap-hint {
  flex: 1; text-align: center; font-size: 0.85rem; color: var(--muted);
  font-weight: 600;
}

/* ── How-to modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal-card {
  background: #fff; border-radius: 20px; padding: 28px 24px;
  max-width: 360px; width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal-title { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.howto-list { list-style: none; padding: 0; margin-bottom: 20px; }
.howto-list li {
  padding: 8px 0; border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem; color: var(--text); line-height: 1.5;
}
.howto-list li::before { content: '🫧 '; }
.howto-list li:last-child { border-bottom: none; }

/* ── Footer ── */
.game-footer { text-align: center; font-size: 0.78rem; color: var(--muted); padding: 8px 0; }
.game-footer a { color: var(--primary); text-decoration: none; }

/* ── About / Privacy pages ── */
.page-wrapper { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.page-hero { text-align: center; padding: 28px 0 20px; }
.page-hero-icon { font-size: 3.5rem; display: block; margin-bottom: 10px; }
.page-hero h1 { font-size: 1.8rem; font-weight: 900; color: var(--primary); }
.page-hero p { color: var(--muted); margin-top: 4px; }
.page-section { background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.page-section h2 { font-size: 1.1rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.page-section p { font-size: 0.9rem; color: var(--text); line-height: 1.7; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: 6px 0; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; }
.feature-list li::before { content: '🫧 '; }
.feature-list li:last-child { border-bottom: none; }
.controls-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.controls-table td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; }
.controls-table td:first-child { font-weight: 700; color: var(--primary); font-family: monospace; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge.cyan { background: #e0f2fe; color: #0369a1; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.gold { background: #fef9c3; color: #854d0e; }
.badge.pink { background: #fce7f3; color: #9d174d; }
.privacy-block { margin-bottom: 16px; }
.privacy-block h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.privacy-block p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

@media (max-width: 400px) {
  .game-title { font-size: 1.6rem; }
  .hud-value { font-size: 0.95rem; }
  .overlay-title { font-size: 1.3rem; }
}
