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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
  font-family: monospace;
  color: #e0e0e0;
}

#app {
  display: flex;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  flex: 1 1 auto;
  display: block;
  min-width: 0;
}

#shop-panel {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  background: #0d0d1a;
  border-left: 1px solid rgba(0, 229, 255, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.2) transparent;
}

/* ── Collapsible tabs ────────────────────────────────── */

.tab {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tab.hidden {
  display: none;
}

.tab-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: monospace;
  color: rgba(0, 229, 255, 0.6);
  transition: background 0.12s;
}

.tab-header:hover {
  background: rgba(0,229,255,0.04);
}

.tab-header--gold {
  color: rgba(255, 214, 0, 0.6);
}

.tab-header--gold:hover {
  background: rgba(255,214,0,0.04);
}

.tab-header--dim {
  color: rgba(255,255,255,0.25);
}

.tab-header--dim:hover {
  background: rgba(255,255,255,0.03);
}

.tab-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  flex: 1 1 auto;
}

.tab-chevron {
  font-size: 8px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.15s;
}

/* When the body is collapsed the chevron flips */
.tab-body--collapsed + * .tab-chevron,
.tab-body.tab-body--collapsed ~ .tab-chevron {
  transform: rotate(180deg);
}

/* Simpler: header holds chevron, so toggle class on header */
.tab-header.is-collapsed .tab-chevron {
  transform: rotate(180deg);
}

.tab-body {
  overflow: visible;
}

.tab-body--collapsed {
  display: none;
}

/* ── Upgrade list ─────────────────────────────────────── */

#upgrade-list {
  padding: 8px 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.3) transparent;
}

.upgrade-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 9px 10px;
  margin-bottom: 7px;
  transition: border-color 0.15s;
}

.upgrade-card:hover {
  border-color: rgba(0,229,255,0.3);
}

.upgrade-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.upgrade-name {
  font-size: 13px;
  color: #e0e0e0;
  flex: 1 1 auto;
}

.upgrade-tier {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.upgrade-tier.maxed {
  color: #ffd600;
}

/* ── Tooltip ──────────────────────────────────────────── */

.upgrade-tooltip-icon {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.35);
  color: rgba(0,229,255,0.5);
  font-size: 9px;
  cursor: default;
  line-height: 1;
}

.upgrade-tooltip-icon:hover {
  border-color: rgba(0,229,255,0.7);
  color: #00e5ff;
}

.upgrade-tooltip-box {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 230px;
  background: #0d0d1a;
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.55;
  color: rgba(255,255,255,0.7);
  white-space: normal;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.upgrade-tooltip-icon:hover .upgrade-tooltip-box {
  display: block;
}

/* ── Maxed (collapsed) card ───────────────────────────── */

.upgrade-card.is-maxed {
  padding: 5px 10px;
  background: rgba(255,214,0,0.03);
  border-color: rgba(255,214,0,0.12);
}

.upgrade-card.is-maxed .upgrade-card-top {
  margin-bottom: 0;
}

.upgrade-card.is-maxed .upgrade-buy-btn {
  display: none;
}

.upgrade-buy-btn {
  width: 100%;
  padding: 5px 0;
  background: transparent;
  border: 1px solid rgba(0,229,255,0.4);
  color: #00e5ff;
  font-family: monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.upgrade-buy-btn:hover:not(:disabled) {
  background: rgba(0,229,255,0.15);
}

.upgrade-buy-btn:disabled {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

.upgrade-buy-btn.maxed {
  border-color: rgba(255,214,0,0.3);
  color: rgba(255,214,0,0.5);
  cursor: default;
}

/* ── Prestige (Ascension) tab content ────────────────── */

#prestige-shard-display {
  font-size: 13px;
  font-weight: bold;
  color: #ffd600;
  flex-shrink: 0;
}

#currency-display {
  font-size: 13px;
  font-weight: bold;
  color: rgba(0, 229, 255, 0.6);
  flex-shrink: 0;
}

#prestige-passive-line {
  font-size: 10px;
  color: rgba(255, 214, 0, 0.5);
  padding: 4px 16px 8px;
}

#prestige-upgrade-list {
  padding: 0 10px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,214,0,0.2) transparent;
}

/* Prestige cards share upgrade-card base styles but with gold accent */
.prestige-card {
  background: rgba(255,214,0,0.03);
  border: 1px solid rgba(255,214,0,0.12);
  border-radius: 4px;
  padding: 9px 10px;
  margin-bottom: 7px;
  transition: border-color 0.15s;
}

.prestige-card:hover {
  border-color: rgba(255,214,0,0.35);
}

.prestige-card .upgrade-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.prestige-card .upgrade-name {
  font-size: 13px;
  color: #e0e0e0;
  flex: 1 1 auto;
}

.prestige-card .upgrade-tier {
  font-size: 11px;
  color: rgba(255,214,0,0.4);
  flex-shrink: 0;
}

.prestige-card .upgrade-tier.maxed {
  color: #ffd600;
}

.prestige-card.is-maxed {
  padding: 5px 10px;
  border-color: rgba(255,214,0,0.08);
}

.prestige-card.is-maxed .upgrade-card-top {
  margin-bottom: 0;
}

.prestige-card.is-maxed .prestige-buy-btn {
  display: none;
}

.prestige-buy-btn {
  width: 100%;
  padding: 5px 0;
  background: transparent;
  border: 1px solid rgba(255,214,0,0.4);
  color: #ffd600;
  font-family: monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.prestige-buy-btn:hover:not(:disabled) {
  background: rgba(255,214,0,0.1);
}

.prestige-buy-btn:disabled {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

.prestige-buy-btn.maxed {
  border-color: rgba(255,214,0,0.25);
  color: rgba(255,214,0,0.45);
  cursor: default;
}

/* ── Ascend button (inside Ascension tab body) ────────── */

#ascend-btn {
  display: block;
  width: calc(100% - 20px);
  margin: 4px 10px 10px;
  padding: 7px 0;
  background: transparent;
  border: 1px solid rgba(255, 214, 0, 0.5);
  color: rgba(255, 214, 0, 0.85);
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#ascend-btn.hidden {
  display: none;
}

#ascend-btn:hover:not(:disabled) {
  background: rgba(255, 214, 0, 0.12);
  border-color: #ffd600;
  color: #ffd600;
}

#ascend-btn:disabled {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

/* ── Settings tab content ─────────────────────────────── */

#volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
}

#volume-control label {
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

#volume-slider {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,229,255,0.7);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(0,229,255,0.7);
  cursor: pointer;
}

#quality-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
}

#quality-control label {
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

#quality-buttons {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
}

.quality-btn {
  flex: 1 1 auto;
  padding: 3px 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.3);
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.quality-btn:hover:not(.active) {
  border-color: rgba(0,229,255,0.3);
  color: rgba(0,229,255,0.6);
}

.quality-btn.active {
  border-color: rgba(0,229,255,0.6);
  color: #00e5ff;
  background: rgba(0,229,255,0.08);
}

.quality-btn.auto-active {
  border-color: rgba(255,214,0,0.5);
  color: rgba(255,214,0,0.7);
  background: rgba(255,214,0,0.06);
}

#auto-quality-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
}

#auto-quality-btn {
  flex-shrink: 0;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid rgba(255,214,0,0.25);
  color: rgba(255,214,0,0.35);
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

#auto-quality-btn:hover:not(.active) {
  border-color: rgba(255,214,0,0.5);
  color: rgba(255,214,0,0.7);
}

#auto-quality-btn.active {
  border-color: #ffd600;
  color: #ffd600;
  background: rgba(255,214,0,0.1);
}

#auto-quality-label {
  font-size: 9px;
  color: rgba(255,255,255,0.2);
  line-height: 1.3;
}

#new-game-btn {
  display: block;
  width: calc(100% - 20px);
  margin: 8px 10px 10px;
  padding: 7px 0;
  background: transparent;
  border: 1px solid rgba(255, 23, 68, 0.4);
  color: rgba(255, 23, 68, 0.7);
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#new-game-btn:hover {
  background: rgba(255,23,68,0.15);
  border-color: #ff1744;
  color: #ff1744;
}

/* ── Traitor (pet) tab ────────────────────────────────── */

.tab-header--green {
  color: rgba(76, 175, 80, 0.7);
}

.tab-header--green:hover {
  background: rgba(76, 175, 80, 0.05);
}

#traitor-bonus-display {
  font-size: 13px;
  font-weight: bold;
  color: #4caf50;
  flex-shrink: 0;
}

#traitor-passive-line {
  font-size: 10px;
  color: rgba(76, 175, 80, 0.55);
  padding: 4px 16px 6px;
}

/* Active slots row */
#traitor-slots {
  display: flex;
  gap: 6px;
  padding: 4px 10px 8px;
}

.traitor-slot {
  flex: 1 1 0;
  min-height: 54px;
  border-radius: 4px;
  border: 1px dashed rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  padding: 4px 2px;
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}

.traitor-slot:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.3);
}

.traitor-slot.filled {
  border-style: solid;
  color: #e0e0e0;
}

.traitor-slot-type {
  font-size: 10px;
  font-weight: bold;
  line-height: 1.1;
}

.traitor-slot-unassign {
  font-size: 8px;
  color: rgba(255,255,255,0.3);
  margin-top: 1px;
}

/* Roster */
#traitor-roster {
  padding: 0 10px 8px;
}

.traitor-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  flex-wrap: wrap;
}

.traitor-group:hover {
  background: rgba(255,255,255,0.04);
}

.rarity-badge {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(0,0,0,0.3);
}

.traitor-group-type {
  font-size: 10px;
  flex: 1 1 auto;
  color: rgba(255,255,255,0.7);
}

.traitor-group-count {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.traitor-btn {
  flex-shrink: 0;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 9px;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.1s, color 0.1s;
}

.traitor-btn-assign {
  border: 1px solid rgba(76,175,80,0.4);
  color: rgba(76,175,80,0.8);
}

.traitor-btn-assign:hover:not(:disabled) {
  background: rgba(76,175,80,0.12);
  color: #4caf50;
}

.traitor-btn-assign:disabled {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

.traitor-btn-merge {
  border: 1px solid rgba(255,152,0,0.5);
  color: rgba(255,152,0,0.85);
}

.traitor-btn-merge:hover {
  background: rgba(255,152,0,0.12);
  color: #ff9800;
}

#traitor-roster-empty {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  padding: 6px 6px 2px;
  font-style: italic;
}

/* ── Traitor capture toast ───────────────────────────── */

#traitor-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 10px 20px;
  text-align: center;
  pointer-events: none;
  z-index: 200;
  min-width: 200px;
}

#traitor-toast.hidden {
  display: none;
}

#traitor-toast.toast-show {
  animation: toast-in-out 3s ease forwards;
}

#traitor-toast-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

#traitor-toast-rarity {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#traitor-toast-type {
  font-size: 15px;
  font-weight: bold;
  color: #e0e0e0;
}

#traitor-toast-bonus {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

@keyframes toast-in-out {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-6px); }
}

#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#confirm-overlay.hidden {
  display: none;
}

#confirm-box {
  background: #0d0d1a;
  border: 1px solid rgba(255,23,68,0.6);
  padding: 28px 32px;
  max-width: 320px;
  text-align: center;
}

#confirm-box p {
  font-size: 14px;
  color: #e0e0e0;
  margin-bottom: 20px;
  line-height: 1.5;
}

#confirm-box .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#confirm-box button {
  padding: 7px 24px;
  font-family: monospace;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
}

#confirm-yes {
  border: 1px solid #ff1744;
  color: #ff1744;
}

#confirm-yes:hover { background: rgba(255,23,68,0.2); }

#confirm-no {
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.6);
}

#confirm-no:hover { background: rgba(255,255,255,0.06); }

/* ── Ascend confirmation dialogue ────────────────────── */

#ascend-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#ascend-overlay.hidden {
  display: none;
}

#ascend-box {
  background: #0d0d1a;
  border: 1px solid rgba(255,214,0,0.5);
  padding: 28px 32px;
  max-width: 340px;
  text-align: center;
}

#ascend-box p {
  font-size: 14px;
  color: #e0e0e0;
  margin-bottom: 10px;
  line-height: 1.5;
}

#ascend-confirm-sub {
  font-size: 11px;
  color: rgba(255,214,0,0.7);
  margin-bottom: 20px !important;
}

#ascend-box .btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#ascend-box button {
  padding: 7px 24px;
  font-family: monospace;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
}

#ascend-yes {
  border: 1px solid #ffd600;
  color: #ffd600;
}

#ascend-yes:hover { background: rgba(255,214,0,0.15); }

#ascend-no {
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.6);
}

/* ── Faction (Covenant) tab ──────────────────────────── */

.tab-header--cyan {
  color: rgba(0, 229, 255, 0.8);
}

.tab-header--cyan:hover {
  background: rgba(0,229,255,0.05);
}

#faction-stack-display {
  font-size: 13px;
  font-weight: bold;
  color: #00e5ff;
  flex-shrink: 0;
}

#faction-status-line {
  font-size: 10px;
  color: rgba(0,229,255,0.5);
  padding: 4px 16px 6px;
}

/* 3-column talent tree grid */
#faction-tree {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 8px 4px;
}

.faction-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
}

/* Connector line down from node (except last row) */
.faction-node:not(.no-child)::after {
  content: '';
  display: block;
  width: 1px;
  height: 4px;
  background: rgba(0,229,255,0.2);
  margin: 0 auto;
}

.faction-node-btn {
  width: 100%;
  padding: 5px 2px;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1.3;
}

.faction-node-btn.state-purchased {
  background: rgba(0,229,255,0.12);
  border: 1px solid rgba(0,229,255,0.7);
  color: #00e5ff;
}

.faction-node-btn.state-available {
  background: transparent;
  border: 1px solid rgba(0,229,255,0.35);
  color: rgba(0,229,255,0.75);
}

.faction-node-btn.state-available:hover:not(:disabled) {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.65);
}

/* Header row inside each tree node: button + tooltip icon */
.faction-node-header {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.faction-node-header .faction-node-btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* Keep tooltip icon vertically centred and properly positioned */
.faction-node-header .upgrade-tooltip-icon {
  flex-shrink: 0;
  /* position: static so the tooltip box is positioned relative to
     .faction-node (position:relative) rather than this 14px icon */
  position: static;
}

/* Tooltip box positioning is relative to .faction-node (position:relative).
   Each column opens toward the panel centre so it stays on-screen. */
.faction-node[data-col="0"] .upgrade-tooltip-box {
  left: 0;
  right: auto;
  top: calc(100% + 3px);
  width: 200px;
}
.faction-node[data-col="1"] .upgrade-tooltip-box {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: calc(100% + 3px);
  width: 200px;
}
.faction-node[data-col="2"] .upgrade-tooltip-box {
  right: 0;
  left: auto;
  top: calc(100% + 3px);
  width: 200px;
}

.faction-node-btn.state-cant-afford {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.25);
  cursor: default;
}

.faction-node-btn.state-locked {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

/* Capstone row: button + tooltip icon side by side */
.faction-capstone-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.faction-capstone-row #faction-capstone-btn {
  flex: 0 1 auto;
}

.faction-node-btn:disabled {
  cursor: default;
}

.faction-node-cost {
  font-size: 8px;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

/* Capstone area */
#faction-capstone-area {
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#faction-capstone-btn {
  width: 60%;
  padding: 6px 0;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  background: transparent;
  border: 1px solid rgba(0,229,255,0.35);
  color: rgba(0,229,255,0.7);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

#faction-capstone-btn:hover:not(:disabled) {
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.7);
  color: #00e5ff;
}

#faction-capstone-btn:disabled {
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
  cursor: default;
}

#faction-capstone-rank {
  font-size: 9px;
  color: rgba(0,229,255,0.45);
  text-align: center;
}

/* ── Faction Choice overlay ─────────────────────────── */

#faction-choice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}

#faction-choice-overlay.hidden {
  display: none;
}

#faction-choice-box {
  background: #0a0a16;
  border: 1px solid rgba(0,229,255,0.3);
  padding: 28px 24px 24px;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

#faction-choice-title {
  font-size: 16px;
  letter-spacing: 3px;
  color: #00e5ff;
  margin-bottom: 6px;
}

#faction-choice-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

#faction-choice-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.faction-choice-card {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}

.faction-choice-card:hover:not(.coming-soon) {
  background: rgba(255,255,255,0.05);
}

.faction-choice-card.coming-soon {
  opacity: 0.45;
  cursor: default;
}

.faction-choice-card.current-faction {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

.faction-card-name {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bold;
  text-transform: uppercase;
}

.faction-card-flavor {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  line-height: 1.4;
}

.faction-card-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  line-height: 1.45;
  flex: 1 1 auto;
}

.faction-card-btn {
  margin-top: 8px;
  width: 100%;
  padding: 6px 0;
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  background: transparent;
  border-radius: 2px;
  transition: background 0.12s, color 0.12s;
}

.faction-card-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── VANGUARD: faction choice countdown ──────────────────────────────────── */

#faction-choice-countdown {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(118,255,3,0.65);
  letter-spacing: 1px;
  text-align: center;
}

/* ── ENDLESS WAR: auto-ascension row in ascend overlay ───────────────────── */

#auto-ascension-row {
  margin: 6px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

#auto-ascension-row label {
  white-space: nowrap;
}

#auto-ascension-select {
  background: #0d0d1a;
  color: #e0e0e0;
  border: 1px solid rgba(255,214,0,0.4);
  border-radius: 2px;
  font-family: monospace;
  font-size: 11px;
  padding: 2px 4px;
  cursor: pointer;
}

