:root {
  --bg: #070b16; --bg2: #0d1426; --card: rgba(255,255,255,0.05); --line: rgba(255,255,255,0.10);
  --text: #e8edf7; --muted: #9aa6bf; --accent: #7fd6b0; --accent2: #8fb8ff; --warm: #ffcf8a;
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #12204a 0%, var(--bg) 60%); }
a { color: var(--accent2); }
button, select, input { font: inherit; color: inherit; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; position: relative; z-index: 3; }
.brand { display: flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .2px; }

main { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 960px) { main { grid-template-columns: 1.25fr 1fr; align-items: start; } .about { grid-column: 1 / -1; } }

.stage { position: relative; height: min(62vh, 640px); min-height: 340px; }
@media (min-width: 960px) { .stage { height: 78vh; position: sticky; top: 0; } }
#globe { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s; touch-action: none; }
#globe.ready { opacity: 1; }
#pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: 0; top: 0; pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; gap: 6px; margin: -6px 0 0 -6px; transition: opacity .25s; }
.pin.hidden { opacity: 0; pointer-events: none; }
.pin .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 0 3px rgba(143,184,255,.18); }
.pin .lbl { font-size: 11px; color: #dfe7f7; text-shadow: 0 1px 3px #000; white-space: nowrap; opacity: .0; transition: opacity .2s; }
.pin:hover .lbl, .pin.active .lbl, .pin.me .lbl { opacity: 1; }
.pin.active .dot { background: var(--warm); box-shadow: 0 0 0 4px rgba(255,207,138,.25); }
.pin.me .dot { background: var(--accent); width: 11px; height: 11px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(127,214,176,.6); } 100% { box-shadow: 0 0 0 14px rgba(127,214,176,0); } }

.stage-ui { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(127,214,176,.14); color: var(--accent); border: 1px solid rgba(127,214,176,.3); }

.panel { padding: 0 14px 8px; display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row label { color: var(--muted); font-size: 14px; min-width: 70px; }
select { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; flex: 1; min-width: 160px; }
.note { margin: -4px 0 0; font-size: 12px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; backdrop-filter: blur(6px); }
.hero { background: linear-gradient(160deg, rgba(40,62,130,.35), rgba(255,255,255,.04)); }
body[data-mode="day"] .hero { background: linear-gradient(160deg, rgba(255,190,110,.18), rgba(255,255,255,.04)); }
.place-name { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.head { margin: 6px 0 0; color: var(--accent2); font-weight: 600; }
body[data-mode="day"] .head { color: var(--warm); }
.big { margin: 2px 0; font-size: clamp(26px, 6vw, 38px); font-weight: 700; line-height: 1.15; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.app-soon { font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.k { margin: 0; font-size: 13px; color: var(--muted); }
.v { margin: 2px 0 0; font-size: 20px; font-weight: 650; }
.v.small { font-size: 15px; font-weight: 500; }
.moon { display: flex; gap: 10px; align-items: center; }
.time .row label { min-width: 90px; }
input[type=range] { flex: 1; accent-color: var(--accent); min-width: 160px; }

.primary { background: var(--accent); color: #062118; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 650; cursor: pointer; }
.app { background: #fff; color: #000; border-radius: 999px; padding: 9px 16px; text-decoration: none; font-weight: 600; font-size: 14px; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--text); }
.ghost.small { font-size: 13px; padding: 5px 11px; }
.ghost[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.about { padding: 8px 16px 20px; max-width: 760px; margin: 0 auto; color: #cdd6e8; }
.about h2 { font-size: 18px; margin: 22px 0 6px; color: var(--text); }
.foot { max-width: 1180px; margin: 0 auto; padding: 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(30px); opacity: 0; background: #1b2a4a; padding: 8px 14px; border-radius: 10px; transition: .3s; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.stage-btns { display: flex; gap: 8px; }
.aurora { background: linear-gradient(160deg, rgba(60,200,140,.16), rgba(255,255,255,.04)); }
.aurora .v #aurChance { color: #7ff0b4; font-size: 26px; }
.aurora .kp { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }

.pin.city .dot { width: 5px; height: 5px; background: #e8edf7; box-shadow: none; opacity: .7; }
.pin.city .lbl { opacity: .9; font-size: 10.5px; background: rgba(7,11,22,.55); padding: 1px 5px; border-radius: 6px; }
.pin.city.off { display: none; }
.wx { background: linear-gradient(160deg, rgba(143,184,255,.14), rgba(255,255,255,.04)); }

.pin.iss .dot { width: 12px; height: 12px; border-radius: 3px; background: #ffcf8a; box-shadow: 0 0 10px #ffcf8a; }
.pin.iss .lbl { opacity: 1; color: #ffcf8a; font-weight: 600; }
.iss { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: #cdd6e8; }
.iss li { margin: 3px 0; }

.signup { max-width: 760px; margin: 8px auto 32px; padding: 0 18px; }
.su { border: 1px solid #1d2a48; background: #0b1224; border-radius: 16px; padding: 18px 18px 8px; }
.su h2 { margin: 0 0 6px; font-size: 19px; }
.su p { color: #b9c4da; margin: 0 0 12px; }
.su-row { display: flex; gap: 8px; flex-wrap: wrap; }
.su-row input { flex: 1 1 220px; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #2a3a60; background: #070b16; color: #e8edf7; }
.su-c { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #9fb0cc; margin: 12px 0 4px; line-height: 1.45; }
.su-c input { margin-top: 3px; }
.su-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.su-msg { min-height: 1.2em; font-size: 14px; color: #ffcf8a; }
.su-ok { color: #7ee2b8; }

select.lang { flex: none; width: auto; max-width: 110px; font: inherit; font-size: 14px; color: inherit; background: transparent; border: 1px solid #2a3a60; border-radius: 999px; padding: 6px 10px; }
select.lang option { color: #000; }

.sl-out { display: block; flex-basis: 100%; font-size: 13px; color: #9fb0cc; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }

.card-ov { position: fixed; inset: 0; background: rgba(3,6,14,.86); z-index: 50; display: grid; place-items: center; padding: 16px; }
.card-box { max-width: 420px; width: 100%; text-align: center; }
.card-box img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; box-shadow: 0 10px 40px #000a; }
.card-tip { color: #9fb0cc; font-size: 13px; margin: 10px 0 8px; }
.card-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* Fixed heights so cards don't jump while dragging the sliders */
.grid .card { min-height: 104px; box-sizing: border-box; }
.grid .card.moon #moonName { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.ms-card { min-height: 96px; box-sizing: border-box; }
#dateOut, #timeOut { min-height: 1.3em; }
.stage-ui { min-height: 62px; align-items: flex-start; }
