/* Aegis Flora · Sanctum Command Interface & Tactical HUD */
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  #btnWave, #topbar #btnWave.btn-wave-heroic { animation: none; transition: none; }
  #btnWave .btn-wave-art, #topbar #btnWave.btn-wave-heroic .btn-wave-art { transition: none; }
  #btnWave:hover .btn-wave-art, #topbar #btnWave.btn-wave-heroic:hover .btn-wave-art { transform: none; }
  #control-sidebar { transition: none; }
  #topbar .stat .stat-bg { transition: none; }
}
:root {
  --hud-gold: #dfbf78;
  --hud-gold-bright: #ffe19c;
  --hud-muted: #8faea4;
  --hud-teal: #80e8bd;
  --hud-cyan: #86eaf0;
  --hud-pink: #ff72aa;
  --hud-amber: #f0a840;
  --field-ink: #06171a;
  --field-line: rgba(223, 191, 120, 0.32);
  --field-side: 219px;
  --field-dock: 192px;
  --font-display: Georgia, 'Cinzel', serif;
  --font-stats: 'Courier New', 'Roboto Mono', ui-monospace, monospace;
}

/* ==========================================================================
   1. Canvas, Scenery & Ambient Overlays
   ========================================================================== */
#game-container canvas { filter: saturate(1.12) contrast(1.06); }
#combat-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 11; }

.letterbox { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 8; transition: height .9s cubic-bezier(.6,0,.3,1); pointer-events: none; }
#letterbox-top { top: 0; }
#letterbox-bottom { bottom: 0; }
body.director #letterbox-top, body.director #letterbox-bottom { height: 7vh; }

#filmgrain {
  position: fixed; inset: -100px; z-index: 8; pointer-events: none; opacity: .05;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="300" height="300" filter="url(%23n)"/></svg>');
  animation: filmgrain 1.1s steps(4) infinite;
}
@keyframes filmgrain {
  0% { transform: translate(0,0); } 25% { transform: translate(-30px,20px); }
  50% { transform: translate(20px,-25px); } 75% { transform: translate(-15px,-10px); }
  100% { transform: translate(0,0); }
}

/* ==========================================================================
   2. GTA Cinematic Solarpunk Loading Screen
   ========================================================================== */
#loading-screen {
  position: fixed; inset: 0; z-index: 99999;
  background: #09171b; color: #f0e5cf;
  overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.85s;
}
#loading-screen.fade-out {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.gta-backdrop-layer {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
}
.gta-bg-img {
  position: absolute; inset: -4%; width: 108%; height: 108%;
  background-size: cover; background-position: center;
  transition: opacity 1.2s ease-in-out, transform 5s cubic-bezier(0.2, 0.8, 0.3, 1);
  transform: scale(1.0); opacity: 0;
}
.gta-bg-img.active {
  opacity: 1; transform: scale(1.06) translate(-1%, -1%);
}
.gta-bg-img.prev {
  opacity: 0; transform: scale(1.1);
}
.gta-vignette {
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(circle at center, transparent 38%, rgba(5,13,16,0.68) 78%, rgba(3,9,11,0.95) 100%),
              linear-gradient(180deg, rgba(8,18,22,0.85) 0%, transparent 22%, transparent 68%, rgba(6,14,17,0.95) 100%);
  pointer-events: none;
}
.gta-scanlines {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0.16;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.4) 4px);
}
.gta-hud-top {
  position: relative; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 34px 44px;
}
.gta-logo-group {
  display: flex; align-items: center; gap: 14px;
}
.gta-logo-mark { width: 27px; height: 32px; color: #fff; flex: 0 0 auto; filter: drop-shadow(0 2px 7px rgba(0,0,0,.8)); }
.gta-title-main {
  font-family: var(--font-serif); font-size: 22px; font-weight: 800; letter-spacing: 3px; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
}
.gta-subtitle {
  font-family: var(--font-stats); font-size: 10px; font-weight: 700; letter-spacing: 2px; color: #dfbf78;
  margin-top: 3px; text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.gta-tactical-coords {
  text-align: right; font-family: var(--font-stats); font-size: 10px; letter-spacing: 1.5px;
  color: #9eb5aa; text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.gta-hud-bottom {
  position: relative; z-index: 10; display: flex; justify-content: space-between; align-items: flex-end;
  padding: 38px 44px; gap: 36px;
}
.gta-mission-intel {
  max-width: 620px;
}
.gta-intel-tag {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-stats); font-size: 10px;
  font-weight: 800; letter-spacing: 2px; color: #dfbf78; text-transform: uppercase; margin-bottom: 8px;
}
.gta-intel-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #00f5d4;
  box-shadow: 0 0 8px #00f5d4;
}
.gta-intel-head {
  font-family: var(--font-serif); font-size: 34px; font-weight: 800; letter-spacing: 1px; color: #fff;
  line-height: 1.15; margin-bottom: 8px; text-shadow: 0 2px 16px rgba(0,0,0,0.95);
}
.gta-intel-body {
  font-size: 13.5px; line-height: 1.5; color: #d0ded6; text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  max-width: 540px; margin-bottom: 12px;
}
.gta-intel-spec {
  display: inline-block; font-family: var(--font-stats); font-size: 9.5px; letter-spacing: 1.2px;
  color: #a4c4b6; padding: 4px 10px; background: rgba(9,27,33,0.7); border: 1px solid rgba(223,191,120,0.3);
  border-radius: 3px; backdrop-filter: blur(6px);
}
.gta-progress-wrap {
  width: 380px; flex-shrink: 0; text-align: right;
}
.gta-bar-meta {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px;
  font-family: var(--font-stats); font-size: 10px; letter-spacing: 1.5px; color: #dfbf78;
}
.gta-bar-track {
  width: 100%; height: 6px; background: rgba(4,18,22,0.85); border: 1px solid rgba(223,191,120,0.35);
  border-radius: 2px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}
.gta-bar-fill {
  width: 0%; height: 100%; background: linear-gradient(90deg, #dfbf78, #00f5d4);
  box-shadow: 0 0 10px rgba(0,245,212,0.6); transition: width 0.15s ease-out;
}
.gta-skip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px;
  padding: 8px 16px; border-radius: 4px; border: 1px solid rgba(246,219,155,.8);
  background: linear-gradient(170deg,rgba(240,211,146,.32),rgba(20,44,43,.92));
  box-shadow: inset 0 1px rgba(255,244,205,.32), 0 3px 12px rgba(0,0,0,.48);
  color: #fff2d2; font: 800 10px var(--font-stats); letter-spacing: 1.9px;
  text-shadow: 0 1px #0b1617; cursor: pointer; transition: background .2s,border-color .2s,transform .2s;
}
.gta-skip:hover { border-color: #fff0be; background: linear-gradient(170deg,rgba(251,230,180,.43),rgba(33,60,58,.94)); transform: translateY(-2px); }
.gta-skip:focus-visible { outline: 2px solid #fff2cf; outline-offset: 3px; }
.gta-skip span { font-size: 17px; line-height: 1; }
.gta-continue-prompt {
  margin-top: 11px; font-family: var(--font-stats); font-size: 9px; font-weight: 800;
  letter-spacing: 1.3px; color: #e7cf9c; animation: gtablink 1.4s infinite;
}
@keyframes gtablink { 50% { opacity: 0.35; } }

@media (max-width: 768px) {
  .gta-hud-top { padding: 20px 24px; }
  .gta-hud-bottom { padding: 24px; flex-direction: column; align-items: flex-start; gap: 20px; }
  .gta-intel-head { font-size: 26px; }
  .gta-progress-box { width: 100%; min-width: 0; text-align: left; }
}

/* ==========================================================================
   3. Top Command Bar (#topbar)
   ========================================================================== */
#topbar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; height: 68px; padding: 8px 24px;
  background: linear-gradient(180deg, rgba(6, 24, 28, 0.72) 0%, rgba(4, 18, 22, 0.58) 100%);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 0; border-bottom: 1px solid rgba(223, 191, 120, 0.22);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  position: fixed; top: 0; left: 0; right: 0; z-index: 15;
}
#topbar::after { display: none; }

.topbar-left {
  display: flex; align-items: center; justify-self: start; min-width: 0;
}
.topbar-left .brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.topbar-left .brand:hover { opacity: 0.9; transform: translateY(-1px); }
.topbar-left .brand-mark {
  width: 26px; height: 31px; color: #fff; flex: 0 0 auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}
.topbar-left .brand-title {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 3.5px;
  color: #ffffff; text-transform: uppercase; font-weight: 400;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* Middle Resource Cards: Full Bleed Visual Art Modules */
#topbar .resource-group {
  display: flex; align-items: stretch; gap: 8px; width: auto; height: 50px;
  justify-self: center; background: none; border: 0; box-shadow: none; backdrop-filter: none;
}
#topbar .stat {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex: 0 0 152px; width: 152px; align-items: center; justify-content: center;
  height: 100%; padding: 0 12px; border-radius: 4px;
  border: 1px solid rgba(223, 191, 120, 0.45);
  background: #09252a;
  box-shadow: inset 0 1px rgba(255, 240, 200, 0.12), 0 6px 16px rgba(0,0,0,0.35);
  transition: all 0.18s ease; cursor: default;
}
#topbar .stat::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(4,19,23,.2) 0%, rgba(4,19,23,.75) 55%, rgba(3,14,18,.96) 100%);
  pointer-events: none;
}
#topbar .stat::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; z-index: 3;
}
#topbar .stat.lives::after { background: #ff6b8b; box-shadow: 0 0 8px rgba(255,107,139,0.7); }
#topbar .stat.cash::after { background: #dfbf78; box-shadow: 0 0 8px rgba(223,191,120,0.7); }
#topbar .stat.mana::after { background: #7fe4ff; box-shadow: 0 0 8px rgba(127,228,255,0.7); }

#topbar .stat .stat-bg {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: saturate(.85) contrast(1.05) brightness(.9);
  transition: transform 0.35s ease;
}
#topbar .stat:hover .stat-bg { transform: scale(1.06); }
#topbar .stat:hover {
  border-color: #ffe19c; box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 10px rgba(223,191,120,0.25);
  transform: translateY(-1px);
}
#topbar .stat .stat-content {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
#topbar .stat small {
  display: inline-flex; align-items: center; gap: 5px;
  color: #c4ded5; font-family: var(--font-display); font-size: 9px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; text-shadow: 0 1px 4px #071419;
}
#topbar .resource-icon.svg-icon {
  width: 12px; height: 12px; margin: 0; flex-shrink: 0;
  filter: drop-shadow(0 0 4px currentColor);
}
#topbar .lives .resource-icon { color: #ff6b8b; }
#topbar .cash .resource-icon { color: #ffd873; }
#topbar .mana .resource-icon { color: #7fe4ff; }
#topbar .stat-value { display: flex; margin: 0; align-items: baseline; gap: 2px; }
#topbar .stat b {
  font-family: var(--font-stats); font-size: 15.5px; font-weight: 800;
  letter-spacing: 0.5px; color: #fffdf5; text-shadow: 0 1px 5px rgba(0,0,0,0.9);
}
#topbar .stat-unit { font-family: var(--font-stats); font-size: 9px; font-weight: 600; color: #9bb5ad; text-shadow: 0 1px 3px #071419; }
#topbar .stat-meter {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 4;
  background: rgba(0,0,0,0.4); overflow: hidden;
}
#topbar .stat-meter i { display: block; height: 100%; transition: width 0.2s ease; }
#healthFill { background: linear-gradient(90deg, #ff4d6d, #ff758f); box-shadow: 0 0 6px #ff4d6d; }
#manaFill { background: linear-gradient(90deg, #00b4d8, #7fe4ff); box-shadow: 0 0 6px #7fe4ff; }

.topbar-right {
  display: flex; align-items: center; gap: 12px; justify-self: end;
}

/* Wave status chip: compact WAVE / PHASE / SCORE readout in the top bar.
   Replaces the removed #field-panel overlay; the primary wave counter lives here. */
.wave-chip {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border: 1px solid rgba(223, 191, 120, 0.3); border-radius: 5px;
  background: rgba(12, 34, 38, 0.85); box-shadow: inset 0 1px rgba(255,255,255,0.08);
  font: 700 10px var(--font-stats); letter-spacing: 1px; color: #8faea4;
  white-space: nowrap;
}
.wave-chip-wave { color: #8faea4; }
.wave-chip-wave b, .wave-chip-score b { color: #fff6df; font-size: 12px; letter-spacing: 0.5px; }
.wave-chip-phase { color: #dfbf78; }
.wave-chip-score b { color: #ffe19c; }

/* Start Wave Button: Spacebar-shaped keycap overlay hovering above the bottom HUD.
   Only pops up when the next wave is available (build phase) or at game start. */
#topbar .command-group { display: flex; align-items: center; gap: 8px; width: auto; }
#btnWave,
#topbar #btnWave.btn-wave-heroic {
  position: fixed;
  left: 50%;
  bottom: calc(var(--field-dock, 192px) + 26px);
  transform: translateX(-50%) translateY(0) scale(1);
  z-index: 45;
  height: 42px;
  min-width: 280px;
  max-width: 380px;
  padding: 0 20px;
  font: 800 11px/1 var(--font-stats);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff6df;
  background-color: rgba(6, 22, 26, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 232, 160, 0.95);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(223, 191, 120, 0.4),
    0 4px 20px rgba(0, 0, 0, 0.65),
    0 0 22px rgba(220, 156, 45, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
  animation: waveGlow 3.2s infinite ease-in-out;
}
#btnWave::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(223, 191, 120, 0.35);
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}
.btn-wave-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('assets/aegis_master.jpg') center 32% / cover no-repeat;
  filter: saturate(1.05) contrast(1.05);
  opacity: 0.32;
  transition: transform 0.35s ease, filter 0.2s ease, opacity 0.2s ease;
}
.btn-wave-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 20, 22, 0.25) 0%, rgba(6, 20, 22, 0.65) 60%, rgba(10, 40, 38, 0.92) 100%);
}
.btn-wave-content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
@keyframes waveGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(223, 191, 120, 0.4),
      0 4px 20px rgba(0, 0, 0, 0.65),
      0 0 18px rgba(220, 156, 45, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      inset 0 -2px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 232, 160, 0.9);
  }
  50% {
    box-shadow:
      0 0 0 1.5px rgba(255, 230, 150, 0.7),
      0 6px 28px rgba(0, 0, 0, 0.75),
      0 0 28px rgba(235, 165, 40, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.45),
      inset 0 -2px 0 rgba(0, 0, 0, 0.5);
    border-color: #ffffff;
  }
}
.btn-wave-icon {
  font-size: 11px;
  color: #ffe6a3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}
.btn-wave-label {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  color: #fff6df;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.6);
}
.btn-kbd {
  font: 900 9px var(--font-stats);
  letter-spacing: 1px;
  background: rgba(14, 34, 38, 0.95);
  color: #ffe6a3;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(223, 191, 120, 0.7);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#btnWave:hover,
#topbar #btnWave.btn-wave-heroic:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.01);
  border-color: #ffffff;
  background-color: rgba(9, 32, 38, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 230, 150, 0.7),
    0 8px 30px rgba(0, 0, 0, 0.75),
    0 0 32px rgba(235, 165, 40, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5);
}
#btnWave:hover .btn-wave-art,
#topbar #btnWave.btn-wave-heroic:hover .btn-wave-art {
  transform: scale(1.06);
  filter: saturate(1.2) brightness(1.1);
  opacity: 0.45;
}
#btnWave:hover .btn-kbd,
#topbar #btnWave.btn-wave-heroic:hover .btn-kbd {
  background: #11282c;
  border-color: #ffd873;
  color: #ffffff;
}
#btnWave:active,
#topbar #btnWave.btn-wave-heroic:active {
  transform: translateX(-50%) translateY(1px) scale(0.99);
}
#btnWave:focus-visible,
#topbar #btnWave.btn-wave-heroic:focus-visible {
  outline: 2px solid #00F5D4;
  outline-offset: 3px;
}
#btnWave:disabled,
#btnWave.is-hidden,
#topbar #btnWave:disabled {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(18px) scale(0.92) !important;
  box-shadow: none !important;
  animation: none !important;
}
#btnWave:disabled .btn-kbd,
#topbar #btnWave:disabled .btn-kbd {
  opacity: 0.4;
}
.sidebar-toggle { flex: 0 0 auto; }

/* Field Controls Sidebar: floating right-side glass-metal HUD panel.
   Narrow and translucent; collapses so it never blocks battlefield clicks. */
#control-sidebar {
  position: fixed; top: 78px; right: 14px; z-index: 30; width: 212px;
  max-height: calc(100vh - 78px - var(--field-dock, 220px) - 16px);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 10px; padding: 12px;
  border: 1px solid rgba(223, 191, 120, 0.4); border-radius: 8px;
  background: linear-gradient(165deg, rgba(16,44,50,0.92) 0%, rgba(6,24,28,0.94) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 12px 32px rgba(0,0,0,0.55), 0 0 18px rgba(0,245,212,0.07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, opacity 0.25s ease;
  scrollbar-width: thin; scrollbar-color: rgba(223,191,120,0.4) transparent;
}
#control-sidebar.collapsed { transform: translateX(calc(100% + 20px)); opacity: 0; pointer-events: none; }
#control-sidebar .sb-heading {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; border-bottom: 1px solid rgba(223, 191, 120, 0.25);
  color: #dfbf78; font: 800 10px var(--font-stats); letter-spacing: 1.5px;
}
#control-sidebar .sb-heading i { width: 6px; height: 6px; border-radius: 50%; background: #00F5D4; box-shadow: 0 0 6px #00F5D4; }
#control-sidebar .sb-group { display: flex; flex-direction: column; gap: 6px; }
#control-sidebar .sb-group-title { color: #80e8bd; font: 700 8.5px var(--font-stats); letter-spacing: 1.2px; }
#control-sidebar .tp-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 4px 8px;
  border: 1px solid rgba(223, 191, 120, 0.25); border-radius: 4px;
  color: #e8eee8; background: rgba(255,255,255,0.04); font: 700 10px var(--font-stats);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#control-sidebar .tp-btn.square { width: 32px; height: 32px; padding: 0; justify-content: center; }
#control-sidebar .sb-group[data-group="interface"] { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#control-sidebar .sb-group[data-group="interface"] .sb-group-title,
#control-sidebar .sb-group[data-group="interface"] #btnAudio,
#control-sidebar .sb-group[data-group="interface"] #btnClaudeRadio,
#control-sidebar .sb-group[data-group="interface"] #btnPad,
#control-sidebar .sb-group[data-group="interface"] .sb-keys { grid-column: 1 / -1; }
#control-sidebar .tp-btn:hover { background: rgba(223, 191, 120, 0.16); border-color: #dfbf78; color: #fff; }
#control-sidebar .tp-btn:focus-visible { outline: 2px solid #00F5D4; outline-offset: 1px; }
#control-sidebar .tp-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#control-sidebar .tp-btn .btn-icon { color: #ffe6a3; }
#control-sidebar .tp-btn kbd, #control-sidebar .sb-keys kbd {
  margin-left: auto; font: 900 8px var(--font-stats);
  background: rgba(14, 30, 33, 0.9); color: #ffe6a3;
  padding: 2px 5px; border-radius: 3px; border: 1px solid rgba(223, 191, 120, 0.5); line-height: 1;
}
#control-sidebar .sb-keys { display: flex; flex-direction: column; gap: 3px; }
#control-sidebar .sb-keys > div { display: flex; align-items: center; gap: 6px; color: #a8c4bd; font: 700 9.5px var(--font-stats); }
#control-sidebar .sb-keys > div > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#control-sidebar .sb-keys kbd { margin-left: 0; flex: 0 0 auto; }
#control-sidebar .sb-help > div > span:first-child { color: #d6e3dc; }
#control-sidebar #cam-mode, #control-sidebar #gfx-mode {
  display: flex; align-items: center; gap: 6px; width: 100%;
  min-height: 28px; padding: 5px 8px; border: 1px solid rgba(223, 191, 120, 0.2); border-radius: 3px;
  background: rgba(255,255,255,0.03); color: #a8c4bd; font: 700 9px var(--font-stats);
  white-space: nowrap; overflow: hidden; cursor: pointer;
}
#control-sidebar #cam-mode .dot, #control-sidebar #gfx-mode .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #80e8bd; box-shadow: 0 0 6px #80e8bd; flex: 0 0 auto;
}
#control-sidebar .cam-hint, #control-sidebar .gfx-sub { display: none; }

/* Claude FM Radio Tuner Popover */
#claude-fm-popover {
  position: fixed; top: 68px; right: 18px; z-index: 1150; width: 290px;
  padding: 16px 18px; border-radius: 8px;
  background: linear-gradient(160deg, #13272c 0%, #081a1e 75%, #041014 100%);
  border: 1px solid rgba(223, 191, 120, 0.45);
  box-shadow: inset 0 1px 0 rgba(255,243,204,0.15), 0 18px 48px rgba(0,0,0,0.85);
  color: #efe6cf; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.claude-fm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.claude-fm-title { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-size: 12px; font-weight: 700; color: #ffe19c; letter-spacing: 1px; }
.claude-fm-live-badge { font: 800 9px var(--font-stats); color: #80e8bd; background: rgba(128,232,189,0.15); border: 1px solid rgba(128,232,189,0.3); padding: 1px 5px; border-radius: 3px; }
.claude-fm-close { background: none; border: none; color: #94aca4; font-size: 15px; cursor: pointer; padding: 2px 6px; }
.claude-fm-close:hover { color: #fff; }

/* ==========================================================================
   4. Bottom Tactical Dock (#drawer): Radar, Arsenal & Abilities
   (Removed overlays: #field-panel and #threat-announcement were deleted in the
   HUD polish pass. The wave counter lives in the topbar .wave-chip.)
   ========================================================================== */
#drawer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px;
  width: min(1280px, calc(100vw - 32px)); height: var(--field-dock); z-index: 10;
  display: flex; justify-content: center; background: none; border: 0; outline: 0; box-shadow: none;
}
#drawer .dock-content {
  display: flex; align-items: stretch; justify-content: center; gap: 14px;
  width: 100%; height: 100%; min-width: 0;
}

/* Radar Panel (Left Wing) */
#drawer .radar-panel {
  flex: 0 0 248px; width: 248px; min-width: 0; display: flex; flex-direction: column;
}
#drawer .dock-heading {
  height: 22px; display: flex; align-items: center; gap: 6px;
  font: 800 9px var(--font-stats); color: #dfbf78; letter-spacing: 1.4px; white-space: nowrap;
}
#drawer .heading-mark { width: 7px; height: 7px; border: 1px solid #dfbf78; transform: rotate(45deg); flex: none; }
#drawer .heading-end { margin-left: auto; color: #7f9b94; font-size: 8px; font-weight: 500; letter-spacing: 1px; }

#drawer .radar-panel #minimap-wrap {
  width: 100%; height: auto; aspect-ratio: 36 / 20; flex: 1 1 auto;
  border: 1px solid rgba(223, 191, 120, 0.45); border-radius: 4px;
  background: #061719; box-shadow: inset 0 1px rgba(255, 240, 200, 0.12), 0 7px 18px rgba(0,0,0,0.35);
  overflow: hidden; position: relative;
}
#drawer .radar-panel #minimap { width: 100%; height: 100%; display: block; }
#drawer .radar-key { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: #9eb5aa; font: 700 8px var(--font-stats); letter-spacing: 0.8px; }
.radar-pip { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; }
.radar-pip.entry { background: #dfbf78; }
.radar-pip.core { background: #80e8bd; }

/* Arsenal Panel & Tower Cards (Center Stage) */
#drawer .arsenal-panel {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 0;
}
#drawer .arsenal-panel .dock-heading { width: 100%; }
#drawer #build-grid {
  display: grid; grid-template-columns: repeat(4, 154px); gap: 10px; height: calc(100% - 22px); min-width: 0;
}
#drawer #build-grid.five-cards {
  grid-template-columns: repeat(5, 140px); gap: 8px;
}

#drawer .card {
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; height: 100%; padding: 0; border: 1px solid rgba(223, 191, 120, 0.45); border-radius: 4px;
  background: #09252a; box-shadow: inset 0 1px rgba(255, 240, 200, 0.12), 0 8px 20px rgba(0,0,0,0.4);
  cursor: pointer; overflow: hidden; transition: all 0.18s ease; text-align: left;
}
#drawer .card::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(4,19,23,.05) 0%, rgba(4,19,23,.12) 30%, rgba(4,19,23,.78) 60%, rgba(3,14,18,.98) 100%);
}
#drawer .card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--tower-accent, #dfbf78); opacity: .75; z-index: 3;
}
#card_gun { --tower-accent: #dfbf78; }
#card_rocket { --tower-accent: #ff8566; }
#card_beam { --tower-accent: #80e8bd; }
#card_slow { --tower-accent: #c4a4f0; }
#card_blocker { --tower-accent: #e5a752; }

#drawer .card .card-thumb {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  filter: saturate(.85) contrast(1.05) brightness(.92);
}
#drawer .card .card-body {
  position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; min-width: 0; height: 100%; padding: 0 12px 10px;
}
#drawer .card-category { font: 800 8px var(--font-stats); letter-spacing: 1px; color: var(--tower-accent, #dfbf78); text-transform: uppercase; text-shadow: 0 1px 4px #071419; }
#drawer .card .nm { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; color: #fff6e5; text-shadow: 0 1px 5px rgba(0,0,0,.8); line-height: 1.15; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#drawer .card .ds { display: none; }
#drawer .card-spec { font-size: 9px; color: #a4c4b6; text-shadow: 0 1px 4px #071419; line-height: 1.2; letter-spacing: 0.4px; }
#drawer .card .card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
#drawer .card .cost { font: 700 12.5px var(--font-stats); color: #ffe19c; text-shadow: 0 1px 5px #071419; }
#drawer .card .key { font: 900 9.5px var(--font-stats); border: 1px solid rgba(223, 191, 120, 0.5); background: rgba(5,23,27,.8); color: #ffe19c; padding: 1px 5px; border-radius: 2px; }

#drawer .card:hover { transform: translateY(-4px); border-color: #ffe19c; box-shadow: 0 0 0 1px rgba(223,191,120,.4), 0 14px 26px rgba(0,0,0,.45); }
#drawer .card.sel { border-color: var(--tower-accent); box-shadow: 0 0 0 1px var(--tower-accent), 0 8px 24px rgba(0,0,0,.5); }
#drawer .card.cant { opacity: 0.5; filter: saturate(0.5); cursor: not-allowed; }

/* Abilities Panel (Right Wing) */
#drawer .abilities-panel {
  flex: 0 0 248px; width: 248px; min-width: 0; display: flex; flex-direction: column;
  position: static !important; transform: none !important;
}
.abilities-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 8px; height: calc(100% - 22px); min-width: 0;
}
.ability-card {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; height: 100%; min-height: 0; border-radius: 4px;
  background: #09252a;
  border: 1px solid rgba(223, 191, 120, 0.45);
  box-shadow: inset 0 1px rgba(255, 245, 205, 0.12), 0 6px 16px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; transition: all 0.18s ease; padding: 0; outline: none;
}
.ability-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,19,23,.18) 0%, rgba(4,19,23,.38) 45%, rgba(3,14,18,.92) 100%);
}
.ability-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--ab-accent, #dfbf78); opacity: .85; z-index: 3;
}
.glyph-card { --ab-accent: #4de89b; }
.upgrade-all-card { --ab-accent: #ffc44d; }
.root-card, #btnRoot { --ab-accent: #80e8bd; }
.flare-card, #btnFlare { --ab-accent: #ff8533; }

.ability-card .ab-bg {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: saturate(.88) contrast(1.05) brightness(.72);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.ability-card:hover:not(:disabled) .ab-bg {
  transform: scale(1.06);
  filter: saturate(1.1) contrast(1.1) brightness(.9);
}
.ability-card .ab-content {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 4px 6px; pointer-events: none;
}
.ability-card:hover:not(:disabled) {
  transform: translateY(-2px); border-color: #ffe19c;
  box-shadow: 0 0 0 1px rgba(223,191,120,.4), 0 10px 22px rgba(0,0,0,0.55);
}
.ability-card .ab-icon {
  font-size: 18px; line-height: 1; margin: 0 0 2px; color: #fff6e5;
  text-shadow: 0 0 10px var(--ab-accent, rgba(223,191,120,0.8)), 0 2px 4px rgba(0,0,0,0.9);
}
.ability-card .ab-name {
  font: 800 9px var(--font-stats); letter-spacing: 0.6px; text-transform: uppercase;
  color: #fff6e5; text-shadow: 0 1px 4px #071419, 0 0 8px rgba(0,0,0,0.8);
}
.ability-card .ab-cost {
  position: absolute; top: 3px; right: 4px; z-index: 3;
  font: 800 8px var(--font-stats);
  background: rgba(8, 26, 30, 0.88); border: 1px solid rgba(223, 191, 120, 0.6);
  color: #ffe19c; padding: 1px 4px; border-radius: 2px;
  text-shadow: 0 1px 3px #000;
  backdrop-filter: blur(4px);
}
.ability-card .ab-key {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); z-index: 3;
  font: 900 8.5px var(--font-stats); background: #dfbf78; color: #081a1e;
  padding: 0 5px; border-radius: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}
.ability-card:disabled, .ability-card.unusable {
  opacity: 0.42; filter: grayscale(0.7) brightness(0.65);
  cursor: not-allowed; transform: none !important;
  box-shadow: none !important;
}
.ability-card.ready-root {
  border-color: #80e8bd;
  box-shadow: 0 0 14px rgba(128, 232, 189, 0.5);
}
.ability-card.ready-flare {
  border-color: #ffd873;
  box-shadow: 0 0 14px rgba(255, 216, 115, 0.55);
}

/* ==========================================================================
   6. Unit Inspector (#inspect) & Modals
   ========================================================================== */
#inspect {
  position: fixed; right: max(18px, calc(50% - 632px)); bottom: calc(var(--field-dock) + 24px); z-index: 30;
  width: 320px; max-width: calc(100vw - 32px); padding: 14px 16px; border-radius: 6px;
  background: rgba(8, 26, 30, 0.96); border: 1px solid rgba(223, 191, 120, 0.5); border-top: 3px solid #dfbf78;
  box-shadow: 0 18px 42px rgba(0,0,0,.55); color: #efe6cf; backdrop-filter: blur(10px);
}
.inspect-close-btn {
  background: transparent; border: 1px solid rgba(223, 191, 120, 0.35);
  color: #c4b58e; border-radius: 3px; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; margin-left: auto; flex-shrink: 0;
}
.inspect-close-btn:hover { background: rgba(220, 80, 80, 0.25); border-color: #ff6b6b; color: #fff; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--field-dock) + 96px); transform: translateX(-50%); z-index: 70;
  background: rgba(10, 28, 32, 0.96); border: 1px solid #dfbf78; border-radius: 4px;
  color: #fff4d8; padding: 9px 22px; font: 700 12px var(--font-stats); box-shadow: 0 8px 24px rgba(0,0,0,.6);
  pointer-events: none;
}

#bosshp {
  position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 13;
  width: min(580px, 54vw); display: none; pointer-events: none;
  background: rgba(8,18,22,0.92); border: 1px solid #ff4466; border-radius: 4px; padding: 6px 12px 8px;
  box-shadow: 0 0 20px rgba(255,68,102,0.4);
}

#wavebanner {
  position: fixed; top: 120px; left: 50%; transform: translateX(-50%) translateY(-10px);
  width: min(520px, calc(100vw - 40px)); z-index: 1000; pointer-events: none;
  text-align: center; opacity: 0; transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(180deg, rgba(8, 26, 30, 0.95), rgba(4, 16, 20, 0.92));
  border: 1px solid rgba(223, 191, 120, 0.45); border-radius: 8px;
  padding: 12px 24px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.2), 0 12px 36px rgba(0,0,0,0.65);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#wavebanner.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#glyphShop {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 60;
  width: min(1050px, calc(100vw - 34px)); max-height: min(820px, calc(100vh - 92px)); overflow: auto;
  border: 1px solid rgba(223, 191, 120, 0.72); border-top: 3px solid #dfbf78;
  border-radius: 10px; background: radial-gradient(circle at 50% -20%, rgba(48,100,87,.3), transparent 48%), linear-gradient(155deg, rgba(12, 36, 40, .99), rgba(5, 18, 22, .99));
  color: #f3ead4; box-shadow: 0 0 0 100vmax rgba(2,10,12,.78), 0 30px 90px rgba(0,0,0,.85), inset 0 1px rgba(255,255,255,.1); backdrop-filter: blur(18px);
}
.glyph-shop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 26px 16px; border-bottom: 1px solid rgba(223,191,120,.18); }
#glyphShop .glyph-kicker { display: block; margin-bottom: 4px; color: #75dac1; font: 700 9px var(--font-stats); letter-spacing: 2.2px; }
#glyphShop h3 { margin: 0 0 4px; font: normal 27px var(--font-display); letter-spacing: .7px; color: #ffe19c; }
#glyphShop p { margin: 0; color: #a9beb7; font-size: 10.5px; line-height: 1.4; }
.glyph-close-x { border: 0; background: transparent; color: #859f98; font: 300 27px/1 sans-serif; cursor: pointer; }
.glyph-close-x:hover { color: #ffe19c; }
.glyph-ledger { display: flex; align-items: stretch; gap: 1px; margin: 14px 26px 0; overflow: hidden; border: 1px solid rgba(101,216,190,.22); border-radius: 6px; background: rgba(0,0,0,.22); }
.glyph-ledger > span { display: flex; flex-direction: column; justify-content: center; min-width: 160px; padding: 10px 14px; border-right: 1px solid rgba(101,216,190,.15); }
.glyph-ledger small { color: #779991; font: 700 8px var(--font-stats); letter-spacing: 1.2px; }
.glyph-ledger b { color: #70f0d4; font: 700 17px var(--font-stats); }
.glyph-ledger .glyph-ledger-note { flex: 1; align-items: flex-end; color: #829c95; font: 9px var(--font-stats); text-transform: uppercase; letter-spacing: .7px; }
.glyph-lock-banner { margin: 10px 26px 0; padding: 7px 10px; border-left: 3px solid #ff8057; background: rgba(255,107,53,.13); color: #ffad8d; font: 10px var(--font-stats); }
.glyph-tree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 18px 20px; }
.glyph-branch { --branch:#dfbf78; position: relative; overflow: hidden; border: 1px solid rgba(223,191,120,.2); border-radius: 8px; background: linear-gradient(180deg, rgba(15,46,48,.8), rgba(4,19,23,.86)); }
.glyph-branch-forge { --branch:#f0b86b; }
.glyph-branch-grove { --branch:#65d397; }
.glyph-branch-solar { --branch:#6ccde8; }
.glyph-branch::before { content:""; position:absolute; inset:0; pointer-events:none; background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--branch) 15%, transparent), transparent 35%); }
.glyph-branch-head { position: relative; display: flex; align-items: center; gap: 9px; padding: 13px 14px 12px; border-bottom: 1px solid color-mix(in srgb, var(--branch) 26%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--branch) 9%, transparent), transparent); }
.glyph-branch-sigil { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--branch) 55%, transparent); border-radius: 50%; color: var(--branch); font-size: 17px; box-shadow: 0 0 16px color-mix(in srgb, var(--branch) 16%, transparent); }
.glyph-branch-head h4 { margin: 0 0 2px; color: #f7ecd3; font: 16px var(--font-display); }
.glyph-branch-head p { color: #77958d !important; font-size: 8.5px !important; text-transform: uppercase; letter-spacing: .5px; }
.glyph-branch-head strong { margin-left: auto; color: var(--branch); font: 700 16px var(--font-stats); }
.glyph-branch-head strong small { font-size: 7px; color: #78958d; }
.glyph-path { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 16px 12px 18px; }
.glyph-path::before { content:""; position:absolute; top:12px; bottom:20px; left:31px; width:2px; background: linear-gradient(var(--branch), rgba(99,145,132,.12)); opacity:.34; }
.glyph-node { position: relative; min-height: 103px; padding: 10px 10px 9px 55px; border: 1px solid rgba(126,157,146,.22); border-radius: 7px; background: linear-gradient(130deg, rgba(20,45,45,.98), rgba(7,25,29,.98)); box-shadow: 0 7px 18px rgba(0,0,0,.22); transition: border-color .18s, transform .18s, box-shadow .18s; }
.glyph-node:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--branch) 48%, transparent); }
.glyph-node.locked { filter: saturate(.45); opacity: .58; }
.glyph-node.invested, .glyph-node.maxed { border-color: color-mix(in srgb, var(--branch) 58%, transparent); box-shadow: inset 0 0 24px color-mix(in srgb, var(--branch) 7%, transparent), 0 8px 20px rgba(0,0,0,.28); }
.glyph-node.capstone { margin-top: 7px; border-width: 2px; background: radial-gradient(circle at 0 0, color-mix(in srgb, var(--branch) 15%, transparent), transparent 55%), rgba(5,23,27,.98); }
.glyph-node.capstone::before { content:"CAPSTONE"; position:absolute; right:8px; top:7px; color:var(--branch); font:700 6.5px var(--font-stats); letter-spacing:1.3px; }
.glyph-node-top { display: flex; align-items: center; min-width: 0; }
.glyph-icon { position: absolute; left: 10px; top: 11px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--branch) 44%, transparent); border-radius: 50%; background: #102a2d; color: var(--branch); font-size: 17px; z-index: 1; box-shadow: 0 0 0 4px #0a2024, 0 0 13px color-mix(in srgb, var(--branch) 14%, transparent); }
.glyph-node.invested .glyph-icon, .glyph-node.maxed .glyph-icon { background: color-mix(in srgb, var(--branch) 22%, #0b2428); box-shadow: 0 0 0 4px #0a2024, 0 0 20px color-mix(in srgb, var(--branch) 30%, transparent); }
.glyph-node-top b { display: block; padding-right: 48px; color: #f5edd8; font-size: 11px; line-height: 1.2; }
.glyph-node-top small { color: #718e87; font: 7.5px var(--font-stats); letter-spacing: .7px; }
#glyphShop .glyph-node > p { min-height: 27px; margin: 5px 0 7px; color: #9fb7b0; font-size: 8.7px; line-height: 1.35; }
.glyph-pips { display: flex; gap: 3px; }
.glyph-pips i { flex: 1; max-width: 24px; height: 3px; border-radius: 2px; background: rgba(126,157,146,.19); }
.glyph-pips i.filled { background: var(--branch); box-shadow: 0 0 5px color-mix(in srgb, var(--branch) 45%, transparent); }
.glyph-buy { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 8px; padding: 5px 7px; border: 1px solid rgba(126,157,146,.22); border-radius: 3px; background: rgba(3,15,18,.7); color: #66817a; font: 7.5px var(--font-stats); }
.glyph-buy b { color: inherit; font-size: 9px; }
.glyph-buy.ready { border-color: color-mix(in srgb, var(--branch) 48%, transparent); color: #f4e3bd; cursor: pointer; }
.glyph-buy.ready:hover { background: color-mix(in srgb, var(--branch) 16%, #071b20); box-shadow: 0 0 13px color-mix(in srgb, var(--branch) 14%, transparent); }
.glyph-requirement, .glyph-maxed { display: block; margin-top: 8px; color: #728d86; font: 7.3px/1.35 var(--font-stats); }
.glyph-maxed { color: var(--branch); letter-spacing: 1px; }
.glyph-shop-foot { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid rgba(223,191,120,.2); background: rgba(5,19,22,.97); }
.glyph-shop-foot > span { color: #69857e; font: 8px var(--font-stats); text-transform: uppercase; letter-spacing: .8px; }
.glyph-shop-foot .btn { min-width: 150px; padding: 8px 13px; border-color: rgba(223,191,120,.35); color: #ffe19c; }
.glyph-shop-foot #btnCloseGlyphs { justify-self: end; }
.glyph-respec { justify-self: start; text-align: left; }
.glyph-respec small { display: block; color: #718e87; font-size: 7px; }
.glyph-respec:disabled { opacity: .35; }

@media (max-width: 820px) {
  #glyphShop { max-height: calc(100vh - 30px); }
  .glyph-tree { grid-template-columns: 1fr; }
  .glyph-ledger-note { display: none !important; }
  .glyph-shop-foot { grid-template-columns: 1fr 1fr; }
  .glyph-shop-foot > span { display: none; }
}

/* Settings Modal */
#settings-modal {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  background: rgba(4, 12, 14, 0.82); backdrop-filter: blur(8px);
}
#settings-modal.open { display: flex; }
#settings-card {
  width: min(490px, 92vw); max-height: 86vh; overflow-y: auto;
  background: linear-gradient(160deg, #13272c 0%, #081a1e 75%, #041014 100%);
  border: 1px solid rgba(223, 191, 120, 0.5); border-radius: 8px; padding: 20px 22px; color: #efe6cf;
  box-shadow: inset 0 1px 0 rgba(255,243,204,0.15), 0 24px 60px rgba(0,0,0,.75);
}
#settings-card h2 { font-family: var(--font-display); letter-spacing: 1.5px; color: #ffe19c; font-size: 20px; margin-bottom: 3px; }
#settings-card .padmap-sub { font-size: 11.5px; color: #9fb3a8; margin-bottom: 12px; line-height: 1.5; }
#settings-card .padmap-sub b, #settings-card kbd { color: #ffd873; }
#settings-card kbd { border: 1px solid rgba(223,191,120,.35); border-radius: 3px; padding: 0 5px; font-family: var(--font-stats); font-size: 10px; }
.settings-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.settings-tabs .btn { flex: 1; height: 34px; font: 700 11px var(--font-stats); }
.settings-tabs .btn.sel { border-color: #dfbf78; color: #fff; background: rgba(223,191,120,0.18); box-shadow: 0 0 12px rgba(223,191,120,.25); }
.settings-panel .padmap-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(223,191,120,.15); }
.settings-panel .padmap-row .act { flex: 1; font-size: 13px; font-weight: 600; }
.settings-panel .padmap-row .act small { display: block; font-weight: 400; font-size: 10.5px; color: #9fb3a8; }
.settings-panel input[type="range"] { width: 150px; accent-color: #dfbf78; }
.settings-panel .switch { width: 20px; height: 20px; accent-color: #80e8bd; cursor: pointer; }
.gfx-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gfx-btns .btn { padding: 4px 9px; font-size: 11px; }
.gfx-btns .btn.sel { border-color: #dfbf78; color: #ffe19c; }

/* General Button Styles */
.btn {
  height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid rgba(223, 191, 120, 0.35); border-radius: 4px;
  background: rgba(255,255,255,0.04); color: #e8ebdb; font: 700 11px var(--font-stats);
  cursor: pointer; transition: all 0.15s ease;
}
.btn:hover { background: rgba(223, 191, 120, 0.15); border-color: #dfbf78; color: #fff; }
.btn.primary {
  border-color: #ffe8a0; color: #122427;
  background: linear-gradient(165deg, #fff3c8 0%, #ecc366 50%, #d59837 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 3px 12px rgba(220,156,45,0.3); font-weight: 800;
}
.btn.primary:hover { background: linear-gradient(165deg, #fff8dc, #f4cd78 52%, #e0a745); }

/* ==========================================================================
   8. Opening Field Briefing & Mazing Guide Modal (#tutorial-modal)
   ========================================================================== */
#tutorial-modal {
  position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center;
  background: rgba(3, 11, 14, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
#tutorial-modal.open { display: flex; }

#tutorial-card {
  width: min(740px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 0; border: 1px solid rgba(223, 191, 120, 0.55); border-radius: 10px;
  background: linear-gradient(160deg, #13272c 0%, #081a1e 62%, #041014 100%);
  color: #f0ecdc; box-shadow: inset 0 1px 0 rgba(255, 243, 204, 0.2), inset 0 0 0 1px rgba(128, 232, 189, 0.12), 0 32px 80px rgba(0, 0, 0, 0.82);
  position: relative;
}
#tutorial-card::before {
  content: ""; position: absolute; top: 0; left: 15%; right: 15%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(223, 191, 120, 0.8) 50%, transparent); pointer-events: none;
}

#tutorial-card .tut-header {
  display: flex; align-items: center; gap: 14px; margin: 0; padding: 16px 24px;
  border-bottom: 1px solid rgba(223, 191, 120, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}
#tutorial-card .tut-badge {
  display: inline-flex; align-items: center; color: #f2e2be; font: 800 11px/1 var(--font-stats); letter-spacing: 1.8px;
}
.tut-badge-icon { width: 18px; height: 21px; color: #dfbf78; margin-right: 8px; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(223,191,120,0.4)); }
#tutorial-card .tut-badge span span { color: #80e8bd; }

#tutorial-card .tut-step-group {
  margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
#tutorial-card .tut-step-counter {
  color: #a4c7bf; font: 700 10.5px var(--font-stats); letter-spacing: 0.8px; white-space: nowrap;
}
.tut-step-pills { display: flex; gap: 5px; align-items: center; }
.tut-pill { width: 14px; height: 4px; border-radius: 2px; background: rgba(164, 199, 191, 0.2); transition: all 0.2s ease; }
.tut-pill.active { width: 22px; background: #dfbf78; box-shadow: 0 0 8px #dfbf78; }
.tut-pill.passed { background: #80e8bd; opacity: 0.7; }

#tutorial-card .tut-close-btn {
  width: 32px; height: 32px; padding: 0; color: #b4c7be; border: 1px solid rgba(223, 191, 120, 0.3);
  border-radius: 4px; background: rgba(255,255,255,0.03); cursor: pointer; transition: all 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
#tutorial-card .tut-close-btn:hover { border-color: #dfbf78; color: #fff; background: rgba(223, 191, 120, 0.15); }

#tutorial-card .tut-progress { height: 3px; background: rgba(128, 232, 189, 0.12); }
#tutorial-card .tut-progress i { display: block; height: 100%; background: linear-gradient(90deg, #80e8bd 0%, #dfbf78 70%, #ffe8a8 100%); box-shadow: 0 0 8px rgba(223,191,120,0.5); transition: width .2s ease; }

#tutorial-card .tut-body { padding: 22px 26px 18px; }
#tutorial-card .tut-title {
  margin: 0 0 10px; color: #fff5dc; font-family: var(--font-display); font-size: clamp(23px, 2.8vw, 30px);
  font-weight: 700; letter-spacing: 0.5px; line-height: 1.15; text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
#tutorial-card .tut-desc {
  max-width: 680px; margin: 0 0 18px; color: #d4e3dc; font-size: 14.5px; line-height: 1.6;
}

#tutorial-card .tut-visual {
  display: block; margin: 0; padding: 0; border: 1px solid rgba(223, 191, 120, 0.35);
  border-radius: 6px; background: #041417; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}
#tutorial-card .tut-map-head {
  display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px;
  background: rgba(8, 30, 36, 0.95); border-bottom: 1px solid rgba(223, 191, 120, 0.2);
  color: #8faea4; font: 700 9.5px var(--font-stats); letter-spacing: 1.2px;
}
#tutorial-card .tut-map-head span:nth-child(2) { color: #ffe19c; font-weight: 800; text-align: center; }
#tutorial-card .tut-map { display: block; width: 100%; height: auto; aspect-ratio: 600 / 220; }
#tutorial-card .tut-map-caption {
  padding: 10px 15px; background: rgba(5, 20, 24, 0.9); border-top: 1px solid rgba(223, 191, 120, 0.2);
  color: #c4dcd2; font: 12px/1.4 var(--font-stats);
}
#tutorial-card .tut-map-caption b { color: #ffe19c; }

#tutorial-card .tut-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 16px 24px 20px;
  border-top: 1px solid rgba(223, 191, 120, 0.22);
}
#tutorial-card .tut-footer-secondary, #tutorial-card .tut-nav { display: flex; align-items: center; gap: 8px; }
#tutorial-card .tut-shortcuts-hint {
  color: #7d9e96; font: 10px var(--font-stats); letter-spacing: 0.5px;
}
#tutorial-card .tut-shortcuts-hint kbd {
  border: 1px solid rgba(223, 191, 120, 0.35); border-radius: 3px; padding: 1px 5px;
  color: #dfbf78; background: rgba(255,255,255,0.04); font: 9px var(--font-stats);
}
#tutorial-card .tut-footer .btn {
  min-height: 40px; padding: 0 14px; font: 700 11px var(--font-stats); letter-spacing: 0.5px;
}
#tutorial-card .tut-footer .btn.primary {
  min-width: 170px; height: 42px; border-color: #ffe6a0; color: #102428;
  background: linear-gradient(165deg, #fff3c4 0%, #ecc164 52%, #d29432 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 16px rgba(220,156,45,0.35); font-weight: 800; font-size: 11.5px;
}
#tutorial-card .tut-footer .btn.primary:hover {
  background: linear-gradient(165deg, #fff7d4, #f4cc76 52%, #dda23e);
  box-shadow: inset 0 1px 0 #fff, 0 6px 22px rgba(220,156,45,0.48);
}

/* ==========================================================================
   9. Responsive Layouts & Breakpoints
   ========================================================================== */
@media (max-width: 1240px) {
  #drawer { width: calc(100vw - 28px); }
  #drawer .dock-content { gap: 10px; }
  #drawer .radar-panel, #drawer .abilities-panel { flex: 0 0 210px; width: 210px; }
  #drawer #build-grid { grid-template-columns: repeat(4, 134px); gap: 8px; }
  #drawer #build-grid.five-cards { grid-template-columns: repeat(5, 118px); gap: 6px; }
  #topbar { padding: 8px 16px; gap: 12px; }
  #topbar .stat { padding: 0 10px; gap: 6px; }
  #topbar .stat b { font-size: 15px; }
  #topbar #btnWave { font-size: 10.5px; height: 40px; min-width: 130px; }
  #control-sidebar { top: 74px; width: 200px; }
  #inspect { right: 14px; }
}

@media (max-width: 980px) {
  #topbar { grid-template-columns: auto 1fr auto; gap: 10px; }
  .topbar-left .brand-meta { display: none; }
  #topbar .resource-group { min-width: 0; }
  .wave-chip { height: 40px; padding: 0 10px; gap: 8px; }
  #topbar .command-group { min-width: 170px; }
  #topbar #btnWave { min-width: 150px; }
  #drawer .dock-content { gap: 8px; }
  #drawer .radar-panel, #drawer .abilities-panel { flex: 0 0 175px; width: 175px; }
  #drawer #build-grid { grid-template-columns: repeat(4, 112px); gap: 6px; }
  #drawer #build-grid.five-cards { grid-template-columns: repeat(5, 96px); gap: 5px; }
  #drawer .card .nm { font-size: 11.5px; }
  #drawer .card-category { font-size: 7px; }
  #drawer .card-spec { display: none; }
  .ability-card .ab-name { font-size: 7.5px; }
  .ability-card .ab-icon { font-size: 15px; }
}

@media (max-width: 690px) {
  :root { --field-dock: 168px; }
  #topbar {
    height: 108px; grid-template-columns: 36px minmax(0, 1fr) minmax(118px, 134px);
    grid-template-rows: 38px 44px; gap: 4px 8px; padding: 6px 10px;
  }
  .topbar-left { grid-column: 1; grid-row: 1; }
  #topbar .logo-wrap { width: 36px; height: 36px; min-width: 36px; }
  #topbar .logo-mark { width: 22px; height: 26px; }
  .topbar-right { grid-column: 2 / 4; grid-row: 1; justify-self: end; gap: 6px; }
  .wave-chip { height: 36px; padding: 0 8px; gap: 6px; font-size: 9px; }
  .wave-chip-score { display: none; }
  #topbar .command-group { min-width: 0; }
  #topbar #btnWave { height: 36px; font-size: 9.5px; padding: 0 6px; letter-spacing: 0; min-width: 100px; }
  /* Small screens: sidebar becomes a toggleable bottom sheet so the
     battlefield and dock stay fully visible and clickable. */
  #control-sidebar {
    top: auto; right: 10px; left: 10px; bottom: calc(var(--field-dock, 168px) + 8px);
    width: auto; max-height: 38vh;
  }
  #control-sidebar.collapsed { transform: translateY(calc(100% + 20px)); }
  #topbar .resource-group { grid-column: 1 / 4; grid-row: 2; height: 42px; min-width: 0; width: 100%; }
  #topbar .stat { padding: 0 6px; gap: 6px; }
  #topbar .stat small { font-size: 8.5px; letter-spacing: 0.8px; gap: 4px; }
  #topbar .stat b { font-size: 14px; }
  #topbar .resource-icon.svg-icon { width: 12px; height: 12px; }

  #drawer { left: 10px; right: 10px; bottom: 8px; transform: none; width: auto; }
  #drawer .dock-content { justify-content: flex-start; }
  #drawer .radar-panel { flex-basis: 120px; width: 120px; }
  #drawer .radar-panel .dock-heading { font-size: 7.5px; letter-spacing: 0.5px; }
  #drawer .arsenal-panel { flex: 1; min-width: 0; }
  #drawer #build-grid { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #drawer #build-grid::-webkit-scrollbar { display: none; }
  #drawer .card { flex: 0 0 135px; width: 135px; }
  #drawer .card .card-body { padding: 0 8px 8px; }
  #drawer .card .nm { font-size: 11px; }
  #drawer .card-spec, #drawer .heading-end { display: none; }

  #drawer .abilities-panel {
    position: fixed; right: 10px; bottom: calc(var(--field-dock) + 16px) !important;
    width: auto; height: auto; flex: none; z-index: 25;
  }
  #drawer .abilities-panel .dock-heading { display: none; }
  .abilities-grid { display: flex; gap: 5px; height: auto; }
  .ability-card { width: 48px; height: 48px; flex: 0 0 48px; }
  .ability-card .ab-icon { font-size: 14px; margin: 0; }
  .ability-card .ab-name { font-size: 6.5px; }
  .ability-card .ab-cost { font-size: 6.5px; padding: 0 2px; top: 2px; right: 2px; }
  .ability-card .ab-key { display: none; }

  #tutorial-card .tut-header { padding: 12px 16px 10px; gap: 8px; }
  #tutorial-card .tut-badge { font-size: 9px; letter-spacing: 0.8px; }
  .tut-badge-icon { width: 14px; height: 16px; margin-right: 5px; }
  #tutorial-card .tut-step-counter { font-size: 9px; }
  #tutorial-card .tut-body { padding: 16px 16px 14px; }
  #tutorial-card .tut-title { font-size: 22px; }
  #tutorial-card .tut-desc { font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
  #tutorial-card .tut-map-head { font-size: 7.5px; letter-spacing: 0.2px; padding: 6px 10px; }
  #tutorial-card .tut-map-caption { font-size: 10px; padding: 8px 10px; }
  #tutorial-card .tut-footer { flex-wrap: wrap; padding: 12px 16px 16px; gap: 8px; }
  #tutorial-card .tut-shortcuts-hint { display: none; }
  #tutorial-card .tut-footer-secondary { flex: 1; }
  #tutorial-card .tut-footer .btn { padding: 0 8px; font-size: 9.5px; min-height: 36px; }
  #tutorial-card .tut-footer .btn.primary { min-width: 118px; }
}

/* ==========================================================================
   10. Slim command HUD — icon-first navigation and closed utility rail
   ========================================================================== */
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

#topbar {
  grid-template-columns: minmax(330px, 1fr) auto minmax(430px, 1fr);
  gap: 12px; padding-inline: 18px;
}
.topbar-left { gap: 14px; }
.topbar-left .brand { flex: 0 0 auto; }
.topbar-left .wave-chip { flex: 0 1 auto; }
.wave-chip { height: 44px; padding: 0 12px; gap: 9px; }

.topbar-right { gap: 9px; min-width: 0; }
.topbar-tools {
  display: flex; align-items: center; gap: 5px; padding: 4px;
  border: 1px solid rgba(223,191,120,.22); border-radius: 8px;
  background: rgba(6,24,28,.58); box-shadow: inset 0 1px rgba(255,255,255,.06);
}
.hud-icon-btn, .hud-menu-btn, .rail-icon {
  border: 1px solid rgba(223,191,120,.25); color: #e9f0e9;
  background: linear-gradient(165deg, rgba(35,66,68,.78), rgba(7,25,29,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 3px 8px rgba(0,0,0,.2);
  cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.hud-icon-btn {
  width: 34px; height: 34px; border-radius: 6px; padding: 0;
  display: inline-grid; place-items: center; font: 800 12px var(--font-stats);
}
.hud-icon-btn:hover, .hud-menu-btn:hover, .rail-icon:hover,
.hud-icon-btn.active { border-color: #ffe19c; color: #fff; background: rgba(223,191,120,.16); transform: translateY(-1px); }
.hud-icon-btn:focus-visible, .hud-menu-btn:focus-visible, .rail-icon:focus-visible { outline: 2px solid #00f5d4; outline-offset: 2px; }
.hud-icon-btn .btn-icon { font-size: 14px; line-height: 1; }
.speed-icon .btn-speed-val { color: #ffe19c; font-size: 10px; }
.weather-icon .weather-symbol { color: #ffe19c; font-size: 15px; filter: drop-shadow(0 0 5px rgba(255,225,156,.35)); }

#topbar .command-group { min-width: 0; gap: 6px; }
.hud-menu-btn {
  width: 38px; height: 38px; border-radius: 9px; padding: 0 9px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.hud-menu-btn > span {
  display: block; width: 100%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #80e8bd, #ffe19c); transition: transform .2s ease, opacity .2s ease;
}
.hud-menu-btn[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hud-menu-btn[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
.hud-menu-btn[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#control-sidebar {
  top: 78px; right: 14px; width: 54px; max-height: none; overflow: visible;
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 7px;
  border-radius: 12px; background: linear-gradient(165deg, rgba(16,44,50,.91), rgba(6,24,28,.95));
}
#control-sidebar.collapsed { transform: translateX(calc(100% + 22px)); opacity: 0; pointer-events: none; }
#control-sidebar[aria-hidden="false"] { opacity: 1; }
#control-sidebar .sb-heading {
  width: 100%; justify-content: center; gap: 5px; padding: 2px 0 7px;
  font-size: 7px; letter-spacing: .8px;
}
#control-sidebar .sb-heading i { width: 4px; height: 4px; }
.rail-icon {
  position: relative; width: 38px; height: 38px; flex: 0 0 38px; padding: 0;
  border-radius: 8px; display: grid; place-items: center;
  font: 800 15px/1 var(--font-stats);
}
.rail-icon .live-dot {
  position: absolute; right: 5px; top: 5px; width: 5px; height: 5px;
  border-radius: 50%; background: #80e8bd; box-shadow: 0 0 5px #80e8bd;
}

@media (max-width: 1500px) {
  #topbar { grid-template-columns: minmax(270px, 1fr) auto minmax(385px, 1fr); padding-inline: 12px; }
  .topbar-left { gap: 8px; }
  .topbar-left .brand-title { font-size: 13px; letter-spacing: 2.4px; }
  .wave-chip { padding: 0 8px; gap: 6px; font-size: 8.5px; }
  .wave-chip-score { display: none; }
  #topbar .stat { flex-basis: 132px; width: 132px; }
  #topbar #btnWave.btn-wave-heroic { min-width: 148px; padding-inline: 9px; }
}

@media (max-width: 1120px) {
  #topbar { grid-template-columns: minmax(205px, 1fr) auto minmax(330px, 1fr); }
  .topbar-left .brand-title { display: none; }
  .wave-chip-phase { display: none; }
  #topbar .stat { flex-basis: 108px; width: 108px; padding-inline: 6px; }
  .topbar-tools { gap: 3px; }
  .hud-icon-btn { width: 30px; height: 32px; }
  #topbar #btnWave.btn-wave-heroic { min-width: 118px; }
  .btn-wave-icon, .btn-kbd { display: none; }
}

@media (max-width: 690px) {
  #topbar {
    height: 108px; grid-template-columns: minmax(100px, 1fr) auto;
    grid-template-rows: 38px 44px; padding: 6px 9px;
  }
  .topbar-left { grid-column: 1; grid-row: 1; }
  .topbar-left .brand { display: none; }
  .topbar-left .wave-chip { height: 34px; }
  .topbar-right { grid-column: 2; grid-row: 1; gap: 4px; }
  .topbar-tools { gap: 2px; padding: 2px; }
  .hud-icon-btn { width: 27px; height: 30px; }
  .topbar-tools #btnCam, .topbar-tools #btnClarity { display: none; }
  #topbar #btnWave.btn-wave-heroic { min-width: 76px; height: 34px; }
  .hud-menu-btn { width: 32px; height: 32px; }
  #topbar .resource-group { grid-column: 1 / 3; grid-row: 2; }
  #control-sidebar { top: 116px; right: 9px; left: auto; bottom: auto; width: 50px; max-height: none; }
  #control-sidebar.collapsed { transform: translateX(calc(100% + 18px)); }
}
