:root {
  --bg-start: #05203f;
  --bg-end: #0b4f8c;
  --panel: rgba(8, 20, 48, 0.74);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fbff;
  --text-soft: #d5e5ff;
  --yellow: #ffd24d;
  --orange: #ff8a5b;
  --mint: #69f0d0;
  --sky: #72baff;
  --pink: #ff88c7;
  --danger-soft: #ffd5da;
  --success-soft: #d4ffe9;
  --shadow: 0 18px 40px rgba(1, 8, 24, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-display: "Trebuchet MS", "Avenir Next", sans-serif;
  --font-body: "Verdana", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 210, 77, 0.16), transparent 30%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(180deg, rgba(255, 243, 165, 0.16), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
  z-index: 20;
}

body.celebration-flash::after {
  opacity: 1;
}

button,
input {
  font: inherit;
}

.stars-bg,
.stars-bg::before,
.stars-bg::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 25;
}

.stars-bg::before,
.stars-bg::after {
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 210, 77, 0.95) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(105, 240, 208, 0.8) 0 1px, transparent 1.4px);
  background-size: 180px 180px, 240px 240px, 300px 300px;
  animation: drift 18s linear infinite;
  opacity: 0.75;
}

.stars-bg::after {
  animation-duration: 28s;
  opacity: 0.35;
  transform: scale(1.2);
}

.app-shell {
  position: relative;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.topbar,
.panel,
.hero-card {
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

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

.brand__planet {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffe89a, #ffbc37 58%, #ff8a5b);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06);
  position: relative;
}

.brand__planet::after {
  content: "";
  position: absolute;
  inset: 18px -6px;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.stats {
  display: flex;
  gap: 10px;
}

.chip {
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.chip__label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}

.hero-copy p {
  max-width: 35rem;
  color: var(--text-soft);
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  min-height: 50px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.button__icon {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  font-size: 1.05em;
  line-height: 1;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #1b1630;
  box-shadow: 0 12px 24px rgba(255, 138, 91, 0.3);
}

.button--secondary {
  background: linear-gradient(135deg, var(--mint), var(--sky));
  color: #073350;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-visual {
  position: relative;
  min-height: 290px;
}

.rocket {
  position: absolute;
  right: 18%;
  top: 10%;
  width: 100px;
  height: 170px;
  border-radius: 50px 50px 30px 30px;
  background: linear-gradient(180deg, #f2f8ff, #b4ccff);
  transform: rotate(12deg);
  animation: bob 3.6s ease-in-out infinite;
}

.rocket__window {
  position: absolute;
  inset: 30px 28px auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #72baff 62%, #0b4f8c);
}

.rocket__wing {
  position: absolute;
  bottom: 34px;
  width: 28px;
  height: 42px;
  background: var(--orange);
}

.rocket__wing--left {
  left: -18px;
  border-radius: 18px 0 0 18px;
  transform: skewY(22deg);
}

.rocket__wing--right {
  right: -18px;
  border-radius: 0 18px 18px 0;
  transform: skewY(-22deg);
}

.rocket__fire {
  position: absolute;
  left: 32px;
  bottom: -24px;
  width: 36px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff1a4, #ff8a5b);
  filter: blur(0.5px);
  animation: flame 0.9s ease-in-out infinite;
}

.orbit,
.planet {
  position: absolute;
  border-radius: 50%;
}

.orbit {
  border: 2px dashed rgba(255, 255, 255, 0.12);
}

.orbit--one {
  inset: 8% auto auto 0;
  width: 220px;
  height: 220px;
}

.orbit--two {
  inset: auto 8% 4% auto;
  width: 160px;
  height: 160px;
}

.planet--big {
  left: 8%;
  bottom: 8%;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle at 35% 30%, #98f2ea, #2ad2c9 50%, #138da0);
}

.planet--small {
  right: 4%;
  bottom: 18%;
  width: 68px;
  height: 68px;
  background: radial-gradient(circle at 35% 30%, #ffc6ef, #ff88c7 55%, #c8527e);
}

.panel {
  padding: 20px;
}

.panel__header,
.mission-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lesson-map {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.lesson-tile,
.card,
.question-card,
.reward-item,
.collection-item {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lesson-tile {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.lesson-tile--locked {
  opacity: 0.6;
}

.lesson-tile__meta,
.lesson-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.9rem;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  padding: 18px;
}

.steps-list {
  margin: 16px 0;
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.6;
}

.lesson-example {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.lesson-example span {
  display: block;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-family: var(--font-display);
}

.lesson-example p,
.card p {
  color: var(--text-soft);
}

.panel--mission {
  min-height: 72vh;
}

.mission-progress {
  flex: 1;
}

.progress-bar {
  width: 100%;
  height: 14px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--mint), var(--yellow));
  transition: width 220ms ease;
}

.question-card {
  margin-top: 24px;
  padding: 24px;
  text-align: center;
}

.question-card--shake {
  animation: shake 0.32s linear;
}

.question-card--pulse {
  animation: pulse 0.76s ease;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 28px rgba(255, 210, 77, 0.28);
}

.question-tip {
  margin: 10px auto 20px;
  max-width: 32rem;
  color: var(--text-soft);
}

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

.answer-option {
  min-height: 74px;
  border-radius: 22px;
  border: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #082643;
  background: linear-gradient(180deg, #ffffff, #dbe7ff);
  cursor: pointer;
}

.answer-manual {
  margin-top: 18px;
}

.answer-manual label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
}

.manual-answer__row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.manual-answer__row input {
  width: min(180px, 50vw);
  min-height: 52px;
  text-align: center;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.feedback-banner {
  min-height: 28px;
  margin-top: 16px;
  text-align: center;
  font-weight: 700;
}

.feedback-banner--success {
  color: var(--success-soft);
}

.feedback-banner--error {
  color: var(--danger-soft);
}

.reward-panel {
  text-align: center;
}

.reward-items,
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.reward-item,
.collection-item {
  padding: 18px;
}

.reward-item__icon,
.collection-item__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(255, 210, 77, 0.25), rgba(105, 240, 208, 0.25));
}

.reward-item__icon {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.collection-item__icon {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.reward-item__art,
.collection-item__art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(6, 17, 50, 0.28));
}

.collection-item--locked {
  opacity: 0.45;
}

.confetti-piece {
  position: fixed;
  top: -18px;
  width: 10px;
  height: 16px;
  border-radius: 4px;
  opacity: 0.9;
  animation: confetti-fall 3s linear forwards;
}

.firework-burst,
.star-burst {
  position: absolute;
  pointer-events: none;
}

.firework-burst {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: hsl(var(--burst-hue) 100% 70%);
  box-shadow:
    0 -32px 0 0 currentColor,
    0 32px 0 0 currentColor,
    32px 0 0 0 currentColor,
    -32px 0 0 0 currentColor,
    22px 22px 0 0 currentColor,
    -22px 22px 0 0 currentColor,
    22px -22px 0 0 currentColor,
    -22px -22px 0 0 currentColor;
  animation: firework-pop 2s ease-out forwards;
}

.star-burst {
  color: #fff4a8;
  text-shadow:
    0 0 12px rgba(255, 242, 163, 0.8),
    0 0 24px rgba(114, 186, 255, 0.45);
  animation: star-float 2.4s ease-out forwards;
}

.reward-panel {
  position: relative;
  overflow: hidden;
}

.reward-panel::before {
  content: "";
  position: absolute;
  inset: -20% 20% auto;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 210, 77, 0.26), transparent 65%);
  animation: reward-glow 4.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(120px);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: rotate(12deg) translateY(0);
  }
  50% {
    transform: rotate(8deg) translateY(-10px);
  }
}

@keyframes flame {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.82);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) rotate(240deg);
    opacity: 0;
  }
}

@keyframes firework-pop {
  0% {
    transform: scale(0.12);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@keyframes star-float {
  0% {
    transform: translateY(18px) scale(0.4) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-36px) scale(1.08) rotate(18deg);
    opacity: 0;
  }
}

@keyframes reward-glow {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@media (max-width: 820px) {
  .hero-card,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 240px;
  }

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

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 10px;
  }

  .topbar,
  .panel__header,
  .mission-top,
  .hero-actions,
  .manual-answer__row {
    flex-direction: column;
    align-items: stretch;
  }

  .stats {
    width: 100%;
  }

  .chip {
    flex: 1;
  }

  .panel,
  .hero-card {
    padding: 16px;
    border-radius: 22px;
  }

  .question-card {
    padding: 18px 14px;
  }

  .answer-option {
    min-height: 64px;
  }
}
