/* Rig Explorer HUD: tokens, ring buttons, title strips, back link, corner labels, edge fades.
   Values copied from explorer/sketch-b.html (only change: corner labels 11px, legibility floor).
   Every size is multiplied by --u (index.html sets it from SMUI.layout: 1 on a phone, up to 1.4 on a laptop). */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300;400;500;600&display=swap");

:root{--ice:#d9f3ff;--cy:#45d4ff;--dim:#86b2cb;--hot:#ffab3d;--bg:#02050b;--smui-font:"Barlow Condensed",system-ui,sans-serif}

/* ---- one motion system for the whole HUD (every ui/*.css uses these; index.html and gestures.js may too) ----
   Durations: a press answers within a frame (--m-press); entries are short ease-out; exits shorter; a release or
   anything that follows a finger settles on a calm spring (--e-spring, about 4 % overshoot, no wobble).
   Distances scale with --u. Only transform and opacity move (the leader's draw-in is the one stroke-dashoffset, paint
   only). Every move is a CSS transition on a state class, so it can be reversed mid-way without a jump; keyframes are
   used only for one-shot marks that nothing interrupts (the lock ring, the run picker's lines). No timer drives motion. */
:root{
  --m-press:70ms;--m-release:360ms;--m-exit:150ms;--m-fade:200ms;--m-entry:260ms;--m-draw:220ms;--m-stage:400ms;
  --e-out:cubic-bezier(.16,1,.3,1);--e-exit:cubic-bezier(.4,0,1,1);--e-std:cubic-bezier(.2,0,0,1);
  --e-spring:cubic-bezier(.22,1.12,.36,1);
  --d-rise:calc(4px*var(--u,1));--d-nudge:calc(2px*var(--u,1));
}
@supports (transition-timing-function:linear(0,1)){
  :root{--e-spring:linear(0,.034 1.1%,.141 2.5%,.473 6.1%,.733 9.6%,.893 13.3%,.986 17.6%,1.026 22%,1.037 26.6%,1.03 32.4%,1.011 42.3%,.999 56.5%,1)}
}
/* reduced motion: nothing travels or scales; what changes crossfades, quickly */
@media (prefers-reduced-motion:reduce){
  :root{--m-press:0ms;--m-release:0ms;--m-exit:120ms;--m-fade:120ms;--m-entry:120ms;--m-draw:0ms;--m-stage:160ms;--e-spring:linear;--d-rise:0px;--d-nudge:0px}
}

/* ---- round control (prototype #rb at scale .78; 48 px box centred on the ring, same size on every screen) ---- */
.smui-ring{position:absolute;width:calc(48px*var(--u,1));height:calc(48px*var(--u,1));margin:0;padding:0;border:0;border-radius:50%;background:none;color:var(--ice);font-family:var(--smui-font);cursor:pointer;-webkit-appearance:none;appearance:none;touch-action:none;-webkit-tap-highlight-color:transparent;outline:none}
.smui-ring::after{content:"";position:absolute;left:calc(-22px*var(--u,1));right:calc(-22px*var(--u,1));top:calc(-8px*var(--u,1));bottom:calc(-24px*var(--u,1))}
.smui-ring-svg{position:absolute;left:calc(-6px*var(--u,1));top:calc(-6px*var(--u,1));width:calc(60px*var(--u,1));height:calc(60px*var(--u,1));overflow:visible;pointer-events:none;transform-origin:50% 50%;transition:transform var(--m-release) var(--e-spring)}
/* pressed: set on pointerdown by controls.js (is-pressed), so it shows under the finger in the same frame, not on click;
   it goes in fast and springs back on release */
.smui-ring.is-pressed .smui-ring-svg,.smui-ring:active .smui-ring-svg{transform:scale(.9);transition-duration:var(--m-press);transition-timing-function:var(--e-out);will-change:transform}
.smui-ring.is-pressed .smui-lbl{color:var(--ice)}
.smui-ring::before{content:"";position:absolute;left:calc(-3px*var(--u,1));top:calc(-3px*var(--u,1));width:calc(54px*var(--u,1));height:calc(54px*var(--u,1));box-sizing:border-box;border-radius:50%;border:1.5px solid var(--ice);opacity:0;pointer-events:none}
.smui-ring:focus-visible::before{opacity:.85}
.smui-ring[disabled]{cursor:default;opacity:.4}
/* a mouse: the control answers the pointer (a touch screen never keeps a stuck hover) */
@media (hover:hover) and (pointer:fine){
  .smui-ring:not([disabled]):hover .smui-ring-svg{transform:scale(1.06)}
  .smui-ring:not([disabled]):hover .smui-lbl{color:var(--ice)}
  .smui-ring:not([disabled]).is-pressed .smui-ring-svg,.smui-ring:not([disabled]):active .smui-ring-svg{transform:scale(.9)}
  .smui-back:hover{color:var(--ice)}
}
@media (prefers-reduced-motion:reduce){.smui-ring.is-pressed .smui-ring-svg,.smui-ring:active .smui-ring-svg{transform:none}}
.smui-gc{} /* no glow: the prototype's drop-shadow on the <g> drew only in Chrome, so the laptop looked different from the iPhone (Safari); parity and the calm look win */
.smui-gl{stroke:#eefaff;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}.smui-gl .f{fill:#eefaff;stroke:none}.smui-gl .fs{fill:#eefaff;stroke-width:1.4}

/* ---- corner label (prototype .lbl): standalone, or under a ring (28 px below the ring centre) ---- */
.smui-lbl{position:absolute;width:calc(110px*var(--u,1));margin-left:calc(-55px*var(--u,1));height:calc(12px*var(--u,1));line-height:calc(12px*var(--u,1));text-align:center;font-family:var(--smui-font);font-weight:500;font-size:calc(11px*var(--u,1));letter-spacing:.2em;padding-left:.2em;color:#a9cfe2;text-shadow:0 0 calc(6px*var(--u,1)) #02050b,0 0 calc(12px*var(--u,1)) #02050b;pointer-events:none;white-space:nowrap;box-sizing:border-box}
.smui-lbl.el{width:auto;margin-left:0;padding-left:0;text-align:left}
.smui-lbl.er{width:auto;margin-left:0;padding-left:0;margin-right:-.2em;text-align:right}
.smui-ring .smui-lbl{top:calc(52px*var(--u,1));left:50%}
.smui-ring[data-align="start"] .smui-lbl{left:calc(3px*var(--u,1));width:auto;margin-left:0;padding-left:0;text-align:left}
.smui-ring[data-align="end"] .smui-lbl{left:auto;right:calc(3px*var(--u,1));width:auto;margin-left:0;padding-left:0;margin-right:-.2em;text-align:right}

/* ---- top-left block (prototype .hd): holds the whole-rig strip or the back link; right edge clears the Find ring ---- */
.smui-hd{position:absolute;left:calc(16px*var(--u,1));right:calc(69px*var(--u,1));top:calc(56px*var(--u,1));font-family:var(--smui-font);color:var(--ice)}

/* whole-rig title strip (prototype .hd .strip) */
.smui-strip{--ts:calc(22px*var(--u,1));position:relative;height:calc(30px*var(--u,1));padding:0 calc(14px*var(--u,1)) 0 calc(11px*var(--u,1));display:inline-flex;align-items:center;background:linear-gradient(90deg,rgba(69,212,255,.22),rgba(69,212,255,.05));font-family:var(--smui-font);font-weight:500;font-size:var(--t,var(--ts));letter-spacing:.075em;white-space:nowrap;color:var(--ice);box-sizing:border-box}
.smui-strip::before{content:"";position:absolute;left:0;right:calc(-22px*var(--u,1));top:calc(-4px*var(--u,1));height:1.5px;background:var(--cy);box-shadow:0 0 calc(6px*var(--u,1)) rgba(69,212,255,.6)}
.smui-strip::after{content:"";position:absolute;left:0;top:calc(-6px*var(--u,1));width:calc(34px*var(--u,1));height:calc(3.5px*var(--u,1));background:var(--cy)}

/* back link (prototype .hd .sub): "‹ ASSEMBLY"; the prototype's 40 px line (top 52, centre 72) in a 44 px box with
   the same centre (top 50), so the text sits where it did and the touch target is 44 px */
.smui-back{position:relative;display:flex;align-items:center;gap:calc(7px*var(--u,1));height:calc(44px*var(--u,1));margin:0;padding:0;border:0;background:none;font-family:var(--smui-font);font-weight:500;font-size:calc(13px*var(--u,1));letter-spacing:.2em;color:var(--dim);cursor:pointer;text-shadow:0 0 calc(6px*var(--u,1)) #02050b;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;text-transform:uppercase}
.smui-back::after{content:"";position:absolute;left:calc(-8px*var(--u,1));right:calc(-8px*var(--u,1));top:calc(-2px*var(--u,1));bottom:calc(-2px*var(--u,1))}
.smui-back i{display:inline-block;font-style:normal;color:var(--cy);font-size:calc(17px*var(--u,1));line-height:.8;transition:transform var(--m-release) var(--e-spring)}
/* pressed: the words light, the chevron leans the way it goes */
.smui-back.is-pressed{color:var(--ice)}
.smui-back.is-pressed i{transform:translateX(calc(var(--d-nudge) * -1));transition-duration:var(--m-press);transition-timing-function:var(--e-out)}
/* the piece name on C is its own info control (index.html #piece-info): it answers the press the same way */
#piece-info.is-pressed::after{opacity:.8}
/* the page's text buttons (try again, the notice's action): a step dimmer under the finger */
.pg-retry.is-pressed,.pg-toast-btn.is-pressed{opacity:.65}
.smui-back:focus{outline:none}
.smui-back:focus-visible{outline:1.5px solid var(--ice);outline-offset:calc(2px*var(--u,1));border-radius:calc(2px*var(--u,1))}

/* centred part title (prototype .ttl / .ttl span, heavy centred accent bar); P0 sets top */
.smui-ttl{position:absolute;left:calc(16px*var(--u,1));right:calc(16px*var(--u,1));height:calc(30px*var(--u,1));display:flex;align-items:center;justify-content:center;pointer-events:none;font-family:var(--smui-font)}
.smui-ttl-text{--ts:calc(22px*var(--u,1));position:relative;height:calc(30px*var(--u,1));line-height:calc(30px*var(--u,1));padding:0 calc(16px*var(--u,1)) 0 calc(calc(16px*var(--u,1)) + .09em);font-weight:500;font-size:var(--t,var(--ts));letter-spacing:.09em;white-space:nowrap;color:var(--ice);text-shadow:0 0 calc(6px*var(--u,1)) #02050b;background:linear-gradient(90deg,rgba(69,212,255,0),rgba(69,212,255,.16) 28%,rgba(69,212,255,.16) 72%,rgba(69,212,255,0))}
.smui-ttl-text::before{content:"";position:absolute;left:0;right:0;top:calc(-3px*var(--u,1));height:1.5px;background:linear-gradient(90deg,rgba(69,212,255,0),var(--cy) 28%,var(--cy) 72%,rgba(69,212,255,0))}
.smui-ttl-text::after{content:"";position:absolute;left:50%;top:calc(-5px*var(--u,1));width:calc(34px*var(--u,1));margin-left:calc(-17px*var(--u,1));height:calc(3.5px*var(--u,1));background:var(--cy)}
/* open part (B): 30 px, 40 px tall */
.smui-ttl--open{height:calc(40px*var(--u,1))}
.smui-ttl--open .smui-ttl-text{--ts:calc(30px*var(--u,1));height:calc(40px*var(--u,1));line-height:calc(40px*var(--u,1));padding:0 calc(24px*var(--u,1)) 0 calc(calc(24px*var(--u,1)) + .1em);letter-spacing:.1em}
/* a new part name crossfades in place: words that are about to be read never travel */
@keyframes smui-tin{from{opacity:0}}
.smui-tin{animation:smui-tin var(--m-entry) var(--e-out)}

/* ---- edge fades: dark at top and bottom where text sits, clear in the middle; none on the whole-rig screen ----
   toggle .is-open (B) / .is-apart (C) on one .smui-fade element, or let body[data-screen] pick it */
.smui-fade{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity var(--m-stage) var(--e-std);background:linear-gradient(180deg,rgba(2,5,11,.88) 0,rgba(2,5,11,.6) 9%,rgba(2,5,11,0) 19%),linear-gradient(0deg,rgba(2,5,11,.88) 0,rgba(2,5,11,.6) 12%,rgba(2,5,11,0) 28%)}
.smui-fade.is-open,body[data-screen="open"] .smui-fade{opacity:1;background:linear-gradient(180deg,rgba(2,5,11,.9) 0,rgba(2,5,11,.68) 12%,rgba(2,5,11,.52) 24%,rgba(2,5,11,0) 32%),linear-gradient(0deg,rgba(2,5,11,.9) 0,rgba(2,5,11,.62) 12%,rgba(2,5,11,.3) 24%,rgba(2,5,11,0) 34%)}
.smui-fade.is-apart,body[data-screen="apart"] .smui-fade{opacity:1}

/* reduced motion: arcs paused by controls.js (SMIL), no title fade-in, instant states */
@media (prefers-reduced-motion:reduce){
  .smui-tin{animation:none}
  .smui-ring-svg{transition:none}
}
