/* Our Solar System: a Qu game. Off-white page, navy ink, yellow accent, Fraunces. The space panels are deep navy. */
:root {
  --bg: var(--color-off-white, #F8F9F0);
  --ink: var(--color-navy, #1E3A5F);
  --yellow: var(--color-yellow, #FDE358);
  --soft: rgba(30, 58, 95, .68);
  --line: rgba(30, 58, 95, .22);
  --ok: #2C9A5A;
  --no: #D5503F;
  --space: #0b1a2e;
  --font: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; text-align: left; }
#app { position: fixed; inset: var(--bar-h, 64px) 0 0 0; overflow-y: auto; overscroll-behavior: contain; }
.sr { max-width: 760px; margin: 0 auto; padding: 18px 18px 72px; }
a { color: var(--ink); }
.fine { text-align: center; color: var(--soft); font-size: 13px; margin-top: 36px; }
.hide { display: none !important; }

.hero { text-align: center; padding: 6px 0 14px; }
.hero h1 { font-weight: 400; font-size: clamp(38px, 8vw, 60px); margin: 0 0 8px; line-height: 1.05; }
.hero h1 b { font-weight: 700; text-decoration: underline; text-decoration-thickness: .1em; text-underline-offset: .12em; text-decoration-color: var(--yellow); text-decoration-skip-ink: none; }
.hero p { margin: 0 auto; color: var(--soft); font-size: clamp(15px, 4vw, 19px); line-height: 1.45; }
.hero p span { display: block; }

/* ---- the space panel ---- */
.space { background: radial-gradient(circle at 50% 50%, #14305a 0%, var(--space) 70%); border-radius: 18px; overflow: hidden; border: 1.5px solid var(--ink); aspect-ratio: 1 / 1; max-height: 62vh; margin: 0 auto; width: min(100%, 62vh); position: relative; }
.space.small { width: min(100%, 440px); }
.orrery { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.orrery .body { cursor: pointer; outline: none; }
.orrery .body:focus-visible .sel { opacity: 1; }
.orrery .lab { fill: #fff; font: 600 5.8px/1 var(--font); opacity: .9; paint-order: stroke; stroke: rgba(11, 26, 46, .8); stroke-width: .8px; pointer-events: none; }
.system .lab { font-size: 6.4px; }
.orrery.nolabels .lab { display: none; }
.sun-glow { animation: glow 4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes glow { 50% { transform: scale(1.12); opacity: .85; } }
.orrery .body.good { animation: pop .6s ease; }
.orrery .body.bad { animation: shake .45s; }
@keyframes pop { 40% { transform-box: fill-box; scale: 1.8; } }
@keyframes shake { 25% { translate: 2px 0; } 75% { translate: -2px 0; } }
@media (prefers-reduced-motion: reduce) { .sun-glow, .orrery .body.good, .orrery .body.bad { animation: none; } }

.date { text-align: center; margin: 12px 0 8px; font-size: 18px; }
.date b { background: var(--yellow); padding: 1px 8px; border-radius: 999px; margin-right: 4px; font-weight: 700; }
.date b:empty { display: none; }
.ctl, .tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.pill { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 600; text-align: center; }
.pill:hover { background: #fff; }
.pill.on { background: var(--ink); color: var(--bg); }
.note { text-align: center; color: var(--soft); font-size: 14px; margin: 6px auto 14px; max-width: 34em; }

/* ---- info cards ---- */
.info { border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 16px; background: #fff; margin: 0; }
.info.hint { background: transparent; border-style: dashed; text-align: center; color: var(--soft); }
.info.hint p { margin: 4px 0; }
.info h3 { margin: 0 0 10px; font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.info h3 small { font-size: 14px; font-weight: 500; color: var(--soft); }
.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(30, 58, 95, .35); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 16px; }
.facts li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts b { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.facts.plain b { display: none; }
.facts small { color: var(--soft); }
.src { margin: 10px 0 0; font-size: 13px; color: var(--soft); }
.sec { font-size: 26px; margin: 30px 0 12px; }

/* ---- level cards ---- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: block; width: 100%; background: transparent; border: 1.5px solid var(--ink); border-radius: 12px; padding: 0; transition: box-shadow .15s, background .15s; }
.card:hover, .card:focus-visible { background: #fff; box-shadow: 0 0 0 3px var(--yellow); outline: none; }
.card .cb { padding: 16px 18px 18px; }
.card h2 { margin: 0 0 4px; font-size: 25px; font-weight: 400; }
.card h2 b { font-weight: 700; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .13em; text-underline-offset: .12em; text-decoration-skip-ink: none; }
.card p { margin: 0 0 12px; color: var(--soft); font-size: 15px; }
.stars { font-size: 18px; color: #c79a00; letter-spacing: 2px; } .stars i { color: rgba(30, 58, 95, .2); font-style: normal; }
.card .stars:not(:has(i)) { font-size: 13px; color: var(--soft); letter-spacing: 0; }

.back { background: none; border: 0; padding: 4px 0 10px; font-size: 15px; color: var(--soft); }
.back:hover { color: var(--ink); text-decoration: underline; }
.lvhead { text-align: center; margin: 0 0 14px; }
.lvhead h1 { font-weight: 400; font-size: clamp(32px, 7vw, 46px); margin: 0 0 8px; line-height: 1.08; }
.lvhead h1 b { font-weight: 700; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: .1em; text-underline-offset: .12em; text-decoration-skip-ink: none; }
.lvhead p { margin: 0 auto; color: var(--soft); max-width: 30em; font-size: 17px; line-height: 1.45; }
.primary { background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 700; font-size: 17px; text-align: center; }
.primary:hover { box-shadow: 0 0 0 3px var(--yellow); }
.primary.big { display: block; margin-inline: auto; font-size: 19px; padding: 14px 30px; }
.pcards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pcards .info { margin: 0; height: 100%; }
.pcards .facts { font-size: 15px; }

/* ---- quiz ---- */
.q { max-width: 600px; margin: 0 auto; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--soft); margin-bottom: 10px; position: relative; }
.prog i { position: absolute; left: 0; bottom: -6px; height: 3px; background: var(--ink); border-radius: 2px; transition: width .3s; }
.qp { font-size: clamp(22px, 5vw, 30px); font-weight: 600; margin: 12px 0 14px; line-height: 1.25; }
.opts { display: grid; gap: 10px; }
.opt { background: #fff; border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 16px; font-size: 18px; }
.opt:hover:not(:disabled) { box-shadow: 0 0 0 3px var(--yellow); }
.opt.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.no { background: rgba(213, 80, 63, .12); border-color: var(--no); color: var(--no); text-decoration: line-through; }
.why { margin: 14px 0 6px; color: var(--ink); font-size: 17px; line-height: 1.4; }
.q .primary { margin-top: 8px; }
.result { text-align: center; padding-top: 20px; }
.result h2 { font-size: clamp(28px, 7vw, 40px); font-weight: 400; margin: 0 0 12px; }
.bigstars { font-size: 56px; color: #c79a00; letter-spacing: 6px; } .bigstars i { color: rgba(30, 58, 95, .2); font-style: normal; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

/* ---- days and years ---- */
.agebox { text-align: center; margin: 10px 0 14px; }
.agebox label { display: block; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; }
.agebox input { font: inherit; font-size: 20px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); }
.ages { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.ages li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; align-items: center; }
.ages .who { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; }
.ages .age { font-size: 28px; font-weight: 700; text-align: right; }
.ages .detail { grid-column: 1 / -1; font-size: 13px; color: var(--soft); }

/* ---- big and far ---- */
.bigbox, .farbox { display: grid; gap: 12px; }
.bigbox h2, .farbox h2 { font-size: 26px; margin: 0; }
.scroll { width: fit-content; max-width: 100%; margin: 0 auto; overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; }
.sizes { display: block; max-width: none; height: auto; }
.sizes text { fill: var(--ink); font: 600 14px var(--font); }
.sizes .cap { font-size: 12px; fill: var(--soft); font-weight: 500; }
.mini { color: var(--soft); font-size: 15px; line-height: 1.45; margin: 0; }
.mini.center { text-align: center; }
.readout { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 20px; min-height: 5.4em; font-variant-numeric: tabular-nums; }
.readout span { font-size: 14px; opacity: .85; }
.walk { overflow: hidden; border: 1.5px solid var(--ink); border-radius: 12px; background: radial-gradient(circle at 0 50%, #14305a, var(--space) 40%); height: 190px; position: relative; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.walk.grab { cursor: grabbing; }
.walk:focus-visible { outline: 3px solid var(--yellow); }
.walk .ball, .walk .mark, .walk .lbl, .walk .axis { position: absolute; left: 0; will-change: transform; }
.walk .ball { top: 50%; margin-top: -20px; border-radius: 50%; background: radial-gradient(circle at 35% 32%, #fff6c2, #fde358); box-shadow: 0 0 22px 6px rgba(253, 227, 88, .5); }
.walk .axis { top: 50%; border-top: 1px dashed rgba(255, 255, 255, .25); }
.walk .lbl { top: calc(50% + 28px); width: 60px; margin-left: -30px; text-align: center; color: #fff; font-weight: 600; font-size: 14px; }
.mark { top: 50%; color: #fff; width: 0; height: 0; }
.mark i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; border: 1px solid #fff; }
.mark b { position: absolute; left: 0; top: -44px; transform: translateX(-50%); font-size: 15px; white-space: nowrap; }
.mark small { position: absolute; left: 0; top: 14px; transform: translateX(-50%); font-size: 11px; opacity: .8; white-space: nowrap; }
.mark::before { content: ""; position: absolute; left: 0; top: -26px; height: 22px; border-left: 1px solid rgba(255, 255, 255, .5); }
.travel { width: 100%; accent-color: var(--ink); height: 28px; margin: 0; }

/* ---- sources ---- */
.sources { margin: 26px 0 0; font-size: 14px; color: var(--soft); }
.sources summary { cursor: pointer; font-size: 15px; }
.sources ul { padding-left: 20px; }

/* ---- zoom buttons, speed note ---- */
.zoombar { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoombar button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .55); background: rgba(11, 26, 46, .7); color: #fff; font-size: 20px; line-height: 1; padding: 0; text-align: center; }
.zoombar button:hover:not(:disabled) { background: rgba(253, 227, 88, .9); color: var(--space); }
.zoombar button:disabled { opacity: .35; cursor: default; }
.orrery.zoomed { cursor: grab; }
.rate { text-align: center; color: var(--soft); font-size: 14px; }
.aside { margin: 12px 0 0; color: var(--soft); font-size: 15px; }
.stack { display: grid; gap: 22px; }

/* ---- the pop-up ---- */
.modal { position: fixed; inset: 0; z-index: 9999; background: rgba(11, 26, 46, .62); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s ease; }
.modalbox { position: relative; background: var(--bg); border: 1.5px solid var(--ink); border-radius: 18px; width: min(100%, 460px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; animation: rise .22s ease; }
.modalbox .pic { background: radial-gradient(circle at 50% 50%, #14305a 0%, var(--space) 75%); border-radius: 16.5px 16.5px 0 0; padding: 14px 0; }
.modalbox .bigpic { display: block; width: 100%; height: 170px; }
.modalbox .info { border: 0; border-radius: 0 0 16px 16px; margin: 0; background: transparent; padding: 16px 20px 20px; }
.xbtn { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .6); background: rgba(11, 26, 46, .7); color: #fff; font-size: 22px; line-height: 1; padding: 0; text-align: center; z-index: 1; }
.xbtn:hover { background: var(--yellow); color: var(--space); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .modal, .modalbox { animation: none; } }

/* ---- even spacing: every block on a page sits the same distance (24px) from the next ---- */
.sr { --gap: 24px; }
.sr > * { margin-top: 0; margin-bottom: 0; }
.sr > * + * { margin-top: var(--gap); }
.sr > .back + * { margin-top: 10px; }
.sr > .fine { margin-top: 40px; }
.sr > .date { margin-top: 16px; }
.sr > .rate { margin-top: 4px; }
.sr > .rate + .ctl { margin-top: 12px; }
.farbox .tabs, .farbox .ctl { margin: 0; }
@media (min-width: 480px) { .modalbox .facts:not(.plain) { grid-template-columns: 1fr 1fr; gap: 0 22px; } .modalbox .facts:not(.plain) li:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }

/* ---- headings: room between the title and its line of text, and a comfortable line length ---- */
.hero, .lvhead { padding: 0 8px; }
.hero h1, .lvhead h1 { margin: 0 0 18px; line-height: 1.12; }
.hero p, .lvhead p { max-width: 28em; margin: 0 auto; line-height: 1.5; text-wrap: balance; }
.lvhead { margin: 0; }
.card h2, .info h3 { line-height: 1.2; }
.card h2 { margin: 0 0 8px; }
.card p { margin: 0 0 14px; line-height: 1.45; }
.qp { line-height: 1.3; margin: 16px 0 18px; }
.prog { margin-bottom: 18px; }
.why { margin: 18px 0 10px; }

.infoslot { display: grid; gap: 16px; justify-items: center; }
.infoslot p { margin: 0; }
.tapline { font-size: 19px; font-weight: 700; text-align: center; }
.infoslot .mini { max-width: 34em; text-wrap: balance; }
.sr > .fine { max-width: 34em; margin: 40px auto 0; line-height: 1.55; text-wrap: balance; padding: 0 8px; }


/* ---- Meet the Planets: each card opens with a picture of the planet ---- */
.pcards > li { display: flex; }
.pcard { width: 100%; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; }
.pcard .pic { background: radial-gradient(circle at 50% 50%, #14305a 0%, var(--space) 75%); padding: 10px 0; }
.pcard .bigpic { display: block; width: 100%; height: 130px; }
.pcards .pcard .info { border: 0; border-radius: 0; height: auto; }
