/* void-hud polish: restrained cyan instrumentation around a miniature battlefield. */
#game-shell { background: linear-gradient(180deg, #111b23 0, var(--color-canvas) 130px); }
.topbar { border-bottom: 1px solid #b4e5ef0a; }
.brand-mark { letter-spacing: -3px; padding-right: 3px; }
.topbar nav button { transition: color 160ms, background-color 160ms, border-color 160ms; }
.topbar nav button:hover { color: var(--color-primary); background: #22d3ee0c; }
#battle-stage { border: 1px solid #3d647344; }
#battle-hud { padding-top: 5px; }
.base-readout { position: relative; }
.base-readout > span { font-family: var(--font-mono); letter-spacing: .5px; }
.base-readout i { height: 5px; background: #26353f; }
.base-readout em { background: linear-gradient(90deg, #178ea7, #88f4f2); }
.base-readout.enemy em { background: linear-gradient(90deg, #e0574e, #ffc29a); }
.time-readout b { letter-spacing: 2px; }
.time-readout small { color: #829eab; letter-spacing: 1px; }
#intro {
  isolation: isolate;
  background: linear-gradient(90deg, #08141afc 0%, #08141ae6 30%, #08141a66 65%, #08141a18 100%);
}
#intro::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #08141af7 0%, #08141ae0 30%, #08141a77 65%, #08141a44), url('../assets/battlefield.png') center/cover;
  opacity: 1;
}
#intro::after {
  content: ''; position: absolute; right: 6%; top: 16%; width: 44%; height: 64%; z-index: -1;
  border: 1px solid #6fe9ee24; border-radius: 50%; transform: rotate(-18deg);
  background: radial-gradient(ellipse, #42c8cf16, transparent 68%);
  pointer-events: none;
}
.intro-copy { animation: content-arrive 650ms 80ms both; }
#game-title { text-shadow: 0 8px 28px #06131b88; }
#hero-art { filter: drop-shadow(12px 20px 12px #03101480); animation: hero-arrive 850ms 100ms both; }
.intro-stamp { letter-spacing: 1px; }
.start-button { position: relative; overflow: hidden; transition: background-color 160ms, transform 160ms; }
.start-button::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 25%, #ffffff60 48%, transparent 70%); transform: translateX(-120%); }
.start-button:hover::before { animation: button-glint 600ms ease-out; }
#command-deck { position: relative; background: linear-gradient(180deg, #15212b 0, #0c1117 100%); border-top-color: #426778; }
#command-deck::before { content: ''; position: absolute; top: -1px; left: 24px; width: 56px; height: 2px; background: var(--color-primary); }
.deck-status { margin-bottom: 10px; }
.energy { align-items: center; }
.energy strong { text-shadow: 0 0 15px #22d3ee33; }
#energy-cells i { position: relative; background: #233741; overflow: hidden; border-radius: 1px; }
#energy-cells i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #22c5da, #9df5ed); transform: scaleX(var(--fill, 0)); transform-origin: left; transition: transform 90ms linear; }
#energy-cells i.full, #energy-cells i.partial { background: #233741; }
#energy-cells i.full::after { animation: energy-ready 360ms ease-out; }
.next-card { display: flex; align-items: center; gap: 6px; }
.next-card canvas { width: 31px; height: 31px; border-bottom: 1px solid #648693; background: #293e4a66; }
.next-card b { display: inline-block; margin-left: 3px; }
.unit-card {
  --card-accent: #8bcddd;
  background: radial-gradient(ellipse at 80% 30%, #a3e3e51c, transparent 65%), linear-gradient(135deg, #263b49, #14222b 75%);
  border: 1px solid #435d6d; border-top: 2px solid var(--card-accent);
  transition: transform 180ms cubic-bezier(.2,.8,.3,1), border-color 160ms, background-color 160ms;
}
.unit-card[data-card='bomber'] { --card-accent: #ffc071; background-color: #312a23; }
.unit-card[data-card='medic'] { --card-accent: #8be6b9; }
.unit-card[data-card='runner'] { --card-accent: #d8bbf5; }
.unit-card[data-card='mech'] { --card-accent: #8ee3eb; }
.unit-card::before { content: ''; position: absolute; inset: 6px; border: 1px solid #97dae80b; pointer-events: none; }
.unit-card::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--color-primary); opacity: 0; pointer-events: none; transition: opacity 180ms; }
.unit-card canvas { transition: transform 200ms cubic-bezier(.2,.8,.3,1), opacity 160ms; transform-origin: center bottom; filter: drop-shadow(0 4px 3px #03121b99); }
.unit-card .cost { color: #c0f7fb; font-size: 21px; text-shadow: 0 2px 4px #06141b; }
.unit-card .card-meta { margin: 0 -8px -6px; left: 8px; right: 8px; padding: 16px 8px 8px; background: linear-gradient(0deg, #0a1827 65%, #0a182700); }
.unit-card .card-meta small { color: #a0bac7; }
.unit-card.selected { transform: translateY(-5px); border-color: var(--color-primary); background-color: #20444f; }
.unit-card.selected::after { opacity: 1; }
.unit-card.selected canvas { transform: translateY(-3px) scale(1.04); }
.unit-card.unavailable { border-color: #314752; border-top-color: #54707a; }
.unit-card.unavailable.selected { border-color: var(--color-primary); }
.unit-card.card-enter { animation: card-arrive 310ms cubic-bezier(.2,.8,.3,1) both; }
.tactic { overflow: hidden; border-color: #334b5a; background: linear-gradient(160deg, #20313f, #121d28); transition: transform 180ms, border-color 160ms; }
.tactic .tactic-icon { width: 30px; height: 30px; line-height: 0; color: #bfd8e2; }
.tactic .tactic-icon svg { display: block; width: 100%; height: 100%; }
.tactic[data-card='airstrike'] .tactic-icon { color: #ffca8d; }
.tactic[data-card='heal'] .tactic-icon { color: #97e7bb; }
.tactic[data-card='focus'] .tactic-icon { color: #e4cba1; }
.tactic::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--color-primary); transform: scaleX(var(--cooldown-left, 0)); transform-origin: left; transition: transform 90ms linear; }
.tactic .cooldown { background: #0b1622b8; text-shadow: 0 2px 8px #000; font-size: 21px; }
.tactic.selected { border-color: var(--color-primary); }
#selection-info, #inspector { border-left: 3px solid var(--color-primary); box-shadow: 0 4px 16px #04131a66; }
#notice { border-top: 1px solid #bfd6df1c; border-bottom: 1px solid #bfd6df1c; letter-spacing: .3px; }
#modal { border-top: 2px solid var(--color-primary); background: radial-gradient(ellipse at 100% 0, #1d3f4a55, transparent 65%), var(--color-surface); box-shadow: 0 24px 70px #0008; }
#modal[open] { animation: modal-arrive 280ms cubic-bezier(.2,.8,.3,1) both; }
#modal[data-kind='result'] .result-title { animation: content-arrive 350ms 80ms both; }
.stars { display: flex; gap: 8px; }
.stars span { display: inline-block; animation: star-arrive 450ms cubic-bezier(.2,.8,.3,1) both; animation-delay: calc(160ms + var(--star) * 110ms); }
.upgrade-choice { transition: transform 160ms, background-color 160ms, border-color 160ms; }
.upgrade-choice:hover { transform: translateX(3px); border-color: var(--color-primary); background: #18303a; }
body[data-paused='true'] #command-deck * { animation-play-state: paused; }
@media (hover: hover) {
  .unit-card:not(.selected):hover { transform: translateY(-3px); border-color: #8cb9c8; }
  .unit-card:hover canvas { transform: translateY(-2px) scale(1.03); }
  .tactic:hover { border-color: #8cb9c8; }
}
@keyframes content-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-arrive { from { opacity: 0; transform: translate(18px, 12px); } to { opacity: 1; transform: translate(0, 0); } }
@keyframes card-arrive { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes modal-arrive { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes star-arrive { from { opacity: 0; transform: translateY(6px) scale(.7); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes button-glint { to { transform: translateX(120%); } }
@keyframes energy-ready { 40% { opacity: .5; } }
@media (max-width: 600px) {
  #battle-stage { border-left: 0; border-right: 0; }
  #intro { background: linear-gradient(0deg, #08141afa 0%, #08141af0 35%, #08141a88 66%, #08141a11 100%); }
  #intro::before { background: linear-gradient(0deg, #08141aff 0%, #08141aee 35%, #08141a88 66%, #08141a33), url('../assets/battlefield.png') center/cover; }
  #intro::after { right: 8%; top: 3%; width: 75%; height: 48%; }
  #command-deck::before { left: 8px; width: 40px; }
  .deck-status { margin-bottom: 7px; }
  .unit-card .cost { font-size: 17px; }
  .unit-card .card-meta { margin: 0 -5px -3px; left: 5px; right: 5px; padding: 12px 5px 5px; }
  .unit-card.selected { transform: translateY(-3px); }
  .tactic .tactic-icon { width: 19px; height: 19px; flex-shrink: 0; }
  .tactic .cooldown { font-size: 16px; }
  .next-card { gap: 4px; }
  .next-card canvas { width: 24px; height: 24px; }
  .next-card b { margin-left: 1px; }
  #hero-art { height: 48%; top: 1%; filter: drop-shadow(5px 10px 8px #03101466); }
}
@media (max-width: 360px) { .next-card canvas { display: none; } .tactic .tactic-icon { width: 17px; height: 17px; } }
@media (max-height: 800px) and (min-width: 601px) {
  .intro-copy { padding: 24px 48px; max-width: 520px; }
  #game-title { font-size: clamp(58px, 7vw, 88px); margin: 18px 0; }
  .intro-tagline { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html[data-motion='reduce'] *, html[data-motion='reduce'] *::before, html[data-motion='reduce'] *::after { animation: none !important; transition: none !important; }

/* Numbers are readable before recruitment and share the combat definitions. */
.unit-card { height: 131px; }
.unit-card .squad-size { position: absolute; top: 7px; right: 6px; padding: 2px 5px; background: #081722d9; color: #c4dce5; font: 10px var(--font-mono); }
.unit-card .card-meta { bottom: 29px; }
.card-numbers { position: absolute; bottom: 0; left: 0; right: 0; height: 25px; display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 0 8px; background: #08131de8; border-top: 1px solid #38546377; font: 10px var(--font-mono); color: #a8c1ca; }
.card-numbers > span { white-space: nowrap; }
.card-numbers b { font-size: 12px; font-weight: 600; color: #e3f7f7; }
.card-numbers > span:first-child b { color: #a7e9d1; }
.tactic { gap: 5px; }
.tactic-value { color: #e5d8b9; font: 11px var(--font-mono); white-space: nowrap; }
.tactic[data-card='heal'] .tactic-value { color: #a7e9d1; }
.base-readout b { font-size: 15px; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px 12px; margin: 0; }
.stat-grid > div { min-width: 0; }
.stat-grid dt { color: #a2b9c5; font-size: 10px; line-height: 1.5; white-space: nowrap; }
.stat-grid dd { margin: 1px 0 0; font: 600 12px/1.4 var(--font-mono); color: #edf8f9; font-variant-numeric: tabular-nums; white-space: nowrap; }
#selection-info { width: 700px; display: grid; gap: 7px; padding: 10px 14px; bottom: 8px; background: #09141bf5; }
.stat-heading { display: flex; align-items: center; gap: 12px; padding-right: 30px; min-height: 22px; }
#selection-info #selection-context { color: #9eb9c5; font-size: 10px; }
#selection-info #selection-hint { padding-top: 6px; border-top: 1px solid #40617066; color: #b6dae2; font-size: 10px; }
#cancel-selection { position: absolute; right: 0; top: 0; }
#inspector { width: 460px; max-width: calc(100% - 16px); display: grid; gap: 9px; padding: 12px; bottom: 8px; right: 8px; }
#inspect-label { padding-right: 28px; color: #c3edf2; }
#inspect-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
#inspect-stats > div:first-child { grid-column: span 2; }
#upgrade-preview { font-size: 10px; color: #c8dab4; line-height: 1.6; margin: 0; }
#upgrade-tower { justify-self: end; }
#close-inspector { position: absolute; top: 0; right: 0; border: 0; background: transparent; }
.roster-caption { color: #a8c8d1 !important; font-size: 12px !important; }
.roster article { display: block; padding: 12px; background: #09172099; }
.roster-identity { display: flex; gap: 9px; align-items: center; margin-bottom: 10px; }
.roster-identity > div { min-width: 0; }
.roster-identity small { display: block; color: #9fbac6; font-size: 10px; margin: 5px 0; }
.roster .roster-identity canvas { width: 51px; height: 60px; flex-shrink: 0; }
.roster .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); padding-top: 9px; border-top: 1px solid #38546366; }
.roster-icon { display: grid; place-items: center; width: 51px; flex-shrink: 0; color: #9fdae5; }
.roster-icon svg { width: 34px; height: 34px; }
@media (max-width: 900px) and (min-width: 601px) {
  #tactics { flex: .8; }
  .card-numbers { padding: 0 5px; font-size: 9px; }
  .card-numbers b { font-size: 11px; }
}
@media (max-width: 600px) {
  .unit-card { height: 108px; }
  .unit-card .card-meta { bottom: 27px; padding-top: 9px; }
  .unit-card .squad-size { top: 5px; right: 3px; padding: 2px 3px; font-size: 9px; }
  .card-numbers { height: 24px; padding: 0 5px; font-size: 9px; }
  .card-numbers b { font-size: 11px; }
  .base-readout > span { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 9px; }
  .base-readout.enemy > span { align-items: flex-end; }
  .base-readout b { font-size: 12px; letter-spacing: .2px; }
  .base-readout i { margin-top: 4px; }
  .tactic { min-height: 57px; gap: 2px 4px; display: grid; grid-template-columns: 20px 1fr; align-content: center; padding: 5px; }
  .tactic .tactic-icon { grid-column: 1; grid-row: 1; }
  .tactic b { grid-column: 2; grid-row: 1; font-size: 10px; }
  .tactic .tactic-cost { grid-column: 1; grid-row: 2; font-size: 9px; }
  .tactic .tactic-value { grid-column: 2; grid-row: 2; font-size: 9px; }
  #selection-info { padding: 7px 9px; max-width: calc(100% - 12px); gap: 5px; bottom: 5px; }
  .stat-heading { gap: 8px; }
  #selection-stats { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px 7px; }
  .stat-grid dt { font-size: 9px; }
  .stat-grid dd { font-size: 11px; }
  #selection-info #selection-hint { padding-top: 4px; }
  #inspector { gap: 7px; padding: 9px; font-size: 11px; }
  .roster article { padding: 10px; }
}
@media (max-width: 360px) {
  .card-numbers { padding: 0 3px; gap: 2px; }
  .card-numbers b { font-size: 10px; }
  .tactic { grid-template-columns: 16px 1fr; gap: 2px; padding: 4px 2px; }
  .tactic .tactic-value { font-size: 8px; }
  #selection-info #selection-context { font-size: 9px; }
}
