/* RELAY — terminal space-opera. cyan accent; paragon blue / renegade red. */
:root {
  --bg: #0a0d12;
  --fg: #c6ced6;
  --dim: #67737f;
  --accent: #5bc8dc;
  --good: #7dc47f;
  --bad: #d4695f;
  --paragon: #6aa7ff;
  --renegade: #ff6a5e;
  --line: #1d2733;
  --btnbg: #101620;
  --btncool: #1a2330;
}
body.light {
  --bg: #f0f2f4;
  --fg: #26292c;
  --dim: #7d868e;
  --accent: #0e7c94;
  --good: #3a7d3d;
  --bad: #a53c33;
  --paragon: #1f5fc4;
  --renegade: #c43a2e;
  --line: #d3d9de;
  --btnbg: #e4e8ec;
  --btncool: #d6dce2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
}

#wrapper { max-width: 1100px; margin: 0 auto; padding: 12px 16px 60px; }

#saveNotify {
  position: fixed; top: 8px; right: 16px;
  color: var(--dim); opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none; z-index: 50;
}
#saveNotify.show { opacity: 1; transition: opacity 0.1s; }

#gameTitle { color: var(--accent); letter-spacing: 6px; margin-bottom: 4px; font-size: 13px; }

#tabs { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.tabBtn { display: inline-block; cursor: pointer; margin-right: 18px; color: var(--dim); padding: 2px; }
.tabBtn:hover { color: var(--fg); }
.tabBtn.selected { color: var(--accent); }

#content { display: flex; gap: 18px; }
#notifications {
  width: 230px; flex: none;
  max-height: 80vh; overflow: hidden;
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}
.notification { margin-bottom: 8px; font-size: 13px; }
.notification.good { color: var(--good); }
.notification.bad { color: var(--bad); }
.notification.paragon { color: var(--paragon); }
.notification.renegade { color: var(--renegade); }

#panels { flex: 1; min-width: 0; }
.panel { display: none; }
.panel.activePanel { display: block; }

#sidebar { width: 220px; flex: none; }
.storesTitle { color: var(--dim); border-bottom: 1px solid var(--line); margin: 10px 0 4px; }
.storeRow { display: flex; justify-content: space-between; font-size: 13px; }
.storeName { color: var(--fg); }
.storeVal { color: var(--accent); }

.paragonText { color: var(--paragon); }
.renegadeText { color: var(--renegade); }
.mBar { height: 4px; background: var(--line); margin: 2px 0 6px; }
.mFill { height: 100%; width: 0%; }
.paragonFill { background: var(--paragon); }
.renegadeFill { background: var(--renegade); }

.panelStatus { margin: 8px 0; }
.dim { color: var(--dim); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.accent { color: var(--accent); }
.sectionTitle { color: var(--dim); margin: 14px 0 6px; border-bottom: 1px solid var(--line); }

.button {
  position: relative; display: inline-block;
  border: 1px solid var(--line); background: var(--btnbg);
  padding: 5px 14px; cursor: pointer; overflow: hidden;
  min-width: 90px; text-align: center;
}
.button:hover { border-color: var(--dim); }
.button.disabled { color: var(--dim); cursor: default; }
.button.cooling { color: var(--dim); cursor: default; }
.button .btnLabel { position: relative; z-index: 2; }
.cooldownBar { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--btncool); z-index: 1; }

/* galaxy / system rows */
.sysRow { display: flex; align-items: center; gap: 12px; margin: 5px 0; flex-wrap: wrap; }
.sysName { }
.jumpBtn, .shootBtn { cursor: pointer; color: var(--accent); white-space: nowrap; }
.jumpBtn:hover, .shootBtn:hover { color: var(--fg); }
.jumpBtn.disabled { color: var(--dim); cursor: default; }

/* crew */
.crewCard { border: 1px solid var(--line); padding: 10px 12px; margin: 10px 0; }
.crewHead { display: flex; gap: 12px; align-items: baseline; }
.crewName { color: var(--accent); }
.crewLoyal { font-size: 11px; letter-spacing: 2px; }
.crewBio { font-size: 13px; margin: 4px 0; }
.crewAbility { font-size: 13px; margin: 4px 0; }
.deadRow { opacity: 0.45; }

/* combat */
.combatSide { border: 1px solid var(--line); padding: 8px 12px; margin: 8px 0; }
.playerSide { border-color: var(--dim); }
.enemyRow { display: flex; gap: 14px; align-items: baseline; margin: 3px 0; flex-wrap: wrap; }
.enemyName { min-width: 150px; color: var(--accent); }
.enemyStats { color: var(--fg); font-size: 13px; }
.combatLog { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.combatLogLine { font-size: 12px; color: var(--dim); }
.combatLogLine.good { color: var(--good); }
.combatLogLine.bad { color: var(--bad); }

/* modal */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
body.light .overlay { background: rgba(40,50,60,0.4); }
.modalBox {
  background: var(--bg); border: 1px solid var(--dim);
  padding: 18px 22px; max-width: 520px; width: 92%;
  max-height: 85vh; overflow-y: auto;
}
.modalBox.wide { max-width: 680px; }
.modalTitle { color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.modalTitle.bad { color: var(--bad); }
.modalText { margin: 8px 0; }
.modalButtons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modalButtons.vertical { flex-direction: column; align-items: stretch; }
.choiceBtn { text-align: left; }
.choiceParagon { border-left: 3px solid var(--paragon); }
.choiceRenegade { border-left: 3px solid var(--renegade); }
.missionFooter { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.missionRestart { color: var(--dim); cursor: pointer; font-size: 12px; }
.missionRestart:hover { color: var(--fg); }
.missionRestart.accent { color: var(--accent); }
.missionRestart.dim { cursor: default; }
.missionRestart.dim:hover { color: var(--dim); }
.modalInput {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 6px 10px;
  background: var(--btnbg);
  color: var(--fg);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
  user-select: text;
}
.modalInput:focus { outline: none; border-color: var(--accent); }
.modalTextarea {
  width: 100%; height: 110px; background: var(--btnbg); color: var(--fg);
  border: 1px solid var(--line); font-family: inherit; font-size: 12px; user-select: text;
}

.slotRow { border: 1px solid var(--line); padding: 8px 10px; margin: 8px 0; }
.slotRow.activeSlot { border-color: var(--accent); }
.slotLabel { margin-bottom: 6px; }

#menu {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 8px 16px; text-align: right;
}
.menuBtn { color: var(--dim); cursor: pointer; margin-left: 18px; }
.menuBtn:hover { color: var(--fg); }

@media (max-width: 900px) {
  #content { flex-direction: column; }
  #notifications { width: 100%; max-height: 120px; order: 3; }
  #sidebar { width: 100%; order: 2; }
  #panels { order: 1; }
}
