/* The control plane is shallow; its raised instruments retain full hit areas. */
:root {
  --hud-material-graphite:rgba(25,28,32,.67);
  --hud-material-smoke:rgba(33,37,42,.74);
  --hud-material-alloy:rgba(25,27,30,.98);
  --energy-color:#f1d16d;
  --energy-highlight:#fff0ad;
  --energy-spent:rgba(233,200,117,.18);
  --energy-shadow:#b58b2c;
}
.run-hud[data-run-hud] {
  --hud-shelf-face-height:74px;
  --hud-shelf-material:var(--hud-material-graphite);
  --hud-shelf-line:rgba(196,210,219,.52);
  --hud-shelf-blur:14px;
  background:none; border:0; box-shadow:none; backdrop-filter:none;
  -webkit-backdrop-filter:none; overflow:visible;
}
.run-hud[data-hud-surface="smoke"] { --hud-shelf-material:var(--hud-material-smoke); --hud-shelf-line:rgba(196,204,210,.32); --hud-shelf-blur:10px; }
.run-hud[data-hud-surface="alloy"] { --hud-shelf-material:var(--hud-material-alloy); --hud-shelf-line:rgba(190,199,205,.42); --hud-shelf-blur:0px; }
.run-hud[data-run-hud]:before,.run-hud[data-run-hud]:after { content:none; }
.hud-shelf-plane {
  position:absolute; left:0; right:0; bottom:0;
  height:calc(var(--hud-shelf-face-height) + var(--safe-bottom));
  z-index:-1; pointer-events:none; background-color:var(--hud-shelf-material);
  background-image:radial-gradient(circle at 1px 1px,#dbeef045 .65px,transparent .9px),linear-gradient(180deg,#d7e8f124,transparent 23px);
  background-size:12px 12px,100% 100%;
  backdrop-filter:blur(var(--hud-shelf-blur)); -webkit-backdrop-filter:blur(var(--hud-shelf-blur));
  clip-path:polygon(0 20px,5% 16.2px,10% 12.8px,15% 9.8px,20% 7.2px,25% 5px,30% 3.2px,35% 1.8px,40% .8px,45% .2px,50% 0,55% .2px,60% .8px,65% 1.8px,70% 3.2px,75% 5px,80% 7.2px,85% 9.8px,90% 12.8px,95% 16.2px,100% 20px,100% 100%,0 100%);
}
.hud-shelf-edge { position:absolute; top:0; left:0; width:100%; height:40px; fill:none; pointer-events:none; }
.hud-shelf-edge path { stroke:var(--hud-shelf-line); stroke-width:1; vector-effect:non-scaling-stroke; filter:drop-shadow(0 2px 0 #a8b9c22b) drop-shadow(0 3px 4px #02060abb); }
.run-hud[data-hud-detail="quiet"] .hud-shelf-plane { background-image:none; }
.run-hud[data-run-hud] .run-hud-inner { display:block; position:relative; padding:0; height:var(--run-hud-height); }
.run-hud[data-run-hud] .run-player {
  --commander-portrait-size:84px; position:absolute; left:50%; right:auto; top:auto;
  bottom:6px; width:84px; height:98px; transform:translateX(-50%);
  grid-column:auto; margin:0; padding:0;
}
.run-hud[data-run-hud] .run-player:active { transform:translateX(-50%); }
.run-hud[data-run-hud] .run-player-portrait { width:84px; height:84px; flex-basis:84px; }
.run-hud[data-run-hud] .run-player-info { top:62px; }
.run-hud[data-run-hud] .run-deck {
  position:absolute; left:auto; right:2px; top:auto; bottom:0;
  width:64px; height:96px; padding:0; border:0; background:none;
  grid-column:auto; justify-self:auto; transition:none;
}
.run-hud[data-run-hud] .run-deck-stack { top:4px; right:0; width:56px; height:82px; transform:rotate(8deg); transition:transform .14s ease; }
.run-hud[data-run-hud] .run-deck-count { left:-1px; right:auto; top:46px; min-width:25px; height:25px; }
.run-hud[data-run-hud] .run-deck:hover .run-deck-stack { transform:rotate(4deg) translateY(-3px); }
.run-hud[data-run-hud] .run-favor { position:absolute; left:18px; top:auto; bottom:32px; align-self:auto; font-size:18px; gap:7px; }
.run-hud[data-run-hud] .run-favor .icon { width:16px; height:16px; }
@media(min-width:600px) { .run-hud[data-run-hud] .run-favor .icon { width:18px; height:18px; } }
.run-hud[data-run-hud] .run-progression { position:absolute; left:18px; bottom:12px; display:flex; align-items:center; gap:7px; width:82px; height:16px; color:#b8c7ce; pointer-events:none; }
.run-progress-level { display:flex; align-items:baseline; gap:3px; font:500 14px/1 var(--font-ui,sans-serif); font-variant-numeric:tabular-nums; }
.run-progress-level small { font-size:9px; letter-spacing:.04em; color:#8e9da5; }
.run-progress-level b { font:inherit; }
.run-progress-gauge { display:block; position:relative; width:46px; height:5px; background:repeating-linear-gradient(90deg,#71838b4d 0 4px,transparent 4px 6px); }
.run-progress-gauge i { position:absolute; inset:0 auto 0 0; height:100%; background:#a7cbdc; mask-image:repeating-linear-gradient(90deg,#000 0 4px,transparent 4px 6px); -webkit-mask-image:repeating-linear-gradient(90deg,#000 0 4px,transparent 4px 6px); transition:width .18s ease; }
.run-hud[data-run-hud] .run-battle-piles { position:absolute; left:8px; top:auto; bottom:11px; width:92px; align-items:center; gap:4px; }
.run-hud[data-run-hud] :is(.run-pile,.run-history) {
  position:relative; display:grid; place-items:center; width:44px; min-width:44px;
  height:44px; min-height:44px; padding:0; color:#bac7ce; border:0; border-radius:0;
  background:none; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none;
  cursor:pointer; touch-action:manipulation;
}
.run-hud[data-run-hud] :is(.run-pile,.run-history) .icon { width:21px; height:21px; }
.run-hud[data-run-hud] .run-end-turn {
  position:absolute; left:auto; right:72px; top:auto; bottom:10px;
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:3px;
  width:44px; height:44px; min-width:44px; min-height:44px; padding:0;
  border:0!important; border-radius:0; background:none!important; box-shadow:none!important;
  backdrop-filter:none; -webkit-backdrop-filter:none; color:#8eabb8!important;
  font:500 11px/1 var(--font-ui,sans-serif); letter-spacing:.07em;
  text-transform:uppercase; transition:color .1s ease,opacity .1s ease;
}
.run-hud[data-run-hud] .run-end-turn .icon { width:20px; height:20px; }
.run-hud[data-run-hud] .run-end-turn:after { content:none; display:none; }
.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):before {
  content:""; position:absolute; inset:0; opacity:0; pointer-events:none;
  transform:scale(1.06); transition:opacity .12s ease,transform .12s ease;
  background:linear-gradient(#b8e7fa,#b8e7fa) left top/8px 1px no-repeat,linear-gradient(#b8e7fa,#b8e7fa) left top/1px 8px no-repeat,linear-gradient(#b8e7fa,#b8e7fa) right bottom/8px 1px no-repeat,linear-gradient(#b8e7fa,#b8e7fa) right bottom/1px 8px no-repeat;
}
.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):not(:disabled):is(:hover,:focus-visible,:active,.is-open):before { opacity:.85; transform:none; }
.run-hud[data-run-hud] .run-end-turn.is-suggested:not(:disabled) { color:#e2f5ff!important; text-shadow:0 0 12px #9ddcff55; }
.run-hud[data-run-hud] .run-end-turn.is-suggested:not(:disabled):before { opacity:.7; transform:none; }
.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):not(:disabled):is(:hover,:focus-visible,:active,.is-activated) { color:#d8f2ff!important; background:none!important; }
.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):focus-visible { outline:1px solid #b8e7fa; outline-offset:2px; }
.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):disabled { opacity:.35; cursor:default; }
.run-hud[data-run-hud] .run-energy { position:absolute; inset:-10px; display:block; pointer-events:none; }
.energy-ring { display:block; width:100%; height:100%; overflow:visible; fill:none; pointer-events:none; filter:drop-shadow(0 1px 1px #06111be6); }
.energy-ring-segment { fill:none; stroke:var(--energy-spent); stroke-width:3.6; stroke-linecap:butt; vector-effect:non-scaling-stroke; }
.energy-ring-segment.is-filled { stroke:var(--energy-color); filter:drop-shadow(0 0 2px #e9c8753d); }
.energy-ring-segment.is-locked { visibility:hidden; }
.energy-ring-segment.is-preview { stroke:var(--energy-highlight); stroke-width:5; stroke-opacity:1; }
.energy-ring.is-shortfall .is-preview { stroke:var(--energy-shadow); stroke-opacity:1; }
.energy-ring-segment.is-spending { animation:energy-spend .32s ease-out both; }
.energy-ring.is-insufficient .energy-ring-segment:not(.is-locked) { animation:energy-insufficient .38s ease-out both; }
@keyframes energy-spend { from { stroke:var(--energy-highlight); filter:drop-shadow(0 0 4px #fff0ad66); } to { stroke:var(--energy-spent); filter:none; } }
@keyframes energy-insufficient { 30% { stroke:var(--energy-highlight); filter:drop-shadow(0 0 6px #fff0ad99); } }
.run-hud[data-run-hud] .run-deck,.run-hud[data-run-hud] .run-end-turn { animation-delay:0s; }
.run-hud[data-run-hud].is-battle .run-deck { animation:none; }
.run-hud[data-run-hud][data-turn="enemy"] .run-end-turn .icon { opacity:.7; }
.run-hud[data-run-hud] [hidden] { display:none!important; }
@media(min-width:600px) {
  .run-hud[data-run-hud] { --hud-shelf-face-height:82px; }
  .run-hud[data-run-hud] .run-player { --commander-portrait-size:96px; width:96px; height:110px; bottom:8px; }
  .run-hud[data-run-hud] .run-player-portrait { width:96px; height:96px; flex-basis:96px; }
  .run-hud[data-run-hud] .run-player-info { top:74px; }
  .run-hud[data-run-hud] .run-deck { right:12px; width:76px; height:111px; }
  .run-hud[data-run-hud] .run-deck-stack { width:66px; height:96px; }
  .run-hud[data-run-hud] .run-deck-count { top:54px; }
  .run-hud[data-run-hud] .run-end-turn { right:100px; bottom:14px; width:48px; height:48px; }
  .run-hud[data-run-hud] .run-favor { left:25px; bottom:36px; font-size:20px; }
  .run-hud[data-run-hud] .run-progression { left:25px; bottom:16px; }
  .run-hud[data-run-hud] .run-battle-piles { left:18px; bottom:15px; }
}
@media(max-width:359px) {
  .run-hud[data-run-hud] .run-end-turn { bottom:0; }
}
@media(prefers-reduced-motion:reduce) {
  .run-hud[data-run-hud] .run-deck-stack,.run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):before { transition:none; }
  .energy-ring-segment { animation:none!important; }
  .energy-ring.is-insufficient .energy-ring-segment:not(.is-locked) { stroke:var(--energy-highlight); filter:none; }
}
.reduce-motion .run-hud[data-run-hud] .run-deck-stack,.reduce-motion .run-hud[data-run-hud] :is(.run-pile,.run-history,.run-end-turn):before { transition:none; }
.reduce-motion .energy-ring-segment { animation:none!important; }
.reduce-motion .energy-ring.is-insufficient .energy-ring-segment:not(.is-locked) { stroke:var(--energy-highlight); filter:none; }
