:root {
  --ink: #cfe3ff;
  --ink-dim: #7d93b8;
  --panel: rgba(6, 12, 26, 0.92);
  --panel-edge: #2c4a7a;
  --accent: #4ea1ff;
  --yellow: #ffd040;
  --bg: #05070f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
  overflow: hidden;
}
#app { position: fixed; inset: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: none; background: #000; }
#screens { position: absolute; inset: 0; }
#toast {
  position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: rgba(0,0,0,0.8); border: 1px solid var(--panel-edge); color: var(--yellow);
  padding: 6px 16px; font-size: 14px; display: none; z-index: 60; white-space: pre-line; text-align: center;
}

/* ---------- generic screens ---------- */
.screen { position: absolute; inset: 0; background-size: cover; background-position: center; }
.screen.dim::after { content: ""; position: absolute; inset: 0; background: rgba(2, 6, 16, 0.72); }
.screen > * { position: relative; z-index: 2; }

.center-col { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }

.btn {
  background: linear-gradient(180deg, #17305a, #0c1c38);
  border: 1px solid var(--panel-edge); color: var(--ink);
  padding: 9px 22px; font-family: inherit; font-size: 15px; letter-spacing: 1px;
  cursor: pointer; text-transform: uppercase;
}
.btn:hover { background: linear-gradient(180deg, #24508f, #123058); color: #fff; border-color: var(--accent); }
.btn.primary { border-color: var(--accent); color: #eaf4ff; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--panel-edge);
  box-shadow: 0 0 24px rgba(30, 90, 190, 0.25), inset 0 0 40px rgba(20, 60, 140, 0.12);
  padding: 14px 18px;
}
.title-big { font-size: 44px; letter-spacing: 6px; color: #e8f2ff; text-shadow: 0 0 18px rgba(80, 160, 255, 0.8); text-transform: uppercase; }
.sub { color: var(--ink-dim); font-size: 13px; }
.warn { color: #ff7777; }
.good { color: #7dff9a; }
.yellow { color: var(--yellow); }

input[type=text] {
  background: #060d1c; border: 1px solid var(--panel-edge); color: var(--ink);
  padding: 9px 12px; font-family: inherit; font-size: 15px; outline: none; width: 240px;
}
input[type=text]:focus { border-color: var(--accent); }

/* ---------- title ---------- */
.house-cards { display: flex; gap: 14px; }
.house-card {
  width: 190px; padding: 12px; text-align: center; cursor: pointer;
  border: 2px solid #333; background: rgba(4, 8, 18, 0.85);
}
.house-card:hover { border-color: var(--accent); }
.house-card.selected { box-shadow: 0 0 16px currentColor; }
.house-swatch { width: 100%; height: 8px; margin-bottom: 8px; }
.house-card .hname { font-size: 14px; letter-spacing: 1px; }
.house-card .hdesc { font-size: 11px; color: var(--ink-dim); margin-top: 6px; max-height: 84px; overflow: hidden; }

/* ---------- lobby ---------- */
.lobby-grid {
  position: absolute; inset: 6% 5%; display: grid;
  grid-template-columns: 300px 1fr 340px; grid-template-rows: 1fr auto; gap: 14px;
}
.tabs { display: flex; gap: 6px; }
.tab { padding: 8px 26px; background: #0a1628; border: 1px solid var(--panel-edge); cursor: pointer; letter-spacing: 2px; font-size: 13px; }
.tab.active { background: #1b3a6b; color: #fff; }
.tab:hover { border-color: var(--accent); }

.player-list { overflow-y: auto; max-height: 100%; }
.player-row { display: flex; justify-content: space-between; padding: 5px 6px; border-bottom: 1px solid rgba(60, 100, 170, 0.25); font-size: 13px; }
.player-row .pname.inArena::before { content: "▸ "; color: var(--yellow); }
.player-row .house-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }

.chat-box { display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; font-size: 13px; line-height: 1.5; padding: 6px; background: rgba(0,0,0,0.35); border: 1px solid rgba(60,100,170,0.25); min-height: 120px; max-height: 220px; }
.chat-log .cname { font-weight: bold; }
.chat-input { margin-top: 6px; width: 100%; }

.mission-card { border: 1px solid rgba(60,100,170,0.4); padding: 10px; margin-bottom: 10px; background: rgba(0,0,0,0.3); }
.mission-card.sel { border-color: var(--accent); }

/* ---------- hangar ---------- */
.hangar-grid {
  position: absolute; inset: 5% 4%; display: grid;
  grid-template-columns: 360px 1fr 320px; gap: 14px;
}
.ship-preview { position: relative; width: 100%; height: 300px; }
.ship-preview img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 86%; }
.loadout-line { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed rgba(70,110,180,0.35); }
.item-list { overflow-y: auto; max-height: 52vh; }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; border-bottom: 1px solid rgba(60,100,170,0.25); font-size: 13px; }
.item-row.eq { background: rgba(40, 90, 170, 0.25); }
.item-row .price { color: var(--yellow); }
.item-row .fits-no { color: #ff8888; }

/* ---------- arena overlays ---------- */
#arena-ui { position: absolute; inset: 0; pointer-events: none; }
#chat-line { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 46%; pointer-events: auto; }
#chat-line input { width: 100%; background: rgba(0,0,0,0.65); }
#arena-msg { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font-size: 26px; letter-spacing: 3px; text-align: center; text-shadow: 0 0 12px #000; }
#esc-menu { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); z-index: 40; pointer-events: auto; }
