:root {
  --bg: #070b12;
  --bg2: #0c1220;
  --panel: #0e1626ee;
  --line: #1e3a4c;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --red: #fb7185;
  --ok: #34d399;
  --mute: #94a3b8;
  --text: #e8eef7;
  --enemy: #c084fc;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: "Source Sans 3", system-ui, sans-serif; overflow: hidden; }
.hidden { display: none !important; }

.boot {
  height: 100%; display: grid; place-content: center; text-align: center; gap: .4rem;
  background: radial-gradient(ellipse at 50% 30%, #123 0%, #070b12 70%);
}
.boot h1, .top .brand { font-family: Syne, sans-serif; }
.boot h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; letter-spacing: .04em; }
.kicker { letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); font-size: .72rem; }
.boot-msg { color: var(--mute); }

.app { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.top {
  display: flex; align-items: center; gap: .75rem; padding: .45rem .8rem;
  border-bottom: 1px solid var(--line); background: #080e18;
}
.brand { color: var(--text); text-decoration: none; font-weight: 800; font-size: .95rem; }
.phase-pill {
  font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .14em;
  padding: .28rem .7rem; border: 1px solid var(--cyan); color: var(--cyan); border-radius: 999px;
}
.res { display: flex; flex-wrap: wrap; gap: .65rem; font-size: .82rem; color: var(--mute); }
.res b { color: var(--gold); font-weight: 700; }
.hq-pips { margin-left: auto; display: flex; gap: .35rem; align-items: center; font-size: .78rem; color: var(--mute); }
.pip { width: 10px; height: 10px; border-radius: 2px; background: #334155; display: inline-block; }
.pip.me { background: var(--cyan); }
.pip.foe { background: var(--enemy); }
.pip.dead { background: #3f1d24; }

.stage { display: grid; grid-template-columns: 270px 1fr 300px; min-height: 0; }
.viewport { position: relative; min-width: 0; min-height: 0; background:
  radial-gradient(ellipse at 50% 0%, #2a3d5c 0%, #121c2e 42%, #070b12 75%); }
#iso { width: 100%; height: 100%; display: block; cursor: crosshair; }
.hint {
  position: absolute; left: 12px; bottom: 28px; max-width: 70%;
  font-size: .8rem; color: #cbe7f0; text-shadow: 0 1px 4px #000;
  pointer-events: none;
}
.cam-help {
  position: absolute; right: 10px; bottom: 8px; font-size: .68rem; color: #64748b;
  font-family: "IBM Plex Mono", monospace; pointer-events: none;
}

.rail { background: var(--bg2); border-color: var(--line); overflow: auto; min-height: 0; }
.left { border-right: 1px solid var(--line); padding: .6rem; }
.right { border-left: 1px solid var(--line); padding: .6rem; display: flex; flex-direction: column; gap: .55rem; }
.panel { background: #0b1522; border: 1px solid var(--line); border-radius: 10px; padding: .65rem; }
.panel h3 { margin: 0 0 .4rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); font-family: Syne, sans-serif; }
.cat { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #64748b; margin: .55rem 0 .25rem; }
.item {
  display: grid; grid-template-columns: 42px 1fr auto; gap: .45rem; align-items: center;
  width: 100%; text-align: left; background: #101a2a; border: 1px solid #1e293b; color: inherit;
  border-radius: 8px; padding: .35rem; margin: 0 0 .35rem; cursor: pointer; font: inherit;
}
.item img { width: 42px; height: 42px; object-fit: contain; background: #071018; border-radius: 6px; }
.item .nm { font-weight: 700; font-size: .82rem; }
.item .ds { font-size: .7rem; color: var(--mute); }
.item .cost { font-family: "IBM Plex Mono", monospace; font-size: .72rem; color: var(--gold); }
.item:hover, .item.on { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.item:disabled { opacity: .4; cursor: not-allowed; }

.log { font-family: "IBM Plex Mono", monospace; font-size: .7rem; color: #93c5c9; max-height: 28vh; overflow: auto; white-space: pre-wrap; line-height: 1.45; }
.sel-meta { font-size: .82rem; color: var(--mute); }
.hpbar { height: 6px; background: #1e293b; border-radius: 99px; overflow: hidden; margin: .35rem 0; }
.hpbar > i { display: block; height: 100%; background: linear-gradient(90deg, #fb7185, #34d399); }

.dock {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem;
  border-top: 1px solid var(--line); background: #080e18;
}
.grow { flex: 1; font-size: .8rem; color: var(--mute); }
.btn {
  background: #132033; color: var(--text); border: 1px solid #334155; border-radius: 9px;
  padding: .5rem .85rem; cursor: pointer; font: 650 0.82rem Syne, sans-serif;
}
.btn:hover { border-color: var(--cyan); }
.btn.gold { background: var(--gold); color: #111; border-color: var(--gold); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.paypal-mini {
  display: inline-flex; align-items: center; justify-content: center;
  background: #0070ba; color: #fff !important; text-decoration: none !important;
  font-weight: 800; font-size: .72rem; letter-spacing: .04em;
  padding: .32rem .65rem; border-radius: 8px; white-space: nowrap;
}
.paypal-mini:hover { filter: brightness(1.12); }

.radio-dock {
  position: fixed; left: 10px; bottom: 58px; z-index: 25;
  width: min(320px, calc(100vw - 20px));
  background: #0b1522ee; border: 1px solid #1e3a4c; border-radius: 12px;
  padding: .45rem .55rem; backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px #0008;
}
.radio-dock.collapsed { width: auto; }
.radio-dock.collapsed .radio-panel { display: none; }
.radio-chip { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.radio-chip button, .radio-row button {
  background: #132033; color: var(--text); border: 1px solid #334155; border-radius: 8px;
  padding: .28rem .55rem; cursor: pointer; font: 650 0.72rem Syne, sans-serif;
}
.radio-chip button:hover, .radio-row button:hover { border-color: var(--cyan); }
.radio-panel { margin-top: .4rem; }
.radio-head { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .35rem; }
.radio-head strong { font-size: .78rem; color: var(--cyan); }
.radio-head a { font-size: .68rem; color: #7dd3fc; }
.radio-title {
  font-family: "IBM Plex Mono", monospace; font-size: .7rem; color: #cbd5e1;
  min-height: 2.2em; line-height: 1.3;
}
.radio-row { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.radio-vol { display: flex; align-items: center; gap: .3rem; font-size: .68rem; color: var(--mute); }
.radio-vol input { width: 80px; }

@media (max-width: 980px) {
  .radio-dock { bottom: auto; top: 52px; right: 8px; left: auto; }
}

.overlay {
  position: fixed; inset: 0; background: #05070ccc; display: none; place-items: center; padding: 1.2rem; z-index: 20;
}
.overlay.show { display: grid; }
.overlay.show.menu { display: block; padding: 0; background: #05070c; overflow: auto; }

.title-screen {
  min-height: 100vh; display: grid; grid-template-columns: 1.15fr minmax(320px, 0.9fr);
}
.title-art { position: relative; min-height: 100vh; background: #070b12; }
.title-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.title-art-fade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 40%, #070b12 96%);
  pointer-events: none;
}
.title-panel {
  padding: clamp(1.2rem, 4vh, 2.4rem) clamp(1rem, 3vw, 2rem);
  background: linear-gradient(180deg, #0c1524, #070b12);
  display: flex; flex-direction: column; justify-content: center;
}
.title-panel h1 {
  font-family: Syne, sans-serif; font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  margin: 0 0 .4rem; letter-spacing: .06em; line-height: 1.05;
}
.title-tag { color: #e2e8f0; font-size: 1.05rem; margin: 0 0 .7rem; }

@media (max-width: 900px) {
  .title-screen { grid-template-columns: 1fr; }
  .title-art { min-height: 28vh; }
  .title-art-fade { background: linear-gradient(180deg, transparent 40%, #070b12 100%); }
}
.modal {
  width: min(720px, 100%); max-height: 90vh; overflow: auto; background: linear-gradient(180deg, #121c2c, #0a1018);
  border: 1px solid #2dd4bf55; border-radius: 16px; padding: 1.2rem 1.3rem 1.4rem;
  box-shadow: 0 0 80px #22d3ee22;
}
.modal h2 { font-family: Syne, sans-serif; margin: 0 0 .4rem; font-size: 1.7rem; }
.modal p { color: #cbd5e1; line-height: 1.5; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .7rem 0; }
input, select {
  background: #0b1220; color: var(--text); border: 1px solid #334155; border-radius: 8px;
  padding: .5rem .65rem; font: inherit;
}
.lb { width: 100%; border-collapse: collapse; font-size: .82rem; }
.lb th, .lb td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid #1e293b; }
.lb th { color: var(--cyan); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(42vh, 1fr) auto; }
  .rail { max-height: 28vh; }
  .left { border-right: 0; border-bottom: 1px solid var(--line); }
  .right { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; overflow: auto; }
  .right .panel { min-width: 220px; }
}
