:root {
  --ink: #0b1022; --panel: rgba(16, 23, 49, 0.82); --line: #2c3a66;
  --amber: #ffa23e; --lume: #3ce8ff; --violet: #c04df0; --text: #dfe7ff;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--ink); color: var(--text);
  font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; }
#hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 10px;
  align-items: center; padding: 8px 10px; pointer-events: none; }
#hud-top > * { pointer-events: auto; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 10px; display: flex; gap: 8px; align-items: baseline; }
.stat .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8fa0cf; }
.stat .v { font-size: 16px; font-weight: 700; color: var(--amber); min-width: 2.2em; }
.spacer { flex: 1; }
.mini { background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 10px; font-size: 14px; cursor: pointer; }
.mini:hover { border-color: var(--amber); }
#selinfo { position: fixed; top: 52px; left: 12px; background: rgba(11, 16, 34, 0.7);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px;
  font-size: 12px; color: #9fb0e0; max-width: 60vw; pointer-events: none; }
#buildbar { position: fixed; left: 12px; bottom: 12px; display: flex; gap: 8px; }
.buildbtn { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 8px 12px; text-align: left; cursor: pointer; min-width: 92px;
  display: flex; flex-direction: column; gap: 2px; }
.buildbtn b { color: var(--amber); font-size: 15px; }
.buildbtn i { font-style: normal; font-size: 10px; color: #8fa0cf; }
.buildbtn .cost { font-size: 12px; color: var(--lume); }
.buildbtn:hover { border-color: var(--amber); }
.buildbtn.cant { opacity: 0.45; }
#minimap { position: fixed; right: 12px; bottom: 12px; width: 128px; height: 128px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  touch-action: manipulation; }
#stick { position: fixed; left: 16px; bottom: 120px; width: 84px; height: 84px;
  border-radius: 50%; background: rgba(20, 28, 58, 0.55); border: 1px solid var(--line);
  touch-action: none; display: none; }
#stick-nub { position: absolute; left: 50%; top: 50%; margin: -18px 0 0 -18px;
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 162, 62, 0.55);
  border: 1px solid var(--amber); }
#zoombtns { position: fixed; right: 12px; bottom: 150px; display: none; flex-direction: column; gap: 8px; }
#zoombtns button { width: 44px; height: 44px; border-radius: 12px; font-size: 20px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); cursor: pointer; }
#marquee { position: fixed; display: none; border: 1px solid var(--amber);
  background: rgba(255, 162, 62, 0.12); pointer-events: none; z-index: 20; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(5, 8, 20, 0.72); z-index: 30;
  backdrop-filter: blur(3px); }
.card { background: linear-gradient(180deg, #16204a, #0d1430);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px;
  max-width: 640px; width: min(92vw, 640px); max-height: 88vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.card h1 { font-size: 30px; color: var(--amber); letter-spacing: 0.02em; }
.card .tag { color: var(--lume); margin: 6px 0 16px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.cols h3 { font-size: 13px; color: var(--lume); margin-bottom: 4px; }
.cols div { font-size: 12.5px; color: #b9c6ea; }
.bigbtn { display: block; width: 100%; padding: 13px; font-size: 17px; font-weight: 700;
  color: #14182e; background: linear-gradient(180deg, #ffc46e, #ff9420);
  border: none; border-radius: 12px; cursor: pointer; }
.bigbtn:hover { filter: brightness(1.1); }
#overlay-end .card h1 { color: var(--lume); }
@media (pointer: coarse), (max-width: 700px) {
  #stick, #zoombtns { display: flex; }
  #stick { display: block; }
  #minimap { width: 88px; height: 88px; }
  #buildbar { left: 8px; bottom: 8px; }
  .buildbtn { min-width: 74px; padding: 6px 8px; }
  .cols { grid-template-columns: 1fr; }
  #hud-top { gap: 6px; }
  .stat { padding: 3px 7px; }
  .stat .v { font-size: 13px; }
  #stick { bottom: 108px; }
  #zoombtns { bottom: 112px; }
}
