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

:root {
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --yellow: #f59e0b;
  --green:  #10b981;
  --red:    #ef4444;
  --bg:     #fdf8f0;
  --white:  #ffffff;
  --text:   #1e1b4b;
  --muted:  #6b7280;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
}

body {
  font-family: 'Nunito', 'Comic Sans MS', cursive, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.hidden { display: none !important; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 5%;
  background: var(--purple);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

.logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}
.nav-links a {
  color: rgba(255,255,255,0.75);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  transition: all 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.2);
}

.star-pill {
  background: var(--yellow);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.8rem;
  border-radius: 99px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover   { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.btn:active  { transform: translateY(0); }

.btn-primary  { background: var(--purple); color: #fff; }
.btn-secondary{ background: var(--yellow); color: #fff; }
.btn-outline  { background: transparent; color: var(--purple); border: 3px solid var(--purple); }

/* ── Home Hero ───────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 4rem 5%;
  background: linear-gradient(135deg, #ede9fe 0%, #fdf8f0 60%);
}

.hero-globe {
  font-size: 5rem;
  animation: spin 8s linear infinite;
  display: inline-block;
  margin-bottom: 0.5rem;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.highlight { color: var(--purple); }

.hero-content p {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 420px;
}

.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-flags {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}
.hero-flags span {
  font-size: 3.5rem;
  animation: floatFlag 3s ease-in-out infinite;
  display: block;
}
.hero-flags span:nth-child(2) { animation-delay: 0.3s; }
.hero-flags span:nth-child(3) { animation-delay: 0.6s; }
.hero-flags span:nth-child(4) { animation-delay: 0.9s; }
.hero-flags span:nth-child(5) { animation-delay: 1.2s; }
.hero-flags span:nth-child(6) { animation-delay: 1.5s; }
.hero-flags span:nth-child(7) { animation-delay: 1.8s; }
.hero-flags span:nth-child(8) { animation-delay: 2.1s; }
.hero-flags span:nth-child(9) { animation-delay: 2.4s; }

@keyframes floatFlag {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ── Section titles ──────────────────────────────────────────────── */
.section-title {
  font-size: 1.7rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ── Daily Country ───────────────────────────────────────────────── */
.daily-section {
  padding: 3.5rem 5%;
  background: var(--white);
}

.daily-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: var(--radius);
  border: 3px solid #ddd;
  box-shadow: var(--shadow);
}

.daily-flag {
  font-size: 6rem;
  line-height: 1;
  text-align: center;
}

.daily-info h3 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
}
.daily-capital { color: var(--muted); font-weight: 700; margin-bottom: 0.4rem; }
.daily-hint    { font-size: 1.4rem; margin-bottom: 0.5rem; letter-spacing: 0.1em; }
.daily-fact    { font-size: 0.95rem; color: #555; line-height: 1.5; }

/* ── Continent grid (home) ───────────────────────────────────────── */
.continents-section { padding: 3.5rem 5%; }

.continent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.continent-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 3px solid var(--c, #ccc);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
}
.continent-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow);
  background: var(--bg, #f9f9f9);
}

.continent-emoji { font-size: 2.5rem; }
.continent-label { font-weight: 900; font-size: 1rem; }
.continent-count { font-size: 0.8rem; color: var(--muted); }

/* ── How to Play ─────────────────────────────────────────────────── */
.how-section {
  padding: 3.5rem 5%;
  background: var(--purple);
}
.how-section .section-title { color: #fff; }

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
}

.how-card {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
}
.how-icon { font-size: 2.2rem; margin-bottom: 0.6rem; }
.how-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.how-card p  { font-size: 0.88rem; opacity: 0.85; }

/* ── Quiz page ───────────────────────────────────────────────────── */
.quiz-section { padding: 3rem 5%; max-width: 760px; margin: 0 auto; }

.quiz-title    { font-size: 2rem; font-weight: 900; text-align: center; margin-bottom: 0.5rem; }
.quiz-subtitle { text-align: center; color: var(--muted); font-size: 1.05rem; margin-bottom: 2rem; }

/* Continent picker */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.5rem 1rem;
  background: var(--white);
  border: 3px solid var(--c, #7c3aed);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, background 0.15s;
}
.picker-btn:hover {
  background: var(--c, #7c3aed);
  color: #fff;
  transform: scale(1.04);
}
.all-btn { border-color: var(--purple); --c: #7c3aed; }

.picker-emoji { font-size: 2.5rem; }
.picker-label { font-weight: 900; font-size: 1.1rem; }
.picker-sub   { font-size: 0.8rem; color: var(--muted); }
.picker-btn:hover .picker-sub { color: rgba(255,255,255,0.8); }

/* Quiz game header */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.q-progress    { font-weight: 700; color: var(--muted); }
.stars-display { font-weight: 900; font-size: 1.1rem; color: var(--yellow); }

/* Progress bar */
.progress-bar {
  height: 12px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--yellow));
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Flag display */
.flag-display {
  text-align: center;
  margin-bottom: 1.5rem;
}
.flag-emoji {
  font-size: 7rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.hint-row {
  font-size: 2rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}
.q-prompt {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--muted);
}

/* Options */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.option-btn {
  padding: 1rem;
  border-radius: var(--radius);
  border: 3px solid #e5e7eb;
  background: var(--white);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
  text-align: center;
}
.option-btn:not(:disabled):hover {
  border-color: var(--purple);
  transform: scale(1.03);
}
.option-btn.correct {
  border-color: var(--green);
  background: #dcfce7;
  color: #166534;
}
.option-btn.wrong {
  border-color: var(--red);
  background: #fee2e2;
  color: #991b1b;
  animation: shake 0.4s;
}
.option-btn.pop {
  animation: bigPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes shake {
  0%,100%   { transform: translateX(0); }
  20%,60%   { transform: translateX(-6px); }
  40%,80%   { transform: translateX(6px); }
}
@keyframes bigPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Feedback */
.feedback {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  min-height: 1.6rem;
  margin-bottom: 0.6rem;
}
.correct-feedback { color: var(--green); }
.wrong-feedback   { color: var(--red); }

/* Fact box */
.fact-box {
  background: #fffbeb;
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #78350f;
  font-weight: 600;
  line-height: 1.5;
}

.next-btn {
  width: 100%;
  font-size: 1.1rem;
  padding: 1rem;
}

/* Results */
.results-card {
  background: var(--white);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 480px;
  margin: 2rem auto;
}

.result-emoji   { font-size: 5rem; margin-bottom: 0.5rem; display: block; animation: bigPop 0.5s ease; }
.result-message { font-size: 1.4rem; font-weight: 900; margin-bottom: 1.5rem; }

.result-score-box {
  background: var(--purple-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.result-label { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.2rem; }
.result-score { font-size: 2.5rem; font-weight: 900; color: var(--purple); }

.result-stars-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.result-star-block { flex: 1; }
.star-earned  { font-size: 1.4rem; font-weight: 900; color: var(--yellow); }
.star-total   { font-size: 1.1rem; font-weight: 800; color: var(--purple); }
.star-label   { font-size: 0.8rem; color: var(--muted); }

.result-buttons { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.result-buttons .btn { font-size: 0.9rem; padding: 0.65rem 1.2rem; }

/* ── Tips ────────────────────────────────────────────────────────── */
.tips-area {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  min-height: 0;
}

.tip-item {
  background: #fef9c3;
  border: 2px solid #fcd34d;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #78350f;
  line-height: 1.45;
  animation: tipPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.btn-tip {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-tip:hover  { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.btn-tip:active { transform: translateY(0); }

/* ── Explore page ────────────────────────────────────────────────── */
.explore-hero {
  text-align: center;
  padding: 3rem 5% 1.5rem;
  background: linear-gradient(135deg, #ede9fe, #fdf8f0);
}
.explore-hero h1 { font-size: 2rem; font-weight: 900; margin-bottom: 0.4rem; }
.explore-hero p  { color: var(--muted); }

.continent-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1.2rem 5%;
  background: var(--white);
  border-bottom: 2px solid #f3f4f6;
  position: sticky;
  top: 62px;
  z-index: 50;
}

.tab-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 99px;
  border: 2px solid var(--c, #ccc);
  background: var(--white);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.tab-btn:hover  { background: var(--c, #ccc); color: #fff; }
.tab-active     { background: var(--c, #ccc) !important; color: #fff !important; }

.explore-count {
  padding: 0.8rem 5%;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  padding: 0.5rem 5% 3rem;
}

.explore-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 3px solid var(--c, #e5e7eb);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
  display: grid;
  grid-template-columns: 90px 1fr;
}
.explore-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.ec-flag {
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #f9f9f9);
  border-right: 3px solid var(--c, #e5e7eb);
  padding: 0.5rem;
}

.ec-body    { padding: 1rem; }
.ec-name    { font-size: 1.05rem; font-weight: 900; margin-bottom: 0.2rem; }
.ec-capital { font-size: 0.83rem; color: var(--muted); font-weight: 600; margin-bottom: 0.3rem; }
.ec-hint    { font-size: 1.1rem; letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.ec-fact    { font-size: 0.82rem; color: #555; line-height: 1.45; margin-bottom: 0.6rem; }
.ec-badge   {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.explore-cta {
  text-align: center;
  padding: 3rem 5%;
  background: var(--purple);
  color: #fff;
}
.explore-cta h2 { font-size: 1.6rem; font-weight: 900; margin-bottom: 0.4rem; }
.explore-cta p  { opacity: 0.8; margin-bottom: 1.5rem; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: #1e1b4b;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  line-height: 2;
}
.site-footer strong { color: var(--yellow); }

/* ── Confetti keyframe ───────────────────────────────────────────── */
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero           { grid-template-columns: 1fr; }
  .hero-flags     { display: none; }
  .daily-card     { grid-template-columns: 1fr; text-align: center; }
  .options-grid   { grid-template-columns: 1fr; }
  .explore-card   { grid-template-columns: 1fr; }
  .ec-flag        { border-right: none; border-bottom: 3px solid var(--c); padding: 1rem; }
  .result-buttons { flex-direction: column; }
  .continent-tabs { top: 56px; }
}
