:root {
  --eu-blue: #003399;
  --eu-blue-dark: #00267a;
  --eu-yellow: #FFCC00;
  --eu-yellow-dark: #d9a800;
  --green: #58CC02;
  --green-dark: #46a302;
  --red: #FF4B4B;
  --red-light: #FFDFE0;
  --green-light: #D7FFB8;
  --orange: #FF9600;
  --sky: #1CB0F6;
  --ink: #3c3c3c;
  --muted: #777;
  --line: #e5e5e5;
  --bg: #fff;
  --card: #fff;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 900; line-height: 1.2; margin: 0; }

a { color: inherit; text-decoration: none; }

/* Buttons: chunky, with a solid bottom "shadow" */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .05s, box-shadow .05s, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none !important; }
.btn { min-height: 48px; touch-action: manipulation; }
.btn:disabled { cursor: not-allowed; background: var(--line); color: #afafaf; box-shadow: 0 4px 0 #cfcfcf; }

.btn-primary { background: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dark); }
.btn-secondary { background: var(--eu-yellow); color: var(--eu-blue); box-shadow: 0 4px 0 var(--eu-yellow-dark); }
.btn-ghost { background: #fff; color: var(--eu-blue); border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 4px 0 #ea2b2b; }
.btn-small { min-width: 0; min-height: 44px; padding: 10px 16px; font-size: 13px; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(16px, env(safe-area-inset-right), calc((100% - 1040px) / 2));
  padding-left: max(16px, env(safe-area-inset-left), calc((100% - 1040px) / 2));
  background: rgba(255,255,255,.95);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(6px);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 900;
  color: var(--eu-blue);
  letter-spacing: -.02em;
}
.logo-star { width: 30px; height: 30px; fill: var(--eu-yellow); stroke: var(--eu-blue); stroke-width: 1.5; }

main > section {
  padding: 64px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left));
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 1040px;
  margin: 0 auto;
  min-height: 72vh;
  min-height: 72svh;
}
.hero-art { flex: 0 0 auto; }
.mascot { width: min(360px, 70vw); height: auto; display: block; }
.mascot .train { animation: bob 2.4s ease-in-out infinite; transform-origin: center; }
.mascot .pupil { animation: look 5s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes look { 0%,40%,100% { transform: translateX(0); } 50%,80% { transform: translateX(-4px); } }

.hero-copy { max-width: 460px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4vw, 36px); color: var(--ink); }
.lead { margin: 16px 0 32px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-actions .btn { width: 100%; max-width: 340px; }

/* Topic strip */
.topics { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 20px 16px !important; }
.topics ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1040px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
}
.topics li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 14px; letter-spacing: .05em; }
.topics li span { font-size: 22px; }

/* Section heads */
.section-head { text-align: center; max-width: 560px; margin: 0 auto 32px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); color: var(--eu-blue); }
.section-head p { color: var(--muted); margin: 8px 0 0; font-size: 17px; }

/* Quiz card */
.card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}
.quiz-top { display: flex; align-items: center; gap: 16px; padding: 24px 24px 0; }
.progress { flex: 1; height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 99px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.3);
  transition: width .4s ease;
}
.hearts { color: var(--red); font-weight: 900; white-space: nowrap; }
.quiz-tag { margin: 24px 24px 4px; color: #ce82ff; text-transform: uppercase; font-size: 13px; font-weight: 900; letter-spacing: .06em; }
.quiz h3 { margin: 0 24px 20px; font-size: 22px; }

.options { display: grid; gap: 12px; padding: 0 24px 24px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--line);
  cursor: pointer;
  transition: background .1s;
}
.option .key {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: #afafaf;
}
.option.selected { background: #DDF4FF; border-color: #84D8FF; box-shadow: 0 3px 0 #84D8FF; color: #1899D6; }
.option.selected .key { border-color: #84D8FF; color: #1899D6; }
.option.correct { background: var(--green-light); border-color: var(--green); box-shadow: 0 3px 0 var(--green); color: var(--green-dark); }
.option.wrong { background: var(--red-light); border-color: var(--red); box-shadow: 0 3px 0 var(--red); color: #ea2b2b; }
.options.locked .option { cursor: default; }

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-top: 2px solid var(--line);
  transition: background .2s;
}
.quiz-footer.is-correct { background: var(--green-light); border-color: transparent; }
.quiz-footer.is-wrong { background: var(--red-light); border-color: transparent; }
.feedback { margin: 0; font-size: 16px; }
.quiz-footer.is-correct .feedback { color: var(--green-dark); }
.quiz-footer.is-wrong .feedback { color: #ea2b2b; }
.feedback strong { display: block; font-size: 20px; font-weight: 900; }
.quiz-footer .btn { min-width: 150px; flex: 0 0 auto; }

/* Learning path */
.path-section { background: #f7f9ff; }
.unit { max-width: 520px; margin: 0 auto 20px; }
.unit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--eu-blue);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--eu-blue-dark);
}
.unit-green .unit-banner { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.unit-orange .unit-banner { background: var(--orange); box-shadow: 0 4px 0 #cc7800; }
.unit.locked { opacity: .55; }
.unit-label { margin: 0; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; opacity: .85; }
.unit-title { margin: 2px 0 0; font-size: 20px; font-weight: 900; }
.unit-icon { font-size: 30px; }

.path {
  list-style: none;
  margin: 0;
  padding: 36px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.node {
  position: relative;
  transform: translateX(calc(var(--x) * 52px));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.node span {
  width: 70px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 50%;
  background: var(--line);
  box-shadow: 0 7px 0 #b7b7b7;
  filter: grayscale(1);
}
.node.done span { background: var(--eu-yellow); box-shadow: 0 7px 0 var(--eu-yellow-dark); filter: none; }
.node.current { margin-top: 34px; }
.node.current span { background: var(--eu-blue); box-shadow: 0 7px 0 var(--eu-blue-dark); filter: none; outline: 6px solid #dbe4ff; outline-offset: 4px; }
.node.chest span, .node.trophy span { filter: none; opacity: .75; }
.node em {
  margin-top: 12px;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}
.node.current::before {
  content: "START";
  position: absolute;
  top: -38px;
  padding: 6px 12px;
  background: #fff;
  color: var(--eu-blue);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  animation: bob 1.6s ease-in-out infinite;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto;
}
.feature { text-align: center; padding: 8px; }
.feature-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: #fff8d6;
  border-radius: 24px;
}
.feature h3 { font-size: 22px; color: var(--eu-blue); }
.feature p { color: var(--muted); margin: 8px 0 0; }

/* CTA */
.cta {
  text-align: center;
  background: var(--eu-blue);
  color: #fff;
  background-image: radial-gradient(circle at 15% 30%, rgba(255,204,0,.25) 0 3px, transparent 4px),
                    radial-gradient(circle at 85% 70%, rgba(255,204,0,.25) 0 3px, transparent 4px);
  background-size: 120px 120px;
}
.cta h2 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 28px; }

.footer { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: #fff; background: var(--eu-blue-dark); font-size: 14px; opacity: .95; }
.footer p { margin: 0; opacity: .75; }

/* Hover effects only on devices with a real pointer, so taps don't leave a stuck hover state */
@media (hover: hover) {
  .btn:hover:not(:disabled) { filter: brightness(1.06); }
  .option:hover:not(.selected):not(.correct):not(.wrong) { background: #f7f7f7; }
}

/* Tablet */
@media (max-width: 900px) {
  .hero { gap: 32px; }
  .mascot { width: min(280px, 40vw); }
}

/* Phone */
@media (max-width: 760px) {
  main > section { padding-top: 48px; padding-bottom: 48px; }
  .hero { flex-direction: column; gap: 24px; min-height: 0; padding-top: 32px; }
  .mascot { width: 200px; }
  .lead { font-size: 17px; margin-bottom: 24px; }
  .btn { letter-spacing: .05em; }
  .logo { font-size: 24px; }
  .logo-star { width: 26px; height: 26px; }

  /* Topics become a swipeable row of chips */
  .topics { padding: 16px 0 !important; }
  .topics ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding: 0 16px 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .topics ul::-webkit-scrollbar { display: none; }
  .topics li {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 2px solid var(--line);
    border-radius: 99px;
    font-size: 13px;
    scroll-snap-align: start;
  }
  .topics li span { font-size: 18px; }

  .quiz-top { padding: 18px 16px 0; }
  .quiz-tag { margin: 18px 16px 4px; }
  .quiz h3 { margin: 0 16px 16px; font-size: 20px; }
  .options { padding: 0 16px 18px; gap: 10px; }
  .option { font-size: 16px; min-height: 52px; }
  .quiz-footer { padding: 16px; }
  .unit-title { font-size: 18px; }
  .cta .btn { width: 100%; max-width: 340px; }
  .quiz-footer { flex-direction: column; align-items: stretch; }
  .feature-icon { width: 72px; height: 72px; font-size: 34px; }
  .quiz-footer .btn { width: 100%; }
  .node { transform: translateX(calc(var(--x) * 36px)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
