/* ============================================================
   WASTE WARRIORS — Master Stylesheet
   Premium educational game for Indian children
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Palette */
  --green-bin:    #27ae60;
  --green-light:  #d5f5e3;
  --blue-bin:     #2980b9;
  --blue-light:   #d6eaf8;
  --red-bin:      #c0392b;
  --red-light:    #fadbd8;
  --black-bin:    #2c3e50;
  --black-light:  #d5d8dc;

  /* UI Colors */
  --primary:      #27ae60;
  --primary-dark: #1e8449;
  --accent:       #f39c12;
  --accent-dark:  #d68910;
  --bg:           #f0f6f0;
  --bg-alt:       #ffffff;
  --text:         #212529;
  --text-light:   #6c757d;
  --white:        #ffffff;
  --shadow:       0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.12);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    6px;
  --transition:   .28s cubic-bezier(.4,0,.2,1);

  /* Typography */
  --font:         'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Utility ---------- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.sr-only   { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: box-shadow var(--transition);
}
.site-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.08); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1140px; margin: 0 auto; padding: 12px 24px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--primary-dark); }
.nav-logo img { height: 38px; width: auto; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-weight: 700; font-size: .95rem; color: var(--text); transition: color var(--transition); }
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 50px;
  background: var(--primary); color: var(--white);
  font-weight: 700; font-size: .92rem;
  transition: background var(--transition), transform var(--transition);
}
.nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Mobile nav toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--text); border-radius: 2px; transition: var(--transition); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform var(--transition);
    z-index: 999;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a, .nav-links .nav-cta { padding: 16px 24px; width: 100%; text-align: center; border-radius: 0; }
  .nav-links .nav-cta { background: var(--primary); color: var(--white); }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px;
  background: linear-gradient(160deg, #e8f8f0 0%, #f0f6f0 40%, #e3f2fd 100%);
  overflow: hidden;
}

/* Floating decorative blobs */
.hero-blob {
  position: absolute; border-radius: 50%; opacity: .12; pointer-events: none;
  animation: blobFloat 8s ease-in-out infinite alternate;
}
.hero-blob--1 { width: 340px; height: 340px; background: var(--primary); top: -80px; left: -100px; animation-delay: 0s; }
.hero-blob--2 { width: 260px; height: 260px; background: var(--accent); bottom: -60px; right: -80px; animation-delay: 2s; }
.hero-blob--3 { width: 180px; height: 180px; background: var(--blue-bin); top: 30%; right: 5%; animation-delay: 4s; }
.hero-blob--4 { width: 120px; height: 120px; background: var(--red-bin); bottom: 20%; left: 8%; animation-delay: 3s; opacity: .08; }

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, -30px) scale(1.08); }
}

/* Floating leaf particles */
.hero-leaf {
  position: absolute; font-size: 1.4rem; opacity: .18; pointer-events: none;
  animation: leafDrift 12s ease-in-out infinite;
}
@keyframes leafDrift {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-40px) rotate(15deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center; max-width: 720px;
}
.hero-logo {
  width: 140px; height: auto; margin: 0 auto 24px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(39,174,96,.18);
  animation: heroLogoIn .8s ease-out both;
}
@keyframes heroLogoIn {
  from { opacity: 0; transform: translateY(20px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px; margin-bottom: 18px;
  border-radius: 50px;
  background: rgba(39,174,96,.12);
  color: var(--primary-dark);
  font-weight: 700; font-size: .85rem;
  letter-spacing: .5px;
  animation: fadeUp .7s .2s ease-out both;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--primary-dark);
  margin-bottom: 16px;
  animation: fadeUp .7s .35s ease-out both;
}
.hero h1 span { color: var(--accent); }

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-light);
  max-width: 560px; margin: 0 auto 32px;
  animation: fadeUp .7s .5s ease-out both;
}

.hero-btns {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  animation: fadeUp .7s .65s ease-out both;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px;
  font-weight: 700; font-size: 1rem;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.15);
  transform: translateX(-100%);
  transition: transform .4s ease;
}
.btn:hover::after { transform: translateX(0); }

.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 4px 16px rgba(39,174,96,.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(39,174,96,.35); }

.btn-outline { background: var(--white); color: var(--primary-dark); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--green-light); transform: translateY(-2px); }

.btn-accent { background: var(--accent); color: var(--white); box-shadow: 0 4px 16px rgba(243,156,18,.3); }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* ============================================================
   SECTION COMMON
   ============================================================ */
.section {
  padding: 90px 24px;
}
.section-header {
  text-align: center; max-width: 640px; margin: 0 auto 52px;
}
.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin-bottom: 12px;
  color: var(--text);
}
.section-header p {
  font-size: 1.05rem; color: var(--text-light);
}
.section-tag {
  display: inline-block;
  padding: 5px 14px; margin-bottom: 12px;
  border-radius: 50px;
  font-size: .8rem; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
}

/* ============================================================
   4-BIN CARDS SECTION
   ============================================================ */
.bins-section { background: var(--bg-alt); }

.bins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1140px; margin: 0 auto;
}

.bin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  border-top: 5px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.bin-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.bin-card--green  { border-top-color: var(--green-bin); }
.bin-card--blue   { border-top-color: var(--blue-bin); }
.bin-card--red    { border-top-color: var(--red-bin); }
.bin-card--black  { border-top-color: var(--black-bin); }

.bin-card-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: 18px;
  color: var(--white);
}
.bin-card--green  .bin-card-icon { background: var(--green-bin); }
.bin-card--blue   .bin-card-icon { background: var(--blue-bin); }
.bin-card--red    .bin-card-icon { background: var(--red-bin); }
.bin-card--black  .bin-card-icon { background: var(--black-bin); }

.bin-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.bin-card .bin-type { font-size: .88rem; color: var(--text-light); margin-bottom: 14px; font-weight: 600; }

.bin-card ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
}
.bin-card ul li {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 50px;
  font-size: .82rem; font-weight: 600;
}
.bin-card--green  ul li { background: var(--green-light); color: #1a7a42; }
.bin-card--blue   ul li { background: var(--blue-light); color: #1a5e8a; }
.bin-card--red    ul li { background: var(--red-light); color: #922b21; }
.bin-card--black  ul li { background: var(--black-light); color: var(--black-bin); }

/* ============================================================
   HOW IT WORKS SECTION
   ============================================================ */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  max-width: 1000px; margin: 0 auto;
}
.step-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.step-card:hover { transform: translateY(-4px); }

.step-num {
  width: 50px; height: 50px;
  border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #2ecc71);
  color: var(--white); font-weight: 800; font-size: 1.2rem;
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step-card p  { font-size: .92rem; color: var(--text-light); }

/* ============================================================
   BENEFITS SECTION
   ============================================================ */
.benefits-section { background: var(--bg-alt); }

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  max-width: 1060px; margin: 0 auto;
}

.benefit-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 28px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.benefit-card:hover { transform: translateY(-3px); }

.benefit-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: var(--green-light);
}
.benefit-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.benefit-card p  { font-size: .9rem; color: var(--text-light); }

/* ============================================================
   DID YOU KNOW SECTION
   ============================================================ */
.dyk-section {
  background: linear-gradient(135deg, #1e8449, #27ae60);
  color: var(--white);
}
.dyk-section .section-header h2 { color: var(--white); }
.dyk-section .section-header p  { color: rgba(255,255,255,.8); }

.dyk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; max-width: 1060px; margin: 0 auto;
}
.dyk-card {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  padding: 24px;
  transition: background var(--transition);
}
.dyk-card:hover { background: rgba(255,255,255,.2); }
.dyk-card .dyk-emoji { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.dyk-card p { font-size: .95rem; line-height: 1.55; color: rgba(255,255,255,.92); }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(160deg, #fffde7 0%, #e8f8f0 100%);
}
.cta-section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}
.cta-section p {
  font-size: 1.05rem; color: var(--text-light);
  max-width: 500px; margin: 0 auto 28px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black-bin);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 40px 24px;
}
.site-footer .footer-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--white);
}
.site-footer .footer-logo img { height: 32px; border-radius: 6px; }
.site-footer .footer-tagline { font-size: .92rem; margin-bottom: 8px; }
.site-footer .footer-copy { font-size: .82rem; opacity: .6; }

/* ============================================================
   SCROLL ANIMATIONS (landing page)
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease-out, transform .7s ease-out;
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}

/* ============================================================
   GAME PAGE — LAYOUT
   ============================================================ */
.game-page {
  height: 100vh;
  height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(170deg, #e8f8f0, #e3f2fd);
  overflow: hidden;
  position: fixed;
  inset: 0;
}

/* Top bar */
.game-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  z-index: 100;
  flex-shrink: 0;
}
.game-topbar-left { display: flex; align-items: center; gap: 10px; }
.game-topbar-left img { height: 32px; border-radius: 6px; }
.game-topbar-left span { font-weight: 800; font-size: 1rem; color: var(--primary-dark); }

.game-stats {
  display: flex; gap: 18px; align-items: center;
}
.game-stat {
  text-align: center;
}
.game-stat-label {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-light);
}
.game-stat-value {
  font-size: 1.25rem; font-weight: 800; color: var(--text);
  line-height: 1.2;
}
.game-stat-value.score-pop {
  animation: scorePop .35s ease;
}
@keyframes scorePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); color: var(--primary); }
  100% { transform: scale(1); }
}

.game-topbar-right {
  display: flex; gap: 8px;
}
.game-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid rgba(0,0,0,.08);
  font-size: 1.1rem;
  transition: background var(--transition);
}
.game-btn:hover { background: #ddd; }

/* Game area */
.game-area {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Falling zone */
.fall-zone {
  flex: 1; position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Falling item — responsive card for all screen sizes */
.falling-item {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  top: -220px;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(8px, 2vw, 16px);
  pointer-events: none;
  z-index: 10;
  transition: none;
  /* Card container */
  background: var(--white);
  padding: clamp(16px, 3vw, 28px) clamp(20px, 4vw, 38px) clamp(12px, 2.5vw, 20px);
  border-radius: clamp(18px, 4vw, 36px);
  box-shadow: 0 10px 40px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.08);
  border: clamp(3px, .5vw, 5px) solid rgba(39,174,96,.25);
  max-width: 85vw;
  width: auto;
}
.falling-item-emoji {
  font-size: clamp(3.5rem, 12vw, 6rem);
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.18));
  animation: itemBob 1.5s ease-in-out infinite;
}
@keyframes itemBob {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50%      { transform: rotate(3deg) scale(1.04); }
}
.falling-item-label {
  background: linear-gradient(135deg, #f0f6f0, #e3f2fd);
  padding: clamp(5px, 1.2vw, 9px) clamp(14px, 3vw, 24px);
  border-radius: 50px;
  font-size: clamp(.85rem, 2.5vw, 1.1rem); font-weight: 900;
  color: var(--text);
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
  white-space: nowrap;
  letter-spacing: .4px;
}

/* Bins container */
.bins-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 16px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(0,0,0,.06);
  flex-shrink: 0;
}

.game-bin {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}
.game-bin:active { transform: scale(.93); }
@media (hover: hover) {
  .game-bin:hover { transform: translateY(-3px); }
}

.game-bin--green  { background: var(--green-light); border-color: var(--green-bin); }
.game-bin--blue   { background: var(--blue-light);  border-color: var(--blue-bin); }
.game-bin--red    { background: var(--red-light);    border-color: var(--red-bin); }
.game-bin--black  { background: var(--black-light);  border-color: var(--black-bin); }

.game-bin:focus-visible {
  box-shadow: 0 0 0 4px rgba(0,0,0,.08);
}

.game-bin-emoji { font-size: 2rem; }
.game-bin-name  { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.game-bin-type  { font-size: .65rem; font-weight: 600; color: var(--text-light); }

.game-bin--green .game-bin-name  { color: #1a7a42; }
.game-bin--blue  .game-bin-name  { color: #1a5e8a; }
.game-bin--red   .game-bin-name  { color: #922b21; }
.game-bin--black .game-bin-name  { color: var(--black-bin); }

/* Bin feedback flash */
.game-bin.correct-flash {
  animation: binCorrect .4s ease;
}
@keyframes binCorrect {
  0%   { box-shadow: 0 0 0 0 rgba(39,174,96,.5); }
  50%  { box-shadow: 0 0 0 12px rgba(39,174,96,.2); background: rgba(39,174,96,.25); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

.game-bin.wrong-flash {
  animation: binWrong .5s ease;
}
@keyframes binWrong {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); background: rgba(192,57,43,.2); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Correct burst particles */
.burst {
  position: fixed; pointer-events: none; z-index: 9999;
}
.burst-particle {
  position: absolute; width: 8px; height: 8px;
  border-radius: 50%;
  animation: burstOut .6s ease-out forwards;
}
@keyframes burstOut {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* Streak fire */
.streak-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem; pointer-events: none;
  animation: streakPop .6s ease forwards;
  z-index: 50;
}
@keyframes streakPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  40%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(.8); }
}

/* Milestone badge */
.milestone-toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: var(--white); padding: 12px 28px;
  border-radius: 50px;
  font-weight: 800; font-size: 1rem;
  box-shadow: 0 6px 24px rgba(243,156,18,.35);
  z-index: 200;
  animation: toastIn .5s ease forwards, toastOut .5s 2.5s ease forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* ============================================================
   GAME OVERLAYS
   ============================================================ */
.game-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.game-overlay.active { opacity: 1; pointer-events: all; }

.game-modal {
  background: var(--white);
  border-radius: 24px;
  padding: 36px 28px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(.9);
  transition: transform .35s ease;
  margin: auto;
}
.game-overlay.active .game-modal { transform: scale(1); }

.game-modal-logo { height: 60px; margin: 0 auto 16px; border-radius: 14px; }
.game-modal h2 { font-size: 1.6rem; margin-bottom: 8px; }
.game-modal p  { font-size: .95rem; color: var(--text-light); margin-bottom: 8px; }

.game-modal .final-score {
  font-size: 3rem; font-weight: 800;
  color: var(--primary); margin: 12px 0 4px;
}
.game-modal .high-score-note {
  font-size: .85rem; color: var(--accent); font-weight: 700; margin-bottom: 6px;
}

/* Educational feedback card inside game over */
.edu-feedback {
  background: #fef9e7;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  margin: 16px 0;
  text-align: left;
}
.edu-feedback strong { color: var(--text); }
.edu-feedback p { font-size: .88rem; color: var(--text-light); margin: 0; }

.modal-btns {
  display: flex; flex-direction: column; gap: 10px; margin-top: 20px;
}
.modal-btns .btn { justify-content: center; width: 100%; }

/* Start screen extras */
.start-instructions {
  display: flex; flex-direction: column; gap: 8px;
  margin: 16px 0 20px;
}
.start-instructions .inst-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: .88rem; font-weight: 600;
  text-align: left;
}
.inst-step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}

/* Pause overlay */
.pause-content { font-size: 1.3rem; font-weight: 800; color: var(--text); }

/* ============================================================
   GAME SCREEN SHAKE
   ============================================================ */
.shake {
  animation: screenShake .4s ease;
}
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px) rotate(-.5deg); }
  40%      { transform: translateX(4px) rotate(.5deg); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ============================================================
   RESPONSIVE — LANDING PAGE
   ============================================================ */
@media (max-width: 768px) {
  .hero { padding: 100px 20px 60px; min-height: auto; }
  .hero-logo { width: 100px; }
  .hero-badge { font-size: .78rem; padding: 5px 14px; }
  .hero-sub { font-size: 1rem; margin-bottom: 24px; }
  .hero-btns { gap: 10px; }
  .btn { padding: 12px 24px; font-size: .92rem; }
  .section { padding: 60px 16px; }
  .section-header { margin-bottom: 36px; }
  .section-header p { font-size: .95rem; }
  .bins-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .bin-card { padding: 24px 20px; }
  .steps-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .benefits-grid { grid-template-columns: 1fr; gap: 16px; }
  .dyk-grid { grid-template-columns: 1fr; gap: 14px; }
  .cta-section { padding: 60px 20px; }
}

@media (max-width: 480px) {
  .hero { padding: 90px 16px 50px; }
  .hero-logo { width: 80px; border-radius: 14px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn { width: 100%; max-width: 280px; justify-content: center; }
  .section { padding: 48px 14px; }
  .bins-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { padding: 24px 18px; }
  .benefit-card { padding: 20px 16px; }
  .site-footer { padding: 30px 16px; }
}

/* ============================================================
   RESPONSIVE — GAME PAGE (Tablet)
   ============================================================ */
@media (max-width: 768px) {
  .game-topbar { padding: 8px 14px; }
  .game-topbar-left img { height: 28px; }
  .game-topbar-left span { font-size: .9rem; }
  .game-stats { gap: 14px; }
  .game-stat-label { font-size: .6rem; }
  .game-stat-value { font-size: 1.05rem; }
  .game-btn { width: 36px; height: 36px; font-size: 1rem; }

  .bins-container { gap: 8px; padding: 10px 12px 14px; }
  .game-bin { padding: 14px 6px 12px; border-radius: 10px; }
  .game-bin-emoji { font-size: 1.8rem; }
  .game-bin-name { font-size: .7rem; }

  .game-modal { padding: 30px 22px; }
  .game-modal h2 { font-size: 1.4rem; }
  .game-modal .final-score { font-size: 2.4rem; }
}

/* ============================================================
   RESPONSIVE — GAME PAGE (Phone)
   ============================================================ */
@media (max-width: 480px) {
  .game-topbar { padding: 6px 10px; gap: 6px; }
  .game-topbar-left img { height: 24px; }
  .game-topbar-left span { font-size: .8rem; }
  .game-stats { gap: 8px; }
  .game-stat-label { font-size: .55rem; letter-spacing: .3px; }
  .game-stat-value { font-size: .95rem; }
  .game-btn { width: 32px; height: 32px; font-size: .9rem; border-radius: 8px; }

  /* 2x2 bin grid for bigger tap targets on phones */
  .bins-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }
  .game-bin {
    padding: 12px 8px 10px;
    border-width: 2.5px;
    border-radius: 12px;
    flex-direction: row;
    gap: 8px;
    min-height: 52px;
    justify-content: center;
  }
  .game-bin-emoji { font-size: 1.5rem; }
  .game-bin-name { font-size: .75rem; }
  .game-bin-type { display: none; }

  .game-modal { padding: 24px 18px; border-radius: 20px; }
  .game-modal-logo { height: 44px; margin-bottom: 10px; }
  .game-modal h2 { font-size: 1.2rem; margin-bottom: 6px; }
  .game-modal p { font-size: .88rem; }
  .game-modal .final-score { font-size: 2rem; margin: 8px 0 2px; }
  .edu-feedback { padding: 10px 12px; margin: 12px 0; }
  .edu-feedback p { font-size: .82rem; }
  .modal-btns { gap: 8px; margin-top: 14px; }
  .modal-btns .btn { padding: 11px 20px; font-size: .9rem; }

  .start-instructions { gap: 6px; margin: 12px 0 16px; }
  .start-instructions .inst-step { padding: 6px 10px; font-size: .82rem; gap: 8px; }
  .inst-step-num { width: 24px; height: 24px; font-size: .7rem; }

  .milestone-toast { font-size: .88rem; padding: 10px 20px; top: 55px; }
  .streak-badge { font-size: 1.3rem !important; }
}

/* Very small phones */
@media (max-width: 360px) {
  .game-topbar-left span { display: none; }
  .game-stats { gap: 6px; }
  .game-stat-value { font-size: .88rem; }
  .game-stat-label { font-size: .5rem; }
}

/* Landscape phone — keep 4-column bins */
@media (max-height: 500px) and (orientation: landscape) {
  .bins-container { grid-template-columns: repeat(4, 1fr); padding: 6px 10px; gap: 6px; }
  .game-bin { flex-direction: column; padding: 8px 4px 6px; min-height: 40px; }
  .game-bin-emoji { font-size: 1.3rem; }
  .game-bin-name { font-size: .6rem; }
  .game-bin-type { display: none; }
  .game-topbar { padding: 4px 10px; }
  .game-topbar-left img { height: 22px; }
  .falling-item-emoji { font-size: clamp(2rem, 8vw, 3.5rem) !important; }
}

/* ============================================================
   GOOGLE FONT FALLBACK
   ============================================================ */
/* Nunito is loaded via <link> in HTML. If it fails, system fonts kick in via var(--font). */
