/* Vesmírná výprava: noční obloha, raketa na rampě, otázky na palivo a úkoly na planetách */
body { background: radial-gradient(ellipse at 30% 0%, var(--cosmos-2), var(--cosmos) 70%) fixed var(--cosmos); color: var(--off); }
.home-btn { background: var(--cosmos-2); color: var(--off); }

/* Hvězdy na pozadí */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 72%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 32%, #FFE9A8 50%, transparent 51%), radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 58%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 26%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 8% 88%, #C9D2FF 50%, transparent 51%), radial-gradient(1px 1px at 52% 92%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 94% 84%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 36% 50%, #fff 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

/* Trasa: Země, Měsíc, Mars, Jupiter */
.route { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.route li { position: relative; width: clamp(72px, 14vw, 110px); display: grid; justify-items: center; gap: 4px; font-size: 15px; color: #C9C4F2; }
.route li + li::before { content: ""; position: absolute; top: 14px; right: 50%; width: 100%; border-top: 2px dashed rgba(201, 196, 242, .4); z-index: -1; }
.route li.here { color: var(--sun); font-weight: 600; }
.route li.here .planet { outline: 3px solid var(--sun); outline-offset: 3px; }
.route li.done span:last-child::after { content: " ✓"; color: var(--mint); }
.stage { position: relative; flex: 1; min-height: 380px; display: grid; place-items: center; overflow: hidden; border-radius: 28px; }

/* Vlastní SVG mají kruh bez okrajů: --s tak stále určuje porovnávaný průměr. */
.planet { display: inline-block; flex: none; width: var(--s, 80px); max-width: 100%; aspect-ratio: 1; border-radius: 50%;
  background-size: 100% 100%; background-repeat: no-repeat; box-shadow: 0 6px 18px #090F2926; }
.p-zeme { background-image: url("img/zeme.svg"); }
.p-mesic { background-image: url("img/mesic.svg"); }
.p-mars { background-image: url("img/mars.svg"); }
.p-jupiter { background-image: url("img/jupiter.svg"); }

.rocket { width: var(--rw, 90px); height: auto; overflow: visible; filter: drop-shadow(0 6px 12px #080E3870); }
/* plamen je uvnitř <use>, proto ho zapíná zděděná proměnná, ne selektor */
.burning { --flame: 1; }

/* Úvodní ilustrace: stejná raketa a stejné planety jako při samotné výpravě. */
.expedition-art { position: relative; width: min(340px, 78vw); height: 240px; isolation: isolate; }
.expedition-art::before { content: ""; position: absolute; inset: 35px -4px; border: 1px dashed #B7C7FC55; border-radius: 50%; transform: rotate(-28deg); }
.expedition-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse, #668BEA33, transparent 68%); }
.expedition-art .planet { position: absolute; }
.expedition-art .p-zeme { left: 8px; bottom: 0; }
.expedition-art .p-mesic { left: 30px; top: 20px; }
.expedition-art .p-mars { right: 14px; bottom: 18px; }
.expedition-art .p-jupiter { right: 8px; top: 0; }
.expedition-art .rocket { position: absolute; width: 90px; left: calc(50% - 45px); top: 8px; transform: rotate(24deg); --flame: 1; }

/* ===== Tankování ===== */
.fuel { width: 100%; display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: 22px; align-items: center; }
.pad { position: relative; height: 360px; overflow: hidden; border-radius: 24px; }
.pad .horizon { position: absolute; left: 50%; bottom: -470px; --s: 600px; width: 600px; max-width: none; transform: translateX(-50%); }
.pad .rocket { position: absolute; left: calc(50% - 45px); bottom: 124px; }
.pad .rocket.launch { animation: launch 1.3s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes launch { to { transform: translateY(-900px); } }
.gauge { position: absolute; right: 10px; bottom: 140px; display: grid; gap: 6px; padding: 8px; border-radius: 16px; background: rgba(0, 0, 0, .35); justify-items: center; }
.gauge small { font-size: 12px; letter-spacing: .08em; color: var(--off); }
.gauge div { display: flex; flex-direction: column-reverse; gap: 6px; }
.gauge i { width: 28px; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, .15); transition: background .3s, box-shadow .3s; }
.gauge i.full { background: var(--mint); box-shadow: 0 0 14px var(--mint); }
.quiz, .task { background: var(--panel); color: var(--ink); border-radius: 28px; padding: 20px; display: grid; gap: 16px; }
.q-text { font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; text-align: center; }
.q-visual { min-height: 140px; display: grid; place-items: center; }

/* Tlačítka s odpověďmi */
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.answers.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.answer {
  min-height: 96px; border: 0; border-radius: 22px; background: var(--panel-soft); color: var(--ink);
  font-size: 48px; font-weight: 700; box-shadow: 0 5px 0 #C9D0F5; transition: transform .1s, background .2s;
}
.answer:active { transform: translateY(3px); }
.answer.right { background: var(--mint); box-shadow: 0 5px 0 #6FC26A; }
.answer.wrong { opacity: .45; }
.answer.planet-ans { display: grid; place-items: center; gap: 8px; padding: 14px 8px; font-size: 20px; font-weight: 600; }
.compare { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 12px; }
.compare .answer { background: transparent; box-shadow: none; }
.compare .answer.right { background: var(--mint); }

/* Obrázky k otázkám: hvězdy, tečky, odpočet */
.starfield { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 48px); gap: 6px 14px; place-items: center; }
.starfield svg { width: 40px; height: 40px; fill: var(--sun); stroke: #E0A800; stroke-width: 1; }
.dots { display: flex; align-items: center; gap: 18px; font-size: 44px; font-weight: 700; }
.dots span { display: flex; flex-wrap: wrap; gap: 8px; max-width: 120px; justify-content: center; }
.dots i { width: 30px; height: 30px; border-radius: 50%; }
.dots i.y { background: radial-gradient(circle at 32% 25%, #FFF7C2, #FFD972 40%, #D99B37); box-shadow: inset 0 -2px 0 #B9802D; }
.dots i.b { background: radial-gradient(circle at 32% 25%, #D9E7FF, #8BA8F4 40%, #4D62BB); box-shadow: inset 0 -2px 0 #3F4D95; }
.seq { display: flex; gap: 12px; }
.seq b { display: grid; place-items: center; width: 64px; height: 76px; border-radius: 16px; background: var(--cosmos); color: var(--sun); font-size: 44px; }
.seq b.q { background: var(--panel-soft); color: var(--cosmos-2); border: 3px dashed var(--star-blue); }

/* ===== Odlet a let ===== */
.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: clamp(100px, 20vw, 170px); font-weight: 700; color: var(--sun); text-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.countdown.pop { animation: pop .8s ease-out; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.travel { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; }
.travel .rocket { --rw: 80px; animation: wobble .5s ease-in-out infinite alternate; }
@keyframes wobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-6px); } }
.travel p { font-size: 28px; font-weight: 600; color: var(--sun); }
.streak { position: absolute; top: -80px; width: 2px; height: 70px; background: linear-gradient(transparent, #fff); animation: streak .7s linear infinite; }
@keyframes streak { to { transform: translateY(900px); } }

/* ===== Přistání a úkoly ===== */
.land { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.land.solo { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.land .hero { --s: clamp(130px, 24vw, 240px); animation: arrive 1.2s cubic-bezier(.2, .8, .3, 1); }
@keyframes arrive { from { transform: scale(.15) translateY(-120px); opacity: 0; } }
.task { justify-items: center; }
.task .answers { width: min(100%, 440px); }

/* Měsíc: skok s čárkami výšky */
.jump-field { position: relative; width: 100%; max-width: 380px; height: 230px; border-radius: 20px; overflow: hidden; background: linear-gradient(var(--cosmos), var(--cosmos-2)); }
.jump-field .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: radial-gradient(circle at 20% 40%, #A3A3AF 0 8px, transparent 9px), radial-gradient(circle at 70% 60%, #A3A3AF 0 6px, transparent 7px), #C9C9D1; }
.jump-field .jumper { position: absolute; left: calc(50% - 35px); bottom: 30px; width: 70px; }
.mark { position: absolute; left: 0; right: 0; border-top: 3px dashed; font-size: 15px; font-weight: 600; }
/* popisek pod čárou: čára Měsíce je u horního okraje a nad ní by se usekl */
.mark span { position: absolute; right: 8px; top: 2px; }
.mark.earth { color: var(--mint); }
.mark.moon { color: var(--sun); }

/* Mars: dva měsíce na drahách */
.mars-sys { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
/* dráhy ťuknutí propouští: vnější dráha leží přes vnitřní měsíc a jinak by ho nešlo chytit */
.orbit { position: absolute; inset: var(--in); border-radius: 50%; border: 2px dashed rgba(42, 53, 128, .25); animation: spin var(--t) linear infinite; pointer-events: none; }
.orbit.o1 { --in: 58px; --t: 10s; }
.orbit.o2 { --in: 8px; --t: 16s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.moonlet { pointer-events: auto; position: absolute; top: -26px; left: calc(50% - 26px); width: 52px; height: 52px; border: 0; border-radius: 42% 58% 55% 45%; background: linear-gradient(#BA8F6340, #82644950), url("img/mesic.svg") center / cover; box-shadow: inset -3px -3px 5px #352B4A55, 0 3px 6px #252B4826; font-size: 24px; font-weight: 700; color: var(--ink); }
.o2 .moonlet { border-radius: 57% 43% 40% 60%; }
.moonlet.found { background: var(--sun); box-shadow: 0 0 18px var(--sun); }

/* ===== Konec výpravy ===== */
.finale { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 560px; }
.finale h2 { font-size: clamp(32px, 5vw, 46px); }
.finale .big-stars { font-size: 40px; font-weight: 700; color: var(--sun); }
.rain { position: absolute; top: -40px; color: var(--sun); font-size: 28px; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(700px) rotate(200deg); opacity: .2; } }

@media (max-width: 720px) {
  .bar h1 { font-size: clamp(20px, 3.4vw, 30px); }
  .expedition-art { width: min(300px, 78vw); height: 190px; }
  .expedition-art .rocket { width: 76px; left: calc(50% - 38px); top: 0; }
  .fuel, .land { grid-template-columns: minmax(0, 1fr); }
  /* nižší rampa a karta, ať se na iPhonu na výšku odpovědi vejdou bez posouvání */
  .pad { height: 170px; }
  .pad .horizon { bottom: -550px; }
  .pad .rocket { --rw: 52px; left: calc(50% - 26px); bottom: 46px; }
  .gauge { bottom: 14px; }
  .gauge i { height: 26px; }
  .quiz { padding: 16px; gap: 12px; }
  .q-visual { min-height: 100px; }
  .land .hero { --s: 120px; justify-self: center; }
  .answer { min-height: 84px; font-size: 40px; }
  .starfield { grid-template-columns: repeat(3, 54px); }
}

@media (prefers-reduced-motion: reduce) {
  .sky, .orbit, .streak { animation: none !important; }
}
