:root {
  --blue: #1a3a8c;
  --blue2: #2756d0;
  --yellow: #f5c200;
  --mint: #26c6da;
  --green: #43a047;
  --red: #e53935;
  --pink: #ec407a;
  --orange: #f59300;
  --pear: #8bc34a;
  --bg1: #0d1b4b;
  --bg2: #122366;
  --bg3: #1a3a8c;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.15);
  --glow: rgba(245,194,0,0.35);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg1);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
}

/* ===== ANIMATED BG ===== */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== SCREENS ===== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ===== HOME ===== */
#home {
  align-items: center;
  justify-content: flex-start;
  padding: 28px 20px 40px;
  overflow-y: auto;
  gap: 0;
}

.home-logo {
  text-align: center;
  margin-bottom: 6px;
  animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.home-logo h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(52px, 14vw, 88px);
  color: var(--yellow);
  text-shadow: 0 0 40px rgba(245,194,0,0.6), 4px 4px 0 rgba(0,0,0,0.3);
  line-height: 1;
  letter-spacing: -1px;
}
.home-logo .sub {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  margin-top: 2px;
}

.flavor-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 14px 0 8px;
  animation: fadeUp 0.5s 0.2s both;
}
.flavor-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: chipPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.flavor-chip:hover { transform: scale(1.1) rotate(-2deg); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

.tagline {
  color: rgba(255,255,255,0.65);
  font-size: 15px;
  text-align: center;
  margin-bottom: 24px;
  animation: fadeUp 0.5s 0.3s both;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 520px;
  animation: fadeUp 0.5s 0.4s both;
}

.game-card {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 20px;
  padding: 20px 14px 18px;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, border-color 0.25s;
  backdrop-filter: blur(8px);
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  border-radius: inherit;
  transition: opacity 0.3s;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.1), transparent 70%);
}
.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.35);
}
.game-card:hover::before { opacity: 1; }
.game-card:active { transform: scale(0.97); }

.game-card .icon {
  font-size: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  width: 64px; height: 64px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.game-card .icon svg { width: 100%; height: 100%; }
.game-card:hover .icon { transform: scale(1.15) rotate(-5deg); }
.game-card .gname {
  font-family: 'Fredoka One', cursive;
  font-size: 17px;
  color: var(--yellow);
  margin-bottom: 5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.game-card .gdesc {
  font-size: 11.5px;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
  font-weight: 600;
}
.game-card .gbadge {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero bubbles (kept for bg animation) */
.hero-bubbles { display: none; }
.hero-bubble  { display: none; }

/* ===== GAME HEADER ===== */
.game-header {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  flex-shrink: 0;
}
.game-header .title {
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(245,194,0,0.5);
}
.btn-back {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-back:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.score-pill {
  background: rgba(245,194,0,0.2);
  border: 1px solid rgba(245,194,0,0.4);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 900;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(245,194,0,0.4);
  min-width: 80px;
  text-align: center;
  transition: transform 0.15s;
}
.score-pill.bump { animation: scoreBump 0.3s; }

/* ===== GAME AREA ===== */
.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ===== OVERLAY ===== */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,20,60,0.88);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 30;
  animation: fadeIn 0.3s;
}
.overlay.show { display: flex; }
.overlay h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 36px;
  color: var(--yellow);
  text-shadow: 0 0 24px rgba(245,194,0,0.6);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.overlay p { font-size: 16px; color: rgba(255,255,255,0.75); font-weight: 700; }
.btn-primary {
  background: linear-gradient(135deg, var(--yellow), #ff9500);
  color: #1a1a00;
  border: none;
  border-radius: 28px;
  padding: 14px 40px;
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245,194,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.5px;
}
.btn-primary:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 8px 30px rgba(245,194,0,0.55); }
.btn-primary:active { transform: scale(0.97); }

/* ===== ANIMATIONS ===== */
@keyframes popIn { 0%{transform:scale(0.5);opacity:0} 100%{transform:scale(1);opacity:1} }
@keyframes fadeUp { 0%{transform:translateY(20px);opacity:0} 100%{transform:translateY(0);opacity:1} }
@keyframes fadeIn { 0%{opacity:0} 100%{opacity:1} }
@keyframes scoreBump { 0%,100%{transform:scale(1)} 50%{transform:scale(1.3)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }
@keyframes glow { 0%,100%{box-shadow:0 0 8px rgba(245,194,0,0.4)} 50%{box-shadow:0 0 24px rgba(245,194,0,0.8)} }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes chipPop { 0%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:1} }
@keyframes float { 0%,100%{transform:translateY(0) rotate(0deg)} 50%{transform:translateY(-12px) rotate(3deg)} }
@keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

/* ===== GAME 1: CATCHER ===== */
#g1-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 14px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.flavor-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.flavor-dot-big {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  transition: background 0.3s;
}
#g1canvas { display: block; width: 100%; max-width: 480px; margin: 0 auto; touch-action: none; cursor: none; }

/* ===== GAME 2: MATCH-3 ===== */
#g2-hud {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  gap: 12px;
}
.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.hud-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.hud-val { font-family: 'Fredoka One', cursive; font-size: 22px; color: var(--yellow); text-shadow: 0 0 10px rgba(245,194,0,0.4); }

#g2board-wrap { flex: 1; overflow-y: auto; padding: 12px; display: flex; justify-content: center; align-items: flex-start; }
#g2board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 380px;
  width: 100%;
}
.g2cell {
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: clamp(18px, 5vw, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.08);
  transition: transform 0.15s, border-color 0.15s, opacity 0.25s, background 0.15s;
  user-select: none;
  position: relative;
  backdrop-filter: blur(4px);
}
.g2cell:hover { background: rgba(255,255,255,0.16); transform: scale(1.06); }
.g2cell.selected {
  border-color: var(--yellow);
  background: rgba(245,194,0,0.2);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(245,194,0,0.3);
  animation: glow 1s infinite;
}
.g2cell.matched { opacity: 0; transform: scale(0.4) rotate(20deg); pointer-events: none; }
.g2cell.empty { background: rgba(255,255,255,0.03); pointer-events: none; }
.g2cell.drag-target {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.22);
  transform: scale(1.08);
}

/* ===== GAME 3: WHACK ===== */
#g3-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.g3-target-box {
  margin: 10px auto 0;
  max-width: 360px;
  width: 90%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 10px 20px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.g3-target-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); font-weight: 700; }
.g3-target-emoji { font-size: 36px; display: block; margin: 4px 0 2px; animation: bounce 1s infinite; }
.g3-target-name { font-family: 'Fredoka One', cursive; font-size: 20px; color: var(--yellow); }

#g3grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px;
  max-width: 360px;
  margin: 0 auto;
  flex: 1;
}
.g3hole {
  aspect-ratio: 1;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 8vw, 40px);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  overflow: hidden;
}
.g3hole::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.05), transparent);
  pointer-events: none;
}
.g3hole.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 20px rgba(255,255,255,0.15);
  animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.g3hole:active { transform: scale(0.9); }
.g3hole.hit-right {
  background: rgba(76,175,80,0.35);
  border-color: #4caf50;
  box-shadow: 0 0 20px rgba(76,175,80,0.5);
}
.g3hole.hit-wrong {
  background: rgba(229,57,53,0.35);
  border-color: #e53935;
  animation: shake 0.35s;
}
.g3hole .emoji-inner { pointer-events: none; }
.timer-arc {
  position: absolute;
  width: 48px; height: 48px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

/* ===== GAME 4: MEMORY ===== */
#g4-hud {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  gap: 12px;
}
#g4board-wrap { flex: 1; overflow-y: auto; padding: 12px; display: flex; justify-content: center; align-items: center; }
#g4board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 380px;
  width: 100%;
}
.g4card {
  aspect-ratio: 1;
  perspective: 600px;
  cursor: pointer;
  border-radius: 14px;
}
.g4inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
  border-radius: 14px;
}
.g4card.flipped .g4inner,
.g4card.matched .g4inner { transform: rotateY(180deg); }
.g4face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.g4front {
  background: #1a3a8c;
  border: 2px solid rgba(255,255,255,0.2);
  font-family: 'Fredoka One', cursive;
  font-size: clamp(22px, 6vw, 32px);
  color: rgba(255,255,255,0.35);
}
.g4back {
  background: #0f2260;
  border: 2px solid rgba(255,255,255,0.2);
  transform: rotateY(180deg);
  font-size: clamp(26px, 7vw, 38px);
}
.g4back .card-name {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.g4card.matched .g4back {
  background: rgba(76,175,80,0.2);
  border-color: rgba(76,175,80,0.6);
  box-shadow: 0 0 20px rgba(76,175,80,0.3);
  animation: glow 1.5s infinite;
}
.g4card:not(.matched):not(.flipped):hover .g4inner {
  transform: rotateY(15deg);
}

/* Timer bar */
.timer-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--yellow));
  transition: width 1s linear, background 1s;
}

/* Particle effects */
.particle {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  font-size: 20px;
  animation: particleUp 0.8s ease-out forwards;
}
@keyframes particleUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.3); opacity: 0; }
}

/* Combo notice */
.combo-flash {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Fredoka One', cursive;
  font-size: 36px;
  color: var(--yellow);
  text-shadow: 0 0 30px rgba(245,194,0,0.8);
  pointer-events: none;
  z-index: 200;
  animation: comboAnim 0.7s ease-out forwards;
}
@keyframes comboAnim {
  0% { transform: translate(-50%,-50%) scale(0.5); opacity: 1; }
  60% { transform: translate(-50%,-80%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%,-100%) scale(1); opacity: 0; }
}

.progress-stars {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 8px;
}
.star { font-size: 20px; opacity: 0.3; transition: opacity 0.3s, transform 0.3s; }
.star.lit { opacity: 1; transform: scale(1.2); }

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ===== LOTTERY MODAL ===== */
#lottery-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5,10,30,0.92);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s;
}
#lottery-modal.show { display: flex; }
.lottery-box {
  background: linear-gradient(160deg, #0d2060 0%, #0a1438 100%);
  border: 1.5px solid rgba(245,194,0,0.35);
  border-radius: 24px;
  padding: 30px 24px 26px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 0 60px rgba(245,194,0,0.12), 0 24px 60px rgba(0,0,0,0.6);
  animation: popIn 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.lottery-trophy {
  text-align: center;
  font-size: 52px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 18px rgba(245,194,0,0.5));
  animation: bounce 1.5s infinite;
}
.lottery-title {
  font-family: 'Fredoka One', cursive;
  font-size: 26px;
  color: var(--yellow);
  text-align: center;
  text-shadow: 0 0 20px rgba(245,194,0,0.4);
  margin-bottom: 4px;
  line-height: 1.1;
}
.lottery-sub {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.4;
}
.lottery-field {
  margin-bottom: 12px;
}
.lottery-field label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 5px;
}
.lottery-field input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.lottery-field input::placeholder { color: rgba(255,255,255,0.25); }
.lottery-field input:focus {
  border-color: rgba(245,194,0,0.5);
  background: rgba(255,255,255,0.1);
}
.lottery-error {
  font-size: 10px;
  color: #ff5252;
  font-weight: 700;
  margin-top: 3px;
  display: none;
}
.lottery-error.show { display: block; }
.lottery-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--yellow), #ff9500);
  color: #1a1a00;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(245,194,0,0.3);
}
.lottery-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(245,194,0,0.45); }
.lottery-submit:active { transform: scale(0.98); }
.lottery-close {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.5);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lottery-close:hover { background: rgba(255,255,255,0.18); }

/* Already entered state */
.lottery-already {
  text-align: center;
  padding: 10px 0 6px;
}
.lottery-already p {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-weight: 700;
  line-height: 1.5;
}
.lottery-already .check-big { font-size: 40px; margin-bottom: 8px; }

/* ===== 3-STAR BADGE ON HOME CARDS ===== */
.card-star-badge {
  position: absolute;
  bottom: 10px; left: 10px;
  display: flex;
  gap: 1px;
  font-size: 11px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}
.card-completed-check {
  position: absolute;
  top: 8px; left: 8px;
  width: 22px; height: 22px;
  background: linear-gradient(135deg,#4caf50,#81c784);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  box-shadow: 0 0 10px rgba(76,175,80,0.6);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== LOTTERY BANNER ON HOME ===== */
.lottery-banner {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(135deg, rgba(245,194,0,0.1), rgba(255,149,0,0.08));
  border: 1px solid rgba(245,194,0,0.25);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeUp 0.5s 0.45s both;
}
.lottery-banner-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.lottery-banner-text { flex: 1; }
.lottery-banner-title {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: var(--yellow);
  margin-bottom: 3px;
}
.lottery-banner-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  line-height: 1.45;
}
.lottery-progress-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.lottery-pip {
  width: 28px; height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s;
}
.lottery-pip.done { background: var(--yellow); box-shadow: 0 0 8px rgba(245,194,0,0.5); }
.lottery-pip-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 800;
  margin-left: 4px;
}
.lottery-pip-label.done { color: var(--yellow); }

/* ===== SOUND TOGGLE ===== */
#sound-btn {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 999;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}
#sound-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
#sound-btn.muted { opacity: 0.5; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
  /* Home */
  #home { padding: 20px 14px 32px; }
  .home-logo h1 { font-size: clamp(46px, 16vw, 72px); }
  .home-logo .sub { font-size: 10px; letter-spacing: 2px; }
  .flavor-row { gap: 5px; margin: 10px 0 6px; }
  .flavor-chip { font-size: 10px; padding: 4px 9px; }
  .tagline { font-size: 13px; margin-bottom: 16px; }
  .games-grid { gap: 10px; }
  .game-card { padding: 14px 10px 12px; border-radius: 16px; }
  .game-card .icon { font-size: 34px; margin-bottom: 6px; }
  .game-card .gname { font-size: 14px; }
  .game-card .gdesc { font-size: 10px; }
  .game-card .gbadge { font-size: 8px; padding: 2px 6px; }

  /* Game headers */
  .game-header { padding: 8px 10px; }
  .game-header .title { font-size: 14px; }
  .btn-back { padding: 5px 11px; font-size: 11px; }
  .score-pill { font-size: 11px; padding: 4px 10px; min-width: 64px; }

  /* HUD stats */
  .hud-val { font-size: 18px; }
  .hud-label { font-size: 8px; }
  #g2-hud, #g3-hud, #g4-hud { padding: 6px 10px; }
  #g1-hud { padding: 6px 10px; }

  #g1canvas { cursor: crosshair; }
  #g2board { gap: 3px; }
  #g2board-wrap { padding: 8px; }
  .g2cell { border-radius: 8px; font-size: clamp(16px, 4.5vw, 22px); }

  .g3-target-box { margin: 6px auto 0; padding: 7px 14px; border-radius: 12px; }
  .g3-target-emoji { font-size: 28px; }
  .g3-target-name { font-size: 16px; }
  #g3grid { gap: 10px; padding: 10px; }
  .g3hole { font-size: clamp(22px, 7vw, 34px); }

  #g4board { gap: 7px; }
  #g4board-wrap { padding: 8px; }
  .g4card { border-radius: 10px; }
  .g4face { border-radius: 10px; }
  .g4back .card-name { font-size: 8px; }

  .overlay h2 { font-size: 28px; }
  .overlay p { font-size: 14px; }
  .btn-primary { padding: 11px 30px; font-size: 17px; }
  .combo-flash { font-size: 28px; }
  #sound-btn { width: 34px; height: 34px; font-size: 15px; top: 10px; right: 10px; }
}

@media (max-width: 360px) {
  .home-logo h1 { font-size: 42px; }
  .games-grid { gap: 8px; }
  .game-card .icon { font-size: 28px; }
  .game-card .gname { font-size: 12px; }
  .game-card .gdesc { font-size: 9.5px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  #home { flex-direction: row; flex-wrap: wrap; padding: 12px 16px; gap: 10px; justify-content: center; align-items: flex-start; }
  .home-logo { width: 100%; margin-bottom: 0; }
  .home-logo h1 { font-size: 36px; }
  .flavor-row { display: none; }
  .tagline { display: none; }
  .games-grid { grid-template-columns: repeat(4,1fr); max-width: 100%; }
  .game-card { padding: 10px 8px; }
  .game-card .icon { font-size: 26px; margin-bottom: 4px; }
  .game-card .gname { font-size: 11px; }
  .game-card .gdesc { display: none; }
  #g3grid { gap: 8px; padding: 8px; }
  #g4board-wrap { padding: 6px; }
  #g4board { gap: 6px; }
}