:root {
  --accent: #ff6b6b;
  --accent-soft: #fff1da;
  --accent-blue: #4d96ff;
  --accent-yellow: #ffd93d;
  --accent-green: #6bcf63;
  --accent-pink: #ff8fab;
  --ink: #24324a;
  --muted: #61708c;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --line: #d8e4f5;
  --shadow: 0 18px 40px rgba(36, 50, 74, 0.12);
  --radius: 28px;
  --radius-sm: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.22);
  }
  50% {
    box-shadow: 0 18px 34px rgba(77, 150, 255, 0.24);
  }
}

@keyframes sparkleRise {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.75);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(1.1);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(140%);
  }
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 217, 61, 0.38), transparent 18%),
    radial-gradient(circle at 88% 10%, rgba(77, 150, 255, 0.28), transparent 16%),
    radial-gradient(circle at 80% 68%, rgba(255, 143, 171, 0.24), transparent 18%),
    radial-gradient(circle at 14% 74%, rgba(107, 207, 99, 0.22), transparent 16%),
    linear-gradient(180deg, #fff9ef 0%, #eef7ff 46%, #fffef7 100%);
}

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

img {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.site-shell::before,
.site-shell::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
}

.site-shell::before {
  width: 220px;
  height: 220px;
  left: -80px;
  top: 120px;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.72), transparent 68%);
  animation: floatBob 7s ease-in-out infinite;
}

.site-shell::after {
  width: 240px;
  height: 240px;
  right: -90px;
  top: 360px;
  background: radial-gradient(circle, rgba(77, 150, 255, 0.54), transparent 68%);
  animation: floatBob 9s ease-in-out infinite reverse;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(219, 229, 242, 0.9);
}

.site-header__inner,
.site-footer__inner,
.site-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

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

.brand__mark {
  width: 68px;
  height: 56px;
  position: relative;
  display: block;
}

.brand__bubble {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: var(--shadow);
  animation: floatBob 3.8s ease-in-out infinite;
}

.brand__bubble--one {
  left: 0;
  top: 12px;
  background: linear-gradient(135deg, #ff6b6b, #ff9f68);
}

.brand__bubble--two {
  left: 18px;
  top: 0;
  background: linear-gradient(135deg, #4d96ff, #7cc6ff);
  animation-delay: 0.25s;
}

.brand__bubble--three {
  right: 0;
  top: 14px;
  background: linear-gradient(135deg, #6bcf63, #b8e94e);
  animation-delay: 0.5s;
}

.brand__copy strong {
  display: block;
  font-size: 1.1rem;
}

.brand__copy span {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.site-main {
  flex: 1;
  padding: 28px 0 64px;
  position: relative;
  z-index: 1;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a::after {
  content: "›";
  margin-left: 8px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.hero--home {
  padding: 10px 0 12px;
}

.hero__content,
.hero__panel,
.section,
.activity-card,
.result-card,
.legal-card,
.cookie-banner,
.worksheet-sheet,
.callout {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 229, 242, 0.95);
  box-shadow: var(--shadow);
  animation: fadeUp 0.55s ease both;
}

.hero__content,
.hero__panel,
.activity-card,
.result-card,
.legal-card,
.callout {
  border-radius: var(--radius);
  padding: 28px;
}

.hero__content {
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.42), transparent 24%),
    radial-gradient(circle at left bottom, rgba(77, 150, 255, 0.2), transparent 30%),
    radial-gradient(circle at 24% 18%, rgba(255, 143, 171, 0.18), transparent 20%),
    rgba(255, 255, 255, 0.94);
}

.hero__panel {
  display: grid;
  gap: 14px;
  align-content: start;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 107, 0.2), transparent 25%),
    radial-gradient(circle at bottom right, rgba(107, 207, 99, 0.14), transparent 24%),
    rgba(255, 255, 255, 0.96);
}

.hero__panel--compact {
  align-self: center;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  line-height: 1.65;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero__actions,
.hero__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero__steps span,
.chip,
.tag-row li {
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff6cf, #ffe8f0);
  color: var(--ink);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover,
.answer-button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ffb347 56%, var(--accent-yellow));
  box-shadow: 0 12px 24px rgba(255, 107, 107, 0.28);
  animation: pulseGlow 3.4s ease-in-out infinite;
}

.button--ghost {
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
}

.section {
  margin-top: 26px;
  border-radius: var(--radius);
  padding: 26px;
}

.section--soft {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.98)),
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.14), transparent 24%),
    var(--surface-soft);
}

.section-heading {
  margin-bottom: 18px;
}

.grade-grid,
.topic-grid,
.feature-grid,
.format-grid,
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.topic-list {
  display: grid;
  gap: 18px;
}

.grade-card,
.topic-card,
.feature-card,
.format-card,
.topic-tile,
.review-card,
.stat-card,
.quiz-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.grade-card,
.topic-card,
.feature-card,
.format-card,
.topic-tile,
.review-card {
  padding: 22px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.grade-card:hover,
.topic-card:hover,
.feature-card:hover,
.format-card:hover,
.topic-tile:hover,
.review-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 38px rgba(36, 50, 74, 0.14);
  border-color: rgba(255, 107, 107, 0.28);
}

.grade-card {
  background:
    radial-gradient(circle at top left, var(--grade-soft), transparent 45%),
    radial-gradient(circle at bottom right, rgba(255, 217, 61, 0.12), transparent 28%),
    #fff;
  box-shadow: var(--shadow);
}

.grade-card__badge {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--grade-soft);
  color: var(--grade-accent);
  font-weight: 700;
}

.topic-card__header,
.topic-tile {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.topic-card__icon,
.topic-tile__icon,
.format-card__emoji {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff4bd, #ffd9e6);
  font-size: 1.8rem;
}

.topic-card__guide {
  margin: 18px 0;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.format-card {
  display: grid;
  gap: 14px;
}

.format-card__emoji {
  margin-bottom: 6px;
}

.ad-slot {
  margin-top: 26px;
  padding: 18px 20px;
  border: 2px dashed rgba(95, 108, 132, 0.25);
  border-radius: 22px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(255, 249, 214, 0.74)),
    rgba(255, 255, 255, 0.54);
  text-align: center;
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.stat-card {
  padding: 20px;
  display: grid;
  gap: 4px;
  animation: fadeUp 0.75s ease both;
}

.stat-card strong {
  font-size: 1.9rem;
}

.mini-guide {
  border-radius: 22px;
  background: linear-gradient(135deg, #fff6cf, #e9f4ff);
  padding: 18px;
}

.callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.activity-card {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 217, 61, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.98));
}

.answer-grid,
.review-grid {
  margin-top: 20px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.answer-button {
  min-height: 84px;
  border: 2px solid transparent;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f6fbff);
  cursor: pointer;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.answer-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.7), transparent 70%);
  transform: translateX(-120%);
}

.answer-button.is-correct {
  background: #e6fbef;
  border-color: #57c785;
  animation: pulseGlow 0.9s ease;
}

.answer-button.is-wrong {
  background: #fff1f0;
  border-color: #f28482;
}

.answer-button:hover::after {
  animation: shimmer 0.9s ease;
}

.feedback {
  margin-top: 20px;
}

.feedback--good,
.feedback--soft {
  padding: 16px 18px;
  border-radius: 18px;
}

.feedback--good {
  background: #e8fff0;
}

.feedback--soft {
  background: #fff6de;
}

.quiz-form {
  display: grid;
  gap: 18px;
}

.quiz-card {
  padding: 22px;
  margin: 0;
}

.quiz-card legend {
  margin-bottom: 14px;
  font-weight: 700;
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f6fbff);
  margin-bottom: 10px;
}

.result-card {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-card .hero__actions {
  justify-content: center;
}

.review-card.is-good {
  background: #ecfff5;
}

.review-card.is-soft {
  background: #fff8ea;
}

.muted {
  color: var(--muted);
}

.worksheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.worksheet-toolbar label {
  display: grid;
  gap: 8px;
  min-width: 180px;
  color: var(--muted);
}

.worksheet-toolbar select {
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fff;
}

.worksheet-sheet {
  width: min(210mm, 100%);
  margin: 0 auto;
  border-radius: 22px;
  padding: 28px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.worksheet-sheet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 3px dotted rgba(255, 183, 3, 0.35);
  border-radius: 18px;
  pointer-events: none;
}

.worksheet-sheet::after {
  content: "★  ✦  ●  ▲";
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: rgba(255, 107, 107, 0.24);
  font-weight: 800;
  letter-spacing: 0.35em;
}

.worksheet-sheet__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.worksheet-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.worksheet-list {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 16px;
}

.worksheet-list li {
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(95, 108, 132, 0.35);
}

.worksheet-list strong {
  display: inline-block;
  margin-left: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf4ff;
}

.worksheet-line {
  display: inline-block;
  width: 140px;
  border-bottom: 1px solid #8b98ab;
  margin-left: 14px;
}

.legal-card h2 + p {
  margin-top: 6px;
}

.cookie-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  z-index: 30;
  border-radius: 24px;
  padding: 20px;
  animation: fadeUp 0.45s ease both;
}

.site-footer {
  padding: 0 0 34px;
  position: relative;
  z-index: 1;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
}

.game-stage {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.game-stage__mascot {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 247, 205, 0.95), rgba(231, 244, 255, 0.95));
  border: 1px solid rgba(216, 228, 245, 0.95);
}

.game-stage__emoji {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-size: 2rem;
  background: linear-gradient(135deg, #ffde59, #ff8fab);
  animation: floatBob 3s ease-in-out infinite;
}

.game-stage__mascot p,
.game-stage__meta {
  margin: 0;
  color: var(--muted);
}

.game-stage__track {
  display: grid;
  gap: 10px;
}

.progress-ribbon {
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-ribbon__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b6b, #ffb347, #ffd93d, #6bcf63, #4d96ff);
  background-size: 180% 100%;
  transition: width 0.35s ease;
  animation: shimmer 2.2s linear infinite;
}

.game-stage__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  bottom: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd93d 0%, #ff8fab 70%, transparent 72%);
  animation: sparkleRise 2.8s ease-in-out infinite;
}

.sparkles--result .sparkle {
  width: 16px;
  height: 16px;
  bottom: 22px;
}

@media (max-width: 960px) {
  .hero,
  .callout,
  .grade-grid,
  .topic-grid,
  .feature-grid,
  .format-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .site-header__inner,
  .worksheet-sheet__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .game-stage__meta {
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .site-header__inner,
  .site-main,
  .site-footer__inner {
    width: min(100% - 20px, 1180px);
  }

  .hero__content,
  .hero__panel,
  .section,
  .activity-card,
  .result-card,
  .legal-card,
  .callout,
  .worksheet-sheet {
    padding: 20px;
    border-radius: 22px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .answer-button {
    width: 100%;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
