/* ============================================================
   Ask Space - space questions for kids
   ============================================================ */

:root {
    --ink: #eef0ff;
    --soft: #a9afd6;
    --card: rgba(255, 255, 255, .07);
    --line: rgba(255, 255, 255, .12);
    --gold: #ffd166;
    --good: #46d48a;
    --bad: #ff7a6b;
    --blue: #6c8cff;
    --shadow: 0 10px 30px rgba(0, 0, 20, .35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { background: #090b22; }

body {
    font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink);
    background: radial-gradient(ellipse at 70% -10%, #2e2470 0%, transparent 55%),
        radial-gradient(ellipse at 0% 100%, #102a5c 0%, transparent 50%),
        #090b22;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 66px 14px 40px;
    overflow-x: hidden;
}

main { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; }
a { color: inherit; }

/* twinkling star layers */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.stars i { position: absolute; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%; }
.stars i:nth-child(2) { animation: twinkle 4s ease-in-out infinite alternate; }
.stars i:nth-child(3) { animation: twinkle 6s ease-in-out infinite alternate-reverse; }

@keyframes twinkle { to { opacity: .35; } }

/* ---------- top bar ---------- */
.topbar {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 20;
    pointer-events: none;
}

.chip {
    pointer-events: auto;
    font-weight: 700;
    font-size: 17px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(20, 22, 60, .8);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    text-decoration: none;
}

.starcount .s { color: var(--gold); margin-right: 4px; }

/* ---------- shared bits ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-weight: 800;
    font-size: 18px;
    min-height: 48px;
    padding: 6px 18px;
    margin: 5px 4px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: transform .08s, background .15s;
}

.btn:hover { background: rgba(255, 255, 255, .16); }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.small { font-size: 15px; min-height: 38px; padding: 4px 14px; }
.btn:disabled { cursor: default; }

.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 14px; }
.row.left { justify-content: flex-start; margin: 4px -4px 0; }
.small { font-size: 15px; color: var(--soft); }
.center { text-align: center; }
.note { max-width: 680px; margin: 0 auto 10px; }

.section-h {
    font-family: 'Fredoka One', sans-serif;
    font-weight: 400;
    font-size: 26px;
    margin: 26px 4px 12px;
}

.page-head { margin: 6px 4px 16px; }

.page-head h1 {
    font-family: 'Fredoka One', sans-serif;
    font-weight: 400;
    font-size: clamp(32px, 5vw, 44px);
    line-height: 1.1;
    color: var(--cc, var(--ink));
}

.page-head .sub { color: var(--soft); font-size: 19px; }

/* ---------- planets drawn with CSS ---------- */
.planet {
    position: relative;
    display: inline-block;
    flex: none;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, var(--light), var(--dark) 70%, #000 120%);
    box-shadow: inset calc(var(--size) * -.12) calc(var(--size) * -.08) calc(var(--size) * .2) rgba(0, 0, 0, .45);
}

.planet.banded {
    background:
        radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .25), transparent 60%),
        repeating-linear-gradient(0deg, var(--light) 0 9%, var(--dark) 9% 15%, #d9a77a 15% 22%);
}

.planet.earthy {
    background:
        radial-gradient(circle at 30% 35%, #4fbf6a 0 14%, transparent 15%),
        radial-gradient(circle at 62% 62%, #4fbf6a 0 18%, transparent 19%),
        radial-gradient(circle at 32% 30%, var(--light), var(--dark) 70%, #000 120%);
}

.planet.ringed::after {
    content: '';
    position: absolute;
    left: -45%;
    right: -45%;
    top: 38%;
    height: 24%;
    border-radius: 50%;
    border: calc(var(--size) * .07) solid rgba(230, 205, 150, .8);
    transform: rotate(-12deg);
}

/* ---------- home ---------- */
.hero { text-align: center; padding: 10px 0 6px; }

.title {
    font-family: 'Fredoka One', sans-serif;
    font-weight: 400;
    font-size: clamp(46px, 9vw, 76px);
    line-height: 1;
    letter-spacing: 1px;
}

.title span { color: var(--gold); text-shadow: 0 0 30px rgba(255, 209, 102, .5); }
.tagline { color: var(--soft); font-size: 20px; margin: 4px 0 16px; }

.ask-box {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 680px;
    margin: 0 auto;
    padding: 6px 8px 6px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 0 0 6px rgba(108, 140, 255, .25), var(--shadow);
}

.ask-icon { font-size: 26px; }

.ask-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    color: #1c1f4a;
    padding: 8px 0;
}

.results { max-width: 680px; margin: 12px auto 0; text-align: left; }
.results-label { color: var(--soft); font-weight: 700; margin: 0 6px 6px; }

.no-answer {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.save-btn { display: flex; margin: 8px auto 0; }

.qotd {
    display: block;
    text-decoration: none;
    margin-top: 22px;
    border-left: 8px solid var(--cc);
}

.qotd-label { text-transform: uppercase; letter-spacing: 2px; font-size: 14px; font-weight: 800; color: var(--cc); }
.qotd-q { font-family: 'Fredoka One', sans-serif; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 4px 0; }
.qotd-go { color: var(--soft); font-weight: 700; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.topic {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 4px solid var(--cc);
    text-decoration: none;
    transition: transform .12s, background .15s;
}

.topic:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .1); }
.topic-emoji { grid-row: 1 / 4; font-size: 40px; }
.topic-name { font-weight: 800; font-size: 19px; line-height: 1.2; }
.topic-count { font-size: 14px; color: var(--soft); }
.topic-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 4px; }
.topic-bar i { display: block; height: 100%; background: var(--cc); }

.extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.extra {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(108, 140, 255, .22), rgba(177, 140, 255, .12));
    border: 1px solid var(--line);
    text-decoration: none;
    transition: transform .12s;
}

.extra:hover { transform: translateY(-3px); }
.extra-emoji { font-size: 36px; }
.extra b { display: block; font-size: 19px; line-height: 1.2; }
.extra small { color: var(--soft); font-size: 14px; line-height: 1.3; display: block; }

/* ---------- question lists ---------- */
.q-list { display: flex; flex-direction: column; gap: 8px; }

.q-link, .saved {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 5px solid var(--cc, var(--blue));
    text-decoration: none;
    font-weight: 700;
    transition: background .15s, transform .1s;
}

.q-link:hover { background: rgba(255, 255, 255, .12); transform: translateX(3px); }
.q-link.read { opacity: .75; }
.q-emoji { font-size: 24px; }
.q-text { flex: 1; }
.q-tick { color: var(--soft); font-size: 20px; }
.q-link.read .q-tick { color: var(--good); }

.icon-btn {
    font: inherit;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 0;
    background: rgba(255, 255, 255, .1);
    color: var(--ink);
    cursor: pointer;
}

/* ---------- one question ---------- */
.crumb {
    display: inline-block;
    margin: 4px 4px 10px;
    font-weight: 800;
    color: var(--cc);
    text-decoration: none;
}

.answer-card { border-top: 6px solid var(--cc); padding: 26px; }

.q-title {
    font-family: 'Fredoka One', sans-serif;
    font-weight: 400;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.15;
    margin-bottom: 12px;
}

.short { font-size: clamp(21px, 2.6vw, 25px); font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.more p { font-size: 20px; color: #dfe3ff; margin-bottom: 10px; max-width: 780px; }

.wow {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 209, 102, .12);
    border: 1px solid rgba(255, 209, 102, .35);
    font-size: 19px;
}

.wow-tag { font-weight: 800; color: var(--gold); margin-right: 8px; }

/* ---------- me on other planets ---------- */
.me-inputs { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; justify-content: center; font-weight: 800; }
.me-inputs label { display: flex; align-items: center; gap: 8px; }

.field {
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .3);
    color: var(--ink);
    width: 110px;
    color-scheme: dark;
}

.field[type="date"] { width: auto; }
.unit { min-width: 52px; margin: 0; }

.me-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.me-card { text-align: center; margin: 0; padding: 16px; }
.me-card.home { border-color: rgba(108, 140, 255, .7); }
.me-art { height: 76px; display: grid; place-items: center; }
.me-name { font-family: 'Fredoka One', sans-serif; font-size: 22px; }
.big-num { font-family: 'Fredoka One', sans-serif; font-size: 30px; color: var(--gold); line-height: 1.2; }
.age { font-size: 18px; margin-top: 6px; }
.age b { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 26px; color: #9fe6ff; }

/* ---------- scale ---------- */
.jumps { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-btn {
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .08);
    color: var(--ink);
    cursor: pointer;
}

.chip-btn.on, .btn.on { background: var(--gold); color: #1c1f4a; border-color: var(--gold); }

body[data-page="scale"] { padding-bottom: 0; }
body[data-page="scale"] .credits { display: none; }

.sc-hero { max-width: 760px; margin: 10px auto 30px; text-align: center; position: relative; z-index: 3; }
.sc-hero h1 { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: clamp(32px, 5vw, 50px); line-height: 1.1; margin-bottom: 10px; }
.sc-hero h1 span { color: var(--gold); }
.sc-hero p { font-size: 19px; margin-bottom: 8px; }
.sc-hero .row { align-items: center; gap: 12px; margin-top: 10px; }

.sc-track { position: relative; margin: 300px -14px 0; overflow-x: clip; }

.sc-disk {
    display: block;
    flex: none;
    border-radius: 50%;
    background-repeat: no-repeat;
    box-shadow: inset -6px -4px 14px rgba(0, 0, 0, .45);
}

.sc-sun { position: absolute; left: 50%; transform: translateX(-50%); box-shadow: 0 0 80px 30px rgba(255, 170, 60, .55); }
.sc-sun-glow { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 60, .35) 0%, rgba(255, 120, 40, .12) 40%, transparent 70%); pointer-events: none; }

.sc-tick {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(255, 255, 255, .08);
    padding: 3px 0 0 calc(50% + 14px);
    font-size: 12px;
    color: rgba(169, 175, 214, .55);
    pointer-events: none;
}

.sc-tick span { font-weight: 800; margin-right: 6px; }
.rock, .ice { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #b8a48a; opacity: .7; }
.ice { background: #bfe3ff; opacity: .5; }

/* the lineup sits over the Sun's photo, so it gets a dark panel to stay readable */
.sc-lineup, .sc-scroll-hint { background: rgba(10, 12, 36, .72); backdrop-filter: blur(6px); }
.sc-lineup { display: inline-block; padding: 10px 16px 4px; border-radius: 18px; }
.sc-lineup p { margin: 6px 0 4px; }
.sc-scroll-hint { padding: 6px 12px; border-radius: 999px; }
.sc-sizes { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 0; }
.sc-size { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sc-size small { font-size: 11px; color: var(--soft); }

.sc-milestone {
    position: absolute;
    left: 50%;
    transform: translate(60px, -50%);
    max-width: 330px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .05);
    border: 1px dashed rgba(255, 255, 255, .18);
    font-size: 15px;
    line-height: 1.35;
    color: #d6daf5;
}

.sc-ms-emoji { font-size: 22px; }

.sc-body { position: absolute; left: 50%; max-width: calc(50% - 16px); display: flex; align-items: center; gap: 28px; transform: translateY(-50%); }
/* the planet is centred on the line, so it only takes up its right half in the row */
.sc-ping { position: relative; display: grid; place-items: center; transform: translateX(-50%); margin-right: calc(-1 * var(--half, 0px)); }
.sc-ping.small::before, .sc-ping.small::after {
    content: '';
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--cc);
    animation: ping 2.4s ease-out infinite;
}
.sc-ping.small::after { animation-delay: 1.2s; }
@keyframes ping { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.sc-saturn { display: block; height: auto; }

.sc-card {
    width: min(360px, 40vw);
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(10, 12, 36, .78);
    border: 1px solid var(--line);
    border-left: 4px solid var(--cc);
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow);
}

.sc-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.sc-card-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.sc-card-head b { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 24px; color: var(--cc); }
.sc-card p { font-size: 15px; margin: 4px 0; }
.sc-visitors { color: #9fe6ff; }
.sc-card .btn { margin: 4px 0 0; }

.sc-craft { position: absolute; left: 50%; transform: translate(-100%, -50%); display: flex; align-items: center; gap: 0; }
.sc-craft-card {
    width: min(360px, 40vw);
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    margin-right: 22px;
    border-radius: 18px;
    background: rgba(20, 40, 60, .78);
    border: 1px solid rgba(110, 211, 255, .45);
    box-shadow: 0 0 24px rgba(110, 211, 255, .15);
    font-size: 15px;
}

.sc-craft-card img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.sc-craft-emoji { font-size: 40px; }
.sc-craft-card b { font-size: 18px; color: #9fe6ff; }
.sc-craft-card p { margin: 2px 0 0; line-height: 1.3; }
.sc-craft-dot { width: 12px; height: 12px; border-radius: 50%; background: #6ed3ff; box-shadow: 0 0 14px #6ed3ff; transform: translateX(50%); }
.sc-craft-card::after { content: ''; }

.sc-end { position: absolute; left: 50%; transform: translateX(-50%); width: min(680px, 92%); text-align: center; }
.sc-end h2 { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 32px; color: var(--gold); }
.sc-end p { margin-top: 10px; }

/* the journey rail */
.sc-rail {
    position: fixed;
    left: 14px;
    top: 70px;
    bottom: 120px;
    width: 150px;
    z-index: 14;
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    border-radius: 18px;
    background: rgba(8, 10, 30, .7);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.sc-rail-title { font-weight: 800; font-size: 14px; text-align: center; margin-bottom: 8px; }
.sc-rail-note { font-size: 11px; color: var(--soft); text-align: center; margin-top: 8px; line-height: 1.2; }
.sc-rail-bar { position: relative; flex: 1; margin-left: 18px; border-left: 2px solid rgba(255, 255, 255, .18); }
.sc-rail-sun { position: absolute; left: -9px; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 10px #ffb347; }

.sc-rail-mark {
    position: absolute;
    left: -6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.sc-rail-mark::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--cc); flex: none; }
.sc-rail-mark.craft::before { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); margin-left: 1px; }
.sc-rail-mark.craft span { color: #9fe6ff; }
.sc-rail-mark:hover span { text-decoration: underline; }
.sc-ship { position: absolute; left: -14px; font-size: 22px; transform: translateY(-50%) rotate(135deg); transition: top .1s linear; filter: drop-shadow(0 0 6px #ffd166); pointer-events: none; }

/* the cockpit dashboard */
.sc-hud {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 15;
    width: min(1040px, calc(100vw - 20px));
    padding: 8px 10px;
    border-radius: 20px;
    background: rgba(8, 10, 30, .9);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.sc-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sc-tile { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.sc-tile-emoji { font-size: 22px; }
.sc-tile small { display: block; font-size: 11px; color: var(--soft); text-transform: uppercase; letter-spacing: .5px; line-height: 1.1; }
.sc-tile b { color: var(--gold); font-size: 16px; line-height: 1.2; }
.sc-pilot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sc-pilot .btn { margin: 0; }

@media (max-width: 900px) {
    .sc-rail { width: 46px; padding: 8px 4px; top: 64px; bottom: 150px; }
    .sc-hero { padding-left: 50px; }
    .sc-lineup { max-width: 100%; }
    .sc-sizes { flex-wrap: wrap; row-gap: 8px; }
    .sc-rail-title, .sc-rail-note, .sc-rail-mark span { display: none; }
    .sc-rail-bar { margin-left: 16px; }
    .sc-tiles { grid-template-columns: repeat(3, 1fr); }
    .sc-tile:nth-child(n+4) { display: none; }
    .sc-tile { padding: 4px 6px; }
    .sc-tile-emoji { display: none; }
    .sc-milestone { left: 56px; right: 10px; transform: translateY(-140%); max-width: none; }
    .sc-body { left: 64px; right: 10px; max-width: none; gap: 12px; flex-wrap: wrap; }
    .sc-ping { transform: none; margin-right: 0; }
    .sc-card { width: auto; flex: 1 1 220px; }
    .sc-craft { left: auto; right: 10px; transform: translateY(-50%); }
    .sc-craft-card { width: calc(100vw - 110px); margin-right: 8px; }
    .sc-tick { padding-left: 64px; }
}

/* ---------- travel ---------- */
.travel-note { margin-top: 12px; color: var(--soft); }
.travel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.travel-card { margin: 0; text-align: center; }
.travel-emoji { font-size: 40px; line-height: 1.2; }
.travel-name { font-weight: 800; }

/* ---------- quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; padding: 24px; }
.quiz-progress { display: flex; justify-content: space-between; color: var(--soft); font-weight: 700; }
.quiz-q { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; margin: 8px 0 14px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn.option { margin: 0; text-align: center; }
.btn.option.right { background: var(--good); border-color: var(--good); color: #062a14; }
.btn.option.wrong { background: rgba(255, 122, 107, .25); border-color: var(--bad); }
.quiz-feedback { margin-top: 14px; }
.quiz-feedback .btn { margin-left: 0; }
.right-text { font-weight: 800; color: var(--good); font-size: 22px; }
.wrong-text { font-weight: 800; color: var(--bad); font-size: 20px; }
.why { margin: 4px 0 6px; font-size: 17px; }
.big-emoji { font-size: 72px; text-align: center; }

/* ---------- toast & footer ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 40;
    max-width: 92vw;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--gold);
    color: #1c1f4a;
    font-weight: 800;
    box-shadow: var(--shadow);
    text-align: center;
}

.toast.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translate(-50%, 30px) scale(.85); opacity: 0; } }

.credits {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 30px auto 0;
    text-align: center;
    font-size: 14px;
    color: var(--soft);
}

@media (max-width: 640px) {
    .options { grid-template-columns: 1fr; }
    .ask-input { font-size: 18px; }
    .answer-card { padding: 18px; }
    .scale-label { max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
    .stars i { animation: none; }
}

/* ============================================================
   3D SPACE MAP
   ============================================================ */
#space { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#space[hidden], #labels[hidden] { display: none; }
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.topbar-right { display: flex; gap: 8px; pointer-events: auto; }
.topbar .chip { font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); cursor: pointer; }

body.in-space { overflow: hidden; height: 100vh; padding: 0; }
body.in-space .stars, body.in-space .credits { display: none; }
body.in-space main { position: fixed; inset: 0; max-width: none; z-index: 2; pointer-events: none; }
body.in-space main > * { pointer-events: auto; }

.place-label {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent);
    background: rgba(8, 10, 30, .6);
    backdrop-filter: blur(6px);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, box-shadow .2s;
}

.place-label:hover, .place-label.hot {
    background: color-mix(in srgb, var(--cc) 35%, rgba(8, 10, 30, .8));
    box-shadow: 0 0 22px color-mix(in srgb, var(--cc) 70%, transparent);
}

.pl-emoji { font-size: 20px; }

.moon-label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(8, 10, 30, .55);
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.side-sub { margin-top: 12px; font-weight: 800; font-size: 15px; color: var(--soft); }
.side-moons { margin-top: 6px; font-size: 15px; }

.hud-top {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(620px, calc(100vw - 230px));
    text-align: center;
}

.small-title { font-size: clamp(30px, 4vw, 44px); text-shadow: 0 2px 20px rgba(0, 0, 0, .6); margin-bottom: 6px; }
.search.compact .ask-box { padding: 3px 6px 3px 14px; }
.search.compact .ask-input { font-size: 18px; padding: 6px 0; }
.search .results { max-height: 52vh; overflow: auto; padding: 2px; }
.search .q-link { background: rgba(14, 16, 44, .92); }

.hud-dock {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(1100px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 22px;
    background: rgba(8, 10, 30, .62);
    border: 1px solid var(--line);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.dock-hint { text-align: center; font-size: 14px; color: var(--soft); margin-bottom: 6px; }
.dock-places { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }

.dock-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 6px 4px;
    border-radius: 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--cc);
    background: rgba(255, 255, 255, .05);
    text-decoration: none;
    text-align: center;
    line-height: 1.15;
    transition: background .15s, transform .12s;
}

.dock-place span { font-size: 24px; }
.dock-place b { font-size: 13px; }
.dock-place:hover, .dock-place.focus { background: color-mix(in srgb, var(--cc) 28%, transparent); transform: translateY(-3px); }

.dock-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; margin-top: 8px; }
.dock-row .btn { margin: 0; }

.dock-qotd {
    display: flex;
    flex-direction: column;
    max-width: 340px;
    padding: 4px 12px;
    border-radius: 12px;
    border-left: 4px solid var(--cc);
    background: rgba(255, 255, 255, .06);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
}

.dock-qotd small { color: var(--cc); text-transform: uppercase; letter-spacing: 1px; font-size: 11px; font-weight: 800; }
.dock-extra-name { font-size: 14px; }

.side-panel, .q-panel {
    position: absolute;
    top: 64px;
    bottom: 14px;
    overflow: auto;
    border-radius: 24px;
    background: rgba(8, 10, 30, .66);
    border: 1px solid var(--line);
    border-top: 5px solid var(--cc);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    padding: 14px;
    animation: slideIn .6s cubic-bezier(.2, .9, .3, 1) both;
}

.side-panel { left: 14px; width: min(380px, calc(100vw - 28px)); }
.side-head { display: flex; justify-content: space-between; align-items: center; }
.side-head .btn { margin: 0; }
.side-nav { display: flex; gap: 4px; }
.side-nav .icon-btn { display: grid; place-items: center; text-decoration: none; font-size: 22px; }
.side-title { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 30px; line-height: 1.1; margin: 10px 0 2px; color: var(--cc); }
.side-panel .q-list { margin-top: 10px; gap: 6px; }
.side-panel .q-link { padding: 8px 12px; font-size: 16px; }
.q-link.active, .q-link.focus { background: color-mix(in srgb, var(--cc) 30%, transparent); }

.q-panel { right: 14px; width: min(560px, 46vw); padding: 12px; animation-name: slideInRight; }
.q-panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.q-panel-top .btn { margin: 0; }
.q-panel .answer-card { background: none; border: 0; box-shadow: none; padding: 4px; margin: 0; backdrop-filter: none; }
.q-panel .q-title { font-size: clamp(26px, 2.6vw, 36px); }
.q-panel .short { font-size: 21px; }
.q-panel .more p { font-size: 18px; }

.hud-hint {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(8, 10, 30, .6);
    color: var(--soft);
    font-size: 14px;
}

@keyframes slideIn { from { opacity: 0; transform: translateX(-30px); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } }

/* ---------- photos ---------- */
.photo-wrap { margin: -6px -6px 14px; }

.photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 0;
    padding: 0;
    border-radius: 18px;
    background: #000;
    cursor: zoom-in;
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .8s;
    animation: kenburns 26s ease-in-out infinite alternate;
}

.photo img.in { opacity: 1; }

@keyframes kenburns {
    from { transform: scale(1.02) translate(0, 0); }
    to { transform: scale(1.16) translate(-3%, -2%); }
}

.photo-wrap figcaption { font-size: 12px; color: var(--soft); margin: 4px 8px 0; }
.photo-wrap figcaption a { color: var(--soft); }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 8, .92);
    cursor: zoom-out;
    animation: fadeIn .3s;
}

.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 0 60px rgba(0, 0, 0, .8); }
@keyframes fadeIn { from { opacity: 0; } }

@media (max-width: 900px) {
    .hud-top { width: calc(100vw - 24px); top: 56px; }
    .small-title { display: none; }
    .dock-places { grid-template-columns: repeat(4, 1fr); }
    .dock-extra-name, .dock-qotd { display: none; }
    .side-panel { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-height: 46vh; }
    .q-panel { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 64vh; }
    .hud-hint { display: none; }
    .place-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .photo img { animation: none; }
    .side-panel, .q-panel { animation: none; }
}

.place-label[hidden], .moon-label[hidden] { display: none; }

/* ---------- labelled diagrams ---------- */
.diagram svg { display: block; width: 100%; height: auto; border-radius: 18px; }
.dg-title { fill: #ffffff; font: 800 18px 'Baloo 2', sans-serif; }
.dg-sub { fill: #c9cff5; font: 600 14px 'Baloo 2', sans-serif; }
.dg-small { font-size: 13px; }
.dg-cap { fill: #a9afd6; font: 600 14px 'Baloo 2', sans-serif; }
.dg-line { fill: none; stroke: #ffd166; stroke-width: 1.5; }
.dg-dot { fill: #ffd166; stroke: #070918; stroke-width: 1.5; }
.dg-bracket { fill: none; stroke: #a9afd6; stroke-width: 2; }

/* ---------- gallery ---------- */
.gallery { position: relative; }
.gallery-stage .photo.diagram { aspect-ratio: 8 / 5; background: #070918; cursor: zoom-in; }
.gallery-stage .photo.diagram svg { width: 100%; height: 100%; display: block; }

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(8, 10, 30, .7);
    color: var(--ink);
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.gallery-arrow.left { left: 8px; }
.gallery-arrow.right { right: 8px; }
.gallery-arrow:hover { background: rgba(108, 140, 255, .6); }

.gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }

.gallery-dot {
    font: inherit;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
    color: var(--ink);
    cursor: pointer;
}

.gallery-dot.on { background: var(--cc, var(--blue)); color: #0b0d24; border-color: transparent; }
.photo-wrap figcaption b { color: var(--ink); }
.lightbox .diagram.big { width: min(96vw, 150vh); }
.lightbox .diagram.big svg { width: 100%; height: auto; display: block; border-radius: 12px; }

/* ---------- planets strip ---------- */
.planet-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }

.planet-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: background .15s, transform .12s;
}

.planet-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 12px color-mix(in srgb, var(--cc) 60%, transparent); }
.planet-chip:hover, .planet-chip.on { background: color-mix(in srgb, var(--cc) 30%, transparent); transform: translateY(-2px); }
.side-title small { font-size: 16px; color: var(--soft); font-family: 'Baloo 2', sans-serif; }

/* ---------- sounds ---------- */
.sound-card {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(110, 211, 255, .08);
    border: 1px solid rgba(110, 211, 255, .3);
}

.sound-card.none { background: rgba(255, 255, 255, .04); border-color: var(--line); }
.sound-row { display: flex; gap: 10px; align-items: flex-start; }
.sound-row + .sound-row { margin-top: 8px; }
.sound-btn { flex: none; margin: 0; }
.sound-btn.on { background: #6ed3ff; color: #0b0d24; border-color: #6ed3ff; }
.sound-kind { font-weight: 800; font-size: 14px; color: #9fe6ff; }
.sound-text .small a { color: var(--soft); }
.sound-card.compact { margin-top: 14px; }
.sound-card.compact .sound-row { align-items: center; }

.place-label.planet { font-size: 14px; padding: 3px 10px; }

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-dots { display: flex; gap: 6px; margin: 8px 0 2px; }
.quiz-dots span { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.quiz-dots span.now { background: var(--cc, var(--blue)); }
.quiz-dots span.right { background: var(--good); }
.quiz-dots span.wrong { background: var(--bad); }
.quiz-body { margin: 6px 0 4px; }
.quiz-photo { margin: 0 auto 10px; max-width: 320px; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #000; }
.quiz-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.options.tf { grid-template-columns: 1fr 1fr; }
.options.tf .btn { font-size: 22px; min-height: 64px; }
.big-play { display: flex; margin: 0 auto 12px; font-size: 22px; min-height: 64px; }
.why-more { margin-top: 6px; }
.mission-box { padding: 4px; }
.mission-btn { display: flex; margin: 12px 0 0; width: 100%; }

/* guess the number */
.guess-value { text-align: center; font-family: 'Fredoka One', sans-serif; font-size: 30px; color: var(--gold); margin: 8px 0; }
.guess-value b { font-family: 'Baloo 2', sans-serif; color: var(--ink); font-size: 20px; }
.guess-stars { font-size: 34px; letter-spacing: 4px; color: var(--gold); }
.guess-slider { width: 100%; accent-color: var(--gold); height: 34px; }
.guess-ends { display: flex; justify-content: space-between; }

/* put in order */
.order-ends { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 700; }
.order-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.order-card {
    width: 96px;
    padding: 8px 6px;
    border-radius: 16px;
    border: 2px solid var(--line);
    background: rgba(255, 255, 255, .06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 14px;
    line-height: 1.15;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: transform .15s, border-color .15s;
}

.order-card.dragging { transform: scale(1.08); border-color: var(--gold); cursor: grabbing; z-index: 2; }
.order-card.right { border-color: var(--good); background: rgba(70, 212, 138, .15); }
.order-card.wrong { border-color: var(--bad); background: rgba(255, 122, 107, .12); }
.order-card img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; pointer-events: none; }
.order-art .phase-icon { width: 54px; height: 54px; display: block; }
.order-star { width: 48px; height: 48px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 18px var(--sc); margin: 3px; }
.order-emoji { font-size: 40px; line-height: 54px; }
.order-moves { display: flex; gap: 4px; }
.order-moves .icon-btn { width: 30px; height: 26px; font-size: 18px; line-height: 1; }

/* label the diagram */
.label-board { position: relative; }
.label-board .diagram svg { border-radius: 16px; }
.dg-blank .dg-label text { display: none; }

.label-spot {
    position: absolute;
    transform: translate(var(--ax, 0%), -50%);
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    border: 2px dashed #ffd166;
    background: rgba(8, 10, 30, .85);
    color: #ffd166;
    font: inherit;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.label-spot.filled { border-style: solid; color: var(--ink); background: rgba(108, 140, 255, .85); border-color: #fff; }
.label-spot.right { background: var(--good); color: #062a14; border-color: var(--good); }
.label-spot.wrong { background: var(--bad); color: #fff; border-color: var(--bad); }
.label-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 4px; min-height: 40px; }

.label-chip {
    font: inherit;
    font-weight: 800;
    font-size: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 2px solid var(--gold);
    background: rgba(255, 209, 102, .15);
    color: var(--ink);
    cursor: grab;
    touch-action: none;
}

.label-chip.on { background: var(--gold); color: #1c1f4a; }
.label-chip.ghost { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; background: var(--gold); color: #1c1f4a; }

/* passport */
.rank-card { display: flex; gap: 16px; align-items: center; }
.rank-emoji { font-size: 60px; }
.rank-name { font-family: 'Fredoka One', sans-serif; font-size: 30px; color: var(--gold); }
.rank-card .topic-bar { margin-top: 8px; height: 8px; }
.rank-card .topic-bar i { background: var(--gold); }
.quiz-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mode-card { text-decoration: none; text-align: center; margin: 0; transition: transform .12s; }
a.mode-card:hover { transform: translateY(-3px); }
.mode-emoji { font-size: 40px; }
.mode-card b { font-size: 20px; }
.passport-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

.passport-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    text-decoration: none;
    text-align: center;
    transition: transform .12s;
}

.passport-slot:hover { transform: translateY(-3px); }
.passport-slot.done { border-color: rgba(255, 209, 102, .6); background: rgba(255, 209, 102, .08); }

.stamp {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .06);
    border: 3px dashed rgba(255, 255, 255, .25);
    filter: grayscale(.85) opacity(.55);
}

.stamp img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; }
.stamp-emoji { font-size: 34px; }
.stamp.on { filter: none; border: 3px solid var(--cc); box-shadow: 0 0 18px color-mix(in srgb, var(--cc) 60%, transparent); }
.stamp.on::after { content: '✓'; position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1c1f4a; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.stamp-pop { display: flex; justify-content: center; margin: 8px 0; animation: stampIn .8s cubic-bezier(.2, 1.6, .4, 1); }
.stamp-pop .stamp { width: 110px; height: 110px; }
.stamp-pop .stamp img { width: 92px; height: 92px; }
@keyframes stampIn { from { transform: scale(2.4) rotate(-25deg); opacity: 0; } }

/* grown-up report */
.report { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.report-row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; }
.report-row .topic-bar i { background: var(--cc); }
.retry-list { margin: 8px 0 8px 20px; font-size: 16px; }

.topbar-left { display: flex; gap: 8px; }
.home-link { text-decoration: none; white-space: nowrap; }
@media (max-width: 560px) {
    body:not([data-page="home"]) .home-link,
    body[data-page="home"] #homeBtn { display: none; }
}
