/* Orbitile: the sky, the board and its stars are one canvas filling the stage; the HUD, the tool bar, the coach line,
   the result card and the panels are HTML over it (game.js keeps the board between them) */
.po { display: flex; flex-direction: column; color: #e6e9ff; --po-hud: 54px; --po-bar: 64px; --po-accent: #7ad7ff; --po-violet: #a77bff; --po-pink: #ff5ca8; --po-gold: #ffd166;
  --po-line: #1f2552; --po-glass: rgba(10,12,34,0.82); }
.po-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 480px; background: #03040d; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; outline: none; }
@media (max-width: 600px) { .po-stage { height: auto; aspect-ratio: 3 / 4.4; max-height: 88vh; min-height: 0; } }
#po-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: pointer; }
#po-canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(122,215,255,.5); }

/* HUD */
.po-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--po-hud); display: flex; align-items: center; gap: 14px; padding: 0 8px 0 10px; z-index: 3; pointer-events: none; }
.po-hud > * { pointer-events: auto; }
.po-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 0; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid var(--po-line); background: var(--po-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; max-width: 46vw; min-width: 96px; }
.po-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lvc, #9aa5d6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.po-pz-n { font-size: 18px; font-weight: 900; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.po-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #9aa5d6; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .po-pz:hover { border-color: var(--po-accent); } }
.po-pz:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-stat { display: flex; flex-direction: column; line-height: 1.05; flex: none; }
.po-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #9aa5d6; }
.po-stat b { font-size: 21px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.po-moves b { display: inline-block; transition: transform .16s cubic-bezier(.3,1.6,.5,1), color .16s; transform-origin: left center; }
.po-moves b.pop { transform: scale(1.16); color: #c9f0ff; }
.po-moves b.over #po-mv { color: #ffb38a; }
.po-moves small { font-size: 12.5px; font-weight: 700; color: #9aa5d6; margin-left: 4px; letter-spacing: 0; }
.po-time b { font-size: 17px; margin-top: 3px; color: #e6e9ff; }
.po-notimer .po-time { display: none; }
.po-sp { flex: 1 1 auto; }
.po-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--po-line); background: var(--po-glass);
  color: #c8d2ff; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s, opacity .15s; }
.po-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.po-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .po-tool:hover:not(:disabled) { border-color: var(--po-accent); color: #fff; } }
.po-tool:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
#po-sound .off { display: none; } #po-sound[aria-pressed="true"] { color: #6d76a8; } #po-sound[aria-pressed="true"] .on { display: none; } #po-sound[aria-pressed="true"] .off { display: inline; }
.po-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--po-pink); box-shadow: 0 0 8px var(--po-pink); }
.po-dot[hidden] { display: none; }

/* the coach line: a word about a new idea, or a hint */
.po-coach[hidden] { display: none; }
.po-coach { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--po-hud) + 4px); z-index: 3; width: min(calc(100% - 20px), 540px); padding: 8px 34px 8px 12px; border-radius: 12px;
  background: rgba(9,11,32,0.9); border: 1px solid rgba(167,123,255,0.5); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(167,123,255,.14); font-size: 13.5px; line-height: 1.38; color: #e6e9ff;
  animation: po-drop .22s ease-out; pointer-events: auto; }
/* centred with translateX: their entrances keep it */
@keyframes po-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes po-rise { from { opacity: 0; transform: translate(-50%, 6px); } }
.po-coach b { color: #c9b2ff; font-weight: 800; margin-right: 6px; }
.po-coach.hint { border-color: rgba(255,209,102,0.6); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(255,209,102,.14); }
.po-coach.hint b { color: var(--po-gold); }
.po-coach small { display: block; color: #9aa5d6; font-size: 12px; margin-top: 2px; }
.po-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #9aa5d6; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .po-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }

/* the tool bar */
.po-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--po-bar) - 12px); z-index: 3; display: flex; gap: 6px; padding: 0 6px; width: min(calc(100% - 12px), 540px); }
.po-bar[hidden] { display: none; }
.po-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1px solid var(--po-line);
  background: rgba(10,12,34,0.86); color: #d4dcff; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; padding: 0 2px;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.po-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.po-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .po-btn:hover:not(:disabled) { border-color: var(--po-accent); color: #fff; } }
.po-btn:active:not(:disabled) { transform: translateY(1px); }
.po-btn:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-btn:disabled { opacity: 0.36; cursor: default; }
.po-hint { color: #ffe3a3; }
@media (hover: hover) { .po-hint:hover:not(:disabled) { border-color: var(--po-gold); } }
.po-next.ready { background: linear-gradient(135deg, #7ad7ff, #a77bff 55%, #ff5ca8); color: #0a0420; border-color: transparent; box-shadow: 0 6px 22px rgba(167,123,255,0.35); }
.po-side .po-bar { left: auto; right: 8px; top: calc(var(--po-hud) + 4px); bottom: 8px; transform: none; height: auto; width: 76px; flex-direction: column; padding: 0; }
.po-side .po-btn { font-size: 10.5px; }

/* the result card: a strip over the bottom of the board, so the restored sky stays in view */
.po-card[hidden] { display: none; }
.po-card { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4; width: min(calc(100% - 16px), 460px); padding: 14px 14px 12px; border-radius: 18px;
  background: rgba(9,11,32,0.92); border: 1px solid rgba(167,123,255,0.35); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 40px rgba(122,215,255,.12); animation: po-up .35s cubic-bezier(.2,.9,.25,1.1);
  max-height: calc(100% - var(--po-hud) - 20px); overflow: auto; overscroll-behavior: contain; }
@keyframes po-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.po-card-top { display: flex; align-items: center; gap: 12px; }
.po-card-top > div { flex: 1 1 auto; min-width: 0; }
.po-card h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.1; text-shadow: 0 0 22px rgba(167,123,255,.55); }
.po-card p { margin: 2px 0 0; font-size: 13px; color: #9aa5d6; line-height: 1.4; }
.po-card .po-stars { flex: none; }
.po-card .po-actions { margin-top: 12px; }
.po-card .po-lb { margin-top: 8px; }

/* a finished star system: its constellation, revealed */
.po-reveal { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px; border-radius: 14px; background: radial-gradient(120% 140% at 0% 50%, rgba(255,209,102,.14), transparent 60%), #070920; border: 1px solid rgba(255,209,102,.35); }
.po-reveal svg { width: 86px; height: 86px; flex: none; }
.po-reveal b { color: #fff; } .po-reveal p { margin: 2px 0 0; }

/* panels */
.po-overlay[hidden] { display: none; }
.po-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 6; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(4,5,18,0.5), rgba(3,4,12,0.86)); animation: po-fade .18s ease-out; }
.po-panel { position: relative; width: min(100%, 430px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--po-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(9,11,32,0.95); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(122,215,255,0.05) inset; animation: po-in .26s cubic-bezier(.2,.9,.25,1.1); }
.po-panel.wide { width: min(100%, 580px); }
@keyframes po-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
@keyframes po-fade { from { opacity: 0; } }
.po-panel h2 { margin: 0 36px 12px 0; font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.25; }
.po-panel h3 { margin: 14px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #9aa5d6; }
.po-panel p, .po-panel li { font-size: 13.5px; line-height: 1.5; color: #bcc5ea; }
.po-panel p { margin: 0 0 8px; }
.po-panel ul { margin: 0 0 8px; padding-left: 18px; }
.po-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2c3470; background: #0b0e28; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.po-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #d4dcff; cursor: pointer; padding: 0; z-index: 2; }
.po-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .po-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.po-x:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-fine { font-size: 12px !important; color: #6d76a8 !important; margin: 8px 0 0 !important; }
.po-center { text-align: center; }

.po-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.po-row { display: flex; gap: 8px; } .po-row > * { flex: 1 1 0; }
.po-b { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation; text-decoration: none;
  border: 1px solid var(--po-line); background: #0c0f2c; color: #e6e9ff; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .po-b:hover:not(:disabled) { border-color: var(--po-accent); } }
.po-b:active { transform: translateY(1px); }
.po-b:disabled { opacity: .45; cursor: default; }
.po-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.po-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.po-b span { white-space: nowrap; }
.po-b-primary { background: linear-gradient(135deg, #7ad7ff, #a77bff 55%, #ff5ca8); color: #0a0420; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(167,123,255,0.35); }
@media (hover: hover) { .po-b-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.08); } }
.po-b-sm { min-height: 38px; padding: 6px 10px; font-size: 13px; }

/* stars (the reward kind) and stats */
.po-stars { display: flex; justify-content: center; gap: 4px; }
.po-stars svg { width: 28px; height: 28px; }
.po-stars .s-on { fill: var(--po-gold); filter: drop-shadow(0 0 8px rgba(255,209,102,.75)); }
.po-stars .s-off { fill: #222a5c; }
.po-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; vertical-align: middle; margin-left: 6px;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: po-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,0.5); }
@keyframes po-shine { to { background-position: -200% 0; } }
.po-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.po-stats.three { grid-template-columns: repeat(3, 1fr); }
.po-stats div { padding: 8px 4px; border-radius: 10px; background: #070920; border: 1px solid #171c44; text-align: center; min-width: 0; }
.po-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6d76a8; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e6e9ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.po-stats .gold b { color: var(--po-gold); } .po-stats .hot b { color: #ff9fc9; } .po-stats .ok b { color: #7dffcf; }
.po-lb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.po-lb h3 { margin-top: 6px; }
.po-lb li { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: #070920; font-size: 13px; }
.po-lb li span { color: #6d76a8; font-weight: 800; font-variant-numeric: tabular-nums; }
.po-lb li b { color: #e6e9ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.po-lb li em { font-style: normal; color: var(--po-gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.po-lb li i { font-style: normal; color: #9aa5d6; font-variant-numeric: tabular-nums; font-size: 12px; }
.po-lb li.me { background: rgba(122,215,255,0.12); box-shadow: inset 0 0 0 1px rgba(122,215,255,0.4); }

/* the hub: every way to play */
.po-hubs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.po-hubc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 92px; padding: 12px 12px 10px; border-radius: 15px; border: 1px solid var(--po-line);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hc) 22%, transparent), transparent 60%), #070920; color: #e6e9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s, transform .1s; overflow: hidden; }
.po-hubc.big { grid-column: 1 / -1; min-height: 104px; }
.po-hubc svg { width: 28px; height: 28px; fill: none; stroke: var(--hc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hc) 60%, transparent)); }
.po-hubc b { font-size: 15.5px; color: #fff; }
.po-hubc small { font-size: 12px; color: #9aa5d6; line-height: 1.35; }
.po-hubc em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--hc); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .po-hubc:hover { border-color: var(--hc); } }
.po-hubc:active { transform: translateY(1px); }
.po-hubc:focus-visible { outline: 2px solid var(--hc); outline-offset: 2px; }

/* the galaxy map: a strip of star systems, and the chosen system's orbits */
.po-p-map { padding: 16px 14px 14px; }
.po-sys { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -4px 6px; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: thin; }
.po-sysb { flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 74px; padding: 7px 4px 6px; border-radius: 13px; border: 1px solid #171c44; background: #070920;
  color: #9aa5d6; font: inherit; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
.po-sysb i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 8%, var(--sc) 30%, color-mix(in srgb, var(--sc) 40%, #000) 75%); box-shadow: 0 0 12px color-mix(in srgb, var(--sc) 70%, transparent); }
.po-sysb.locked i { filter: grayscale(1) brightness(.35); box-shadow: none; }
.po-sysb b { font-size: 10.5px; font-weight: 800; color: #e6e9ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.po-sysb small { font-size: 10px; font-weight: 700; color: #6d76a8; font-variant-numeric: tabular-nums; }
.po-sysb[aria-selected="true"] { border-color: var(--sc); box-shadow: inset 0 0 0 1px var(--sc), 0 0 16px color-mix(in srgb, var(--sc) 30%, transparent); }
.po-sysb:focus-visible { outline: 2px solid var(--sc); outline-offset: 1px; }
.po-orbit { position: relative; width: 100%; aspect-ratio: 1 / 0.86; border-radius: 16px; overflow: hidden; background: #04051a; border: 1px solid #141943; }
.po-orbit svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.po-lvl { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation; background: none; display: grid; place-items: center;
  color: #fff; font: 800 11px system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.po-lvl i { position: absolute; inset: 7px; border-radius: 50%; background: #1a1f4a; box-shadow: inset 0 0 0 1px #2a3170; transition: transform .15s; }
.po-lvl.open i { background: radial-gradient(circle at 35% 30%, #c9d0ff, #4a5299 70%); box-shadow: 0 0 10px rgba(201,208,255,.35); }
.po-lvl.done i { background: radial-gradient(circle at 35% 30%, #fff 0 6%, var(--pc) 32%, color-mix(in srgb, var(--pc) 35%, #000) 80%); box-shadow: 0 0 14px color-mix(in srgb, var(--pc) 75%, transparent); }
.po-lvl.cur i { animation: po-pulse 1.6s ease-in-out infinite; }
@keyframes po-pulse { 50% { transform: scale(1.18); box-shadow: 0 0 20px rgba(255,255,255,.55); } }
.po-lvl span { position: relative; text-shadow: 0 1px 3px #000; }
.po-lvl.locked { cursor: default; } .po-lvl.locked span { opacity: .45; }
.po-lvl em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: -6px; font-style: normal; font-size: 8px; letter-spacing: -1px; color: var(--po-gold); white-space: nowrap; text-shadow: 0 0 6px rgba(255,209,102,.8); }
.po-lvl:focus-visible { outline: 2px solid #fff; outline-offset: 0; }
@media (hover: hover) { .po-lvl:not(.locked):hover i { transform: scale(1.15); } }
.po-sysname { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 2px 8px; }
.po-sysname b { font-size: 17px; color: #fff; } .po-sysname small { font-size: 12px; color: #9aa5d6; font-variant-numeric: tabular-nums; }
.po-const { position: absolute; left: 10px; bottom: 8px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(230,233,255,.55); pointer-events: none; }

/* lists: trials, cosmos tiers, your universes, constellations */
.po-list { display: flex; flex-direction: column; gap: 6px; }
.po-li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 13px; border: 1px solid #171c44; background: #070920; color: #e6e9ff; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
.po-li:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { .po-li:not(:disabled):hover { border-color: var(--lc, var(--po-accent)); } }
.po-li:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-li-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--lc, #7ad7ff) 16%, transparent); color: var(--lc, #7ad7ff); font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.po-li-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.po-li-t b { font-size: 14.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .po-li-t small { font-size: 12px; color: #9aa5d6; }
.po-li-s { font-size: 12px; font-weight: 800; color: #6d76a8; white-space: nowrap; } .po-li-s.ok { color: var(--po-gold); }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.po-gc { position: relative; height: 52px; border-radius: 12px; border: 1px solid #171c44; background: #070920; color: #d4dcff; font: 800 14px system-ui, sans-serif; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.po-gc.done { border-color: rgba(255,209,102,.45); color: #fff; }
.po-gc i { font-style: normal; font-size: 9px; color: var(--po-gold); letter-spacing: -1px; }
.po-gc:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 2px; }
@media (hover: hover) { .po-gc:hover { border-color: var(--po-accent); } }
.po-cons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.po-con { border-radius: 13px; border: 1px solid #171c44; background: #04051a; padding: 6px 6px 8px; text-align: center; }
.po-con svg { width: 100%; aspect-ratio: 1; display: block; }
.po-con b { display: block; font-size: 11px; color: #e6e9ff; margin-top: 2px; } .po-con small { font-size: 10px; color: #6d76a8; }
.po-con.done { border-color: rgba(255,209,102,.4); box-shadow: 0 0 16px rgba(255,209,102,.1); }

/* calendar */
.po-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.po-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.po-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #262d66; background: #0c0f2c; color: #e6e9ff; cursor: pointer; }
.po-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.po-step:disabled { opacity: .35; cursor: default; }
.po-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.po-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6d76a8; padding: 2px 0; }
.po-cal-d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #171c44; background: #070920; color: #d4dcff; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.po-cal-d.off { opacity: .28; cursor: default; }
.po-cal-d.ok { background: rgba(125,255,207,0.12); border-color: rgba(125,255,207,0.55); color: #7dffcf; }
.po-cal-d.today { box-shadow: 0 0 0 2px var(--po-pink), 0 0 14px rgba(255,92,168,.45); }
.po-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .po-cal-d:not(.off):hover { border-color: var(--po-accent); } }
.po-cal-d:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 1px; }

/* settings, tabs, help */
.po-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #171c44; cursor: pointer; }
.po-set span { display: flex; flex-direction: column; gap: 2px; } .po-set b { font-size: 14px; color: #fff; } .po-set small { font-size: 12px; color: #9aa5d6; }
.po-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.po-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #262d66; background: #0c0f2c; transition: background .15s, border-color .15s; }
.po-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #6d76a8; transition: transform .15s, background .15s; }
.po-set input:checked + .po-sw { background: #241a55; border-color: var(--po-violet); }
.po-set input:checked + .po-sw::after { transform: translateX(19px); background: var(--po-violet); box-shadow: 0 0 10px rgba(167,123,255,.7); }
.po-set input:focus-visible + .po-sw { outline: 2px solid var(--po-accent); outline-offset: 2px; }
.po-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #070920; border: 1px solid var(--po-line); margin: 0 0 12px; }
.po-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: #9aa5d6; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.po-tab[aria-selected="true"] { background: #191d4d; color: #fff; box-shadow: inset 0 0 0 1px rgba(167,123,255,0.5), 0 0 16px rgba(167,123,255,0.18); }
.po-tab:focus-visible { outline: 2px solid var(--po-accent); outline-offset: 1px; }
.po-howto { display: grid; grid-template-columns: 64px 1fr; gap: 10px 12px; align-items: center; margin: 4px 0 6px; }
.po-howto svg { width: 64px; height: 56px; }
.po-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.po-table th, .po-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #171c44; font-variant-numeric: tabular-nums; }
.po-table th:first-child, .po-table td:first-child { text-align: left; }
.po-table thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6d76a8; }
.po-table tbody th { color: #fff; font-weight: 700; }
.po-table td { color: #d4dcff; }

/* the universe maker's tools: a palette and its actions, over the bottom of the board */
.po-edit[hidden] { display: none; }
.po-edit { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; width: min(calc(100% - 12px), 560px); display: flex; flex-direction: column; gap: 6px; }
.po-pal { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; padding: 6px; border-radius: 14px; background: rgba(9,11,32,0.9); border: 1px solid var(--po-line); }
.po-sw2 { width: 38px; height: 38px; border-radius: 10px; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--c); display: grid; place-items: center; color: rgba(0,0,0,.55); touch-action: manipulation; }
.po-sw2 svg { width: 18px; height: 18px; }
.po-sw2[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 14px var(--c); }
.po-sw2.dark { background: #141836; color: #6d76a8; } .po-sw2.gap { background: repeating-linear-gradient(45deg, #05061a 0 4px, #10133a 4px 8px); color: #6d76a8; }
.po-edrow { display: flex; gap: 6px; }
.po-edrow .po-b { flex: 1 1 0; min-height: 42px; padding: 6px 8px; font-size: 13px; background: rgba(9,11,32,0.92); }
.po-edrow .po-b-primary { background: linear-gradient(135deg, #7ad7ff, #a77bff 55%, #ff5ca8); }
.po-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #070920; border: 1px solid var(--po-line); }
.po-seg button { flex: 1 1 0; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: #9aa5d6; font: 700 13px system-ui, sans-serif; cursor: pointer; }
.po-seg button[aria-pressed="true"] { background: #191d4d; color: #fff; box-shadow: inset 0 0 0 1px rgba(167,123,255,.5); }
.po-code { width: 100%; font: 600 12px/1.4 ui-monospace, Menlo, monospace; padding: 8px 10px; border-radius: 10px; border: 1px solid #262d66; background: #04051a; color: #d4dcff; word-break: break-all; }

.po-toast[hidden] { display: none; }
.po-toast { position: absolute; left: 50%; bottom: calc(var(--po-bar) + 10px); transform: translateX(-50%); z-index: 7; padding: 8px 14px; border-radius: 999px; background: #e6e9ff; color: #07051a; font-size: 13px; font-weight: 800; animation: po-rise .2s ease-out; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.po-side .po-toast { bottom: 14px; }
.po-loading[hidden] { display: none; }
.po-loading { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(3,4,12,0.5); color: #d4dcff; font-size: 14px; pointer-events: none; }
.po-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(167,123,255,.2); border-top-color: var(--po-violet); animation: po-rot .9s linear infinite; }
@keyframes po-rot { to { transform: rotate(360deg); } }
.po-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.po-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.po-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .po-help .hint-kb { display: none; } .po-help .hint-touch { display: inline; } }
.stage .po-help { padding: 10px 14px 12px; }

/* narrow phones */
@media (max-width: 560px) { .po-hud { gap: 10px; } }
@media (max-width: 460px) {
  .po-hud { gap: 8px; padding-left: 8px; padding-right: 6px; }
  .po-pz { padding-right: 22px; padding-left: 8px; }
  .po-pz-n { font-size: 16px; }
  .po-stat b { font-size: 19px; }
  .po-moves small { font-size: 11.5px; margin-left: 2px; }
  .po-time b { font-size: 14px; }
  .po-tool { width: 36px; height: 36px; border-radius: 11px; }
  .po-btn { font-size: 10.5px; border-radius: 12px; }
  .po-panel { padding: 18px 14px 14px; }
  .po-stats b { font-size: 15px; }
  .po-cons { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) { .po-time { display: none; } }
@media (max-width: 380px) { #po-sound { display: none; } .po-hubc { min-height: 84px; } }

/* full screen: the sky takes every pixel */
.stage.is-immersive .stage-body > .po { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .po-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .po-help { display: none; }
@media (prefers-reduced-motion: reduce) { .po-panel, .po-toast, .po-coach, .po-overlay, .po-card { animation: none; } .po-tag { animation: none; } .po-moves b { transition: none; } .po-lvl.cur i { animation: none; } }
.po-calm .po-panel, .po-calm .po-toast, .po-calm .po-coach, .po-calm .po-overlay, .po-calm .po-card { animation: none; } .po-calm .po-lvl.cur i { animation: none; }
