:root { color-scheme: dark; font-family: "DM Sans", system-ui, sans-serif; background: #10131d; color: #eef0f7; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; overflow: hidden; }
h1, h2, h3, p { margin: 0; }

/* Header: brand, global progress, connection */
header { flex: none; height: 52px; border-bottom: 1px solid #292d3b; display: flex; align-items: center; gap: 24px; padding: 0 18px; font-family: "Space Grotesk", sans-serif; letter-spacing: .08em; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand strong { font-size: 15px; }
.logo-mark { color: #d8f56a; font-size: 22px; }
.header-progress { flex: 1; max-width: 560px; margin: 0 auto; }
.progress-numbers { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .1em; color: #98a1b1; }
.progress-numbers strong { color: #f2f4f8; font-size: 12px; }
#percent { color: #d3f16c; font-weight: 700; }
.progress-track { height: 4px; background: #3a4250; margin-top: 5px; }
.progress-track div { height: 100%; width: 0; background: #d1ef69; }
.connection { font-size: 11px; color: #a6adbb; display: flex; gap: 8px; align-items: center; flex: none; }
.separator { color: #444b5c; margin: 0 3px; }
#status-dot, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #f1ad6f; display: inline-block; }
#status-dot.connected, .live-dot { background: #c9ef60; box-shadow: 0 0 9px #bde45080; }

/* Two columns that fill the window exactly */
main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px; }
.board-wrap { position: relative; flex: 1; min-height: 0; background: #1a2030; border: 1px solid #343b4b; overflow: hidden; }
#board { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.board-label { position: absolute; top: 12px; left: 12px; background: #151b27df; padding: 7px 9px; font-size: 9px; font-weight: 700; letter-spacing: .15em; pointer-events: none; }
.board-label .live-dot { margin-right: 5px; }
.controls { position: absolute; right: 12px; top: 12px; display: grid; gap: 4px; }
.controls button { width: 32px; height: 32px; background: #161c28e8; color: #f1f3f6; border: 1px solid #465061; cursor: pointer; font-size: 18px; }
.controls button:hover { background: #354256; }
.hint { position: absolute; bottom: 12px; left: 12px; color: #d0d5e0; background: #171d29dd; padding: 7px 8px; font-size: 9px; letter-spacing: .1em; pointer-events: none; }
.hint span { color: #d6f16c; }
.minimap-box { position: absolute; right: 12px; bottom: 12px; width: min(220px, 35%); background: #161a27e8; border: 1px solid #485163; padding: 3px; }
#minimap { width: 100%; height: auto; display: block; image-rendering: pixelated; background: #161a27; cursor: crosshair; }
.board-footer { flex: none; display: flex; justify-content: space-between; gap: 10px; color: #757e90; font-size: 9px; font-weight: 700; letter-spacing: .12em; margin-top: 9px; }

/* Sidebar: credits and upgrades first, team panels in tabs below */
aside { border-left: 1px solid #292d3b; background: #151925; padding: 14px 16px; display: flex; flex-direction: column; min-height: 0; }
.eyebrow { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: #c6e96c; }
.credits { flex: none; display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #303645; }
.credits strong { font: 700 26px "Space Grotesk", sans-serif; }
.credits div div span { font-size: 12px; color: #9da6b6; }
.credit-icon { font-size: 22px; color: #d5f16b; }
.shop-heading { flex: none; display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; }
.shop-heading h3 { font: 700 14px "Space Grotesk", sans-serif; }
.shop-heading span { font-size: 8px; font-weight: 700; letter-spacing: .14em; color: #929bad; }

.upgrade-grid { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.upgrade { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 3px; align-items: center; background: #202635; border: 1px solid #353d4c; color: #f1f4f7; text-align: left; padding: 7px 8px; cursor: pointer; font: inherit; min-width: 0; }
.upgrade:hover:not(:disabled) { border-color: #d0ec6b; }
.upgrade:disabled { opacity: .55; cursor: not-allowed; }
.upgrade-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 26px; height: 26px; background: #36453a; color: #cdeb75; font-size: 15px; }
.drone-icon { background: #3a374d; color: #baaaf4; }
.upgrade-copy { min-width: 0; }
.upgrade-copy strong, .upgrade-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upgrade-copy strong { font-size: 11px; }
.upgrade-copy small { font-size: 9px; color: #9ba5b5; margin-top: 2px; }
.price { grid-column: 2; white-space: nowrap; font-size: 10px; font-weight: 700; color: #d8ef84; }

@media (max-width: 850px) {
  body { overflow: auto; height: auto; }
  main { grid-template-columns: 1fr; }
  .board-wrap { flex: none; height: 60vh; min-height: 300px; }
  aside { border-left: 0; border-top: 1px solid #292d3b; }
  .header-progress { display: none; }
}
@media (max-width: 480px) {
  .connection { font-size: 10px; }
  .hint, .board-footer span:last-child { display: none; }
}
