/* Puzzle Box: Constellations, a window onto the night sky. Luke Steuber.
   Stars, ticks, threads, dotted routes, handles and marks from constellations/style.css. Always night: white ink on a
   black ground with square corners, whatever the cabinet's theme. The cabinet's accent marks only the step Hint will
   play; the solved figure stays white. No haze, glow, blur or twinkle. */
.bx-constellations{--cn-ink:#fff;--cn-sub:#a6a6a6;--cn-route:#6b6b6b;color-scheme:dark}
.bx-constellations .night{position:relative;flex:none;display:flex;align-items:center;justify-content:center;background:#000;border-radius:0;color:var(--cn-ink);overflow:hidden;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bx-constellations .board{position:relative;flex:none;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.bx-constellations .threads{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1}
.bx-constellations .stars{position:absolute;inset:0;pointer-events:none}
.bx-constellations .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;padding:0;margin:0}

/* Threads: one white line per thread, two parallel lines for a double. A group whose every star has its need is
   full white; unfinished groups are gray. */
.bx-constellations .thread{fill:none;stroke:var(--cn-sub);stroke-width:var(--thread,2px);stroke-linecap:round;transition:stroke .3s ease}
.bx-constellations .thread.complete{stroke:var(--cn-ink)}
.bx-constellations .thread.crossing{stroke-dasharray:5 4}
.bx-constellations .thread.pending{stroke:var(--cn-ink);stroke-dasharray:4 4;transition:none}
.bx-constellations .thread.pending.removing{stroke:var(--cn-sub);stroke-dasharray:1 5}
.bx-constellations .thread.leaving{opacity:.3;transition:none}
.bx-constellations .thread.hint-line{stroke:var(--accent,#d2451e);stroke-dasharray:7 5;transition:none}
.bx-constellations .lock-mark{fill:none;stroke:var(--cn-sub);stroke-width:var(--thread,2px);stroke-linecap:round;transition:stroke .3s ease}
.bx-constellations .lock-mark.complete{stroke:var(--cn-ink)}
.bx-constellations .cross-mark{fill:none;stroke:var(--cn-ink);stroke-width:2px;stroke-linecap:round}

/* Routes: a faint dotted line for every possible join, with a handle that shows the count by shape: an open ring
   for none, one dot, two dots across the doubled line. A route crossing a thread is blocked: a small cross. */
.bx-constellations .route{fill:none;stroke:var(--cn-route);stroke-width:var(--dot,1.6px);stroke-linecap:round;stroke-dasharray:0 var(--dash,6px)}
.bx-constellations .route.lit{stroke:var(--cn-sub)}
.bx-constellations .route.blocked{opacity:.55}
.bx-constellations .handle{stroke-width:1.5px;stroke-linecap:round}
.bx-constellations .handle.open{fill:#000;stroke:var(--cn-sub)}
.bx-constellations .handle.open.lit{stroke:var(--cn-ink)}
.bx-constellations .handle.one,.bx-constellations .handle.two{fill:var(--cn-sub);stroke:none;transition:fill .3s ease}
.bx-constellations .handle.complete{fill:var(--cn-ink)}
.bx-constellations .handle.blocked{fill:none;stroke:var(--cn-route)}

/* A star: a solid disc and one tick for every thread it still needs. Marks around it are shapes: a tight ring for
   too many threads, a wide ring when chosen, dashed for a hint, short dashes for a refusal, a square for keyboard focus. */
.bx-constellations .star{position:absolute;width:var(--target);height:var(--target);margin:calc(var(--target)/-2) 0 0 calc(var(--target)/-2);border:0;padding:0;background:none;pointer-events:auto;z-index:2;touch-action:none;color:var(--cn-ink);cursor:pointer}
.bx-constellations .star:focus-visible{outline:none}
.bx-constellations .star svg{width:100%;height:100%;overflow:visible;display:block}
.bx-constellations .star .disc{fill:var(--cn-ink);transform-box:fill-box;transform-origin:center;transition:transform .2s ease}
.bx-constellations .star .tick{stroke:var(--cn-ink);stroke-width:var(--tick,1.75px);stroke-linecap:round}
.bx-constellations .star .tick.spent{display:none}
.bx-constellations .star .over-ring,.bx-constellations .star .state-ring,.bx-constellations .star .focus-mark{fill:none;stroke:var(--cn-ink);display:none}
.bx-constellations .star .over-ring{stroke-width:2px;transform-box:fill-box;transform-origin:center}
.bx-constellations .star.overfull .over-ring{display:inline;animation:bx-constellations-over .45s ease-out 2}
.bx-constellations .star.overfull .disc{transform:scale(.45)}
@keyframes bx-constellations-over{from{transform:scale(1.9);opacity:0}to{transform:none;opacity:1}}
.bx-constellations .star .state-ring{stroke-width:2px}
.bx-constellations .star.selected .state-ring{display:inline}
.bx-constellations .star.hint-target .state-ring{display:inline;stroke:var(--accent,#d2451e);stroke-dasharray:6 4}
.bx-constellations .star.refused .state-ring{display:inline;stroke:var(--cn-ink);stroke-dasharray:2 3}
.bx-constellations .star .focus-mark{stroke-width:2px}
.bx-constellations.keys .star:focus .focus-mark{display:inline}

/* The solve: the figure stands in white, the stars ignore input, and no marks remain. */
.bx-constellations.solved .star{pointer-events:none;cursor:default}
.bx-constellations.solved .state-ring,.bx-constellations.solved .over-ring,.bx-constellations.solved .focus-mark{display:none}
.bx-constellations.unlocking .thread{transition:none}

@media(prefers-reduced-motion:reduce){.bx-constellations *{animation:none!important;transition:none!important}}
:root[data-motion=reduce] .bx-constellations *{animation:none!important;transition:none!important}
@media(forced-colors:active){
 .bx-constellations{--cn-ink:CanvasText;--cn-sub:CanvasText;--cn-route:GrayText}
 .bx-constellations .night{background:Canvas}
 .bx-constellations .star svg,.bx-constellations .threads{forced-color-adjust:none}
 .bx-constellations .handle.open{fill:Canvas}
 .bx-constellations .thread.hint-line,.bx-constellations .star.hint-target .state-ring{stroke:Highlight}
 .bx-constellations.keys .star:focus .focus-mark{stroke:Highlight}
}
/* In space, while the view is turned or settling back to Earth, the routes are there to look at, not to play. */
.bx-constellations.peeking .handle,.bx-constellations.peeking .route{opacity:.4}
