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

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

body {
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  /* Lock body to exactly the visible viewport — no scroll */
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: 'Baloo 2', cursive;
  touch-action: none;
  padding: 8px 0 0;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 999;
  transition: opacity 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-bird {
  font-size: 3.5rem;
  animation: loadingBird 0.6s ease-in-out infinite alternate;
}

@keyframes loadingBird {
  from { transform: translateY(0) rotate(-10deg); }
  to   { transform: translateY(-14px) rotate(10deg); }
}

#loading-title {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: 2.4rem;
  color: #FFD700;
  letter-spacing: 6px;
  text-shadow: 3px 3px 0 #009c3b;
}

#loading-bar-wrap {
  width: 180px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

#loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #009c3b, #FFD700);
  border-radius: 3px;
  animation: loadingProgress 1.2s ease-out forwards;
}

@keyframes loadingProgress {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}

#loading-text {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 2px;
  text-transform: lowercase;
}

#game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  padding: 0 4px;
  /* Fill whatever height body gives, never exceed it */
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#title-bar {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: #FFD700;
  letter-spacing: 4px;
  text-shadow: 3px 3px 0 #00a859, -1px -1px 0 #009c3b;
  animation: titlePulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

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

#hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-shrink: 0;
}

#score-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.score-box {
  background: rgba(255,215,0,0.1);
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 10px;
  padding: 5px 10px;
  text-align: center;
  flex: 1 1 68px;
  min-width: 0;
}

.score-label {
  font-size: 0.6rem;
  color: #aaa;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.score-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  color: #FFD700;
  line-height: 1;
}

/* ── Bottom Nav toolbar ─────────────────────────────────────── */
#toolbar {
  display: flex;
  width: min(360px, calc(100vw - 16px));
  background: rgba(10, 18, 30, 0.97);
  border: 2px solid rgba(255,215,0,0.25);
  border-top: 2px solid rgba(255,215,0,0.4);
  border-radius: 0 0 12px 12px;
  overflow: visible;
  /* Never grow or shrink — always takes its natural height */
  flex-shrink: 0;
  flex-grow: 0;
  margin-top: -8px;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

.tool-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 2px 7px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tool-btn:last-child { border-right: none; }

.tool-btn:active {
  background: rgba(255,215,0,0.12);
}

.tool-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.15s;
}

.tool-btn:active .tool-icon {
  transform: scale(0.88);
}

.tool-label {
  font-family: 'Baloo 2', cursive;
  font-size: 0.58rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s;
}

.tool-btn.active .tool-icon {
  filter: drop-shadow(0 0 6px #FFD700);
}

.tool-btn.active .tool-label {
  color: #FFD700;
}

.tool-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 80%;
  height: 3px;
  background: #FFD700;
  border-radius: 3px 3px 0 0;
}

/* Notification badge */
.tool-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 18px);
  background: #ff3344;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  font-family: 'Baloo 2', cursive;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid rgba(10,18,30,0.9);
  line-height: 1;
}

#canvas {
  border: 3px solid #FFD700;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 0 40px rgba(255,215,0,0.3), 0 0 80px rgba(0,168,89,0.15);
  cursor: pointer;
  display: block;
  width: min(360px, calc(100vw - 16px));
  aspect-ratio: 360 / 500;
  flex: 1 1 0;
  min-height: 0;
  /* height:100% keeps Brave from collapsing the canvas; max-height prevents
     fullscreen distortion by capping to exactly what aspect-ratio allows */
  height: 100%;
  max-height: calc(min(360px, 100vw - 16px) * 1.3889);
  will-change: transform;
}

/* Very small screens */
@media (max-width: 375px) {
  #title-bar { font-size: 1.6rem; letter-spacing: 2px; }
  .score-value { font-size: 1.3rem; }
  .score-box { padding: 4px 6px; }
  .tool-icon { font-size: 1.15rem; }
  .tool-label { font-size: 0.5rem; }
  .tool-btn { padding: 6px 1px 5px; }
}

/* Landscape on phones: shrink height */
@media (max-height: 500px) and (orientation: landscape) {
  #title-bar { display: none; }
  #hud { gap: 4px; }
  #toolbar { display: none; }
  #canvas {
    height: auto;
    align-self: center;
    flex: none;
    max-height: calc(100dvh - 80px);
    max-width: calc((100dvh - 80px) * 360 / 500);
  }
}

#tip {
  position: absolute;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  animation: blink 1.2s ease-in-out infinite;
  z-index: 2;
}

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

#share-btn {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: sharePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

#share-btn:hover { transform: scale(1.05); box-shadow: 0 6px 28px rgba(37,211,102,0.6); }

#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
  will-change: transform;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

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

.overlay-box {
  background: #111;
  border: 2px solid #FFD700;
  border-radius: 16px;
  padding: 28px 24px;
  width: min(92vw, 360px);
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay-box h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: #FFD700;
  text-align: center;
  letter-spacing: 3px;
}

.overlay-box p {
  color: #ccc;
  font-size: 0.95rem;
  text-align: center;
}

.overlay-close, .overlay-box button {
  background: #FFD700;
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s;
  align-self: center;
}

.overlay-close:hover, .overlay-box button:hover { transform: scale(1.05); }

.overlay-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.overlay-btns button.secondary {
  background: #333;
  color: #aaa;
}

#player-name {
  background: #222;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  outline: none;
  text-align: center;
}

#player-name:focus { border-color: #FFD700; }

/* Leaderboard list */
.lb-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  animation: slideIn 0.3s ease both;
}

.lb-entry:nth-child(1) {
  background: rgba(255,215,0,0.12);
  border-color: rgba(255,215,0,0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(255,215,0,0.3); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.lb-entry:nth-child(n) { animation-delay: calc(var(--i, 0) * 0.06s); }

.lb-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: #FFD700;
  min-width: 28px;
  text-align: center;
}

.lb-info {
  flex: 1;
  overflow: hidden;
}

.lb-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.lb-meta {
  font-size: 0.7rem;
  color: #b388ff;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.lb-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  color: #FFD700;
}

.lb-skin { font-size: 1.2rem; }

.lb-you {
  background: rgba(0,168,89,0.15);
  border-color: rgba(0,168,89,0.5);
}

/* Achievement list */
.ach-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: opacity 0.2s;
}

.ach-entry.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.ach-icon { font-size: 2.6rem; }

.ach-info { flex: 1; }

.ach-reward {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFD700;
  white-space: nowrap;
}

.ach-done {
  color: #00e676;
  font-size: 1.2rem;
}

.ach-name {
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
}

.ach-desc {
  font-size: 0.88rem;
  color: #aaa;
  margin-top: 2px;
}

/* Coins display */
#coins-box {
  border-color: rgba(255,215,0,0.7);
  background: rgba(255,215,0,0.15);
}

/* Shop overlay */
.shop-box {
  width: min(95vw, 400px);
  max-height: 90vh;
}

#shop-coins-info {
  text-align: center;
  font-size: 1rem;
  color: #FFD700;
  font-weight: 700;
}

#shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skin-card {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.skin-card.owned {
  border-color: rgba(0,168,89,0.5);
  background: rgba(0,168,89,0.08);
}

.skin-card.equipped {
  border-color: #FFD700;
  background: rgba(255,215,0,0.12);
  box-shadow: 0 0 12px rgba(255,215,0,0.25);
}

.skin-card.locked {
  opacity: 0.55;
}

.skin-card.affordable {
  border-color: #00e676;
  background: rgba(0,230,118,0.1);
  box-shadow: 0 0 10px rgba(0,230,118,0.25);
  opacity: 1;
}

.skin-card.affordable .skin-card-badge::before {
  content: '✨ ';
}

.skin-card-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.skin-card-name {
  font-weight: 800;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  word-break: break-word;
  width: 100%;
}

.skin-card-badge {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
}

.skin-card-btn {
  margin-top: 4px;
  border: none;
  border-radius: 50px;
  padding: 6px 16px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  align-self: stretch;
  text-align: center;
}

.skin-card-btn:hover { transform: scale(1.04); }
.skin-card-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.skin-card-btn.btn-equip {
  background: #FFD700;
  color: #000;
}

.skin-card-btn.btn-equipped {
  background: #00a859;
  color: #fff;
}

.skin-card-btn.btn-buy {
  background: linear-gradient(135deg, #FFD700, #ff9900);
  color: #000;
}

.skin-card-btn.btn-locked {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

.skin-card-btn.btn-buy-crystal {
  background: linear-gradient(135deg, #00c8ff, #a855f7);
  color: #fff;
  font-weight: 700;
}
.skin-card-btn.btn-buy-crystal:disabled {
  background: #2a2a3a;
  color: #555;
  cursor: not-allowed;
}

/* Crystal skin card glow */
.skin-card.crystal-skin {
  border-color: rgba(0,200,255,0.4);
  box-shadow: 0 0 12px rgba(0,200,255,0.15);
}
.skin-card.crystal-skin.affordable {
  border-color: rgba(0,200,255,0.7);
  box-shadow: 0 0 18px rgba(0,200,255,0.3);
}

/* Achievement-locked skin card */
.skin-card.achievement-skin {
  border-color: rgba(255,180,0,0.35);
  box-shadow: 0 0 10px rgba(255,180,0,0.12);
}
.skin-card.achievement-skin .skin-card-canvas {
  filter: grayscale(0.4);
}

/* Shop category header */
.shop-category-header {
  grid-column: 1 / -1;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: #FFD700;
  padding: 10px 0 4px;
  border-bottom: 1px solid rgba(255,215,0,0.25);
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
}
.shop-category-header:first-child {
  padding-top: 2px;
}

/* Tutorial overlay */
.tutorial-box {
  text-align: center;
  max-width: 320px;
}

.tutorial-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin: -8px 0 16px;
}

#tutorial-steps {
  position: relative;
  min-height: 160px;
}

.tutorial-step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  animation: tutorialFadeIn 0.3s ease;
}

.tutorial-step.active { display: flex; }

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

.tutorial-step-icon {
  font-size: 2.8rem;
}

.tutorial-step-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: #FFD700;
}

.tutorial-step-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

#tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 6px;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.2s;
}

.tutorial-dot.active {
  background: #FFD700;
}

.tutorial-btns {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}

.tutorial-btns button {
  flex: 1;
}

/* Results overlay */
.results-box {
  text-align: center;
  min-width: 280px;
}

#results-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  color: #ff4444;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

#results-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 2px;
}

#results-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  color: #fff;
  line-height: 1;
}

#results-record-badge {
  background: linear-gradient(135deg, #FFD700, #ff8c00);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  animation: pulse 0.8s ease infinite alternate;
}

#results-best-row {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
  min-height: 16px;
}

#results-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.results-stat {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.results-stat-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: #FFD700;
  line-height: 1;
}

.results-stat-lbl {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

#results-unlocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.results-unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: #FFD700;
}

.results-btns {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

/* Daily reward overlay */
.daily-box {
  text-align: center;
}

#daily-streak-text {
  font-size: 1.15rem;
  color: #ff9900;
  font-weight: 800;
}

#daily-days-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.daily-day {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 3px;
  text-align: center;
  opacity: 0.38;
}

.daily-day.past {
  opacity: 0.7;
  border-color: rgba(0,168,89,0.5);
  background: rgba(0,168,89,0.1);
}

.daily-day.today {
  opacity: 1;
  border-color: #FFD700;
  background: rgba(255,215,0,0.15);
  transform: scale(1.08);
  animation: dailyPulse 1.5s ease-in-out infinite;
}

@keyframes dailyPulse {
  0%,100% { box-shadow: 0 0 8px rgba(255,215,0,0.4); }
  50%      { box-shadow: 0 0 20px rgba(255,215,0,0.7); }
}

.daily-day-num {
  font-size: 0.55rem;
  color: #888;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.daily-day.today .daily-day-num,
.daily-day.past .daily-day-num { color: #FFD700; }

.daily-day-coin {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
}

.daily-day.today .daily-day-coin { color: #FFD700; font-size: 0.82rem; }

#daily-coin-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: #FFD700;
  letter-spacing: 2px;
  animation: coinPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* XP box */
#xp-box {
  min-width: 64px;
  padding: 4px 10px 6px;
}

#xp-title-display {
  font-size: 0.68rem;
  color: #b388ff;
  letter-spacing: 0px;
  font-weight: 700;
  margin-top: -1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#xp-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
  width: 100%;
}

#xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7B2FBE, #FFD700);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Missions overlay */
#missions-reset-text {
  text-align: center;
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 12px;
}

#missions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Missions tabs */
.missions-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.missions-tab {
  flex: 1;
  padding: 8px 0;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #aaa;
  border-radius: 8px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.missions-tab.active {
  border-color: #FFD700;
  background: rgba(255,215,0,0.12);
  color: #FFD700;
}

.missions-tab:not(.active):hover {
  border-color: rgba(255,255,255,0.3);
  color: #ddd;
}

.mission-entry {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
}

.mission-entry.done {
  background: rgba(0,200,100,0.08);
  border-color: rgba(0,200,100,0.3);
}

.mission-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.mission-icon { font-size: 1.2rem; flex-shrink: 0; }

.mission-desc {
  flex: 1;
  font-size: 0.82rem;
  color: #ddd;
  line-height: 1.2;
}

.mission-reward {
  font-size: 0.82rem;
  color: #FFD700;
  font-weight: 800;
  white-space: nowrap;
}

.mission-progress-wrap {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.mission-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #009c3b, #FFD700);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.mission-entry.done .mission-progress-bar {
  width: 100% !important;
  background: #00cc66;
}

.mission-progress-text {
  font-size: 0.72rem;
  color: #888;
  text-align: right;
}

.mission-entry.done .mission-progress-text { color: #00cc66; }

/* Toast */
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: #1a1a1a;
  border: 2px solid #FFD700;
  border-radius: 50px;
  padding: 10px 22px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.95rem;
  color: #FFD700;
  z-index: 200;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

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

/* ─── Settings overlay ────────────────────────────────────────── */
.settings-box {
  max-width: 340px;
  width: 92%;
  padding: 20px 18px 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  gap: 12px;
}

.setting-row:last-of-type { border-bottom: none; }

.setting-row > label {
  color: #ddd;
  font-family: 'Baloo 2', cursive;
  font-size: 0.95rem;
  flex: 1;
}

.setting-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol-slider {
  width: 110px;
  accent-color: #FFD700;
  cursor: pointer;
}

#vol-value {
  color: #FFD700;
  font-size: 0.85rem;
  font-family: 'Baloo 2', cursive;
  min-width: 38px;
  text-align: right;
}

.lang-btns {
  display: flex;
  gap: 6px;
}

.lang-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #bbb;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Baloo 2', cursive;
}

.lang-btn.active {
  background: #FFD700;
  color: #111;
  border-color: #FFD700;
  font-weight: 700;
}

.lang-btn:hover:not(.active) {
  background: rgba(255,215,0,0.15);
  border-color: rgba(255,215,0,0.4);
  color: #FFD700;
}

.toggle-btn {
  background: #1a4a1a;
  color: #4ade80;
  border: 1px solid #2a6a2a;
  padding: 5px 16px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Baloo 2', cursive;
  min-width: 54px;
  transition: all 0.15s;
}

.toggle-btn.off {
  background: #3a1010;
  color: #f87171;
  border-color: #5a1a1a;
}

/* ─── Auth banner ─────────────────────────────────────────────── */
#auth-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 2px solid #4285f4;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 900;
  width: min(92vw, 360px);
  box-shadow: 0 4px 24px rgba(66,133,244,0.3);
  animation: slideUp 0.4s ease;
}

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

#auth-banner-text {
  flex: 1;
  font-size: 0.8rem;
  color: #ccc;
  line-height: 1.3;
}

#auth-google-btn {
  background: #4285f4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

#auth-google-btn:hover { background: #3367d6; }

#auth-dismiss-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

#auth-dismiss-btn:hover { color: #aaa; }

#auth-status {
  font-size: 0.72rem;
  color: #4ade80;
  text-align: center;
}

#notif-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 2px solid #FFD700;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 900;
  width: min(92vw, 360px);
  box-shadow: 0 4px 24px rgba(255,215,0,0.2);
  animation: slideUp 0.4s ease;
  font-size: 0.8rem;
  color: #ccc;
}

#notif-yes-btn {
  background: #FFD700;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
#notif-yes-btn:hover { background: #e6c200; }

#notif-no-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
#notif-no-btn:hover { color: #aaa; }

#account-menu {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: calc(50% - min(46vw, 180px));
  background: #1a1a2e;
  border: 2px solid #4285f4;
  border-radius: 14px;
  padding: 14px 16px;
  z-index: 901;
  min-width: 200px;
  box-shadow: 0 4px 24px rgba(66,133,244,0.3);
  animation: slideUp 0.2s ease;
}

.acct-info {
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 2px;
}

.acct-sub {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 12px;
}

#acct-login-btn {
  width: 100%;
  background: #4285f4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
#acct-login-btn:hover { background: #3367d6; }

#acct-logout-btn {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: #ccc;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
#acct-logout-btn:hover { background: rgba(255,255,255,0.12); }