*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #000;
  color: #ccc;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

#header {
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  padding: 4px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
#header-title  { color: #78ff00; font-weight: bold; letter-spacing: 2px; }
#header-turn   { color: #aaa; }
#header-status { color: #ffff00; }

#game-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#galaxy-wrap {
  flex-shrink: 0;
  position: relative;
  background: #000;
}

#galaxy {
  display: block;
  cursor: crosshair;
}

#side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #222;
  min-width: 160px;
  max-width: 320px;
}

#scoreboard {
  flex-shrink: 0;
  padding: 6px 8px;
  border-bottom: 1px solid #222;
  font-size: 11px;
}
#scoreboard table          { width: 100%; border-collapse: collapse; }
#scoreboard td             { padding: 1px 2px; }
#scoreboard .s-name        { font-weight: bold; }
#scoreboard .s-planets     { text-align: right; color: #888; }
#scoreboard .s-score       { text-align: right; }
#scoreboard .eliminated    { opacity: 0.35; }

#news-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}
.news-line { white-space: pre-wrap; word-break: break-word; }

#controls {
  flex-shrink: 0;
  border-top: 1px solid #222;
  padding: 6px 8px;
  font-size: 11px;
}

#fleet-ui       { display: none; }
#fleet-ui.show  { display: block; }

#fleet-ui label  { display: block; margin-bottom: 4px; color: #aaa; }
#fleet-ui .row   { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#ship-slider     { flex: 1; accent-color: #78ff00; }
#ship-count      { min-width: 28px; text-align: right; color: #fff; font-weight: bold; }

.btn             { background: #111; color: #ccc; border: 1px solid #444; padding: 3px 10px; cursor: pointer; font-family: inherit; font-size: 11px; }
.btn:hover       { background: #222; border-color: #666; }
.btn.primary     { border-color: #78ff00; color: #78ff00; }
.btn.primary:hover { background: #0a1a0a; }
.btn:disabled    { opacity: 0.3; cursor: default; }

#idle-hint { color: #666; }

/* ── Config dialog ─────────────────────────────────────────── */
#game-config {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#config-box {
  background: #0d0d0d;
  border: 1px solid #333;
  padding: 24px 32px;
  min-width: 280px;
}
#config-box h2     { color: #78ff00; letter-spacing: 3px; margin-bottom: 16px; font-size: 16px; }
#config-box label  { display: block; margin-bottom: 6px; color: #aaa; font-size: 12px; }
#config-box select {
  background: #111; color: #fff; border: 1px solid #444;
  padding: 4px 8px; font-family: inherit; font-size: 12px;
  margin-bottom: 12px; width: 100%;
}
#config-box .start-btn {
  margin-top: 8px; width: 100%; padding: 8px;
  background: #0a2a0a; border: 1px solid #78ff00; color: #78ff00;
  font-size: 13px; cursor: pointer; font-family: inherit; letter-spacing: 1px;
}
#config-box .start-btn:hover { background: #122a12; }

/* ── Game over overlay ─────────────────────────────────────── */
#gameover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
}
#gameover-overlay.show { display: flex; }
#gameover-box          { background: #0d0d0d; border: 1px solid #333; padding: 24px 40px; text-align: center; }
#gameover-box h2       { font-size: 20px; margin-bottom: 10px; letter-spacing: 2px; }
#gameover-box p        { color: #aaa; margin-bottom: 16px; font-size: 12px; }
