/* =========================================================================
   TOWER POWER — ARCHITECTURAL HUD, INSPECTOR, MODALS & SANDBOX STYLESHEET
   ========================================================================= */

:root {
  --bg-obsidian: rgba(7, 12, 21, 0.94);
  --bg-glass: rgba(10, 17, 30, 0.92);
  --bg-glass-deep: rgba(5, 9, 17, 0.96);
  --bg-card: rgba(15, 24, 40, 0.88);
  --border-brass: rgba(180, 152, 98, 0.42);
  --border-steel: rgba(148, 163, 184, 0.32);
  --border-cyan: rgba(56, 189, 248, 0.48);
  --border-Subtle: rgba(148, 163, 184, 0.18);
  --cyan: #22d3ee;
  --gold: #facc15;
  --brass: #d4af37;
  --emerald: #34d399;
  --magenta: #e879f9;
  --danger: #f43f5e;
  --amber: #fb923c;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --chamfer-sm: polygon(
    6px 0%, calc(100% - 6px) 0%, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 0% calc(100% - 6px), 0% 6px
  );
  --chamfer-sm-ring: polygon(
    6px 0%, calc(100% - 6px) 0%, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 0% calc(100% - 6px), 0% 6px, 6px 0%,
    6.6px 1.45px, 1.45px 6.6px, 1.45px calc(100% - 6.6px),
    6.6px calc(100% - 1.45px), calc(100% - 6.6px) calc(100% - 1.45px),
    calc(100% - 1.45px) calc(100% - 6.6px), calc(100% - 1.45px) 6.6px,
    calc(100% - 6.6px) 1.45px, 6.6px 1.45px
  );
  --chamfer-md: polygon(
    10px 0%, calc(100% - 10px) 0%, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0% calc(100% - 10px), 0% 10px
  );
  --chamfer-md-ring: polygon(
    10px 0%, calc(100% - 10px) 0%, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0% calc(100% - 10px), 0% 10px, 10px 0%,
    10.65px 1.55px, 1.55px 10.65px, 1.55px calc(100% - 10.65px),
    10.65px calc(100% - 1.55px), calc(100% - 10.65px) calc(100% - 1.55px),
    calc(100% - 1.55px) calc(100% - 10.65px), calc(100% - 1.55px) 10.65px,
    calc(100% - 10.65px) 1.55px, 10.65px 1.55px
  );
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #03060c;
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
}

#renderCanvas {
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
  outline: none;
}

/* =========================================================================
   FROSTPUNK-INSPIRED ARCHITECTURAL HUD LAYER
   ========================================================================= */
.hud-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  z-index: 10;
}

/* Subtle atmospheric vignette around screen perimeter */
.hud-layer::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 62%, rgba(2, 5, 12, 0.58) 100%);
  z-index: -1;
}

.interactive {
  pointer-events: auto;
}

.hud-card {
  background: linear-gradient(180deg, rgba(12, 20, 34, 0.94) 0%, rgba(6, 11, 20, 0.96) 100%);
  border: 1px solid var(--border-steel);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

/* =========================================================================
   1. TOP SYMMETRICAL RIBBON + CENTRAL CIRCULAR REACTOR MEDALLION
   ========================================================================= */
.top-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  width: 100%;
  padding: 0 12px;
  z-index: 16;
}

.top-wing {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
}

.top-wing-left {
  align-items: flex-end;
  padding-right: 12px;
}

.top-wing-right {
  align-items: flex-start;
  padding-left: 12px;
}

.ribbon-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 16px;
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.95) 0%, rgba(6, 10, 18, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.34);
  clip-path: var(--chamfer-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  min-height: 36px;
}

.ribbon-substrip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  background: rgba(7, 12, 22, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  clip-path: var(--chamfer-sm);
  font-size: 10.5px;
  color: var(--text-muted);
}

.res-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.res-item:last-child {
  padding-right: 0;
  border-right: none;
}

.res-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.res-icon svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.35));
}

.res-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.res-label {
  display: none;
}

.hud-tooltip {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  max-width: 280px;
  padding: 7px 11px;
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.98) 0%, rgba(4, 8, 16, 0.99) 100%);
  border: 1px solid rgba(180, 152, 98, 0.68);
  clip-path: var(--chamfer-sm);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.92), 0 0 14px rgba(34, 211, 238, 0.22);
  font-size: 10.5px;
  line-height: 1.42;
  color: var(--text-main);
  white-space: pre-line;
  backdrop-filter: blur(6px);
}

.hud-tooltip.hidden {
  display: none;
}

.res-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.res-val {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.res-rate {
  font-size: 9.5px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* Sub-ribbon speed controls & work clock */
.speed-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.speed-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
}

.speed-btn:hover {
  color: var(--text-main);
  border-color: var(--cyan);
}

.speed-btn.active {
  background: rgba(34, 211, 238, 0.22);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
}

.sub-divider {
  width: 1px;
  height: 11px;
  background: rgba(148, 163, 184, 0.22);
  margin: 0 2px;
}

.biome-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
}

.biome-pill svg {
  width: 13px;
  height: 13px;
}

.stat-block {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  line-height: 1.05;
  padding-right: 8px;
  border-right: 1px solid rgba(148, 163, 184, 0.15);
}

.stat-block svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.stat-block:last-child {
  border-right: none;
  padding-right: 0;
}

.stat-val {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.frame-time {
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.fps-corner-badge {
  position: fixed;
  top: 6px;
  right: 10px;
  z-index: 30;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  cursor: default;
}

/* CENTRAL FROSTPUNK REACTOR / GRID MEDALLION DIAL */
.core-medallion-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2px;
  z-index: 20;
}

.core-medallion {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(18, 34, 56, 0.98) 0%, rgba(6, 11, 20, 0.99) 74%);
  border: 2px solid rgba(180, 152, 98, 0.65);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.85),
    0 0 22px rgba(34, 211, 238, 0.22),
    inset 0 0 14px rgba(34, 211, 238, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.core-medallion:hover {
  transform: scale(1.03);
  border-color: var(--cyan);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), 0 0 28px rgba(34, 211, 238, 0.42);
}

.core-medallion.brownout-alert {
  border-color: var(--danger);
  background: radial-gradient(circle at 50% 38%, rgba(68, 14, 26, 0.98) 0%, rgba(22, 6, 12, 0.99) 75%);
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.75), inset 0 0 18px rgba(244, 63, 94, 0.45);
  animation: hqAlertPulse 0.6s infinite alternate;
}

.core-ring-svg {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.core-ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 4;
}

.core-ring-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s ease, stroke 0.25s ease;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.65));
}

.core-medallion-label {
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-top: -4px;
}

.core-medallion-val {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
  line-height: 1.05;
}

.core-medallion-unit {
  font-size: 9px;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.06em;
}

.core-sub-pill {
  position: absolute;
  bottom: -8px;
  background: rgba(8, 14, 26, 0.96);
  border: 1px solid rgba(180, 152, 98, 0.55);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.04em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  clip-path: var(--chamfer-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.top-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.top-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.18);
  transform: translateY(-1px);
}

.top-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hq-quick-btn {
  border-color: rgba(56, 189, 248, 0.55);
  color: var(--cyan);
  background: rgba(14, 42, 68, 0.78);
}

.hq-quick-btn.ready-pulse {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(6, 60, 48, 0.85);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
}

.early-wave-btn {
  border-color: rgba(250, 204, 21, 0.55);
  color: var(--gold);
  background: rgba(55, 38, 10, 0.78);
}

.pause-cmd-btn {
  border-color: rgba(232, 121, 249, 0.5);
  color: #f5d0fe;
  background: rgba(48, 18, 60, 0.78);
}

.cyan-text { color: var(--cyan); }
.gold-text { color: var(--gold); }
.emerald-text { color: var(--emerald); }
.magenta-text { color: var(--magenta); }
.danger-text { color: var(--danger); }
.amber-text { color: var(--amber); }

/* =========================================================================
   2. RIGHT-SIDE TACTICAL DOCK: RADAR + FROSTPUNK "BEACON" INSPECTOR CARD
   ========================================================================= */
.mid-section {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 8px 12px;
  pointer-events: none;
  overflow: hidden;
}

.right-dock-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-height: calc(100vh - 195px);
}

.right-panel {
  width: 224px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  clip-path: var(--chamfer-md);
  border: 1px solid rgba(180, 152, 98, 0.42);
}

.radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #cbd5e1;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.radar-zoom-group {
  display: flex;
  gap: 3px;
}

.radar-zoom-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
}

.radar-zoom-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.16);
}

#minimap {
  width: 100%;
  height: 158px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: #040811;
  cursor: crosshair;
}

.minimap-legend {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 700;
}

/* FROSTPUNK "BEACON"-STYLE FRAMED STRUCTURE INSPECTOR CARD (COMPACT 224PX ICON-FIRST) */
.frost-inspector-card {
  width: 248px;
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.96) 0%, rgba(6, 10, 18, 0.98) 100%);
  border: 1px solid rgba(180, 152, 98, 0.55);
  clip-path: var(--chamfer-md);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.frost-inspector-card.hidden {
  display: none;
}

.frost-inspector-card.is-selected {
  --bevel-c: rgba(56, 189, 248, 0.88);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.88),
    0 0 18px rgba(56, 189, 248, 0.18),
    inset 0 0 0 1px rgba(56, 189, 248, 0.16);
}

.frost-insp-close-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 3px;
  background: rgba(14, 30, 48, 0.85);
  color: rgba(186, 230, 253, 0.92);
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.frost-insp-close-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(125, 211, 252, 0.95);
  color: #ffffff;
}

.frost-insp-close-btn.hidden {
  display: none;
}

.frost-inspector-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: linear-gradient(90deg, rgba(22, 33, 52, 0.95), rgba(12, 20, 34, 0.95));
  border-bottom: 1px solid rgba(180, 152, 98, 0.38);
}

.frost-insp-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.frost-insp-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frost-insp-subtitle {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-transform: uppercase;
}

.frost-power-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(6, 11, 20, 0.9);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--emerald);
  flex-shrink: 0;
}

.frost-power-switch.unpowered {
  border-color: rgba(244, 63, 94, 0.6);
  color: var(--danger);
}

.frost-insp-info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(14, 30, 52, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.45);
  cursor: help;
  flex-shrink: 0;
}

.frost-insp-info-badge svg {
  width: 12px;
  height: 12px;
}

.frost-insp-banner {
  display: none;
}

.frost-insp-schematic-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(8, 16, 30, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
  flex-shrink: 0;
}

.frost-insp-schematic-icon svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.65));
}

.frost-insp-footprint-chip,
.frost-insp-tier-chip {
  display: none;
}

/* Frostpunk "Functioning" Chamfered Middle Status Box */
.frost-status-frame {
  margin: 5px 8px 2px;
  padding: 4px 8px;
  background: rgba(5, 9, 16, 0.95);
  border: 1px solid rgba(180, 152, 98, 0.38);
  clip-path: var(--chamfer-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frost-insp-body {
  padding: 5px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.frost-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.frost-stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: rgba(9, 15, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frost-stat-chip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.frost-insp-desc {
  display: none;
}

.frost-insp-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  margin-top: 1px;
}

.frost-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  clip-path: var(--chamfer-sm);
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(14, 38, 62, 0.85);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.14s ease;
}

.frost-action-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.frost-action-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.25);
}

.frost-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.frost-action-btn.salvage {
  border-color: rgba(244, 63, 94, 0.55);
  background: rgba(60, 14, 26, 0.82);
  color: #fda4af;
}

.frost-action-btn.salvage:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.28);
}

.frost-deck-toolbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(180, 152, 98, 0.22);
}

.frost-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 24px;
  padding: 0 3px;
  font-size: 8.5px;
  font-weight: 800;
  border-radius: 3px;
  border: 1px solid rgba(180, 152, 98, 0.45);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.14s ease;
}

.frost-mini-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.frost-mini-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(55, 38, 12, 0.72);
}

.frost-mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================================
   3. BOTTOM HUD ARCHITECTURE:
      - BOTTOM-LEFT: COMPACT THREAT MEDALLION (NO OVERLAP WITH CENTER DOCK)
      - BOTTOM-CENTER: DUAL STACKED STATUS BARS + ICON MEDALLIONS
      - POP-UP SINGLE-ROW COMPACT BUILD STRIP
   ========================================================================= */
.bottom-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0 12px 8px;
  z-index: 15;
}

/* BOTTOM-LEFT CRISIS / HORDE THREAT MEDALLION BANNER */
.threat-medallion-dock {
  position: fixed;
  left: 12px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 16;
  max-width: 196px;
}

.threat-main-row {
  display: flex;
  align-items: center;
}

.threat-circle-badge {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(159, 18, 57, 0.96) 0%, rgba(68, 6, 24, 0.99) 78%);
  border: 2px solid rgba(251, 191, 36, 0.78);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.85),
    0 0 16px rgba(244, 63, 94, 0.45),
    inset 0 0 10px rgba(251, 113, 133, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  flex-shrink: 0;
}

.threat-circle-val {
  font-size: 14px;
  font-weight: 900;
  color: #fff1f2;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
}

.threat-circle-sub {
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fecdd3;
  text-transform: uppercase;
  margin-top: 1px;
}

.threat-banner-wing {
  margin-left: -10px;
  padding: 5px 10px 5px 16px;
  background: linear-gradient(90deg, rgba(24, 13, 24, 0.95) 0%, rgba(9, 14, 25, 0.92) 100%);
  border: 1px solid rgba(180, 152, 98, 0.48);
  clip-path: var(--chamfer-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 146px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
}

.threat-banner-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f8fafc;
}

.threat-banner-title svg {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
}

.threat-banner-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  color: #fda4af;
  font-weight: 700;
}

.threat-objective-strip {
  display: none;
}

/* COMPACT POP-UP BUILD BAR DRAWER ABOVE MEDALLIONS */
.dock-container {
  width: fit-content;
  max-width: min(940px, 95vw);
  padding: 7px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  clip-path: var(--chamfer-md);
  border: 1px solid rgba(180, 152, 98, 0.48);
  transition: all 0.18s ease;
}

.dock-container.collapsed-drawer {
  display: none;
}

.ability-btn.build-mode-active {
  border-color: var(--emerald);
  background: linear-gradient(180deg, rgba(16, 85, 62, 0.92), rgba(8, 42, 32, 0.96));
  color: #a7f3d0;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

/* Hidden redundant inline strip (Hover Tooltip + Right Inspector Card handle specs cleanly) */
.inspector-strip {
  display: none;
}

.insp-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.insp-left svg {
  width: 14px;
  height: 14px;
}

.insp-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.insp-right {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10.5px;
  margin-left: auto;
  text-align: right;
}

.hotkey-hint {
  color: var(--gold);
  font-weight: 700;
  font-size: 10px;
}

/* Category & Tool Filter Strip */
.cat-tabs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.cat-tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  clip-path: var(--chamfer-sm);
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(13, 21, 36, 0.88);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.14s ease;
}

.cat-tab-btn svg {
  width: 14px;
  height: 14px;
}

.cat-tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(180, 152, 98, 0.65);
}

.cat-tab-btn.active {
  color: var(--text-main);
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgba(20, 56, 82, 0.88), rgba(10, 28, 46, 0.94));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
}

.cat-tab-btn.tool-tab-btn {
  margin-left: 8px;
  border-color: rgba(250, 204, 21, 0.45);
  color: var(--gold);
}

.cat-tab-btn.tool-tab-btn.danger-tab {
  margin-left: 0;
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

/* Strictly Single-Row Horizontal Build Cards Strip with Large Icons */
.build-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  margin: 0 auto;
  max-width: 100%;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 4px;
  scrollbar-width: thin;
}

.build-btn {
  min-width: 78px;
  width: 80px;
  height: 76px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.94) 0%, rgba(9, 15, 27, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  clip-path: var(--chamfer-sm);
  padding: 4px 6px 5px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: all 0.12s ease;
  text-align: center;
}

.build-btn:hover {
  border-color: rgba(180, 152, 98, 0.85);
  transform: translateY(-1px);
}

.build-btn.active {
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgba(16, 54, 78, 0.95) 0%, rgba(9, 28, 46, 0.98) 100%);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.build-btn.unaffordable {
  opacity: 0.58;
}

.build-btn.unaffordable .build-cost {
  color: var(--danger);
}

.build-btn.locked {
  opacity: 0.34;
  filter: grayscale(0.75);
}

.build-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  line-height: 1;
  color: var(--text-muted);
}

.hotkey {
  color: var(--cyan);
  font-weight: 800;
}

.tier-badge {
  font-weight: 700;
  color: #94a3b8;
}

.build-icon-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 1px 0;
}

.build-icon-big svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.28));
}

.build-name {
  width: 100%;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.build-cost {
  font-size: 9px;
  line-height: 1;
  color: var(--gold);
  font-weight: 800;
}

/* =========================================================================
   FROSTPUNK BOTTOM-CENTER DUAL STACKED STATUS BARS & CIRCULAR MEDALLIONS
   ========================================================================= */
.frost-bottom-console {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 16px;
  background: linear-gradient(180deg, rgba(11, 18, 31, 0.95) 0%, rgba(5, 9, 16, 0.98) 100%);
  border: 1px solid rgba(180, 152, 98, 0.52);
  clip-path: var(--chamfer-md);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.medallion-btn-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Icon-First Tactical Action Medallion Tiles (42x38px with Hotkey & Cooldown Overlay) */
.ability-btn {
  position: relative;
  width: 42px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, rgba(24, 38, 62, 0.96) 0%, rgba(8, 14, 26, 0.98) 80%);
  border: 1.5px solid rgba(180, 152, 98, 0.58);
  color: var(--text-main);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), inset 0 0 8px rgba(34, 211, 238, 0.12);
  transition: all 0.14s ease;
}

.ability-btn .abil-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-2px);
}

.ability-btn .abil-icon svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.45));
}

.ability-btn .abil-key {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(4, 8, 15, 0.88);
  color: var(--gold);
  letter-spacing: 0.03em;
}

.ability-btn .abil-cd {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 9, 18, 0.82);
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 900;
  color: #facc15;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.ability-btn .abil-cd:empty {
  display: none;
}

.ability-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.85), 0 0 14px rgba(34, 211, 238, 0.38);
}

.ability-btn.locked-btn {
  opacity: 0.48;
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
}

.ability-btn.arsenal-open-btn {
  border-color: rgba(232, 121, 249, 0.68);
  color: #f5d0fe;
  background: radial-gradient(circle at 50% 30%, rgba(62, 22, 78, 0.95) 0%, rgba(22, 9, 34, 0.98) 80%);
}

/* Dual Stacked Horizontal Bars (HQ HULL INTEGRITY + ORBITAL LOCK / MECH XP) */
.dual-status-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 236px;
  padding: 2px 4px;
}

.hq-hull-wrap {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(6, 10, 18, 0.96);
  border: 1px solid rgba(180, 152, 98, 0.55);
  clip-path: var(--chamfer-sm);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  transition: all 0.2s ease;
}

.hq-hull-wrap:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

.hq-hull-wrap.hq-under-attack {
  border-color: var(--danger);
  animation: hqAlertPulse 0.55s infinite alternate;
}

@keyframes hqAlertPulse {
  from { box-shadow: 0 0 6px rgba(244, 63, 94, 0.45); }
  to { box-shadow: 0 0 20px rgba(244, 63, 94, 0.95); }
}

.hq-hull-track {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(10, 16, 28, 0.92);
}

.hq-hull-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.65), rgba(52, 211, 153, 0.82));
  transition: width 0.18s ease, background 0.2s ease;
}

.hq-hull-fill.warn {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.72), rgba(250, 204, 21, 0.85));
}

.hq-hull-fill.crit {
  background: linear-gradient(90deg, rgba(190, 18, 60, 0.82), rgba(251, 113, 133, 0.92));
}

.hq-hull-head {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* Second Stacked Bar: Orbital Lock + Mech Level XP */
.orbital-xp-stack-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.stacked-sub-bar {
  position: relative;
  height: 16px;
  background: rgba(6, 10, 18, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.38);
  clip-path: var(--chamfer-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.stacked-sub-track {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.65), rgba(34, 211, 238, 0.85));
  transition: width 0.2s ease;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.65), rgba(232, 121, 249, 0.88));
  transition: width 0.18s ease;
}

.stacked-sub-label {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: space-between;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* =========================================================================
   TOAST BANNER & OVERLAY MODALS (DRAFT, PAUSE, VICTORY/DEFEAT)
   ========================================================================= */
.toast-banner {
  align-self: center;
  margin-top: 6px;
  padding: 6px 18px;
  clip-path: var(--chamfer-sm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(8, 14, 26, 0.95);
  border: 1px solid var(--cyan);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  transition: opacity 0.2s;
  z-index: 25;
}

.toast-banner.alert {
  border-color: var(--danger);
  color: #fecdd3;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 14, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(7px);
}

.modal-box {
  width: min(480px, 92vw);
  background: rgba(10, 17, 31, 0.97);
  border: 2px solid var(--cyan);
  clip-path: var(--chamfer-md);
  padding: 22px;
  text-align: center;
  box-shadow: 0 0 50px rgba(34, 211, 238, 0.3);
}

.modal-box h2 {
  font-size: 21px;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.modal-stats {
  text-align: left;
  background: rgba(6, 10, 19, 0.9);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 12.5px;
  line-height: 1.75;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.pause-modal-box {
  width: min(940px, 95vw);
  max-height: 88vh;
  background: rgba(9, 15, 28, 0.97);
  border: 1px solid rgba(180, 152, 98, 0.65);
  clip-path: var(--chamfer-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.88);
}

.pause-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(180, 152, 98, 0.28);
  padding-bottom: 10px;
}

.pause-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pause-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  clip-path: var(--chamfer-sm);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  cursor: pointer;
}

.pause-tab-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pause-tab-btn.active {
  color: var(--text-main);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.18);
}

.pause-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 7px;
  margin-top: 6px;
}

.arsenal-node-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  clip-path: var(--chamfer-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: help;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.arsenal-node-card:hover {
  border-color: rgba(180, 152, 98, 0.65);
  background: rgba(20, 31, 54, 0.94);
}

.arsenal-node-card.unlocked-node {
  border-color: rgba(34, 211, 238, 0.55);
}

.arsenal-node-card.evolved-node {
  border-color: var(--gold);
  background: rgba(45, 32, 12, 0.65);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.25);
}

.arsenal-node-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.arsenal-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 24, 0.9);
  border-radius: 5px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

.arsenal-node-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.arsenal-node-sub {
  font-size: 9.5px;
  color: var(--text-muted);
}

.arsenal-lvl-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.14);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.arsenal-node-desc {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 700;
  clip-path: var(--chamfer-sm);
  border: 1px solid var(--cyan);
  background: rgba(34, 211, 238, 0.15);
  color: var(--text-main);
  cursor: pointer;
}

.action-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.action-btn:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.28);
}

.action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: #475569;
}

.bio-btn {
  border-color: var(--magenta);
  background: rgba(232, 121, 249, 0.15);
}

.bio-btn:hover:not(:disabled) {
  background: rgba(232, 121, 249, 0.3);
}

/* VAMPIRE SURVIVORS 3-CARD DRAFT MODAL */
.draft-modal-box {
  width: min(820px, 95vw);
  background: rgba(10, 16, 30, 0.97);
  border: 2px solid var(--magenta);
  clip-path: var(--chamfer-md);
  padding: 22px;
  text-align: center;
  box-shadow: 0 0 55px rgba(232, 121, 249, 0.35);
}

.draft-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.draft-card {
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--cyan);
  clip-path: var(--chamfer-md);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.14s;
}

.draft-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
}

.draft-card-tome {
  border-color: var(--magenta);
}

.draft-card-evolve {
  border-color: var(--gold);
  background: rgba(55, 38, 12, 0.85);
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.4);
}

.draft-card-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(250, 204, 21, 0.14);
  padding: 3px 8px;
  border-radius: 4px;
}

.draft-card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 24, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
}

.draft-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.draft-card-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
  flex: 1;
}

.draft-card-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
}

.atlas-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 11.5px;
}

.atlas-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.biome-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.atlas-mod {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-left: 16px;
}

/* 3D Creature Bestiary Holodeck Cards & Strain Switcher */
.bestiary-strain-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid rgba(180, 152, 98, 0.35);
  border-radius: 5px;
}

.bestiary-strain-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.bestiary-strain-btn:hover {
  border-color: var(--gold);
  color: #f8fafc;
}

.bestiary-strain-btn.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: var(--cyan);
  color: #f8fafc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.bestiary-strain-btn.elite-btn.active {
  border-color: var(--gold);
  color: #fde047;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.bestiary-card-3d {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 12px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(9, 14, 26, 0.92), rgba(15, 23, 42, 0.82));
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  align-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bestiary-card-3d:hover {
  border-color: rgba(180, 152, 98, 0.65);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.bestiary-viewport-wrap {
  position: relative;
  width: 168px;
  height: 118px;
  border-radius: 5px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 60%, rgba(30, 41, 59, 0.95), rgba(7, 10, 19, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.8);
  cursor: grab;
  user-select: none;
}

.bestiary-viewport-wrap:active {
  cursor: grabbing;
}

.bestiary-3d-canvas {
  width: 168px;
  height: 118px;
  display: block;
}

.bestiary-viewport-badge {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  background: rgba(7, 10, 19, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
  text-transform: uppercase;
}

.bestiary-viewport-hint {
  position: absolute;
  bottom: 3px;
  right: 5px;
  font-size: 8px;
  color: rgba(148, 163, 184, 0.78);
  pointer-events: none;
  letter-spacing: 0.03em;
}

.bestiary-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bestiary-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0;
}

.bestiary-stat-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

select.hud-select {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  border: 1px solid var(--border-cyan);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}

.modal-box.defeat-state {
  border-color: rgba(244, 63, 94, 0.85);
  box-shadow: 0 0 48px rgba(244, 63, 94, 0.45);
}

.modal-box.defeat-state h2 {
  color: #fb7185;
  text-shadow: 0 0 16px rgba(244, 63, 94, 0.65);
}

/* =========================================================================
   CONTINUOUS 8-SIDED VECTOR OUTLINE INCLUDING ALL TOP & BOTTOM BEVELS
   ========================================================================= */
.ribbon-strip,
.ribbon-substrip,
.top-btn,
.frost-status-frame,
.frost-action-btn,
.threat-banner-wing,
.cat-tab-btn,
.build-btn,
.toast-banner,
.pause-tab-btn,
.arsenal-node-card,
.action-btn,
.right-panel,
.frost-inspector-card,
.dock-container,
.frost-bottom-console,
.modal-box,
.pause-modal-box,
.draft-modal-box,
.draft-card {
  position: relative;
}

.ribbon-strip,
.ribbon-substrip,
.hud-tooltip,
.top-btn,
.frost-status-frame,
.frost-action-btn,
.threat-banner-wing,
.cat-tab-btn,
.build-btn,
.hq-hull-wrap,
.stacked-sub-bar,
.toast-banner,
.pause-tab-btn,
.arsenal-node-card,
.action-btn,
.right-panel,
.frost-inspector-card,
.dock-container,
.frost-bottom-console,
.modal-box,
.pause-modal-box,
.draft-modal-box,
.draft-card {
  border: none !important;
}

.ribbon-strip { --bevel-c: rgba(148, 163, 184, 0.42); }
.ribbon-substrip { --bevel-c: rgba(148, 163, 184, 0.28); }
.hud-tooltip { --bevel-c: rgba(180, 152, 98, 0.76); }
.top-btn { --bevel-c: rgba(148, 163, 184, 0.42); }
.hq-quick-btn { --bevel-c: rgba(56, 189, 248, 0.62); }
.hq-quick-btn.ready-pulse { --bevel-c: var(--emerald); }
.early-wave-btn { --bevel-c: rgba(250, 204, 21, 0.62); }
.pause-cmd-btn, #openBestiaryBtn { --bevel-c: rgba(232, 121, 249, 0.58); }
.top-btn:hover:not(:disabled),
#openBestiaryBtn:hover:not(:disabled) { --bevel-c: var(--cyan); }
#resumeGameBtn { --bevel-c: var(--emerald); }
#swarmSurgeBtn { --bevel-c: var(--danger); }
#startScreenModal .modal-box { --bevel-c: rgba(180, 152, 98, 0.78); }

.right-panel { --bevel-c: rgba(180, 152, 98, 0.52); }
.frost-inspector-card { --bevel-c: rgba(180, 152, 98, 0.62); }
.frost-status-frame { --bevel-c: rgba(180, 152, 98, 0.46); }
.frost-action-btn { --bevel-c: rgba(56, 189, 248, 0.58); }
.frost-action-btn:hover:not(:disabled) { --bevel-c: var(--cyan); }
.frost-action-btn.salvage { --bevel-c: rgba(244, 63, 94, 0.62); }
.frost-action-btn.salvage:hover:not(:disabled) { --bevel-c: var(--danger); }

.threat-banner-wing { --bevel-c: rgba(180, 152, 98, 0.56); }
.dock-container { --bevel-c: rgba(180, 152, 98, 0.56); }
.cat-tab-btn { --bevel-c: rgba(148, 163, 184, 0.34); }
.cat-tab-btn.tool-tab-btn { --bevel-c: rgba(250, 204, 21, 0.55); }
.cat-tab-btn.tool-tab-btn.danger-tab { --bevel-c: rgba(244, 63, 94, 0.55); }
.cat-tab-btn:hover,
.cat-tab-btn.tool-tab-btn:hover,
.cat-tab-btn.tool-tab-btn.danger-tab:hover { --bevel-c: rgba(180, 152, 98, 0.85); }
.cat-tab-btn.active,
.cat-tab-btn.tool-tab-btn.active,
.cat-tab-btn.tool-tab-btn.danger-tab.active { --bevel-c: var(--cyan); }

.build-btn { --bevel-c: rgba(148, 163, 184, 0.38); }
.build-btn:hover { --bevel-c: rgba(180, 152, 98, 0.88); }
.build-btn.active { --bevel-c: var(--cyan); }

.frost-bottom-console { --bevel-c: rgba(180, 152, 98, 0.58); }
.hq-hull-wrap { --bevel-c: rgba(180, 152, 98, 0.62); }
.hq-hull-wrap:hover { --bevel-c: var(--cyan); }
.hq-hull-wrap.hq-under-attack { --bevel-c: var(--danger); }
.stacked-sub-bar { --bevel-c: rgba(148, 163, 184, 0.46); }

.toast-banner { --bevel-c: var(--cyan); }
.toast-banner.alert { --bevel-c: var(--danger); }
.modal-box { --bevel-c: var(--cyan); }
.modal-box.defeat-state { --bevel-c: rgba(244, 63, 94, 0.88); }
.pause-modal-box { --bevel-c: rgba(180, 152, 98, 0.72); }
.pause-tab-btn { --bevel-c: rgba(148, 163, 184, 0.35); }
.pause-tab-btn:hover { --bevel-c: rgba(180, 152, 98, 0.72); }
.pause-tab-btn.active { --bevel-c: var(--cyan); }

.arsenal-node-card { --bevel-c: rgba(148, 163, 184, 0.32); }
.arsenal-node-card.unlocked-node { --bevel-c: rgba(34, 211, 238, 0.62); }
.arsenal-node-card.evolved-node { --bevel-c: var(--gold); }
.arsenal-node-card:hover,
.arsenal-node-card.unlocked-node:hover,
.arsenal-node-card.evolved-node:hover { --bevel-c: var(--gold); }

.action-btn { --bevel-c: var(--cyan); }
.action-btn:disabled { --bevel-c: #475569; }
.bio-btn { --bevel-c: var(--magenta); }
.draft-modal-box { --bevel-c: var(--magenta); }
.draft-card { --bevel-c: var(--cyan); }
.draft-card-tome { --bevel-c: var(--magenta); }
.draft-card-evolve { --bevel-c: var(--gold); }

.ribbon-strip::after,
.ribbon-substrip::after,
.hud-tooltip::after,
.top-btn::after,
.frost-status-frame::after,
.frost-action-btn::after,
.threat-banner-wing::after,
.cat-tab-btn::after,
.build-btn::after,
.hq-hull-wrap::after,
.stacked-sub-bar::after,
.toast-banner::after,
.pause-tab-btn::after,
.arsenal-node-card::after,
.action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--bevel-c, rgba(148, 163, 184, 0.42));
  clip-path: var(--chamfer-sm-ring);
  z-index: 4;
}

.right-panel::after,
.frost-inspector-card::after,
.dock-container::after,
.frost-bottom-console::after,
.modal-box::after,
.pause-modal-box::after,
.draft-modal-box::after,
.draft-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--bevel-c, rgba(180, 152, 98, 0.56));
  clip-path: var(--chamfer-md-ring);
  z-index: 4;
}

/* =========================================================================
   COMBAT & PHYSICS SANDBOX LAB FLOATING DOCK PANEL
   ========================================================================= */
.sandbox-lab-panel {
  width: 244px;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.95) 0%, rgba(6, 10, 20, 0.98) 100%);
  border: 1px solid rgba(250, 204, 21, 0.58);
  clip-path: var(--chamfer-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 18px rgba(250, 204, 21, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  pointer-events: auto;
}

.sandbox-lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(250, 204, 21, 0.28);
  padding-bottom: 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}

.sandbox-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.sb-btn {
  padding: 5px 6px;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-btn:hover {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.2);
  color: #fff;
}

.sb-btn.sb-active {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}

.sb-btn.sb-gold {
  border-color: rgba(250, 204, 21, 0.65);
  background: rgba(113, 63, 18, 0.45);
  color: #fef08a;
}

.sb-btn.sb-gold:hover {
  background: rgba(250, 204, 21, 0.3);
}

.sb-btn.sb-danger {
  border-color: rgba(244, 63, 94, 0.65);
  background: rgba(136, 19, 55, 0.45);
  color: #fecdd3;
}

.sb-btn.sb-danger:hover {
  background: rgba(244, 63, 94, 0.32);
}

.sb-select {
  background: rgba(9, 15, 28, 0.95);
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 700;
  width: 100%;
}

.sb-section-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ==========================================================================
   SCREEN-EDGE DIRECTIONAL HOSTILE PROXIMITY THREAT ARROWS
   ========================================================================== */
.threat-arrows-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 26;
  overflow: hidden;
}

.threat-edge-indicator {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(15, 10, 20, 0.86);
  border: 1.5px solid rgba(251, 113, 133, 0.72);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.42), inset 0 0 8px rgba(244, 63, 94, 0.22);
  color: #fda4af;
  will-change: transform;
  pointer-events: none;
}

.threat-edge-indicator[data-severity="caution"] {
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.threat-edge-indicator[data-severity="warning"] {
  border-color: rgba(251, 146, 60, 0.85);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.48);
  color: #fdba74;
}

.threat-edge-indicator[data-severity="critical"] {
  border-color: rgba(244, 63, 94, 0.95);
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.72), inset 0 0 10px rgba(244, 63, 94, 0.35);
  color: #fecdd3;
  animation: threatEdgePulse 0.65s ease-in-out infinite alternate;
}

.threat-edge-indicator[data-severity="boss"] {
  border-color: rgba(232, 121, 249, 0.95);
  background: rgba(34, 10, 44, 0.92);
  box-shadow: 0 0 22px rgba(217, 70, 239, 0.85), inset 0 0 12px rgba(217, 70, 239, 0.45);
  color: #f5d0fe;
  animation: threatEdgePulse 0.48s ease-in-out infinite alternate;
}

.threat-arrow-rot {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.threat-chevron-svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 5px currentColor);
}

.threat-badge {
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

@keyframes threatEdgePulse {
  from {
    filter: brightness(0.95);
  }
  to {
    filter: brightness(1.32);
  }
}

/* ============================================================================
   START SCREEN MODAL — ORBITAL COMMAND LAUNCH CARD
   ============================================================================ */
.start-modal-card {
  width: min(444px, calc(100vw - 28px));
  max-width: 444px;
  padding: 24px 26px 18px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.11) 0%, rgba(11, 18, 31, 0) 56%),
    linear-gradient(180deg, rgba(10, 17, 30, 0.97) 0%, rgba(5, 9, 17, 0.99) 100%);
  --bevel-c: rgba(180, 152, 98, 0.6);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.78),
    0 0 36px rgba(14, 116, 144, 0.14);
}

.start-header {
  margin-bottom: 14px;
}

.start-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.start-kicker-rule {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 178, 106, 0.65), transparent);
}

.start-title {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #f8fafc;
  margin: 0 0 6px 0;
  text-shadow: 0 0 22px rgba(56, 189, 248, 0.32);
  line-height: 1.08;
}

.start-subtitle {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.48;
  max-width: 356px;
  margin: 0 auto;
}

.start-loading-wrap {
  background: rgba(6, 11, 20, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 5px;
  padding: 8px 11px;
  margin-bottom: 14px;
  text-align: left;
  transition: border-color 0.25s ease, background 0.25s ease, padding 0.25s ease;
}

.start-loading-wrap.is-ready {
  background: rgba(6, 22, 18, 0.52);
  border-color: rgba(16, 185, 129, 0.34);
  padding: 6px 11px;
}

.start-loading-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.start-loading-wrap.is-ready .start-loading-head {
  margin-bottom: 4px;
}

.start-loading-stage {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #cbd5e1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-loading-wrap.is-ready .start-loading-stage {
  color: #6ee7b7;
}

.start-loading-pct {
  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.start-loading-wrap.is-ready .start-loading-pct {
  color: #34d399;
}

.start-loading-track {
  width: 100%;
  height: 5px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  transition: height 0.25s ease, opacity 0.25s ease;
}

.start-loading-wrap.is-ready .start-loading-track {
  height: 2px;
  opacity: 0.7;
}

.start-loading-fill {
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 55%, #34d399 100%);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
  border-radius: 999px;
  transition: width 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.start-config-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 12px 13px;
  margin-bottom: 14px;
  background: rgba(6, 11, 20, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 6px;
}

.start-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.start-field-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #94a3b8;
  text-transform: uppercase;
}

.start-select {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  background-color: rgba(10, 18, 32, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 4px;
  color: #f1f5f9;
}

.start-select:hover,
.start-select:focus {
  border-color: rgba(56, 189, 248, 0.72);
  outline: none;
}

.start-primary-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.start-continue-btn {
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.26) 0%, rgba(6, 78, 59, 0.45) 100%);
  color: #a7f3d0;
  --bevel-c: rgba(52, 211, 153, 0.85);
}

.start-continue-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.38) 0%, rgba(6, 78, 59, 0.6) 100%);
}

.start-deploy-btn {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.76) 0%, rgba(8, 51, 74, 0.94) 100%);
  color: #f8fafc;
  --bevel-c: rgba(56, 189, 248, 0.95);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.24);
}

.start-deploy-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.85) 0%, rgba(12, 74, 110, 0.95) 100%);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.36);
}

.start-presets-section {
  margin-top: 15px;
}

.start-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #64748b;
  text-transform: uppercase;
}

.start-section-divider::before,
.start-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
}

.start-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.start-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 8px 11px;
  text-align: left;
  background: rgba(11, 18, 32, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.start-preset-btn:hover:not(:disabled) {
  background: rgba(18, 29, 48, 0.94);
  transform: translateY(-1px);
}

.start-preset-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f1f5f9;
  white-space: nowrap;
}

.start-preset-meta {
  font-size: 9.5px;
  font-weight: 600;
  color: #8b9bb4;
  padding-left: 12px;
  white-space: nowrap;
}

.start-preset-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.start-preset-btn.preset-amber .start-preset-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.65); }
.start-preset-btn.preset-amber:hover:not(:disabled) { border-color: rgba(245, 158, 11, 0.6); }

.start-preset-btn.preset-crimson .start-preset-dot { background: #f87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.65); }
.start-preset-btn.preset-crimson:hover:not(:disabled) { border-color: rgba(248, 113, 113, 0.6); }

.start-preset-btn.preset-sky .start-preset-dot { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.65); }
.start-preset-btn.preset-sky:hover:not(:disabled) { border-color: rgba(56, 189, 248, 0.6); }

.start-preset-btn.preset-violet .start-preset-dot { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.65); }
.start-preset-btn.preset-violet:hover:not(:disabled) { border-color: rgba(192, 132, 252, 0.6); }

.start-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.start-controls-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  color: #94a3b8;
}

.start-controls-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 2px;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 800;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 3px;
}

.start-hint-sep {
  color: #475569;
}

.start-music-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.start-music-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
}

#startScreenModal .action-btn:disabled,
#startScreenModal .start-preset-btn:disabled,
#startScreenModal .start-tutorial-btn:disabled {
  opacity: 0.45;
  cursor: wait;
  filter: saturate(0.45);
}

.start-tutorial-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(180deg, rgba(16, 46, 42, 0.72) 0%, rgba(8, 25, 28, 0.9) 100%);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 5px;
  color: #d1fae5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.start-tutorial-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(16, 68, 58, 0.85) 0%, rgba(8, 34, 38, 0.95) 100%);
  border-color: rgba(110, 231, 183, 0.85);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.18);
  transform: translateY(-1px);
}

.start-tutorial-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ecfdf5;
}

.start-tutorial-main .start-preset-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.start-tutorial-sub {
  font-size: 9.5px;
  font-weight: 600;
  color: #86efac;
  opacity: 0.85;
}

/* ============================================================================
   IN-GAME GUIDED TUTORIAL DIRECTIVE CARD (TOP-LEFT)
   ============================================================================ */
.tutorial-card {
  width: 274px;
  padding: 12px 14px 11px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(16, 185, 129, 0.12) 0%, rgba(10, 17, 30, 0) 65%),
    linear-gradient(180deg, rgba(10, 18, 31, 0.94) 0%, rgba(6, 11, 20, 0.96) 100%);
  border: 1px solid rgba(52, 211, 153, 0.55);
  border-radius: 6px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.72),
    0 0 20px rgba(16, 185, 129, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
}

.tutorial-card.hidden {
  display: none;
}

.tutorial-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tutorial-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #34d399;
  text-transform: uppercase;
}

.tutorial-step-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.tutorial-pips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.tutorial-pip {
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  transition: background 0.2s ease;
}

.tutorial-pip.done {
  background: #34d399;
}

.tutorial-pip.active {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.75);
}

.tutorial-title {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #f8fafc;
  line-height: 1.25;
}

.tutorial-instruction {
  margin: 0;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.48;
}

.tutorial-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tutorial-keys kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  color: #e0f2fe;
  background: rgba(14, 116, 144, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 3px;
}

.tutorial-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.tutorial-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
}

.tutorial-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.tutorial-progress-text {
  font-size: 10.5px;
  font-weight: 700;
  color: #86efac;
}

.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.tutorial-link-btn {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #7dd3fc;
  cursor: pointer;
}

.tutorial-link-btn:hover {
  color: #e0f2fe;
  text-decoration: underline;
}

.tutorial-link-btn.muted {
  color: #64748b;
}

.tutorial-link-btn.muted:hover {
  color: #94a3b8;
}
