:root {
  --bg1: #79d7ff;
  --bg2: #4669ff;
  --card: rgba(255,255,255,0.18);
  --white: #ffffff;
  --navy: #12326f;
  --blue: #1488ff;
  --yellow: #ffc928;
  --orange: #ff8a00;
  --green: #30c85e;
  --red: #ff5b5b;
  --shadow: 0 16px 40px rgba(16, 55, 130, 0.2);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Nunito", sans-serif;
  background: linear-gradient(180deg, #dff7ff 0%, #9bdfff 28%, #6aa7ff 100%);
  color: var(--navy);
}
button, input { font-family: inherit; }

.app-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 16px auto 28px;
}

.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.72));
  border: 3px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card {
  border-radius: var(--radius);
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 28px;
  margin-bottom: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-wrap h1 {
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.brand-wrap p {
  margin: 2px 0 0;
  font-weight: 800;
  color: #1a5dbd;
}

.mascot {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: radial-gradient(circle at top, #bff3ff, #3eb4ff 62%, #1970ff);
  box-shadow: inset 0 5px 12px rgba(255,255,255,0.55);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff, #e1f1ff);
  border: 2px solid #d3e9ff;
  font-weight: 900;
}

.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 16px;
}

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-btn, .primary-btn, .secondary-btn, .ghost-btn, .answer-btn {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.menu-btn:hover, .primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .answer-btn:hover { transform: translateY(-2px); }

.menu-btn {
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1c9aff, #1f67ff);
  color: white;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(23, 101, 204, 0.24);
}
.menu-btn.active { background: linear-gradient(180deg, #ffce2f, #ff9900); }

.streak-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fef6ce, #ffe189);
  text-align: center;
}
.streak-label { font-weight: 800; font-size: .95rem; }
.streak-value { font-size: 1.7rem; font-family: "Baloo 2", sans-serif; }

.screen { display: none; min-height: 74vh; }
.screen.active { display: block; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 18px;
  align-items: center;
}

.badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  color: #0d57af;
  background: #def4ff;
  border: 2px solid #b4e2ff;
}

.hero-copy h2, .section-head h2, .quiz-head h2, .result-wrap h2 {
  margin: 8px 0 10px;
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}
.hero-copy p, .section-head p, .result-wrap p { margin: 0; font-size: 1.08rem; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 900;
  padding: 14px 20px;
}

.primary-btn {
  color: #663c00;
  background: linear-gradient(180deg, #ffe45e, #ffaf00);
  box-shadow: 0 12px 24px rgba(255, 169, 0, 0.28);
}
.secondary-btn {
  color: white;
  background: linear-gradient(180deg, #33c870, #18a84d);
  box-shadow: 0 12px 24px rgba(24, 168, 77, 0.24);
}
.ghost-btn {
  color: var(--navy);
  background: linear-gradient(180deg, #ffffff, #ebf5ff);
  border: 2px solid #cbe5ff;
}
.big-btn { min-width: 170px; }

.hero-visual {
  min-height: 300px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 30px;
  background: radial-gradient(circle at top, #effeff, #9ae3ff 42%, #4a8eff 100%);
}
.brain-bubble {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 6rem;
  background: radial-gradient(circle at top, #d9f9ff, #58c8ff 58%, #1d6eff);
  box-shadow: inset 0 8px 18px rgba(255,255,255,.48), 0 16px 42px rgba(29,110,255,.28);
}
.floating-chip {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  background: white;
  box-shadow: var(--shadow);
}
.chip1 { top: 18px; right: 20px; color: #c47b00; }
.chip2 { left: 26px; bottom: 54px; color: #1677d2; }
.chip3 { right: 22px; bottom: 18px; color: #15984f; }

.feature-grid, .category-grid, .rewards-grid, .how-grid {
  display: grid;
  gap: 16px;
}
.feature-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
}
.feature-card, .category-card, .reward-card, .how-card {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(233,245,255,0.9));
  border: 2px solid #d3e9ff;
}
.feature-icon { font-size: 2rem; }
.feature-card h3, .category-card h3, .reward-card h3 { margin: 8px 0 6px; font-family: "Baloo 2", sans-serif; font-size: 1.6rem; }
.feature-card p, .category-card p, .reward-card p { margin: 0; }

.section-head { margin-bottom: 18px; }
.category-grid { grid-template-columns: repeat(3, 1fr); }
.category-card {
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(18,50,111,.08);
}
.category-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.category-emoji { font-size: 2.5rem; }
.category-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.small-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf7ff;
  font-size: .85rem;
  font-weight: 800;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.quiz-status { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-label { font-weight: 900; color: #1d7bcd; text-transform: uppercase; letter-spacing: .05em; }
.progress-bar {
  width: 100%;
  height: 18px;
  margin: 18px 0 20px;
  background: #e3f2ff;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 10%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2bcf68, #0c9fe8);
}
.question-box {
  padding: 22px;
  border-radius: 22px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  text-align: center;
  background: linear-gradient(180deg, #fff9d8, #ffe492);
}
.answers-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.answer-btn {
  text-align: left;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2497ff, #1c69ff);
  color: white;
  font-size: 1.08rem;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(28,105,255,.2);
}
.answer-btn.correct { background: linear-gradient(180deg, #34d86f, #149f45); }
.answer-btn.wrong { background: linear-gradient(180deg, #ff8585, #ff5050); }
.answer-btn.disabled { pointer-events: none; filter: grayscale(.12); opacity: .95; }
.quiz-actions { margin-top: 18px; }

.result-wrap {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 10px;
}
.result-emoji { font-size: 5rem; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.stat-box {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #ecf7ff);
  border: 2px solid #d6ebff;
}
.stat-box span { display: block; font-weight: 800; margin-bottom: 6px; }
.stat-box strong { font-size: 2rem; font-family: "Baloo 2", sans-serif; }

.leaderboard-box {
  overflow: auto;
  border-radius: 24px;
  background: rgba(255,255,255,.85);
  border: 2px solid #d6ebff;
}
.table-note { margin-top: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 16px; }
thead th { background: #dff1ff; font-size: .95rem; text-transform: uppercase; }
tbody tr:nth-child(odd) { background: rgba(237,247,255,.7); }

.rewards-grid { grid-template-columns: repeat(3, 1fr); }
.reward-card.locked { opacity: .9; }
.reward-cost { display: inline-block; margin-top: 10px; font-weight: 900; color: #e18900; }
.reward-status { display: block; margin-top: 8px; font-weight: 800; }
.reward-btn {
  margin-top: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe45e, #ffb200);
}
.reward-btn:disabled { opacity: .5; cursor: not-allowed; }

.how-grid { grid-template-columns: repeat(2, 1fr); }
.how-card {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.05rem;
  font-weight: 800;
}
.how-card strong {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: white;
  background: linear-gradient(180deg, #24a0ff, #2763ff);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 33, 84, 0.55);
  display: grid;
  place-items: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  width: min(460px, calc(100% - 32px));
  padding: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #e8f6ff);
  box-shadow: var(--shadow);
  text-align: center;
}
.modal-card h3 {
  margin: 0 0 8px;
  font-family: "Baloo 2", sans-serif;
  font-size: 2rem;
}
.modal-card p { margin: 0 0 16px; }
.modal-card input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid #cce6ff;
  font-size: 1rem;
  outline: none;
}
.modal-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .feature-grid, .category-grid, .rewards-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 18px, 100%); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .feature-grid, .category-grid, .rewards-grid, .how-grid, .answers-wrap, .result-stats { grid-template-columns: 1fr; }
  .quiz-head { flex-direction: column; align-items: flex-start; }
  .menu-btn { font-size: .96rem; }
  .brand-wrap h1 { font-size: 2.15rem; }
}
