/* ============================================================
   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 ---------- */
.scale-intro p { margin-bottom: 8px; }
.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); }

.scale-track { position: relative; overflow: hidden; margin: 0 -14px; }

.scale-sun {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, #fff7d6 0%, #ffd166 35%, #ff9f43 70%, #ff7a2f 100%);
    box-shadow: 0 0 120px 40px rgba(255, 170, 70, .45);
}

.tick {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(255, 255, 255, .1);
    padding: 2px 12px;
    font-size: 13px;
    color: rgba(169, 175, 214, .7);
}

.rock, .ice { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #b8a48a; opacity: .7; }
.ice { background: #bfe3ff; opacity: .5; }

.scale-body {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 18px;
    transform: translate(calc(-1 * var(--half, 0px)), -50%);
}

.scale-body .planet { transform: translateX(-50%); }

.scale-label { display: flex; flex-direction: column; line-height: 1.3; max-width: 340px; }
.scale-label b { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 24px; }
.scale-label span { font-size: 15px; color: var(--soft); }
.scale-label .fact { color: var(--ink); }

.sun-label, .zone {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    align-items: center;
}

.zone { transform: translate(-50%, -50%); background: rgba(9, 11, 34, .75); padding: 8px 14px; border-radius: 14px; }

.scale-end {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: min(680px, 92%);
    text-align: center;
}

.scale-end h2 { font-family: 'Fredoka One', sans-serif; font-weight: 400; font-size: 32px; color: var(--gold); }
.scale-end p { margin-top: 10px; }

.hud {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 15;
    width: min(760px, calc(100vw - 20px));
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(12, 14, 44, .88);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.hud .row { margin: 0; }
.hud-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; font-size: 16px; }
.hud-text b { color: var(--gold); }

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

/* ---------- 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, scale .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);
    scale: 1.08;
}

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

.beacon-tip {
    position: absolute;
    top: 0;
    left: 0;
    max-width: 260px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(8, 10, 30, .85);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
    pointer-events: none;
}

.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], .beacon-tip[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; }
