/* Courier · Luke Steuber. Paper and ink; color only on a finished board. */
@font-face{font-family:PlexMono;src:url('./fonts/IBMPlexMono-500.woff2') format('woff2');font-weight:500;font-display:swap}
@font-face{font-family:PlexSans;src:url('./fonts/IBMPlexSans-400.woff2') format('woff2');font-weight:400;font-display:swap}
:root{color-scheme:light dark;--paper:#fafafa;--ink:#202020;--muted:#696969;--faint:#b3b3b3;--wash:#e7e7e7;--panel:122px;--size:min(calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 8px),calc(100svh - 148px - var(--panel)),760px)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--paper:#141414;--ink:#ededed;--muted:#aaa;--faint:#676767;--wash:#303030}}
:root[data-theme=dark]{--paper:#141414;--ink:#ededed;--muted:#aaa;--faint:#676767;--wash:#303030}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink)}
body{font:400 1rem/1.5 PlexSans,sans-serif;height:100svh;display:grid;grid-template-rows:60px 1fr 76px;overflow:hidden}
button,select{font:inherit;color:inherit;background:var(--paper);border:1px solid var(--faint);border-radius:0;min-height:44px}
button{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:focus-visible,select:focus-visible,.stage:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
button:disabled{cursor:default;opacity:.35}
header{display:flex;align-items:center;justify-content:center}
#readout{font:500 .8125rem/1.5 PlexMono,monospace;letter-spacing:.04em;font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}
main{margin-left:max(0px,env(safe-area-inset-left));margin-right:max(0px,env(safe-area-inset-right));display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;min-width:0;position:relative}
.stage{position:relative;width:var(--size);height:var(--size);flex-shrink:0;touch-action:manipulation;-webkit-tap-highlight-color:transparent;cursor:pointer}
.stage svg.scene{position:absolute;inset:0;width:100%;height:100%;overflow:visible;color:var(--ink)}
/* The worlds are real buttons for keyboards and screen readers; taps are read from the stage, nearest world wins. */
.world{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;pointer-events:none}
.world:focus-visible{outline:2px solid var(--ink);outline-offset:-4px}
svg .orbit{fill:none;stroke:var(--faint);stroke-width:1}
svg .sun{fill:var(--paper);stroke:var(--ink);stroke-width:1.5}
svg .planet{fill:var(--ink)}
svg .ship{fill:none;stroke:var(--ink);stroke-width:2}
svg .flown{fill:none;stroke:var(--muted);stroke-width:1.5}
svg .arc{fill:none;stroke:var(--ink);stroke-width:2.5;stroke-linecap:round}
svg .ride{fill:none;stroke:var(--ink);stroke-width:2.5;stroke-dasharray:1 7;stroke-linecap:round}
svg .sweep{fill:none;stroke:var(--muted);stroke-width:1.5;stroke-dasharray:3 5}
svg .ghost{fill:var(--paper);stroke:var(--ink);stroke-width:1.5;stroke-dasharray:3 3}
svg .short .arc,svg .short .ride{stroke:var(--muted);stroke-dasharray:6 6}
svg .tether{fill:none;stroke:var(--muted);stroke-width:1}
svg .corner{fill:none;stroke:var(--ink);stroke-width:1.5}
svg .solid{fill:var(--ink);stroke:var(--ink);stroke-width:1.5;stroke-linejoin:miter}
svg .hollow{fill:var(--paper);stroke:var(--ink);stroke-width:1.5}
svg .home{fill:var(--muted);stroke:var(--muted);stroke-width:1.5}
svg .label{font:500 15px/1 PlexMono,monospace;fill:var(--ink);font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--paper);stroke-width:5px;stroke-linejoin:round}
#panel{display:flex;flex-direction:column;align-items:center;width:min(var(--size),360px);height:var(--panel);flex-shrink:0}
#gauge{width:100%;height:auto;max-height:52px;overflow:visible;color:var(--ink);margin-top:6px}
#gauge .cell{fill:var(--ink);stroke:var(--ink);stroke-width:1.2}
#gauge .cell.burn{fill:var(--paper)}
#gauge .cell.spent{fill:none;stroke:var(--faint)}
#gauge .cell.lack{fill:none;stroke:var(--ink);stroke-dasharray:2 2}
#gauge .slash{stroke:var(--ink);stroke-width:1.2}
#gauge .base{stroke:var(--faint);stroke-width:1}
#gauge .wait{stroke:var(--muted);stroke-width:1.5;stroke-dasharray:1 3}
#gauge .leg{stroke:var(--ink);stroke-width:3}
#gauge .leg.try{stroke:var(--muted)}
#gauge .tick{stroke:var(--ink);stroke-width:1.2}
#gauge .par{fill:none;stroke:var(--ink);stroke-width:1.2}
#burn{display:flex;gap:14px;align-items:center;justify-content:center;height:60px}
.box{width:48px;height:48px;padding:11px;border:1px solid var(--ink);background:var(--paper);display:grid;place-items:center}
.box svg,.icon svg{display:block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6}
.box[data-off=true]{visibility:hidden}
.toolbar{display:flex;justify-content:space-between;align-items:center;padding:8px max(16px,calc((100vw - 760px)/2));gap:12px}
.toolbar>div{display:flex;gap:8px}
.icon{width:48px;height:48px;border:0;border-radius:50%;padding:12px;background:transparent}
.icon:hover{background:var(--wash)}
/* One thing on a solved board: the boxed arrow, with a gentle lift. */
.completion{display:flex;justify-content:center;animation:next-in .45s .5s both}
.completion[hidden]{display:none}
#next{outline:1px solid var(--ink);outline-offset:-1px;border-radius:0;background:var(--paper)}
#next:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
@keyframes next-in{from{opacity:0;translate:0 4px}to{opacity:1;translate:0 0}}
#undo.nudge{animation:nudge 1.2s 3}
@keyframes nudge{50%{background:var(--wash);scale:1.12}}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.sheet{color:var(--ink);background:var(--paper);width:min(32rem,calc(100vw - 16px));max-height:calc(100svh - 24px);border:1px solid var(--ink);border-radius:0;padding:0;overflow:auto}
.sheet::backdrop{background:rgb(0 0 0 / .35)}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-bottom:1px solid var(--wash)}
h2{font:500 1rem/1.5 PlexMono,monospace;margin:0}
.sheet-body{padding:12px 24px 20px}
.row{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0}
.row select{max-width:70%;padding:4px 12px}
.sheet p{margin:12px 0;max-width:60ch}
.sheet footer{padding:12px 20px;border-top:1px solid var(--wash);font-size:.75rem;color:var(--muted)}
.note{font-size:.875rem;color:var(--muted)}
/* A sideways phone: the gauge and the burn sit beside the sky. */
@media(max-height:520px) and (min-width:560px){:root{--size:min(calc(100svh - 16px),calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 156px - 216px),760px)}body{grid-template-columns:64px 1fr 80px;grid-template-rows:100svh}header{writing-mode:vertical-rl}main{flex-direction:row;gap:8px}#panel{width:200px;height:auto}.toolbar{flex-direction:column;justify-content:space-between;padding:16px 12px}.toolbar>div{flex-direction:column;gap:4px}.sheet{writing-mode:horizontal-tb}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
:root[data-motion=reduce] *{animation:none!important;transition:none!important}
/* Solved: the route takes Slant's four colors, one a leg, and the sun lights. Never before the last delivery. */
:root{--blue:#1768ff;--yellow:#ffe000;--orange:#ed6500;--pink:#da5cce}
svg .k0{--k:var(--blue)}svg .k1{--k:var(--orange)}svg .k2{--k:var(--pink)}svg .k3{--k:var(--yellow)}
svg .won .flown{stroke:var(--k);stroke-width:4;stroke-linecap:round}
svg .won .home{fill:var(--k);stroke:var(--ink)}
svg .won .sun{fill:var(--yellow)}
svg .won .rise{animation:rise .7s ease-out both;animation-delay:calc(var(--n)*140ms)}
@keyframes rise{from{stroke:var(--muted);stroke-width:1.5}}
@media(forced-colors:active){svg .won .flown{stroke:CanvasText}svg .won .home{fill:CanvasText}svg .won .sun{fill:Canvas}}
/* The page takes color with the route: one of the four that no leg has (courier.js picks it), so no leg sinks
   into the page. A route of four legs or more has them all; there the page still takes one, and the legs of
   that color go to ink. On the yellow page the sun is white. What is written on the page follows: white on
   blue, black on the rest. Settings and Help keep their own paper. */
@property --ink{syntax:'<color>';inherits:true;initial-value:#202020}
@property --paper{syntax:'<color>';inherits:true;initial-value:#fafafa}
@property --muted{syntax:'<color>';inherits:true;initial-value:#696969}
@property --faint{syntax:'<color>';inherits:true;initial-value:#b3b3b3}
@property --wash{syntax:'<color>';inherits:true;initial-value:#e7e7e7}
html[data-field="0"]{--field:var(--blue);--field-ink:#fff}html[data-field="1"]{--field:var(--orange);--field-ink:#000}
html[data-field="2"]{--field:var(--pink);--field-ink:#000}html[data-field="3"]{--field:var(--yellow);--field-ink:#000}
html[data-field],html[data-field] body{background-color:var(--field)}
html[data-field] body>:not(dialog){color:var(--field-ink);--ink:var(--field-ink);--muted:var(--field-ink);--paper:var(--field);--faint:color-mix(in srgb,var(--field-ink) 45%,var(--field));--wash:color-mix(in srgb,var(--field-ink) 14%,var(--field))}
html[data-field][data-finishing],html[data-field][data-finishing] body{transition:background-color .7s ease-out}
html[data-field][data-finishing] body>:not(dialog){transition:color .7s ease-out,--ink .7s ease-out,--paper .7s ease-out,--muted .7s ease-out,--faint .7s ease-out,--wash .7s ease-out}
html[data-field="0"] svg .won .k0,html[data-field="1"] svg .won .k1,html[data-field="2"] svg .won .k2,html[data-field="3"] svg .won .k3{--k:var(--field-ink)}
html[data-field="3"] svg .won .sun{fill:#fff}
@media(forced-colors:active){html[data-field],html[data-field] body{background-color:Canvas}html[data-field] body>:not(dialog){color:CanvasText;--ink:CanvasText;--muted:CanvasText;--paper:Canvas;--faint:GrayText;--wash:Canvas}}
