@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --bg-deep: #0d0f1e;
  --bg-mid: #171b30;
  --bg-panel: #1f2540;
  --panel-border: rgba(255,255,255,0.08);
  --gold: #ffc21f;
  --gold-light: #fff3b0;
  --pink: #ff5c8a;
  --purple: #b71fff;
  --blue: #1f8cff;
  --green: #17c964;
  --text: #f2f4ff;
  --text-dim: #9aa1c2;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-lift: 0 10px 30px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh; /* mobiel: houdt rekening met in-/uitklappende adresbalk i.p.v. vaste 100vh */
  overflow: hidden;
  overscroll-behavior: none; /* voorkomt de "rubber band" scroll-bounce van iOS Safari */
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* voorkomt dubbeltik-zoom en de oude 300ms-tikvertraging */
  user-select: none;
}

h1, h2, h3, .display-font { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; }

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(circle at 20% 0%, rgba(183,31,255,0.18), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(31,140,255,0.16), transparent 55%),
    url('../assets/svg/bg-pattern.svg'),
    var(--bg-deep);
  background-size: auto, auto, 220px 220px, auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.35s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  color: #1a0a2e;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 4px 0 #a35d00, 0 8px 18px rgba(0,0,0,0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a35d00, 0 4px 10px rgba(0,0,0,0.3); }
.btn.secondary {
  color: var(--text);
  background: linear-gradient(180deg, #3a4270, #262b4a);
  box-shadow: 0 4px 0 #12152a, 0 8px 18px rgba(0,0,0,0.35);
}
.btn.secondary:active { box-shadow: 0 1px 0 #12152a, 0 4px 10px rgba(0,0,0,0.3); }
.btn.small { padding: 9px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #3a4270, #262b4a);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 3px 0 #12152a, 0 5px 12px rgba(0,0,0,0.4);
  font-size: 1.15rem; font-weight: 800; color: var(--gold-light);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.icon-btn img { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.icon-btn:active { transform: scale(0.92) translateY(1px); box-shadow: 0 1px 0 #12152a, 0 2px 6px rgba(0,0,0,0.3); }

/* ---------- Splash ---------- */
#screen-splash { align-items: center; justify-content: center; text-align: center; }
#screen-splash .logo-wrap { animation: floaty 2.4s ease-in-out infinite; }
#screen-splash img.logo { width: 78%; max-width: 320px; filter: drop-shadow(0 8px 20px rgba(183,31,255,0.4)); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.loading-bar-track { width: 60%; height: 10px; border-radius: 6px; background: var(--bg-panel); margin-top: 34px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width 0.2s ease; }
.splash-hint { margin-top: 12px; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Top bars ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; gap: 10px;
}
.pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-panel); border: 1px solid var(--panel-border);
  padding: 6px 12px 6px 6px; border-radius: 999px; font-weight: 800; font-size: 0.95rem;
  font-family: inherit; color: inherit;
}
.pill img { width: 24px; height: 24px; }
button.pill { cursor: pointer; }
button.pill:active { transform: scale(0.96); }

/* ---------- Menu ---------- */
#screen-menu { align-items: center; justify-content: space-between; padding: 20px 20px 0; text-align: center; }
#screen-menu .menu-logo { width: 70%; max-width: 280px; margin-top: 10px; }
.menu-actions { display: flex; flex-direction: column; gap: 14px; width: 80%; max-width: 320px; margin-bottom: 20px; }
.menu-secondary-row { display: flex; gap: 12px; justify-content: center; }
.player-card { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.badge-dot {
  position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--pink); border: 2px solid var(--bg-deep);
}

/* ---------- Map ---------- */
#screen-map { padding-bottom: 0; }
.map-progress { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 5px; }
.map-progress span { font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-align: center; }
.map-progress-track { height: 8px; border-radius: 999px; background: var(--bg-panel); overflow: hidden; border: 1px solid var(--panel-border); }
.map-progress-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); width: 0%; transition: width 0.4s ease; }
#map-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 30px 0 100px; position: relative; }
.level-path { position: relative; margin: 0 auto; border-radius: var(--radius-lg); }
.world-label {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 0;
  display: flex; align-items: center; gap: 8px;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 0.85rem;
  color: var(--gold-light); text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.35); padding: 4px 18px 4px 4px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14); white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.world-label img { width: 32px; height: 32px; flex-shrink: 0; }
.level-track { position: absolute; top: 0; left: 0; z-index: 0; }
.map-deco { position: absolute; z-index: 0; pointer-events: none; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 0.6; transform: scale(1.05); } }
.level-node {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', sans-serif; font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(180deg, #ffe98a, var(--gold));
  color: #4a2e00; box-shadow: 0 5px 0 #8a5600, 0 8px 20px rgba(0,0,0,0.4);
  position: absolute; z-index: 1;
  transform: translate(-50%, -50%);
}
.level-node.locked { background: linear-gradient(180deg, #3a4270, #262b4a); color: var(--text-dim); box-shadow: 0 5px 0 #12152a; }
.level-node.current { animation: pulse 1.4s ease-in-out infinite; }
.level-node.checkpoint { width: 80px; height: 80px; font-size: 1.5rem; box-shadow: 0 6px 0 #8a5600, 0 0 0 4px rgba(255,194,31,0.3), 0 10px 24px rgba(0,0,0,0.45); }
.level-node.checkpoint.locked { box-shadow: 0 6px 0 #12152a, 0 0 0 4px rgba(255,255,255,0.06); }
.level-node.checkpoint::before {
  content: ''; position: absolute; top: -26px; width: 26px; height: 26px;
  background: url('../assets/svg/icon-crown.svg') center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}
@keyframes pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.08); } }
.level-stars { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.level-stars img { width: 15px; height: 15px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.5)); }

.player-avatar {
  position: absolute; z-index: 2; width: 56px; height: auto;
  transform: translate(-50%, -68%);
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5));
  animation: avatarBob 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes avatarBob { 0%,100% { transform: translate(-50%, -68%) rotate(-3deg); } 50% { transform: translate(-50%, -74%) rotate(3deg); } }

/* ---------- Game screen ---------- */
#screen-game { padding: 10px 12px 12px; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }
.objective-bar-track { flex: 1; height: 18px; border-radius: 10px; background: var(--bg-panel); margin: 0 10px; overflow: hidden; border: 1px solid var(--panel-border); position: relative; }
.objective-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); width: 0%; transition: width 0.4s ease; }
.moves-pill { min-width: 54px; text-align: center; }
.moves-pill.low { color: var(--pink); animation: shake 0.5s ease infinite; }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

#board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
#board {
  position: relative;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.5);
  touch-action: none;
}
.cell-bg {
  position: absolute;
  border-radius: 8px;
  background-color: rgba(255,255,255,0.03);
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
}
.gem {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  will-change: transform;
  transition: left 0.22s cubic-bezier(.4,1.6,.6,1), top 0.22s cubic-bezier(.4,1.6,.6,1);
}
.gem img { width: 86%; height: 86%; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.4)); }
.gem.selected img { transform: scale(1.15); filter: drop-shadow(0 0 10px var(--gold)) drop-shadow(0 3px 4px rgba(0,0,0,0.4)); }
.gem.popping img { animation: pop 0.28s ease forwards; }
@keyframes pop { 0% { transform: scale(1); opacity: 1; } 60% { transform: scale(1.3); opacity: 0.7; } 100% { transform: scale(0.1); opacity: 0; } }
.gem.spawning { opacity: 0; }
.gem.landed img { animation: land 0.18s ease; }
.gem-overlay { position: absolute; top: 0; left: 0; z-index: 3; }
.bomb-timer {
  position: absolute; bottom: -2px; right: -2px; z-index: 4;
  min-width: 20px; height: 20px; padding: 0 3px; border-radius: 999px;
  background: var(--pink); color: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 800;
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-deep);
}
.gem.cracking { animation: crack 0.35s ease; }
@keyframes crack { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-3px) rotate(-3deg); } 75% { transform: translateX(3px) rotate(3deg); } }
.cell-bg.jelly-squish { animation: jellySquish 0.3s ease; }
@keyframes jellySquish { 0% { transform: scale(1); } 50% { transform: scale(0.8, 1.15); } 100% { transform: scale(1); } }
@keyframes land { 0% { transform: scaleY(0.7) scaleY(1.15); } 100% { transform: none; } }

.combo-popup {
  position: absolute; z-index: 20; font-family: 'Baloo 2', sans-serif; font-weight: 800;
  color: var(--gold-light); text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 14px rgba(255,194,31,0.6);
  pointer-events: none; animation: comboFloat 0.9s ease forwards;
}
@keyframes comboFloat { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 20% { opacity: 1; transform: translateY(-10px) scale(1.1); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }

.particle {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 15;
  animation: particleFly 0.6s ease-out forwards;
}
@keyframes particleFly { to { transform: translate(var(--px), var(--py)) scale(0); opacity: 0; } }

.booster-row { display: flex; justify-content: center; gap: 16px; padding-top: 12px; }
.booster-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.booster-btn img { width: 40px; height: 40px; }
.booster-btn .cost { font-size: 0.75rem; color: var(--text-dim); font-weight: 700; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: absolute; inset: 0; background: rgba(4,5,12,0.72);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; animation: fadeIn 0.25s ease; }
.modal-card {
  background: linear-gradient(180deg, #232a4d, #171b30);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lift);
  animation: modalPop 0.32s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop { 0% { transform: scale(0.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-card h2 { margin: 4px 0 14px; font-size: 1.6rem; }
.modal-stars { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }
.modal-stars img { width: 52px; height: 52px; opacity: 0; }
.modal-stars img.earned { animation: starPop 0.5s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes starPop { 0% { opacity: 0; transform: scale(0) rotate(-40deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-row { display: flex; gap: 10px; }
.modal-row .btn { flex: 1; }

/* ---------- Ads ---------- */
.ad-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #14172a; border-top: 1px solid var(--panel-border);
  padding: 8px; font-size: 0.75rem; color: var(--text-dim); flex-shrink: 0;
}
.ad-banner img { width: 20px; height: 20px; opacity: 0.7; }
.interstitial-card { background: #101326; border-radius: var(--radius-lg); padding: 30px 22px; text-align: center; width: 100%; max-width: 380px; border: 1px solid var(--panel-border); }
.interstitial-card img.ad-icon { width: 90px; margin-bottom: 12px; }
.interstitial-countdown { font-size: 0.85rem; color: var(--text-dim); margin-top: 10px; }

/* ---------- Level-voorvertoning ---------- */
.preview-card { position: relative; overflow: hidden; padding-top: 20px; }
.preview-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 90px;
  background: var(--preview-world-color, linear-gradient(180deg, rgba(183,31,255,0.25), transparent));
  opacity: 0.5; z-index: 0; pointer-events: none;
}
.preview-card > * { position: relative; z-index: 1; }
.preview-world-badge { width: 64px; height: 64px; margin: 0 auto 4px; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.preview-world-name { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.preview-targets { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.preview-target-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.preview-target-row img { width: 20px; height: 20px; }
.preview-target-row .score { font-weight: 800; color: var(--gold-light); min-width: 60px; text-align: left; }
.preview-info-row { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); font-size: 0.9rem; margin-bottom: 10px; }
.preview-info-row img { width: 22px; height: 22px; }
.preview-info-row strong { color: var(--text); font-size: 1.05rem; }
.preview-obstacles { display: flex; justify-content: center; gap: 14px; margin-bottom: 6px; }
.preview-obstacle-tag { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.85rem; color: var(--text-dim); }
.preview-obstacle-tag img { width: 26px; height: 26px; }
.preview-boosters-label { font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 14px; margin-bottom: 8px; }
.preview-boosters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.booster-tile {
  background: var(--bg-mid); border: 2px solid var(--panel-border); border-radius: var(--radius-sm);
  padding: 8px 4px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.booster-tile img { width: 28px; height: 28px; }
.booster-tile .name { font-size: 0.68rem; font-weight: 700; color: var(--text-dim); line-height: 1.15; }
.booster-tile .cost { font-size: 0.7rem; font-weight: 800; color: var(--gold-light); display: flex; align-items: center; justify-content: center; gap: 2px; }
.booster-tile .cost img { width: 13px; height: 13px; }
.booster-tile.selected { border-color: var(--gold); background: rgba(255,194,31,0.1); }
.booster-tile.selected .name { color: var(--text); }

/* ---------- Pairing ---------- */
.pairing-code {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: 6px;
  color: var(--gold-light); background: var(--bg-mid); border: 1px dashed var(--panel-border);
  border-radius: var(--radius-sm); padding: 10px; text-align: center; margin-bottom: 10px;
}
.pairing-status { color: var(--text-dim); font-size: 0.85rem; text-align: center; }
.pairing-status.confirmed { color: var(--green); font-weight: 700; }

/* ---------- Shop ---------- */
#screen-shop h3 { margin: 18px 0 10px; font-size: 1.05rem; color: var(--gold-light); }
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shop-item {
  background: var(--bg-panel); border: 1px solid var(--panel-border); border-radius: var(--radius-md);
  padding: 16px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.shop-item img { width: 44px; height: 44px; }
.shop-item-name { font-weight: 700; font-size: 0.85rem; }
.shop-item .btn { width: 100%; }
.shop-item.disabled { opacity: 0.55; }
.shop-item-price-label { font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--gold-light); font-size: 1.1rem; }
.shop-iap-note { color: var(--text-dim); font-size: 0.8rem; text-align: center; margin-top: 14px; }

/* ---------- Achievements ---------- */
.achievements-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge-card {
  background: var(--bg-panel); border: 2px solid var(--panel-border); border-radius: var(--radius-md);
  padding: 14px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.badge-card img { width: 48px; height: 48px; filter: grayscale(1) opacity(0.35); }
.badge-card .badge-name { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); line-height: 1.2; }
.badge-card.unlocked { border-color: var(--gold); box-shadow: 0 0 16px rgba(255,194,31,0.25); }
.badge-card.unlocked img { filter: none; }
.badge-card.unlocked .badge-name { color: var(--text); }

/* ---------- Auth / Settings ---------- */
.form-field { width: 100%; margin-bottom: 12px; text-align: left; }
.form-field label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 4px; font-weight: 700; }
.form-field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-mid); border: 1px solid var(--panel-border); color: var(--text); font-size: 1rem;
  font-family: inherit;
}
.error-text { color: var(--pink); font-size: 0.85rem; min-height: 1.2em; margin-top: 6px; }
.tab-row { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn { flex: 1; padding: 10px; border-radius: var(--radius-sm); background: var(--bg-mid); color: var(--text-dim); font-weight: 700; }
.tab-btn.active { background: var(--gold); color: #1a0a2e; }

.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
.switch { width: 48px; height: 26px; border-radius: 999px; background: var(--bg-mid); position: relative; }
.switch.on { background: var(--green); }
.switch::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: left 0.15s ease; }
.switch.on::after { left: 25px; }
.lang-toggle { display: flex; gap: 6px; }
.lang-toggle button { padding: 6px 12px; border-radius: 999px; background: var(--bg-mid); color: var(--text-dim); font-weight: 700; font-size: 0.85rem; }
.lang-toggle button.active { background: var(--gold); color: #1a0a2e; }

/* ---------- Daily reward ---------- */
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.daily-day {
  background: var(--bg-mid); border-radius: var(--radius-sm); padding: 10px 4px; text-align: center;
  border: 1px solid var(--panel-border); font-size: 0.75rem; font-weight: 700; color: var(--text-dim);
}
.daily-day img { width: 26px; height: 26px; display: block; margin: 0 auto 4px; }
.daily-day.claimed { border-color: var(--green); color: var(--green); opacity: 0.6; }
.daily-day.today { border-color: var(--gold); color: var(--gold-light); animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Leaderboard ---------- */
.leaderboard-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 10px 16px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-panel); margin-bottom: 8px; }
.lb-rank { font-family: 'Baloo 2', sans-serif; font-weight: 800; width: 28px; color: var(--gold); }
.lb-name { flex: 1; font-weight: 700; }
.lb-score { color: var(--text-dim); font-weight: 700; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 6px 0 16px; min-height: 120px; }
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 30%; }
.podium-avatar {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.2rem; color: #1a0a2e;
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); border: 3px solid var(--bg-deep);
  box-shadow: 0 0 0 2px var(--gold);
}
.podium-avatar img { width: 80%; height: 80%; }
.podium-spot.rank-2 .podium-avatar { background: linear-gradient(180deg, #e8ecf5, #b7c0d6); box-shadow: 0 0 0 2px #b7c0d6; }
.podium-spot.rank-3 .podium-avatar { background: linear-gradient(180deg, #ffcfa3, #d99354); box-shadow: 0 0 0 2px #d99354; }
.podium-name { font-size: 0.75rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: 0.7rem; color: var(--gold-light); font-weight: 800; }
.podium-bar {
  width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #3a4270, #262b4a);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 4px;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; color: var(--gold-light);
}
.podium-spot.rank-1 .podium-bar { height: 64px; background: linear-gradient(180deg, #4a3a70, #33264a); }
.podium-spot.rank-2 .podium-bar { height: 44px; }
.podium-spot.rank-3 .podium-bar { height: 30px; }
.podium-spot.rank-1 .podium-avatar { width: 56px; height: 56px; font-size: 1.4rem; }

.lb-me-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(255,194,31,0.12); border: 1px solid var(--gold); margin-top: 4px;
}

.toast {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  max-width: 85%; text-align: center;
  background: var(--bg-panel); border: 1px solid var(--panel-border); padding: 10px 18px;
  border-radius: 999px; font-weight: 700; font-size: 0.85rem; z-index: 60;
  pointer-events: none; /* een melding mag nooit klikken op knoppen eronder blokkeren */
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%,0); } }
@keyframes toastOut { to { opacity: 0; } }

.confetti-piece {
  position: absolute; top: -20px; z-index: 55; border-radius: 2px; pointer-events: none;
  animation: confettiFall var(--fall-duration) linear var(--fall-delay) forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(115vh) rotate(var(--spin)); opacity: 0.9; }
}

.hidden { display: none !important; }

/* ---------- Desktop/web: telefoon-vormgeving blijft hetzelfde, maar netjes gepresenteerd ---------- */
@media (min-width: 700px) {
  html, body { overflow: auto; }
  body {
    height: auto; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    gap: 18px; padding: 30px 16px;
    background:
      radial-gradient(circle at 15% 10%, rgba(183,31,255,0.14), transparent 45%),
      radial-gradient(circle at 85% 90%, rgba(31,140,255,0.14), transparent 45%),
      url('../assets/svg/bg-pattern.svg'), var(--bg-deep);
    background-size: auto, auto, 220px 220px, auto;
  }
  .desktop-brand { display: flex; align-items: center; gap: 10px; opacity: 0.9; }
  .desktop-brand img { height: 34px; }
  #app {
    height: min(880px, 92dvh);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
    overflow: hidden;
    padding: 0; /* safe-area-insets zijn niet relevant op desktop */
  }
  .desktop-hint { color: var(--text-dim); font-size: 0.8rem; text-align: center; max-width: 380px; }
}
.desktop-brand, .desktop-hint { display: none; }
@media (min-width: 700px) { .desktop-brand, .desktop-hint { display: flex; } .desktop-hint { display: block; } }
