/* Space Station (id "spacestation", premium): the bridge of a station in orbit, looking out of raked windows at a planet
   turning below. Clean white hull and steel, one strong orange and a console cyan, deep space behind. The app: white hull
   panels on navy, orange hazard corners, rivets, a steel deck plate for the bottom bar with a glowing edge.
   The scene is SCENES.spacestation in theme-spacestation.js; its style items use the code "ss". */

:root {
  /* the deck plate's chevron strip along the top of the bottom bar */
  --ss-hazard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 12'%3E%3Crect width='48' height='12' fill='%231b2536'/%3E%3Cpath d='M0 12L12 0h12L12 12zM24 12L36 0h12L36 12z' fill='%23ff7a1a'/%3E%3Cpath d='M0 .75H48M0 11.250H48' stroke='%231b1033' stroke-width='1.500'/%3E%3C/svg%3E");
  /* the hull plate along the top of a card: white panel, orange stripe, two rivets */
  --ss-plate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M1 1h118v9l-3 3H4l-3-3z' fill='%23eef3f8' stroke='%231b1033' stroke-width='1.500'/%3E%3Crect x='30' y='5' width='60' height='4' fill='%23ff7a1a' stroke='%231b1033'/%3E%3Cg fill='%239aa8ba' stroke='%231b1033' stroke-width='.8'%3E%3Ccircle cx='9' cy='7' r='2.200'/%3E%3Ccircle cx='111' cy='7' r='2.200'/%3E%3C/g%3E%3C/svg%3E");
  /* a hazard-marked tag (a topic tile's top right) and the steel studs with little lights at a main button's corners */
  --ss-tag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 24'%3E%3Cpath d='M3 3h30v13l-5 5H3z' fill='%23eef3f8' stroke='%231b1033' stroke-width='1.800' stroke-linejoin='round'/%3E%3Cpath d='M7 16l9-9h6l-9 9zM19 16l9-9h3v2l-7 7z' fill='%23ff7a1a'/%3E%3C/svg%3E");
  --ss-corners-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23dfe6ef' stroke='%231b1033' stroke-width='1.2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Ccircle cx='32' cy='8' r='6'/%3E%3Ccircle cx='8' cy='32' r='6'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3Cg fill='%2339d8ff' stroke='%231b1033' stroke-width='.8'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3Ccircle cx='32' cy='32' r='3'/%3E%3C/g%3E%3Cg fill='%23ff7a1a' stroke='%231b1033' stroke-width='.8'%3E%3Ccircle cx='32' cy='8' r='3'/%3E%3Ccircle cx='8' cy='32' r='3'/%3E%3C/g%3E%3C/svg%3E");
  --ss-corners-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3Ccircle cx='32' cy='32' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- colours ---- */
[data-theme="spacestation"] {
  --bg-0: #070e24; --bg-1: #0b1634; --bg-2: #122248;
  --card: rgba(13, 24, 52, .95); --card-2: rgba(223, 230, 239, .09); --panel-edge: rgba(223, 230, 239, .5);
  --ink: #f2f6fb; --ink-dim: #b4c4da; --on-hot: #ffffff;
  --hot: #ee5a12; --cool: #1aa3d9; --amber: #f5a81c; --gold: #f5a81c; --good: #3ddc84; --bad: #ff6a5a; --seen: #7fdcff;
  --title-1: #f2f6fb; --title-2: #ff9a3d;
  --mine: rgba(238, 90, 18, .28); --mine-edge: rgba(238, 90, 18, .6); --fact-bg: rgba(57, 216, 255, .12); --fact-edge: rgba(57, 216, 255, .42);
  --shadow: 0 8px 24px rgba(2, 6, 18, .55);
  --scrim: rgba(4, 9, 24, .66); --off: rgba(223, 230, 239, .2); --press: rgba(0, 0, 0, .3);
  /* painted module doors for the topic tiles */
  --s-general: #ee5a12; --s-geography: #12908a; --s-history: #a8682c; --s-science: #1f7fd0;
  --s-nature: #2f9450; --s-music: #cf4a86; --s-film_tv: #6a4cc8; --s-sport: #d48a12;
  --s-arts_lit: #4a56c8; --s-food: #d8602c; --s-tech_games: #1a8fbf; --s-words: #14907a;
  /* bottom-bar icon colours (look3d.js TAB_ICONS): hull white, steel, cockpit cyan, orange, solar blue */
  --tb-blue-1: #a8e6ff; --tb-blue-2: #1a8fd0; --tb-pink-1: #ffc4a8; --tb-pink-2: #ee6a2a; --tb-green-1: #a8ffd8; --tb-green-2: #18a878;
  --tb-gold-1: #ffe29a; --tb-gold-2: #f09a12; --tb-purple-1: #c8d4ff; --tb-purple-2: #4a62c8; --tb-red-1: #ffb08a; --tb-red-2: #e04a12;
  --tb-cream-1: #ffffff; --tb-cream-2: #c2d0e0; --tb-orange-1: #ffc48a; --tb-orange-2: #ee6a12; --tb-brown-1: #9aa8ba; --tb-brown-2: #4c5a70;
}
[data-theme="spacestation"] #splash { background: linear-gradient(#050a1c, #0b1a3c 62%, #174a8c 86%, #58c0f0); }

/* ---- the scene ---- */
[data-theme="spacestation"] #stage-bg { background: #050a1c; }
.ss-scene { position: absolute; inset: 0; overflow: hidden; --b: calc(var(--tabh) + env(safe-area-inset-bottom)); pointer-events: none; }
.ss-scene img { display: block; -webkit-user-drag: none; }
.ss-scene svg { display: block; overflow: visible; }
.ss-deep { position: absolute; inset: 0; background:
  radial-gradient(40% 26% at 24% 16%, rgba(40, 90, 150, .3), transparent 72%), radial-gradient(34% 22% at 80% 30%, rgba(26, 120, 140, .22), transparent 74%),
  linear-gradient(#040818, #081230 58%, #0b1a3e); }
.ss-stars { position: absolute; inset: 0; }
.ss-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; scale: var(--s); box-shadow: 0 0 3px rgba(190, 225, 255, .9); animation: ss-twinkle 5s ease-in-out infinite; }
@keyframes ss-twinkle { 50% { opacity: .25; } }

/* one sheet in world units, as tall as the space above the bottom bar, centred; every piece is placed in it by percent */
.ss-world { position: absolute; left: 50%; bottom: var(--b); height: calc(100% - var(--b)); aspect-ratio: 880 / 660; transform: translateX(-50%); }
.ss-world > * { position: absolute; }
.ss-layer { max-width: none; }

/* the planet: the land and the clouds are discs turning round its centre at their own speeds, so the coast and the weather slide along the curve */
.ss-planet img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ss-land { animation: ss-turn 520s linear infinite; }
.ss-cloud { animation: ss-turn 300s linear infinite; }
@keyframes ss-turn { to { transform: rotate(360deg); } }
/* sunrise along the edge of the world */
.ss-dawn { left: 14.6%; top: 42.600%; width: 34%; height: 12%; pointer-events: none; mix-blend-mode: screen; background:
  radial-gradient(7% 26% at 50% 50%, #fff, rgba(255, 240, 200, .7) 32%, transparent 72%), radial-gradient(50% 9% at 50% 50%, rgba(255, 244, 214, .95), transparent 70%), radial-gradient(36% 44% at 50% 50%, rgba(255, 170, 90, .35), transparent 72%);
  animation: ss-dawn 11s ease-in-out infinite alternate; }
@keyframes ss-dawn { from { opacity: .72; } to { opacity: 1; } }
/* the station's signal lights */
.ss-nav { animation: ss-strobe 2.6s steps(1) infinite; }
.ss-nav.b { animation-delay: -1.3s; animation-duration: 3.4s; }
@keyframes ss-strobe { 0%, 44% { opacity: 1; } 45%, 100% { opacity: .08; } }
/* anything that flies: the script moves it, in world units */
.ss-ship { left: 0; top: 0; will-change: transform; }
.ss-ship img { width: 100%; height: auto; }
.ss-flame { position: absolute; right: -17%; top: 50%; width: 42%; aspect-ratio: 2.2; margin-top: -9%; opacity: 0; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(60% 50% at 34% 50%, #fff, #8ee8ff 36%, rgba(40, 150, 255, .5) 62%, transparent 76%); animation: ss-flick .13s linear infinite alternate; }
.ss-flame.up { left: 50%; right: auto; top: auto; bottom: -24%; width: 62%; aspect-ratio: .5; margin: 0 0 0 -31%; background: radial-gradient(50% 60% at 50% 24%, #fff, #ffd28a 36%, rgba(255, 110, 30, .6) 62%, transparent 76%); }
@keyframes ss-flick { from { scale: 1; } to { scale: .84 1.08; } }
.ss-tether { left: 0; top: 0; width: 100%; height: 100%; }
/* a faint sheen on the glass, and the side panes on wide screens */
.ss-glass { left: -100%; right: -100%; top: 0; height: 80%; background: linear-gradient(112deg, transparent 44%, rgba(190, 225, 255, .06) 47%, rgba(190, 225, 255, .1) 50%, transparent 53%, transparent 60%, rgba(190, 225, 255, .05) 62%, transparent 64%); }
.ss-wing { top: 0; width: 100%; height: 100%; transform: scaleX(-1); }
.ss-wing.l { left: -100%; }
.ss-wing.r { left: 100%; }
/* the console's lights, three groups that never quite agree */
.ss-led.a { animation: ss-blink 1.9s steps(1) infinite; }
.ss-led.b { animation: ss-blink 2.7s steps(1) infinite -1s; }
.ss-led.c { animation: ss-blink 3.3s steps(1) infinite -.4s; }
@keyframes ss-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .18; } }
/* the robots on the deck */
.ss-bot { left: 0; top: 0; will-change: transform; }
.ss-bot img { width: 100%; height: auto; filter: drop-shadow(0 3px 2px rgba(2, 6, 18, .55)); }

/* ---- the app ---- */
/* no stage spotlights on the bridge: the light here comes from the windows */
[data-theme="spacestation"] .hbeam { display: none; }
/* the title: "Party" in hull white and orange, with a thin dark edge, like a name stencilled on a module */
[data-theme="spacestation"] .logo .l1 { color: #f2f6fb; text-shadow: 0 2px 0 #ee5a12, 0 3px 8px rgba(2, 6, 18, .7); }
[data-theme="spacestation"] .logo .l2 { color: transparent; background: linear-gradient(180deg, #ffffff 16%, #dfe6ef 50%, #ff9a3d 54%, #ee5a12 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(1.2px 0 0 #1b1033) drop-shadow(-1.2px 0 0 #1b1033) drop-shadow(0 1.2px 0 #1b1033) drop-shadow(0 -1.2px 0 #1b1033) drop-shadow(0 3px 0 #0b1634); }
[data-theme="spacestation"] :is(.title, .tag, .dim, .label) { text-shadow: 0 0 5px #050a1c, 0 1px 3px #050a1c, 0 2px 10px rgba(2, 6, 18, .9); }
[data-theme="spacestation"] .hname .ptitle { filter: drop-shadow(0 0 1.5px #0b1634) drop-shadow(0 0 1.5px #0b1634) drop-shadow(0 1px 3px #0b1634); }

/* main buttons: a panel with a steel lip and a stud in each corner, its little light winking */
[data-theme="spacestation"] .btn:not(.ghost):not(.small) { position: relative; overflow: visible; }
:root[data-theme="spacestation"] .btn:not(.ghost) {
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 45%, rgba(6, 12, 30, .18)), var(--hot);
  box-shadow: inset 0 0 0 2px rgba(238, 243, 248, .9), inset 0 0 0 3.5px rgba(27, 16, 51, .45), 0 5px 0 color-mix(in srgb, var(--hot) 55%, #0b1634), 0 12px 20px -6px rgba(2, 6, 18, .6); }
[data-theme="spacestation"] .btn:not(.ghost):not(.small)::before, [data-theme="spacestation"] .btn:not(.ghost):not(.small)::after {
  content: ''; position: absolute; inset: 4px; z-index: 2; pointer-events: none; box-sizing: border-box; background: none;
  border: 10px solid transparent; border-image: var(--ss-corners-a) 40% / 10px no-repeat; border-radius: 0; }
[data-theme="spacestation"] .btn:not(.ghost):not(.small)::after { border-image-source: var(--ss-corners-b); animation: ss-wink 1.4s steps(1) infinite; }
@keyframes ss-wink { 0% { opacity: 1; } 50% { opacity: 0; } }

/* cards: a hull plate riveted across the top, a steel line round the edge */
[data-theme="spacestation"] .panel { position: relative; margin-top: .55rem; }
:root[data-theme="spacestation"] :is(.panel, .sheetbox) { background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 40%), var(--card);
  box-shadow: inset 0 0 0 1.5px rgba(223, 230, 239, .55), 0 14px 28px -10px rgba(2, 6, 18, .75); }
[data-theme="spacestation"] .panel::before { content: ''; position: absolute; left: 8%; right: 8%; top: -.5rem; height: .9rem; pointer-events: none; z-index: 1;
  background: var(--ss-plate) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px rgba(2, 6, 18, .5)); }

/* Head to Head tiles: module doors in hull paint: a white frame with the corners cut, a hazard tag in the corner */
[data-theme="spacestation"] .topic { position: relative; overflow: visible; border: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  background: linear-gradient(170deg, color-mix(in srgb, var(--sc) 78%, #fff), var(--sc) 55%, color-mix(in srgb, var(--sc) 72%, #0b1634));
  box-shadow: inset 0 0 0 3px #dfe6ef, inset 0 0 0 4.5px rgba(27, 16, 51, .45), inset 0 -6px 0 rgba(11, 22, 52, .28); }
[data-theme="spacestation"] .topic::after { content: ''; position: absolute; top: .35rem; right: .45rem; width: 1.45rem; height: .95rem; pointer-events: none; background: var(--ss-tag) center / contain no-repeat; }
[data-theme="spacestation"] .topic span, [data-theme="spacestation"] .topic small { text-shadow: 0 1px 3px rgba(11, 22, 52, .7); }

/* the bottom bar: a steel deck plate, a hazard strip along its edge, the home button lit from under */
[data-theme="spacestation"] #tabbar { overflow: visible; background: radial-gradient(circle at 12px 14px, rgba(255, 255, 255, .16) 0 1.4px, transparent 2px) 0 0 / 3.4rem 100% repeat-x, repeating-linear-gradient(90deg, rgba(11, 22, 52, .55) 0 2px, transparent 2px 3.4rem), linear-gradient(180deg, #4c5a70, #333f54 60%, #232d40); border-top: 2px solid #1b1033; box-shadow: 0 -8px 20px -8px rgba(2, 6, 18, .7); }
[data-theme="spacestation"] #tabbar::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 9px; pointer-events: none; background: var(--ss-hazard) 0 0 / 36px 9px repeat-x; }
[data-theme="spacestation"] #tabbar button.homebtn::before { background: linear-gradient(180deg, #4c5a70, #333f54); box-shadow: 0 -2px 0 #1b1033, 0 -4px 14px rgba(57, 216, 255, .5); }
[data-theme="spacestation"] #tabbar button { color: #eef3f8; }
[data-theme="spacestation"] #tabbar button.on { color: #ff9a3d; }

/* ---- Space Station style items (code "ss") ---- */
/* the win celebration: shuttles, satellites and stars drifting down (style-bundles.js draws them) */
.confetti.fx-ss i { position: absolute; top: -12%; width: calc(2.4rem * var(--s, 1)); height: auto; background: none; animation: fall 3.4s linear infinite; }
/* chat bubble "Comms Channel": a dark console screen with a cyan edge and scan lines */
html body .bubble.bub-ss.bub-ss { color: #dff7ff; border: 2px solid #39d8ff;
  background: repeating-linear-gradient(180deg, rgba(57, 216, 255, .09) 0 1px, transparent 1px 4px), linear-gradient(170deg, #0f2448, #081430); }
html body .bubble.bub-ss.bub-ss small { color: #8fe2ff; opacity: 1; }

/* answer buttons "Control Panel": a white-framed panel in the answer's colour, corners cut, a row of lights along the bottom */
body.btns-ss .abtn, .btns-ss-demo { position: relative; overflow: visible !important; color: #fff !important; text-shadow: 0 1px 2px rgba(11, 22, 52, .8) !important; border: 2px solid #1b1033 !important; border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%, rgba(11, 22, 52, .24)), var(--c) !important;
  box-shadow: inset 0 0 0 2.5px #dfe6ef, inset 0 0 0 4px rgba(27, 16, 51, .4), 0 5px 0 color-mix(in srgb, var(--c) 45%, #0b1634), 0 10px 16px -6px rgba(2, 6, 18, .6) !important; }
body.btns-ss .abtn::before, body.btns-ss .abtn::after, .btns-ss-demo::before { content: ''; position: absolute; inset: -2px; pointer-events: none; box-sizing: border-box; border: 9px solid transparent; border-image: var(--ss-corners-a) 40% / 9px no-repeat; }
body.btns-ss .abtn::after { border-image-source: var(--ss-corners-b); animation: ss-wink 1.4s steps(1) infinite; }
body.btns-ss .abtn:active { transform: translateY(4px); box-shadow: inset 0 0 0 2.5px #dfe6ef, 0 1px 0 color-mix(in srgb, var(--c) 45%, #0b1634) !important; }
.btns-ss-demo { --c: #ee5a12; }

@media (prefers-reduced-motion: reduce) {
  [data-theme="spacestation"] .ss-scene *, [data-theme="spacestation"] .btn::after, body.btns-ss .abtn::after { animation: none !important; }
}
/* v2 */
