* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Consolas', 'Segoe UI', Tahoma, monospace;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

html, body, body * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.75) rgba(3, 12, 24, 0.85);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(2, 10, 24, 0.9), rgba(4, 14, 28, 0.9));
  border: 1px solid rgba(0, 229, 255, 0.15);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.85), rgba(0, 149, 196, 0.85));
  border: 1px solid rgba(201, 246, 255, 0.45);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(85, 250, 255, 0.95), rgba(0, 198, 255, 0.95));
}

body {
  background: radial-gradient(circle at center, #071326 0%, #020610 100%);
  color: #c0e0ff;
}

:root {
  --desktop-ui-zoom: 0.67;
  --ornate-border-image: url("images/Margins1.png");
  --ornate-button-border-image: url("images/Margins3.png");
  --ornate-border-slice-panel: 100 fill;
  --ornate-border-width-panel: 1px;
  --ornate-border-outset-panel: 1px;
  --ornate-border-slice-button: 190 fill;
  --ornate-border-width-button: 5px;
  --ornate-border-outset-button: 1px;
}

@media (min-width: 769px) {
  .sidebar,
  .modal-content,
  .city-explorer-header,
  .city-explorer-footer,
  .city-explorer-close-btn {
    zoom: var(--desktop-ui-zoom);
  }
}

@keyframes driftStars {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-60px, -90px, 0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
  50% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.24); }
}

@keyframes scanSweep {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

@keyframes signalBlink {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.9; }
}

.game-container {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 320px;
  flex-shrink: 0;
  height: 100%;
  background: rgba(6, 16, 32, 0.92);
  border: var(--ornate-border-width-panel) solid transparent;
  border-image: var(--ornate-border-image) var(--ornate-border-slice-panel) stretch;
  border-image-outset: var(--ornate-border-outset-panel);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 14px;
  z-index: 10;
  box-shadow: 10px 0 25px rgba(0, 0, 0, 0.8);
  animation: pulseGlow 7s ease-in-out infinite;
  overflow: hidden;
}

.sidebar-header h1 {
  text-align: center;
  font-size: 22px;
  letter-spacing: 4px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.15) 0%, rgba(2, 10, 24, 0.6) 100%);
  color: #00e5ff;
  padding: 10px;
  border: 1px solid #00e5ff;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.2);
}

.energy-panel {
  border: 1px solid rgba(0, 229, 255, 0.72);
  background: linear-gradient(180deg, rgba(0, 34, 58, 0.95), rgba(2, 11, 22, 0.96));
  padding: 8px;
  box-sizing: border-box;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.34), inset 0 0 12px rgba(0, 229, 255, 0.15);
}

.energy-topline {
  color: #d7fffb;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(93, 255, 240, 0.75);
  pointer-events: none;
  z-index: 3;
}

.energy-bar-shell {
  position: relative;
  height: 30px;
  border: 1px solid rgba(135, 255, 242, 0.62);
  background: rgba(2, 14, 25, 0.92);
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.45), inset 0 0 10px rgba(0, 229, 255, 0.18);
}

.energy-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(75, 255, 233, 0.8), rgba(0, 229, 255, 0.98));
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.55);
  transition: width 0.3s ease;
}

.energy-bar-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 3px;
  pointer-events: none;
}

.energy-line {
  border: 1px solid rgba(128, 245, 255, 0.25);
  background: rgba(18, 48, 68, 0.2);
}

.energy-line.active {
  background: rgba(120, 255, 241, 0.7);
  border-color: rgba(197, 255, 248, 0.8);
}

.energy-debt-display {
  min-height: 0;
  margin-top: 0;
  text-align: center;
  color: #ffd2d2;
  font-size: 0;
  letter-spacing: 0.9px;
}

.fuel-bar-shell {
  position: relative;
  width: 140px;
  height: 10px;
  border: 1px solid rgba(135, 255, 242, 0.62);
  background: rgba(2, 14, 25, 0.92);
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0, 229, 255, 0.2);
}

.fuel-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(75, 255, 233, 0.78), rgba(0, 229, 255, 0.96));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  transition: width 0.2s ease;
}

.fuel-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  letter-spacing: 0.6px;
  color: #d7fbff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

.ion-bomb-panel {
  align-items: stretch;
  gap: 6px;
}

.ion-bomb-line-bar,
.ion-core-line-bar {
  display: grid;
  grid-template-columns: repeat(50, minmax(0, 1fr));
  gap: 2px;
  min-height: 12px;
  border: 1px solid rgba(128, 245, 255, 0.28);
  background: rgba(2, 14, 25, 0.85);
  padding: 2px;
}

.ion-line,
.ion-core-line {
  display: block;
  height: 100%;
  min-height: 8px;
  border: 1px solid rgba(84, 208, 215, 0.24);
  background: rgba(8, 30, 45, 0.45);
}

.ion-line.active,
.ion-core-line.active {
  border-color: rgba(193, 255, 250, 0.85);
  background: linear-gradient(180deg, rgba(151, 255, 248, 0.98), rgba(0, 229, 255, 0.88));
  box-shadow: 0 0 7px rgba(0, 229, 255, 0.45);
}

@keyframes energyCriticalFlicker {
  0%, 100% { opacity: 1; }
  15% { opacity: 0.62; }
  18% { opacity: 1; }
  48% { opacity: 0.55; }
  52% { opacity: 1; }
}

@keyframes batteryVatPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(87, 255, 234, 0.35), inset 0 0 10px rgba(87, 255, 234, 0.1);
  }
  50% {
    box-shadow: 0 0 22px rgba(87, 255, 234, 0.85), inset 0 0 16px rgba(87, 255, 234, 0.3);
  }
}

@keyframes regionBatteryFlicker {
  0%, 100% { opacity: 1; filter: saturate(1); }
  28% { opacity: 0.86; filter: saturate(0.9); }
  30% { opacity: 1; filter: saturate(1); }
  62% { opacity: 0.8; filter: saturate(0.84); }
  64% { opacity: 1; filter: saturate(1); }
}

body.energy-critical .energy-panel,
body.energy-critical .energy-bar-fill,
#energy-panel.critical {
  animation: energyCriticalFlicker 0.8s steps(2, end) infinite;
}

body.energy-critical .map-container {
  filter: grayscale(0.4) contrast(0.92);
}

body.energy-empty .map-container {
  filter: grayscale(0.7) brightness(0.72);
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-bar.custom-player-panel-bg {
  background-image: linear-gradient(180deg, rgba(3, 12, 24, 0.22), rgba(3, 12, 24, 0.56)), var(--player-panel-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.player-avatar-shell {
  width: 256px;
  height: 256px;
  align-self: center;
  border: 1px solid rgba(0, 229, 255, 0.36);
  background: rgba(3, 14, 30, 0.78);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.22), inset 0 0 12px rgba(0, 229, 255, 0.08);
  overflow: hidden;
}

.player-avatar {
  width: 256px;
  height: 256px;
  display: block;
  object-fit: cover;
}

.collections-open-btn {
  width: 100%;
  cursor: pointer;
}

.info-bar {
  background: rgba(10, 28, 54, 0.8);
  color: #88c8ff;
  padding: 9px;
  text-align: center;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 2px;
  text-transform: uppercase;
}

.currency-bar {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid #00e5ff;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.currency-bar span:last-child {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.8);
}

.ascendance-panel {
  border: 1px solid rgba(0, 229, 255, 0.34);
  background: linear-gradient(180deg, rgba(4, 22, 40, 0.9), rgba(3, 12, 24, 0.9));
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ascendance-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9af4ff;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ascendance-bar-shell {
  position: relative;
  height: 24px;
  border: 1px solid rgba(108, 255, 238, 0.62);
  background: rgba(2, 12, 22, 0.92);
  overflow: hidden;
}

.ascendance-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 195, 89, 0.95), rgba(255, 110, 54, 0.95));
  box-shadow: 0 0 14px rgba(255, 140, 66, 0.62);
  transition: width 0.2s ease;
}

.ascendance-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff7e8;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.ascendance-panel-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #8ac3e4;
  font-size: 9px;
  letter-spacing: 0.6px;
}

#ascendance-bonus-label {
  color: #ffc78b;
  font-weight: bold;
  text-transform: uppercase;
}

#ascendance-requirement-label {
  text-align: right;
}

.ascendance-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ascendance-percent-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ascendance-percent-btn {
  background: rgba(1, 9, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #8fe8ff;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.8px;
  cursor: pointer;
}

.ascendance-percent-btn:hover {
  border-color: rgba(108, 255, 238, 0.8);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.22);
}

.ascendance-percent-btn.active {
  border-color: rgba(255, 176, 94, 0.95);
  color: #fff1dc;
  background: linear-gradient(180deg, rgba(255, 156, 72, 0.34), rgba(120, 53, 20, 0.4));
  box-shadow: 0 0 9px rgba(255, 154, 78, 0.36);
}

.ascendance-percent-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ascendance-percent-btn:focus-visible {
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.34);
  outline: none;
}

#ascendance-charge-btn {
  background: rgba(255, 137, 52, 0.18);
  color: #ffd8b0;
  border: 1px solid rgba(255, 166, 93, 0.75);
  padding: 6px 8px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.8px;
  cursor: pointer;
}

#ascendance-charge-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Tab Buttons */
.tab-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-icon-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.meta-icon-btn {
  padding: 9px 0;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.allocation-panel {
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(3, 12, 24, 0.72);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.allocation-panel h3 {
  color: #8fe8ff;
  font-size: 10px;
  letter-spacing: 1.2px;
  margin-bottom: 2px;
}

.allocation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid rgba(0, 229, 255, 0.18);
  background: rgba(0, 28, 48, 0.32);
  color: #8cb7d8;
  font-size: 10px;
  letter-spacing: 0.8px;
}

.allocation-item b {
  color: #00e5ff;
  font-size: 11px;
}

.discord-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border: 1px solid rgba(114, 137, 218, 0.8);
  background: rgba(114, 137, 218, 0.22);
  color: #d9e4ff;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.22s ease;
}

.discord-btn:hover {
  background: rgba(114, 137, 218, 0.95);
  color: #040b1c;
  box-shadow: 0 0 14px rgba(114, 137, 218, 0.55);
}

#lancors-player-list .stats-item {
  font-size: 10px;
  padding: 6px;
}

.lancors-filter-caption {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  line-height: 1.3;
  white-space: normal;
}

.lancors-filter-row {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

.lancors-filter-row select,
.lancors-filter-row input,
.lancors-filter-row button {
  background: rgba(1, 9, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.34);
  color: #8fe8ff;
  padding: 5px 6px;
  font-size: 10px;
  letter-spacing: 0.6px;
  outline: none;
  min-width: 0;
}

.lancors-filter-row select {
  flex: 1 1 54%;
}

.lancors-filter-row input {
  flex: 1 1 46%;
}

.lancors-filter-row button {
  flex: 0 0 auto;
  min-width: 58px;
  cursor: pointer;
}

.lancors-trace-status {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #9fd8ff;
  opacity: 0.9;
}

#lancors-pvp-summary {
  display: block;
  overflow: hidden;
}

.lancors-filter-row select:focus,
.lancors-filter-row input:focus,
.lancors-filter-row button:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.34);
}

#lancors-player-list {
  max-height: calc((34px * 4) + (8px * 3));
  overflow-y: auto;
}

#lancors-player-list .compact-item button {
  font-size: 9px;
  padding: 4px 6px;
}

.lancors-combat-actions {
  display: inline-flex;
  gap: 4px;
}

.lancors-combat-actions button {
  min-width: 52px;
}

#lancors-player-list .lancors-player-row {
  position: relative;
  overflow: hidden;
  min-height: 34px;
}

#lancors-player-list .lancors-player-offline,
#node-players-list .lancors-player-offline {
  opacity: 0.42;
  filter: grayscale(0.55) saturate(0.38);
  pointer-events: none;
}

#lancors-player-list .lancors-player-offline button,
#node-players-list .lancors-player-offline button {
  pointer-events: none;
}

#lancors-player-list .lancors-player-shielded {
  opacity: 0.5;
  padding-top: 14px;
}

#lancors-player-list .lancors-player-shielded button {
  pointer-events: none;
}

#lancors-player-list .lancors-shield-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffd2d2;
  background: rgba(148, 18, 18, 0.78);
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 147, 147, 0.5);
}

#lancors-player-list .battery-low-card,
.councilor-player-list .battery-low-card {
  border-color: rgba(255, 195, 115, 0.78);
  box-shadow: 0 0 10px rgba(255, 176, 89, 0.28), inset 0 0 8px rgba(255, 176, 89, 0.12);
  animation: regionBatteryFlicker 0.9s steps(2, end) infinite;
}

#lancors-player-list .battery-empty-card,
.councilor-player-list .battery-empty-card {
  border-color: rgba(72, 94, 108, 0.45);
  box-shadow: none;
  opacity: 0.58;
  filter: saturate(0.38);
}

.tab-btn {
  background: rgba(8, 22, 44, 0.8);
  color: #7aa1c7;
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 10px;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.25s ease-in-out;
  outline: none;
}

.tab-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  color: #ffffff;
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4), inset 0 0 8px rgba(0, 229, 255, 0.2);
}

.tab-btn.active {
  background: rgba(0, 229, 255, 0.25);
  color: #00e5ff;
  border-color: #00e5ff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
  text-shadow: 0 0 5px #00e5ff;
}

.tab-content {
  flex-grow: 1;
  background: rgba(3, 10, 22, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 14px;
  border-radius: 2px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}

.tab-content h3 {
  color: #00e5ff;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.logout-section {
  width: 100%;
}

.logout-btn {
  width: 100%;
  border-color: rgba(255, 118, 118, 0.75);
  color: #ffb7b7;
  background: rgba(120, 18, 18, 0.24);
}

.logout-btn:hover {
  background: rgba(255, 98, 98, 0.9);
  color: #170304;
  box-shadow: 0 0 16px rgba(255, 92, 92, 0.55);
}

.music-btn {
  width: 100%;
  margin-bottom: 8px;
  border-color: rgba(98, 255, 216, 0.7);
  color: #a9fff1;
  background: rgba(8, 70, 66, 0.24);
}

.music-btn:hover {
  background: rgba(70, 255, 208, 0.9);
  color: #02201f;
  box-shadow: 0 0 16px rgba(82, 255, 219, 0.52);
}

.music-controls {
  border: 1px solid rgba(98, 255, 216, 0.32);
  background: rgba(2, 42, 45, 0.4);
  padding: 8px;
  margin-bottom: 8px;
}

.music-track-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: #a9fff1;
  margin-bottom: 7px;
  text-align: center;
}

.music-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.music-controls-row.volume-row {
  grid-template-columns: 1fr 1fr;
}

.music-controls-row .music-btn,
.music-shuffle {
  margin-bottom: 0;
  font-size: 10px;
  padding: 8px 6px;
}

.music-shuffle.active {
  background: rgba(110, 255, 202, 0.85);
  color: #03211f;
  border-color: rgba(173, 255, 226, 0.95);
}

/* Star Map Area */
.map-container {
  flex-grow: 1;
  height: 100%;
  background-color: #020712;
  background-image: 
    radial-gradient(rgba(0, 229, 255, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px, 80px 80px;
  background-position: 0 0, 20px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.space-parallax,
.screen-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.threat-visor {
  position: absolute;
  inset: 0;
  z-index: 39;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  background:
    radial-gradient(circle at center, transparent 38%, rgba(255, 38, 38, 0.22) 78%, rgba(110, 0, 0, 0.6) 100%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 80, 80, 0.14) 0,
      rgba(255, 80, 80, 0.14) 2px,
      transparent 3px,
      transparent 6px
    );
}

body.threat-active .threat-visor {
  opacity: 1;
}

body.threat-pulse .threat-visor {
  opacity: 0.92;
  animation: threatPulseFlash 0.85s ease;
}

@keyframes threatPulseFlash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0.55; }
}

.melasma-visor {
  position: absolute;
  inset: 0;
  z-index: 39;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 55%, rgba(198, 126, 255, 0.28) 0, rgba(52, 16, 86, 0.18) 34%, transparent 72%),
    repeating-linear-gradient(160deg, rgba(211, 164, 255, 0.18) 0 2px, transparent 2px 10px),
    radial-gradient(circle at 50% 50%, transparent 42%, rgba(35, 12, 58, 0.45) 100%);
  mix-blend-mode: screen;
}

body.melasma-pulse .melasma-visor {
  animation: melasmaPulseFlash 1.2s steps(2, end);
}

@keyframes melasmaPulseFlash {
  0% {
    opacity: 0;
    filter: saturate(1) blur(0);
  }
  18% {
    opacity: 0.95;
    filter: saturate(1.2) blur(0.3px);
  }
  44% {
    opacity: 0.24;
    filter: saturate(0.9) blur(0.7px);
  }
  68% {
    opacity: 0.84;
    filter: saturate(1.1) blur(0.3px);
  }
  100% {
    opacity: 0.1;
    filter: saturate(0.85) blur(0.9px);
  }
}

body.gamma-hit-pulse::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999998;
  background:
    radial-gradient(circle at 50% 50%, rgba(165, 255, 255, 0.34) 0%, rgba(66, 188, 255, 0.22) 36%, rgba(0, 0, 0, 0) 72%),
    linear-gradient(90deg, rgba(100, 220, 255, 0.14), rgba(210, 245, 255, 0.18), rgba(100, 220, 255, 0.14));
  mix-blend-mode: screen;
  animation: gammaHitPulse 0.42s ease-out;
}

@keyframes gammaHitPulse {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.space-parallax {
  z-index: 0;
  background-image:
    radial-gradient(circle at 15% 30%, rgba(0, 229, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle at 75% 65%, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, rgba(255, 207, 94, 0.2) 1px, transparent 1px);
  background-size: 180px 180px, 240px 240px, 300px 300px;
  animation: driftStars 42s linear infinite;
  opacity: 0.65;
}

.screen-vignette {
  z-index: 1;
  background:
    radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.52) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(0, 0, 0, 0.08) 100%);
}

#star-map,
.statistics-view,
.sun-hub-view,
.bank-interface-view,
.inline-input-panel,
.hud-notice {
  position: relative;
  z-index: 2;
}

.battery-vat-charge-helper {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 261;
  padding: 8px 14px;
  border: 1px solid rgba(119, 255, 242, 0.9);
  background: rgba(3, 28, 35, 0.92);
  color: #b8fff5;
  letter-spacing: 1.2px;
  font-size: 11px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(89, 255, 232, 0.55);
  box-shadow: 0 0 16px rgba(55, 255, 220, 0.36), inset 0 0 8px rgba(55, 255, 220, 0.24);
  pointer-events: none;
  animation: batteryVatPulse 2.2s ease-in-out infinite;
}

.hud-notice {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 260;
  padding: 10px 12px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: rgba(6, 18, 36, 0.94);
  color: #c8ecff;
  font-size: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.hud-notice.notice-error {
  border-color: rgba(255, 95, 95, 0.8);
  color: #ffd4d4;
}

.hud-notice.notice-success {
  border-color: rgba(85, 255, 153, 0.75);
  color: #d8ffe6;
}

.inline-input-panel {
  position: absolute;
  top: 56px;
  right: 12px;
  width: min(340px, calc(100% - 24px));
  z-index: 41;
  border: 1px solid rgba(255, 207, 94, 0.55);
  background: rgba(15, 17, 25, 0.95);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-input-panel h4 {
  color: #ffd983;
  letter-spacing: 1px;
  font-size: 13px;
}

.inline-input-panel p {
  color: #b4dfff;
  font-size: 11px;
  line-height: 1.4;
}

.inline-input-panel input {
  width: 100%;
  padding: 9px;
  background: rgba(2, 8, 18, 0.92);
  border: 1px solid rgba(255, 207, 94, 0.65);
  color: #fff1ce;
}

.inline-input-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#star-map {
  width: 100%;
  height: 100%;
}

.city-explorer-view {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 229, 255, 0.22), transparent 40%),
    radial-gradient(circle at 85% 72%, rgba(255, 210, 120, 0.14), transparent 45%),
    rgba(2, 8, 16, 0.92);
}

.city-explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(4, 14, 28, 0.9);
}

.city-explorer-title-wrap h3 {
  margin: 0;
  color: #b8f3ff;
  letter-spacing: 1px;
  font-size: 13px;
}

.city-explorer-title-wrap p {
  margin: 2px 0 0;
  color: #9fd6e6;
  font-size: 11px;
}

.city-explorer-canvas {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.42);
  background: rgba(0, 0, 0, 0.25);
  touch-action: none;
  cursor: grab;
}

.city-explorer-canvas.is-dragging {
  cursor: grabbing;
}

.city-explorer-backdrop {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 600px;
  transform-origin: 0 0;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  filter: saturate(1.08) contrast(1.03);
}

.city-explorer-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 600px;
  transform-origin: 0 0;
}

.city-explorer-node-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center;
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  max-width: 7px;
  max-height: 7px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 0;
  border-image: none;
  background: transparent;
  overflow: visible;
  isolation: isolate;
  color: transparent;
  font-size: 0;
  line-height: 0;
  padding: 0;
  letter-spacing: 0;
  font-weight: 700;
  text-align: center;
  box-shadow: none;
  z-index: 3;
}

.city-explorer-node-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  height: 140%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.52) 0%, rgba(0, 229, 255, 0.25) 45%, rgba(0, 229, 255, 0) 78%);
  filter: blur(1.4px);
  z-index: 0;
  pointer-events: none;
}

.city-explorer-node-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: url("images/circulars.png"), url("images/Cicrculars.png");
  background-size: 100% 100%, 100% 100%;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  z-index: 1;
  pointer-events: none;
}

.city-explorer-node-btn.is-active::before {
  background: radial-gradient(circle, rgba(255, 207, 94, 0.72) 0%, rgba(255, 207, 94, 0.34) 46%, rgba(255, 207, 94, 0) 80%);
}

.city-explorer-node-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.city-explorer-node-btn[data-city-stop-id="dock"] { left: 15%; top: 78%; }
.city-explorer-node-btn[data-city-stop-id="bazaar"] { left: 28%; top: 56%; }
.city-explorer-node-btn[data-city-stop-id="citadel"] { left: 49%; top: 31%; }
.city-explorer-node-btn[data-city-stop-id="hangar"] { left: 72%; top: 46%; }
.city-explorer-node-btn[data-city-stop-id="spire"] { left: 83%; top: 73%; }
.city-explorer-node-btn[data-city-stop-id="gate"] { left: 52%; top: 84%; }

.city-explorer-trail-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.city-explorer-trail-dot {
  position: absolute;
  width: 1.8px;
  height: 1.8px;
  margin-left: -0.9px;
  margin-top: -0.9px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.52);
  filter: blur(0.2px);
}

.city-explorer-ship {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 22px;
  transform: translate(-50%, -50%);
  background: url("images/ship.webp") center/contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.9));
  pointer-events: none;
  z-index: 4;
}

.city-explorer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(4, 14, 28, 0.88);
  color: #a8dff0;
  font-size: 11px;
}

.city-explorer-footer-return-btn {
  margin-left: auto;
  border: 1px solid rgba(255, 207, 94, 0.75);
  background: rgba(15, 22, 36, 0.92);
  color: #ffe7a8;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.9px;
  line-height: 1.2;
}

.city-explorer-footer-return-btn:hover {
  background: rgba(255, 207, 94, 0.2);
}

@media (max-width: 900px) {
  .city-explorer-node-btn {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    max-width: 6px;
    max-height: 6px;
    font-size: 0;
  }

  .city-explorer-footer-return-btn {
    width: 100%;
    margin-left: 0;
  }
}

/* Node Styling & Smooth Hover Fix */
.map-node {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease-out, filter 0.25s ease-out;
}

@media (hover: none) and (pointer: coarse) {
  #star-map .map-node {
    -webkit-tap-highlight-color: transparent;
  }
}

@keyframes mapNodeOrbitSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.map-node-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: mapNodeOrbitSlow 1500s linear infinite;

}

.map-node:hover {
  transform: scale(1.25);
  filter: drop-shadow(0px 0px 8px #00e5ff);
}

.map-node.battery-vat-docked-glow {
  filter: drop-shadow(0 0 16px rgba(144, 255, 238, 0.92)) drop-shadow(0 0 30px rgba(0, 229, 255, 0.75));
  stroke: #c4fff9;
  stroke-width: 3;
}

.map-ship {
  pointer-events: none;
}

.map-ship-trail {
  pointer-events: none;
}

.map-ship-trail-self {
  fill: rgba(0, 229, 255, 0.5);
}

.map-ship-trail-other {
  fill: rgba(255, 231, 168, 0.4);
}

.map-ship-self .ship-body {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.8));
}

.map-ship-other .ship-body {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.35));
  opacity: 0.92;
}

.ship-tag {
  font-size: 8px;
  fill: #d8f3ff;
  text-anchor: middle;
  letter-spacing: 0.5px;
  text-shadow: 0 0 5px #000;
}

.node-label {
  font-size: 11px;
  fill: #e0f4ff;
  font-weight: bold;
  pointer-events: none;
  text-anchor: middle;
  font-family: 'Consolas', monospace;
  letter-spacing: 1.5px;
  text-shadow: 0 0 5px #000;
}

@keyframes stragahornMenaceNodeFlicker {
  0%, 100% {
    fill: #3a0606;
    stroke: #ff7b7b;
    filter: drop-shadow(0 0 7px rgba(255, 72, 72, 0.5));
  }
  42% {
    fill: #4a0909;
    stroke: #ff9a9a;
    filter: drop-shadow(0 0 12px rgba(255, 52, 52, 0.82));
  }
  52% {
    fill: #2a0404;
    stroke: #e66565;
    filter: drop-shadow(0 0 6px rgba(255, 52, 52, 0.42));
  }
}

@keyframes stragahornMenaceLabelFlicker {
  0%, 100% {
    fill: #ff9f9f;
    opacity: 1;
    text-shadow: 0 0 6px rgba(255, 82, 82, 0.55);
  }
  48% {
    fill: #ffc3c3;
    opacity: 0.92;
    text-shadow: 0 0 10px rgba(255, 64, 64, 0.82);
  }
  58% {
    fill: #ff8d8d;
    opacity: 0.78;
    text-shadow: 0 0 4px rgba(255, 64, 64, 0.38);
  }
}

.stragahorn-menace-node {
  animation: stragahornMenaceNodeFlicker 1.7s steps(2, end) infinite;
}

.stragahorn-menace-label {
  animation: stragahornMenaceLabelFlicker 1.5s steps(2, end) infinite;
}

@keyframes stragahornExplorerCorePulse {
  0%, 100% {
    fill: #29fff2;
    stroke: #dfffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(66, 255, 239, 0.85));
  }
  50% {
    fill: #78fff6;
    stroke: #ffffff;
    stroke-width: 2.6;
    filter: drop-shadow(0 0 18px rgba(140, 255, 246, 0.95));
  }
}

@keyframes stragahornExplorerLatticeShift {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -64;
  }
}

.stragahorn-explorer-node {
  stroke-dasharray: 8 6 2 6;
  animation:
    stragahornExplorerCorePulse 2.2s ease-in-out infinite,
    stragahornExplorerLatticeShift 1.6s linear infinite;
}

/* General Buttons */
button {
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(0, 229, 255, 0.1);
  border: var(--ornate-border-width-button) solid transparent;
  border-image: var(--ornate-button-border-image) var(--ornate-border-slice-button) stretch;
  border-image-outset: var(--ornate-border-outset-button);
  font-weight: bold;
  color: #00e5ff;
  letter-spacing: 1px;
  transition: all 0.25s ease-in-out;
  outline: none;
}

button:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #00e5ff;
  color: #020610;
  box-shadow: 0 0 15px #00e5ff;
}

button:disabled,
button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

.node-action-hard-disabled,
.node-action-hard-disabled:hover,
.node-action-hard-disabled:focus,
.node-action-hard-disabled:focus-visible {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.35) saturate(0.7);
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(1, 4, 10, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgba(6, 18, 36, 0.95);
  border: var(--ornate-border-width-panel) solid transparent;
  border-image: var(--ornate-border-image) var(--ornate-border-slice-panel) stretch;
  border-image-outset: var(--ornate-border-outset-panel);
  padding: 24px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.3), inset 0 0 15px rgba(0, 229, 255, 0.1);
}

#login-modal {
  opacity: 1;
  transition: opacity 0.28s ease, background-color 0.28s ease;
}

#login-modal .modal-content {
  position: relative;
  overflow: hidden;
  transform-origin: center;
}

#login-modal.auth-collapsing {
  background: rgba(1, 10, 18, 0.95);
}

#login-modal.auth-collapsing .modal-content {
  animation: authCyanGlitchCollapse 720ms cubic-bezier(0.17, 0.67, 0.32, 1) forwards;
}

#login-modal .auth-login-loading {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: #b9fbff;
  text-shadow: 0 0 12px rgba(0, 234, 255, 0.72);
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 32%, rgba(0, 255, 234, 0.18), transparent 46%),
    radial-gradient(circle at 80% 70%, rgba(0, 174, 255, 0.18), transparent 42%),
    rgba(2, 12, 23, 0.9);
}

#login-modal .auth-login-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 234, 255, 0.12) 0,
    rgba(0, 234, 255, 0.12) 1px,
    transparent 3px,
    transparent 6px
  );
  mix-blend-mode: screen;
  animation: authCyanStaticSweep 0.52s linear infinite;
}

#login-modal.auth-loading-active .auth-login-loading {
  opacity: 1;
}

#login-modal.auth-collapsing .auth-login-loading {
  opacity: 1;
  animation: authLoadingPulse 0.7s ease-out forwards;
}

@keyframes authCyanGlitchCollapse {
  0% {
    transform: scale(1) translateY(0);
    filter: hue-rotate(0deg) brightness(1);
    opacity: 1;
  }
  38% {
    transform: scale(0.985) translateY(-2px) skewX(0.8deg);
    filter: hue-rotate(-8deg) brightness(1.16);
    opacity: 1;
  }
  62% {
    transform: scale(0.97) translateY(2px) skewX(-1deg);
    filter: hue-rotate(8deg) brightness(1.2);
    opacity: 0.92;
  }
  100% {
    transform: scale(0.935) translateY(8px);
    filter: brightness(0.5);
    opacity: 0;
  }
}

@keyframes authCyanStaticSweep {
  0% { transform: translateY(0); }
  100% { transform: translateY(8px); }
}

@keyframes authLoadingPulse {
  0% { opacity: 0.25; }
  45% { opacity: 1; }
  100% { opacity: 0.9; }
}

#login-pane,
#register-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content h2, .modal-content h3 {
  color: #00e5ff;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  text-align: center;
}

.auth-inline-message {
  border: 1px solid rgba(255, 95, 95, 0.82);
  background: rgba(42, 8, 10, 0.88);
  color: #ffd2d2;
  font-size: 11px;
  line-height: 1.35;
  padding: 8px 10px;
  box-shadow: 0 0 14px rgba(255, 95, 95, 0.28);
}

.auth-inline-message.success {
  border-color: rgba(85, 255, 153, 0.72);
  background: rgba(6, 36, 18, 0.86);
  color: #d9ffe8;
  box-shadow: 0 0 14px rgba(85, 255, 153, 0.24);
}

.login-online-count {
  margin: 8px 0 10px;
  padding: 0 2px;
  font-size: 11px;
  color: #8fe8ff;
  letter-spacing: 0.6px;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.trade-modal-content {
  width: min(520px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

#trade-request-modal {
  z-index: 180;
}

#trade-request-modal .trade-modal-content {
  position: relative;
  overflow: visible;
}

#trade-request-modal.nano-burst-active .trade-modal-content::before,
#trade-request-modal.nano-burst-active .trade-modal-content::after {
  content: "";
  position: absolute;
  inset: -22px;
  pointer-events: none;
  border-radius: 10px;
}

#trade-request-modal.nano-burst-active .trade-modal-content::before {
  background:
    radial-gradient(circle at 16% 28%, rgba(102, 229, 255, 0.9) 0, rgba(102, 229, 255, 0.05) 22%, transparent 54%),
    radial-gradient(circle at 78% 30%, rgba(58, 184, 255, 0.75) 0, rgba(58, 184, 255, 0.04) 20%, transparent 50%),
    radial-gradient(circle at 62% 74%, rgba(152, 241, 255, 0.72) 0, rgba(152, 241, 255, 0.03) 18%, transparent 48%),
    radial-gradient(circle at 26% 80%, rgba(79, 216, 255, 0.76) 0, rgba(79, 216, 255, 0.02) 16%, transparent 44%);
  filter: blur(2.5px);
  animation: nanoBlueDispersion 15s ease-out forwards;
}

#trade-request-modal.nano-burst-active .trade-modal-content::after {
  border: 1px solid rgba(126, 232, 255, 0.65);
  box-shadow:
    0 0 18px rgba(102, 229, 255, 0.45),
    0 0 44px rgba(57, 182, 255, 0.3),
    inset 0 0 20px rgba(150, 239, 255, 0.2);
  animation: nanoBlueEdgePulse 15s ease-out forwards;
}

@keyframes nanoBlueDispersion {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  10% {
    opacity: 1;
    transform: scale(1.02);
  }
  35% {
    opacity: 0.85;
    transform: scale(1.1);
  }
  70% {
    opacity: 0.45;
    transform: scale(1.24);
  }
  100% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes nanoBlueEdgePulse {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  16% {
    opacity: 1;
    transform: scale(1.02);
  }
  56% {
    opacity: 0.66;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.trade-confirm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trade-summary-col {
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 24, 44, 0.38);
  padding: 8px;
}

.trade-summary-col h4 {
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 6px;
  color: #9cefff;
}

.trade-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.18);
  padding: 4px 0;
}

.trade-line:last-child {
  border-bottom: 0;
}

.trade-builder-shell {
  margin-top: 10px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(1, 24, 36, 0.48);
  padding: 8px;
}

.trade-builder-title {
  font-size: 11px;
  letter-spacing: 1px;
  color: #9befff;
  margin-bottom: 8px;
}

.trade-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trade-builder-col {
  border: 1px solid rgba(0, 229, 255, 0.22);
  background: rgba(2, 13, 28, 0.7);
  padding: 8px;
}

.trade-builder-col h5 {
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: #8fe8ff;
}

.trade-builder-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.trade-builder-row span {
  font-size: 10px;
  color: #9fc5df;
}

.trade-battery-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8ff6ff;
  text-shadow: 0 0 8px rgba(0, 235, 255, 0.35);
}

.trade-battery-icon {
  width: 14px;
  height: 8px;
  border: 1px solid rgba(0, 242, 255, 0.92);
  border-radius: 2px;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 235, 255, 0.55), inset 0 0 6px rgba(0, 235, 255, 0.24);
  background: linear-gradient(180deg, rgba(0, 255, 255, 0.38), rgba(0, 168, 198, 0.18));
}

.trade-battery-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  right: -3px;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: rgba(0, 242, 255, 0.9);
  box-shadow: 0 0 6px rgba(0, 235, 255, 0.6);
}

.trade-battery-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 70%;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.9), rgba(70, 255, 255, 0.28));
}

.trade-builder-row input {
  width: 96px;
  padding: 6px;
  font-size: 11px;
}

.trade-builder-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.trade-row-actions {
  display: flex;
  gap: 6px;
}

.trade-row-actions button {
  min-width: 70px;
}

.councilor-player-list.scroll-pane {
  max-height: calc((34px * 5) + (8px * 4));
  overflow-y: auto;
}

.financier-ledger-list.scroll-pane {
  max-height: calc((80px * 4) + (8px * 3));
  overflow-y: auto;
}

.financier-ledger-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 18, 30, 0.78);
}

.financier-ledger-inline-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr);
  gap: 8px;
  align-items: stretch;
}

.financier-ledger-player-name {
  font-size: 11px;
  letter-spacing: 0.9px;
  color: #a8f2ff;
  font-weight: 700;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.financier-ledger-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(11ch, 1fr));
  gap: 6px;
}

.financier-ledger-metric-box {
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 10, 20, 0.92);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 12ch;
}

.financier-ledger-metric-label {
  font-size: 9px;
  color: #7bd6e8;
  letter-spacing: 0.7px;
}

.financier-ledger-metric-value {
  font-size: 12px;
  color: #d6fdff;
  letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .financier-ledger-inline-row {
    grid-template-columns: 1fr;
  }

  .financier-ledger-metrics-grid {
    grid-template-columns: 1fr;
  }

  .financier-ledger-list.scroll-pane {
    max-height: calc((118px * 4) + (8px * 3));
  }
}

.electric-trade-shell {
  position: relative;
  overflow: hidden;
}

.electric-trade-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  pointer-events: none;
  background:
    linear-gradient(120deg,
      rgba(0, 229, 255, 0.95) 0%,
      rgba(110, 255, 255, 0.35) 20%,
      rgba(0, 229, 255, 0.95) 40%,
      rgba(110, 255, 255, 0.35) 60%,
      rgba(0, 229, 255, 0.95) 80%,
      rgba(110, 255, 255, 0.35) 100%);
  background-size: 220% 220%;
  animation: electricEdgeFlow 2.4s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@keyframes electricEdgeFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  color: #88c8ff;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-group input, .form-group select {
  padding: 10px;
  background: rgba(2, 8, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  font-family: monospace;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.association-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  width: 100%;
  font-size: 11px;
  letter-spacing: 1.5px;
}

.mode-btn.active {
  background: rgba(0, 229, 255, 0.25);
  color: #00e5ff;
  border-color: #00e5ff;
}

.auth-discord-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(114, 137, 218, 0.85);
  background: linear-gradient(180deg, rgba(114, 137, 218, 0.32), rgba(74, 97, 178, 0.36));
  color: #dce6ff;
  font-weight: 700;
  letter-spacing: 1.1px;
}

.auth-discord-btn:hover,
.auth-discord-btn:focus-visible {
  background: linear-gradient(180deg, rgba(137, 158, 233, 0.88), rgba(99, 119, 204, 0.92));
  color: #031022;
  box-shadow: 0 0 14px rgba(114, 137, 218, 0.55);
}

.auth-discord-caption {
  font-size: 10px;
  line-height: 1.35;
  color: #a9b9f7;
  letter-spacing: 0.5px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Node Modal Actions & Marketplace Controls */
.action-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(0, 229, 255, 0.2);
  padding-top: 12px;
}

.node-travel-intel {
  position: relative;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(126, 242, 255, 0.55);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(90, 229, 255, 0.08) 0,
      rgba(90, 229, 255, 0.08) 2px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    ),
    linear-gradient(180deg, rgba(1, 24, 38, 0.96), rgba(1, 10, 22, 0.94));
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.15), 0 0 14px rgba(0, 229, 255, 0.18);
  font-family: "Consolas", "Courier New", monospace;
}

.node-travel-intel::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 32px;
  border-top: 1px dashed rgba(126, 242, 255, 0.25);
  pointer-events: none;
}

.node-travel-intel-title {
  margin: 0 0 8px 0;
  color: #92eeff;
  letter-spacing: 1.2px;
  font-size: 11px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.42);
}

.node-travel-intel-grid {
  display: grid;
  gap: 6px;
}

.node-travel-intel-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 11px;
}

.node-travel-intel-row span {
  color: rgba(178, 240, 255, 0.78);
  letter-spacing: 0.7px;
}

.node-travel-intel-row strong {
  color: #e6fbff;
  text-align: right;
  text-shadow: 0 0 6px rgba(121, 238, 255, 0.3);
}

.node-travel-intel.state-good .node-travel-intel-row:last-child strong {
  color: #8affba;
}

.node-travel-intel.state-low .node-travel-intel-row:last-child strong {
  color: #ff9e9e;
}

.node-travel-intel-note {
  margin: 8px 0 0 0;
  font-size: 10px;
  color: rgba(170, 228, 242, 0.78);
  line-height: 1.35;
}

.node-go-location-btn {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(130, 242, 255, 0.78);
  color: #d9fbff;
  background:
    linear-gradient(180deg, rgba(58, 196, 255, 0.28), rgba(0, 114, 175, 0.22)),
    linear-gradient(90deg, rgba(8, 25, 45, 0.95), rgba(6, 16, 34, 0.98));
  box-shadow: 0 0 14px rgba(0, 203, 255, 0.26), inset 0 0 9px rgba(0, 203, 255, 0.14);
  letter-spacing: 1.2px;
  font-size: 11px;
  text-transform: uppercase;
}

.node-go-location-btn:hover {
  background:
    linear-gradient(180deg, rgba(97, 224, 255, 0.86), rgba(40, 170, 230, 0.76)),
    linear-gradient(90deg, rgba(14, 36, 62, 0.98), rgba(10, 24, 46, 0.98));
  color: #031423;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.42), inset 0 0 14px rgba(188, 249, 255, 0.28);
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-row input {
  width: 60%;
  padding: 8px;
  background: rgba(2, 8, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-family: monospace;
  outline: none;
}

.action-row button {
  width: 40%;
  padding: 8px;
  font-size: 11px;
}

.sale-badge {
  color: #55ff99;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(85, 255, 153, 0.5);
}

#enter-regional-hub-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.hidden { display: none !important; }

.statistics-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  background:
    linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    #01060f;
  background-size: 28px 28px;
  padding: 14px;
  overflow-y: auto;
  isolation: isolate;
}

.stats-header {
  margin-bottom: 10px;
}

.gov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gov-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gov-scanlines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(185, 255, 253, 0.03) 0,
      rgba(185, 255, 253, 0.03) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.gov-close-btn {
  width: 42px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  border-color: rgba(255, 118, 118, 0.7);
  color: #ffb7b7;
  background: rgba(120, 18, 18, 0.24);
}

.gov-refresh-btn {
  height: 32px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.8px;
  border-color: rgba(0, 229, 255, 0.55);
  color: #c7f8ff;
  background: rgba(6, 54, 78, 0.36);
}

.gov-refresh-btn:hover {
  background: rgba(0, 229, 255, 0.88);
  color: #01212e;
}

.gov-close-btn:hover {
  background: rgba(255, 98, 98, 0.9);
  color: #170304;
}

.stats-header h2 {
  color: #00e5ff;
  letter-spacing: 2px;
  font-size: 18px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-card {
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(2, 14, 28, 0.88);
  min-height: 280px;
  padding: 12px;
  box-shadow: inset 0 0 14px rgba(0, 229, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.role-card:hover {
  transform: translateY(-1px);
  border-color: rgba(127, 244, 255, 0.55);
  box-shadow: inset 0 0 22px rgba(0, 229, 255, 0.14), 0 4px 20px rgba(0, 0, 0, 0.25);
}

.role-card h3 {
  color: #8fe8ff;
  letter-spacing: 1px;
  font-size: 13px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  padding-bottom: 8px;
}

.role-card h3 small {
  color: #66b6d8;
  font-size: 10px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-list.scroll-pane {
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

#leaderboards-view .stats-list.scroll-pane {
  max-height: 200px;
}

.assistance-header p {
  margin-top: 4px;
  color: #8ab4d2;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.assistance-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.assistance-tab-btn {
  padding: 8px 11px;
  font-size: 11px;
  letter-spacing: 0.9px;
  border: 1px solid rgba(0, 229, 255, 0.32);
  background: rgba(2, 15, 28, 0.84);
  color: #84dcff;
  text-transform: uppercase;
}

.assistance-tab-btn:hover {
  border-color: rgba(122, 243, 255, 0.66);
  color: #c7f6ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.26);
}

.assistance-tab-btn.active {
  border-color: rgba(255, 212, 118, 0.82);
  background: rgba(66, 46, 6, 0.45);
  color: #ffe6af;
  box-shadow: 0 0 12px rgba(255, 190, 78, 0.34);
}

.assistance-content {
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(2, 14, 27, 0.9);
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.08);
  padding: 12px;
}

.settings-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-tab-btn {
  padding: 8px 11px;
  font-size: 11px;
  letter-spacing: 0.9px;
  border: 1px solid rgba(0, 229, 255, 0.32);
  background: rgba(2, 15, 28, 0.84);
  color: #84dcff;
  text-transform: uppercase;
}

.settings-tab-btn:hover {
  border-color: rgba(122, 243, 255, 0.66);
  color: #c7f6ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.26);
}

.settings-tab-btn.active {
  border-color: rgba(255, 212, 118, 0.82);
  background: rgba(66, 46, 6, 0.45);
  color: #ffe6af;
  box-shadow: 0 0 12px rgba(255, 190, 78, 0.34);
}

.settings-content {
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(2, 14, 27, 0.9);
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.08);
  padding: 12px;
}

.settings-card h3 {
  color: #9beeff;
  letter-spacing: 1px;
  font-size: 15px;
  margin-bottom: 8px;
}

.settings-card p {
  color: #bdd7ea;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.settings-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.settings-control-row label {
  color: #8fe8ff;
  font-size: 11px;
  letter-spacing: 0.9px;
}

#settings-orientation-select {
  min-width: 150px;
  background: rgba(2, 15, 28, 0.84);
  border: 1px solid rgba(0, 229, 255, 0.32);
  color: #84dcff;
  padding: 7px 10px;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#settings-fullscreen-btn,
#settings-apply-orientation-btn {
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.9px;
  border: 1px solid rgba(255, 212, 118, 0.82);
  background: rgba(66, 46, 6, 0.45);
  color: #ffe6af;
  text-transform: uppercase;
}

#settings-fullscreen-btn:hover,
#settings-apply-orientation-btn:hover {
  box-shadow: 0 0 12px rgba(255, 190, 78, 0.34);
}

.settings-status-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.settings-status-text {
  color: #9fd8ff;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.settings-discord-status {
  white-space: pre-wrap;
  line-height: 1.45;
}

.settings-status-text.info {
  color: #9fd8ff;
}

.settings-status-text.success {
  color: #9df5c8;
}

.settings-status-text.error {
  color: #ffb8c2;
}

.assistance-card h3 {
  color: #9beeff;
  letter-spacing: 1px;
  font-size: 15px;
  margin-bottom: 8px;
}

.assistance-card h4 {
  color: #bdefff;
  font-size: 12px;
  letter-spacing: 0.9px;
  margin-bottom: 6px;
}

.assistance-card p {
  color: #bdd7ea;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.assistance-card ul {
  margin: 0 0 10px 18px;
  color: #cbe8f9;
  font-size: 11px;
  line-height: 1.5;
}

.assistance-card li {
  margin-bottom: 3px;
}

.assistance-inline-note {
  border: 1px solid rgba(255, 207, 94, 0.45);
  background: rgba(30, 20, 5, 0.4);
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistance-inline-note label {
  color: #ffe4a9;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.assistance-inline-note input {
  width: min(280px, 100%);
  padding: 8px;
  background: rgba(4, 10, 19, 0.95);
  border: 1px solid rgba(255, 207, 94, 0.65);
  color: #fff4d2;
}

.assistance-inline-note small {
  color: #d7c18e;
  font-size: 10px;
}

.assistance-region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#government-view.ibris-mode {
  background:
    radial-gradient(circle at 85% 12%, rgba(10, 255, 200, 0.1), transparent 36%),
    radial-gradient(circle at 14% 86%, rgba(0, 168, 255, 0.14), transparent 40%),
    linear-gradient(rgba(0, 255, 224, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 224, 0.05) 1px, transparent 1px),
    #040b13;
  background-size: auto, auto, 24px 24px, 24px 24px, auto;
}

#government-view.ibris-mode .gov-header h2 {
  color: #8dfff8;
  text-shadow: 0 0 14px rgba(30, 255, 228, 0.5);
}

#government-view.ibris-mode .gov-close-btn {
  border-color: rgba(0, 255, 200, 0.6);
  color: #b8fff4;
  background: rgba(0, 78, 78, 0.35);
}

#government-view.ibris-mode .gov-refresh-btn {
  border-color: rgba(0, 255, 200, 0.58);
  color: #c9fff7;
  background: rgba(0, 92, 92, 0.34);
}

#government-view.ibris-mode .gov-close-btn:hover {
  background: rgba(0, 255, 200, 0.85);
  color: #012126;
}

#government-view.ibris-mode .gov-refresh-btn:hover {
  background: rgba(0, 255, 200, 0.85);
  color: #012126;
}

#government-view.ibris-mode .role-card {
  background:
    linear-gradient(180deg, rgba(2, 18, 26, 0.95), rgba(1, 11, 20, 0.9));
  border-color: rgba(74, 255, 237, 0.34);
  box-shadow: inset 0 0 20px rgba(0, 255, 229, 0.08), 0 0 0 1px rgba(0, 255, 229, 0.06);
}

#government-view.ibris-mode .role-card h3 {
  color: #9dfff9;
  border-bottom-color: rgba(95, 255, 234, 0.3);
}

.ibris-console-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ibris-strip {
  border: 1px solid rgba(88, 255, 238, 0.4);
  background: rgba(2, 34, 45, 0.6);
  color: #89fff6;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  padding: 6px 8px;
  animation: signalBlink 1.6s steps(2, end) infinite;
}

.ibris-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #a6f9ff;
  border: 1px dashed rgba(91, 255, 234, 0.32);
  background: rgba(0, 38, 52, 0.34);
  padding: 7px 8px;
}

#government-view.ibris-mode input[type="text"],
#government-view.ibris-mode input[type="number"],
#government-view.ibris-mode input[type="range"] {
  border-color: rgba(85, 255, 230, 0.55);
  color: #a9fff6;
  background: rgba(2, 16, 24, 0.95);
}

.ibri-input-stack input[type="range"] {
  width: 100%;
  accent-color: #54ffe7;
}

.ibris-meter {
  height: 12px;
  width: 100%;
  border: 1px solid rgba(90, 255, 233, 0.4);
  background: rgba(2, 16, 24, 0.88);
  overflow: hidden;
}

.ibris-meter-fill {
  height: 100%;
  transition: width 0.25s ease, background-color 0.2s ease;
}

.ibris-meter-fill.low {
  background: linear-gradient(90deg, rgba(255, 94, 94, 0.95), rgba(255, 150, 94, 0.95));
}

.ibris-meter-fill.medium {
  background: linear-gradient(90deg, rgba(255, 213, 94, 0.95), rgba(174, 255, 94, 0.95));
}

.ibris-meter-fill.high {
  background: linear-gradient(90deg, rgba(94, 255, 190, 0.95), rgba(95, 252, 255, 0.95));
}

.ibris-exec-btn {
  letter-spacing: 1.6px;
  border-color: rgba(88, 255, 228, 0.9);
  background: linear-gradient(180deg, rgba(30, 166, 150, 0.42), rgba(8, 78, 82, 0.42));
  color: #cbfff7;
}

.ibris-exec-btn:hover {
  background: linear-gradient(180deg, rgba(94, 255, 218, 0.95), rgba(24, 212, 183, 0.95));
  color: #022122;
  box-shadow: 0 0 18px rgba(95, 255, 231, 0.62);
}

.ibri-target-row {
  background: rgba(0, 56, 74, 0.28);
  border-color: rgba(97, 255, 233, 0.24);
}

.ibri-target-name {
  color: #bafffa;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.ibri-target-meta {
  margin-top: 4px;
  opacity: 0.8;
  font-size: 10px;
}

.ibris-teleprompter {
  position: relative;
  border: 1px solid rgba(95, 255, 231, 0.34);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(12, 58, 74, 0.48) 0px,
      rgba(12, 58, 74, 0.48) 2px,
      rgba(2, 25, 37, 0.62) 2px,
      rgba(2, 25, 37, 0.62) 4px
    );
  min-height: 60px;
  overflow: hidden;
  padding: 8px;
}

.ibris-teleprompter-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -35%;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(130, 255, 244, 0), rgba(130, 255, 244, 0.2), rgba(130, 255, 244, 0));
  animation: ibriScanSweep 2.4s linear infinite;
}

.ibris-teleprompter-track {
  position: relative;
  min-height: 44px;
}

.ibris-msg {
  position: absolute;
  inset: 0;
  opacity: 0;
  color: #ccfff8;
  font-size: 11px;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(96, 255, 236, 0.35);
  display: flex;
  align-items: center;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ibris-msg.active {
  opacity: 1;
  transform: translateY(0);
  animation: ibriGlitchText 1.9s linear infinite;
}

@keyframes ibriScanSweep {
  0% {
    top: -40%;
  }
  100% {
    top: 100%;
  }
}

@keyframes ibriGlitchText {
  0%, 100% {
    clip-path: inset(0 0 0 0);
    filter: hue-rotate(0deg);
    transform: translate(0, 0);
  }
  18% {
    clip-path: inset(6% 0 48% 0);
    transform: translate(-1px, 0);
  }
  22% {
    clip-path: inset(50% 0 8% 0);
    transform: translate(1px, -1px);
  }
  24% {
    clip-path: inset(0 0 0 0);
    transform: translate(0, 0);
  }
  61% {
    filter: hue-rotate(12deg);
  }
}

.stats-item {
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(0, 38, 68, 0.25);
  color: #d1ebff;
  font-size: 12px;
  padding: 8px;
}

.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-card-bg-sync {
  position: relative;
  overflow: hidden;
}

.player-card-bg-sync > span,
.player-card-bg-sync button,
.player-card-bg-sync .trade-row-actions,
.player-card-bg-sync .lancors-combat-actions,
.player-card-bg-sync .lancors-shield-badge {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.compact-item button {
  padding: 5px 7px;
  font-size: 10px;
}

.role-actions-row button {
  width: 50%;
  font-size: 10px;
  padding: 8px 6px;
}

.role-card select,
.role-card input {
  width: 100%;
  padding: 8px;
  background: rgba(2, 8, 18, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-family: monospace;
}

/* SUN Hub View */
.sun-hub-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    #010509;
  background-size: 24px 24px;
  width: 100%;
  height: 100%;
}

.stragahorn-view {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  grid-template-rows: 66px 1fr;
  gap: 0;
  padding: 0;
  background:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 20% 18%, rgba(0, 229, 255, 0.13), transparent 44%),
    #010509;
  background-size: 24px 24px, 24px 24px, auto, auto;
}

.stragahorn-header {
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: rgba(1, 10, 20, 0.9);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22), inset 0 0 12px rgba(0, 229, 255, 0.08);
  padding: 8px 10px;
  min-height: 66px;
  height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.stragahorn-header h3 {
  margin: 0;
  color: #aaf9ff;
  letter-spacing: 1.6px;
  font-size: 13px;
}

.stragahorn-header p {
  margin: 0;
  color: #d6f8ff;
  font-size: 11px;
  letter-spacing: 0.7px;
  min-height: 32px;
  max-height: 32px;
  overflow: hidden;
}

.stragahorn-run-timer {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #ffd87f;
  border: 1px solid rgba(255, 216, 127, 0.45);
  background: rgba(28, 19, 0, 0.48);
  padding: 6px 8px;
  text-align: center;
}

.stragahorn-mobile-status {
  display: none;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.4px;
  color: #d6f8ff;
  border: 1px solid rgba(120, 212, 255, 0.35);
  background: rgba(6, 16, 32, 0.62);
  padding: 6px 8px;
  max-height: 40px;
  overflow: hidden;
}

.stragahorn-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(9, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(2, 11, 22, 0.94), rgba(1, 8, 16, 0.97));
  box-shadow: inset 0 0 24px rgba(0, 229, 255, 0.12);
}

.stragahorn-tile {
  position: relative;
  margin: 0;
  padding: 0;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  line-height: 1;
  border: 1px solid rgba(0, 229, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 28, 46, 0.84), rgba(5, 18, 30, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0, 229, 255, 0.06);
}

.stragahorn-tile::before {
  content: none;
}

.stragahorn-tile.spawn-player {
  border-color: rgba(118, 255, 245, 0.95);
  background: linear-gradient(180deg, rgba(18, 88, 106, 0.92), rgba(11, 52, 70, 0.95));
  box-shadow: 0 0 10px rgba(79, 255, 242, 0.34), inset 0 0 10px rgba(79, 255, 242, 0.14);
}

.stragahorn-tile.spawn-enemy {
  border-color: rgba(255, 126, 180, 0.88);
  background: linear-gradient(180deg, rgba(89, 22, 50, 0.92), rgba(60, 14, 33, 0.95));
  box-shadow: 0 0 10px rgba(255, 120, 174, 0.3), inset 0 0 10px rgba(255, 120, 174, 0.12);
}

.stragahorn-tile.spawn-objective {
  outline: 2px solid rgba(255, 225, 126, 0.88);
  outline-offset: -2px;
}

.stragahorn-tile.selectable {
  cursor: pointer;
}

.stragahorn-tile.selected {
  border-color: rgba(254, 244, 182, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 242, 194, 0.52), 0 0 12px rgba(255, 228, 131, 0.34);
}

.stragahorn-tile.move-target {
  border-color: rgba(116, 255, 168, 0.88);
  box-shadow: inset 0 0 0 1px rgba(160, 255, 196, 0.35), 0 0 9px rgba(116, 255, 168, 0.3);
}

.stragahorn-tile.lethal-move {
  border-color: rgba(255, 212, 128, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 188, 0.38), 0 0 11px rgba(255, 190, 88, 0.42);
}

.stragahorn-tile.attack-target {
  border-color: rgba(255, 96, 142, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 204, 0.32), 0 0 11px rgba(255, 96, 142, 0.34);
}

.stragahorn-tile.attack-target::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(255, 56, 120, 0.38), rgba(255, 56, 120, 0.38)),
    repeating-linear-gradient(45deg, rgba(255, 219, 233, 0.28) 0, rgba(255, 219, 233, 0.28) 3px, rgba(255, 56, 120, 0.14) 3px, rgba(255, 56, 120, 0.14) 6px);
  z-index: 3;
  pointer-events: none;
  animation: stragahornAttackPulse 0.75s ease-in-out infinite alternate;
}

.stragahorn-attack-marker {
  position: absolute;
  top: 4px;
  right: 5px;
  z-index: 4;
  font-size: 12px;
  font-weight: 700;
  color: #fff1f6;
  text-shadow: 0 0 6px rgba(255, 78, 130, 0.95);
  pointer-events: none;
}

.stragahorn-lethal-marker {
  position: absolute;
  bottom: 4px;
  right: 5px;
  z-index: 4;
  font-size: 10px;
  font-weight: 700;
  color: #fff3dc;
  text-shadow: 0 0 6px rgba(255, 170, 60, 0.96);
  pointer-events: none;
}

@keyframes stragahornAttackPulse {
  from { opacity: 0.52; }
  to { opacity: 0.95; }
}

.stragahorn-unit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  image-rendering: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-user-drag: none;
  user-select: none;
  background: transparent;
  filter: none;
  pointer-events: none;
}

.stragahorn-unit.enemy {
  filter: none;
}

.stragahorn-room-actions {
  margin-top: 8px;
}

.stragahorn-rooms-list {
  max-height: 170px;
  overflow: auto;
  border: 1px solid rgba(0, 229, 255, 0.24);
  background: rgba(2, 12, 28, 0.6);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stragahorn-room-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(142, 236, 255, 0.2);
  padding: 6px;
  background: rgba(11, 28, 44, 0.55);
}

.stragahorn-room-row button {
  min-width: 86px;
}

.stragahorn-modal-content {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  overflow: hidden;
}

.stragahorn-glitch-panel {
  height: 62px;
  border: 1px solid rgba(0, 229, 255, 0.32);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0, 229, 255, 0.18) 0,
      rgba(0, 229, 255, 0.18) 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 5px
    ),
    radial-gradient(circle at 20% 40%, rgba(82, 255, 238, 0.3), transparent 44%),
    radial-gradient(circle at 74% 62%, rgba(255, 86, 168, 0.24), transparent 42%),
    rgba(2, 10, 20, 0.9);
  animation: stragahornGlitch 2.3s steps(2, end) infinite;
}

@keyframes stragahornGlitch {
  0%, 100% { transform: translateX(0); filter: hue-rotate(0deg); }
  20% { transform: translateX(-1px); filter: hue-rotate(12deg); }
  48% { transform: translateX(1px); filter: hue-rotate(-8deg); }
  72% { transform: translateX(-1px); filter: hue-rotate(6deg); }
}

body.stragahorn-mode #btn-statistics,
body.stragahorn-mode #btn-leaderboards,
body.stragahorn-mode #btn-government,
body.stragahorn-mode .info-card,
body.stragahorn-mode .allocation-panel,
body.stragahorn-mode .discord-btn,
body.stragahorn-mode .logout-section {
  display: none !important;
}

body.stragahorn-mode .tab-buttons {
  margin-top: 6px;
}

.sun-hub-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(4, 12, 24, 0.85);
}

.hub-residence-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(4, 14, 28, 0.72);
}

.hub-residence-summary {
  font-size: 11px;
  line-height: 1.4;
  color: #a6d8f7;
  white-space: pre-line;
}

.hub-residence-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-residence-actions button {
  padding: 6px 9px;
  font-size: 10px;
}

.hub-residence-actions-carousel {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 6px;
}

.hub-residence-action-nav {
  width: 28px;
  min-width: 28px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.hub-residence-action-main {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-residence-action-hint {
  font-size: 10px;
  color: #9cc5df;
  line-height: 1.3;
}

.hub-residence-action-pager {
  font-size: 10px;
  color: #7bb3d6;
  text-align: center;
  letter-spacing: 0.5px;
}


.stats-residence-thumbnails {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 6px 0 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.residence-thumb-square {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 40, 70, 0.3);
  color: #98d7ff;
  font-size: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.residence-thumb-square.owned {
  border-color: rgba(130, 220, 255, 0.8);
  background: rgba(0, 125, 190, 0.38);
}

.residence-thumb-square.foreign {
  border-color: rgba(255, 115, 115, 0.72);
  background: rgba(104, 15, 15, 0.55);
  color: #ffc0c0;
}

.residence-thumb-square.for-sale {
  border-color: rgba(85, 255, 153, 0.78);
  background: rgba(12, 84, 44, 0.48);
  color: #ceffd6;
}

.residence-thumb-square.workforce {
  box-shadow: inset 0 0 0 1px rgba(63, 184, 119, 0.78);
}

.residence-thumb-square.military {
  box-shadow: inset 0 0 0 1px rgba(54, 118, 255, 0.75);
}

.residence-thumb-square.empty {
  opacity: 0.35;
}

.stats-residence-thumbnails::-webkit-scrollbar {
  height: 4px;
}

.stats-residence-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.35);
}

.councilor-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.councilor-mode-btn {
  min-height: 64px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1.2px;
}

.councilor-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.councilor-back-btn {
  padding: 7px 10px;
  font-size: 10px;
}

.officer-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  margin-right: 4px;
  color: #ffdf94;
  text-shadow: 0 0 7px rgba(255, 223, 148, 0.65);
  font-weight: bold;
}

.sun-hub-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  gap: 3px;
  padding: 10px;
  width: 100%;
  height: 100%;
}

.sun-hub-grid.metria-grid {
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 5px;
}

.sun-hub-grid.metria-grid .center-of-trust {
  grid-column: 4 / span 2;
  grid-row: 4 / span 2;
}

.industry-square {
  border-color: rgba(255, 207, 94, 0.42);
  background: rgba(45, 34, 8, 0.45);
  color: #ffe7b0;
  font-size: 12px;
  font-weight: bold;
}

.industry-square.owned {
  background: rgba(255, 207, 94, 0.22);
  border-color: rgba(255, 224, 145, 0.78);
}

.industry-square.for-sale {
  box-shadow: 0 0 12px rgba(85, 255, 153, 0.35);
  border-color: rgba(85, 255, 153, 0.72);
}

.pop-square {
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(0, 40, 70, 0.35);
  color: #7ec6ff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
  transition: 0.2s ease;
  width: 100%;
  height: 100%;
}

.pop-square:hover {
  border-color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.pop-square.selected {
  border-color: #ffcf5e;
  box-shadow: 0 0 12px rgba(255, 207, 94, 0.55);
}

.pop-square.owned { background: rgba(0, 229, 255, 0.15); color: #dff5ff; }
.pop-square.assigned-workforce { border-color: #3fb877; background: rgba(63, 184, 119, 0.18); }
.pop-square.assigned-military { border-color: #2d56c9; background: rgba(45, 86, 201, 0.2); }

@keyframes residenceClaimShimmer {
  0% {
    box-shadow: 0 0 8px rgba(255, 223, 122, 0.28), inset 0 0 0 rgba(255, 223, 122, 0);
    border-color: rgba(255, 223, 122, 0.46);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 223, 122, 0.72), inset 0 0 10px rgba(255, 223, 122, 0.18);
    border-color: rgba(255, 241, 181, 0.9);
  }
  100% {
    box-shadow: 0 0 8px rgba(255, 223, 122, 0.28), inset 0 0 0 rgba(255, 223, 122, 0);
    border-color: rgba(255, 223, 122, 0.46);
  }
}

.pop-square.claim-ready {
  animation: residenceClaimShimmer 1.6s ease-in-out infinite;
}

.battery-vat-square {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(142, 255, 245, 0.88);
  background: linear-gradient(180deg, rgba(26, 236, 255, 0.62), rgba(0, 90, 124, 0.96));
  color: #b9fff8;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow:
    0 0 24px rgba(105, 255, 236, 0.9),
    0 0 52px rgba(0, 229, 255, 0.78),
    0 0 96px rgba(0, 229, 255, 0.62),
    0 0 136px rgba(0, 229, 255, 0.42),
    inset 0 0 24px rgba(182, 255, 249, 0.5);
}

.battery-vat-square > * {
  position: relative;
  z-index: 1;
}

.battery-vat-square:hover {
  box-shadow:
    0 0 28px rgba(126, 255, 243, 0.98),
    0 0 64px rgba(0, 229, 255, 0.88),
    0 0 116px rgba(0, 229, 255, 0.66),
    0 0 164px rgba(0, 229, 255, 0.48),
    inset 0 0 26px rgba(194, 255, 251, 0.58);
}

.battery-vat-square.recharging {
  animation: batteryVatPulse 1s ease-in-out infinite;
  border-color: rgba(188, 255, 248, 0.95);
  box-shadow:
    0 0 34px rgba(102, 255, 239, 1),
    0 0 76px rgba(0, 229, 255, 0.95),
    0 0 130px rgba(0, 229, 255, 0.74),
    0 0 188px rgba(0, 229, 255, 0.5),
    inset 0 0 32px rgba(206, 255, 252, 0.68);
}

.battery-vat-square.locked-occupied {
  opacity: 0.42;
  border-color: rgba(108, 255, 239, 0.38);
  box-shadow: 0 0 6px rgba(105, 255, 236, 0.22), inset 0 0 7px rgba(105, 255, 236, 0.1);
}

.battery-vat-icon {
  width: 78%;
  height: 78%;
  object-fit: contain;
  opacity: 0.92;
  filter: brightness(1.35) saturate(1.15) blur(1.6px) drop-shadow(0 0 14px rgba(121, 255, 240, 0.95)) drop-shadow(0 0 28px rgba(0, 229, 255, 0.88)) drop-shadow(0 0 46px rgba(0, 229, 255, 0.7));
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
  .battery-vat-square {
    border: 1px solid rgba(108, 255, 239, 0.75);
    background: linear-gradient(180deg, rgba(16, 228, 255, 0.5), rgba(0, 88, 118, 0.94));
    box-shadow: 0 0 14px rgba(105, 255, 236, 0.58), inset 0 0 12px rgba(105, 255, 236, 0.22);
  }

  .battery-vat-square:hover {
    box-shadow: 0 0 14px rgba(105, 255, 236, 0.66);
  }

  .battery-vat-square.recharging {
    box-shadow: 0 0 26px rgba(102, 255, 239, 0.95), 0 0 52px rgba(0, 229, 255, 0.72), inset 0 0 22px rgba(164, 255, 245, 0.45);
  }
}

.center-of-trust {
  grid-column: 5 / span 3;
  grid-row: 5 / span 3;
  border: 2px solid #ffcf5e;
  color: #ffe7a4;
  font-weight: bold;
  letter-spacing: 1px;
  text-align: center;
  background: radial-gradient(circle, rgba(255, 230, 140, 0.35), rgba(255, 200, 80, 0.08));
  box-shadow: 0 0 25px rgba(255, 207, 94, 0.6), inset 0 0 15px rgba(255, 207, 94, 0.25);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

.contract-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(0, 229, 255, 0.05);
}

/* Bank Modal — Large Desktop Layout */
.bank-modal-large {
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  max-height: 750px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.bank-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(4, 12, 24, 0.9);
}

.bank-modal-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 16px;
  padding: 14px;
  overflow: hidden;
}

.vault-section {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(3, 10, 22, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 12px;
  overflow-y: auto;
}

.vault-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vault-card {
  padding: 10px 6px;
  border: 1px solid rgba(0, 229, 255, 0.4);
  background: rgba(0, 20, 40, 0.80);
  text-align: center;
}

.vault-label {
  font-size: 9px;
  color: #88c8ff;
  letter-spacing: 1px;
}

.vault-amount {
  font-size: 14px;
  font-weight: bold;
  color: #00e5ff;
}

.marketplace-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(3, 10, 22, 0.52);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 12px;
  overflow: hidden;
}

.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.market-slot {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding: 0 0 100% 0;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 24, 46, 0.45);
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.market-slot:hover {
  border-color: rgba(148, 255, 247, 0.82);
  box-shadow: 0 0 12px rgba(104, 255, 241, 0.35);
  transform: translateY(-1px);
}

.market-slot.empty {
  background: rgba(0, 18, 36, 0.35);
  border-color: rgba(0, 229, 255, 0.12);
}

.market-slot.selected {
  border-color: #ffcf5e;
  box-shadow: 0 0 14px rgba(255, 207, 94, 0.5);
}

.market-slot-image {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.18) contrast(1.05);
  z-index: 0;
}

.market-slot.filled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.28) 45%, transparent 70%);
  transform: translateX(-120%);
  animation: marketShimmer 2.4s linear infinite;
  z-index: 1;
  pointer-events: none;
}

.market-slot-timer {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 4px;
  font-size: 9px;
  letter-spacing: 0.6px;
  background: rgba(0, 6, 18, 0.82);
  border: 1px solid rgba(0, 229, 255, 0.42);
  color: #b8fff8;
  z-index: 2;
}

@keyframes marketShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(140%); }
}

.bank-interface-view {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: #03070f;
  overflow: hidden;
  isolation: isolate;
}

.bank-interface-view::before {
  content: "";
  position: absolute;
  inset: -3%;
  background-image: url("images/Elexi.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  transform: scale(1.05);
  filter: blur(2px) brightness(1.02) saturate(1.25) contrast(1.15);
  z-index: 0;
}

.bank-interface-view::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 207, 94, 0.1), transparent 46%),
    linear-gradient(180deg, rgba(2, 6, 14, 0.32), rgba(2, 7, 15, 0.46));
  z-index: 0;
}

.bank-interface-view > * {
  position: relative;
  z-index: 1;
}

.bank-interface-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 207, 94, 0.35);
  background: rgba(8, 12, 22, 0.5);
}

.bank-interface-header h2 {
  color: #ffcf5e;
  letter-spacing: 2px;
  font-size: 20px;
}

.bank-interface-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(340px, 1.25fr);
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.repository-section {
  border: 1px solid rgba(255, 207, 94, 0.35);
  background: rgba(22, 16, 4, 0.52);
  padding: 10px;
  overflow-y: auto;
}

.repository-section h3,
.marketplace-section h3 {
  color: #ffdf94;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

#bank-interface-view .action-row button,
#bank-interface-view .action-group > button {
  background: rgba(18, 28, 42, 0.8);
  border-color: rgba(255, 207, 94, 0.58);
  color: #ffd77a;
}

#bank-interface-view .action-row button:hover,
#bank-interface-view .action-group > button:hover {
  background: rgba(255, 207, 94, 0.8);
  color: #201307;
  box-shadow: 0 0 14px rgba(255, 207, 94, 0.45);
}

#marketplace-contract-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.marketplace-section .action-row input,
.marketplace-section .action-row select,
#marketplace-contract-actions button {
  border: 1px solid rgba(255, 207, 94, 0.55);
  background: linear-gradient(180deg, rgba(43, 31, 7, 0.8), rgba(15, 10, 3, 0.8));
  color: #ffd77a;
  box-shadow: inset 0 0 10px rgba(255, 207, 94, 0.12), 0 0 10px rgba(255, 207, 94, 0.22);
}

.marketplace-section .action-row input:focus,
.marketplace-section .action-row select:focus,
#marketplace-contract-actions button:hover {
  border-color: #ffe39a;
  box-shadow: inset 0 0 10px rgba(255, 207, 94, 0.25), 0 0 14px rgba(255, 207, 94, 0.48);
}

.marketplace-section .action-row select,
#contract-type-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffde8d 50%),
    linear-gradient(135deg, #ffde8d 50%, transparent 50%),
    linear-gradient(180deg, rgba(43, 31, 7, 0.85), rgba(15, 10, 3, 0.9));
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 10px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 28px;
}

#contract-type-select option {
  background: #170f04;
  color: #ffd77a;
}

@media (max-width: 768px) {
  .game-container {
    flex-direction: column-reverse;
  }
  .sidebar {
    width: 100%;
    height: 42%;
    padding: 10px;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .sidebar-header h1 {
    font-size: 16px;
    padding: 6px;
  }
  .info-bar {
    padding: 6px;
    font-size: 11px;
  }
  .map-container {
    height: 58%;
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .assistance-tab-row {
    gap: 6px;
  }
  .assistance-tab-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 7px 8px;
    font-size: 10px;
  }
  .assistance-region-grid {
    grid-template-columns: 1fr;
  }
  .bank-interface-body {
    grid-template-columns: 1fr;
  }
  .marketplace-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .stragahorn-view {
    grid-template-rows: 72px 1fr;
  }
  .stragahorn-header {
    min-height: 72px;
    height: 72px;
  }
  .stragahorn-header p {
    display: none;
  }
  .stragahorn-run-timer {
    font-size: 9px;
    padding: 5px 6px;
  }
  .stragahorn-mobile-status {
    display: block;
    font-size: 9px;
    max-height: 44px;
  }
  #government-view.ibris-mode .role-grid {
    gap: 8px;
  }
  .ibris-strip {
    font-size: 9px;
    letter-spacing: 1.2px;
  }
}

.short-circuit-visor {
  position: absolute;
  inset: 0;
  z-index: 39;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: plus-lighter;
  background:
    radial-gradient(circle at 50% 50%, rgba(196, 255, 255, 0.42), transparent 60%),
    repeating-linear-gradient(118deg, rgba(117, 247, 255, 0.78) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(64deg, rgba(236, 255, 255, 0.75) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, rgba(174, 246, 255, 0.12), rgba(22, 124, 179, 0.1));
}

body.short-circuit-voltage .short-circuit-visor {
  animation: shortCircuitVoltageFlash 1.2s steps(2, end);
}

@keyframes shortCircuitVoltageFlash {
  0% {
    opacity: 0;
    filter: brightness(1) blur(0);
  }
  10% {
    opacity: 1;
    filter: brightness(2.1) blur(0.2px) saturate(1.4);
  }
  22% {
    opacity: 0.15;
    filter: brightness(1.15) blur(0.9px);
  }
  32% {
    opacity: 0.95;
    filter: brightness(2.4) blur(0.25px) saturate(1.35);
  }
  52% {
    opacity: 0.22;
    filter: brightness(1.2) blur(1px);
  }
  66% {
    opacity: 0.88;
    filter: brightness(2.2) blur(0.35px);
  }
  82% {
    opacity: 0.16;
    filter: brightness(1.1) blur(1.2px);
  }
  100% {
    opacity: 0;
    filter: brightness(1) blur(0);
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  #minigame-view:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;  /* Height becomes Width when rotated */
    height: 100vw !important; /* Width becomes Height when rotated */
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    z-index: 9999 !important;
    background: #020712 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Prevent text overlapping on mobile header */
  #minigame-view .stats-header {
    width: 100% !important;
    padding: 6px 16px 2px 16px !important;
    box-sizing: border-box !important;
  }

  #minigame-view .stats-header h2 {
    font-size: 13px !important;
    letter-spacing: 1px !important;
  }

  #minigame-view #exit-minigame-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  /* Preserved 16:9 Canvas Ratio - Prevents Stretching */
  #minigame-canvas {
    width: auto !important;
    height: calc(100vw - 65px) !important;
    max-width: 96vh !important; /* Leaves subtle padding on sides */
    max-height: calc(100vw - 65px) !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important; /* Prevents pixel stretching */
    touch-action: none !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
  }
}

/* Desktop PC Layout */
#astral-view:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#astral-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid #00e5ff;
  background: #010612;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.25);
}

@media (min-width: 769px) {
  #minigame-view:not(.hidden),
  #astral-view:not(.hidden) {
    position: fixed;
    top: 0;
    left: 320px;
    width: calc(100vw - 320px);
    height: 100vh;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background:
      linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
      #01060f;
    background-size: 28px 28px;
    overflow: hidden;
  }

  #minigame-canvas,
  #astral-canvas {
    width: min(100%, 1120px) !important;
    height: auto !important;
    max-height: calc(100vh - 135px) !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}

/* Mobile Auto-Rotate Portrait View */
@media (max-width: 768px) and (orientation: portrait) {
  #astral-view:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    z-index: 9999 !important;
    background: #010612 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #astral-view .stats-header {
    width: 100% !important;
    padding: 6px 16px 2px 16px !important;
    box-sizing: border-box !important;
  }

  #astral-view .stats-header h2 {
    font-size: 13px !important;
    letter-spacing: 1px !important;
  }

  #astral-view #exit-astral-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  #astral-canvas {
    width: auto !important;
    height: calc(100vw - 65px) !important;
    max-width: 96vh !important;
    max-height: calc(100vw - 65px) !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    touch-action: none !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
  }
}

.astral-glitch-active {
  animation: astralGlitch 0.15s infinite alternate;
}

@keyframes astralGlitch {
  0% { transform: translate(0, 0) scale(1); filter: hue-rotate(0deg); }
  50% { transform: translate(-3px, 2px) scale(1.01); filter: hue-rotate(90deg) contrast(1.3); }
  100% { transform: translate(3px, -2px) scale(0.99); filter: hue-rotate(180deg); }
}

/* --- SYNTH GARDEN MOBILE PORTRAIT ROTATION LAYOUT --- */
@media (max-width: 768px) and (orientation: portrait) {
  #garden-view:not(.hidden) {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;  /* Height becomes Width when rotated */
    height: 100vw !important; /* Width becomes Height when rotated */
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    z-index: 9999 !important;
    background: #020712 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Prevent text overlapping on mobile header */
  #garden-view .stats-header {
    width: 100% !important;
    padding: 6px 16px 2px 16px !important;
    box-sizing: border-box !important;
  }

  #garden-view .stats-header h2 {
    font-size: 13px !important;
    letter-spacing: 1px !important;
  }

  #garden-view #exit-garden-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }

  /* Preserved 16:9 Canvas Ratio for Garden */
  #garden-canvas {
    width: auto !important;
    height: calc(100vw - 65px) !important;
    max-width: 96vh !important;
    max-height: calc(100vw - 65px) !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    touch-action: none !important;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2) !important;
    border: 1px solid rgba(0, 243, 255, 0.4) !important;
  }
}

/* --- SYNTH GARDEN DESKTOP PC LAYOUT --- */
#garden-view:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#garden-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid #00f3ff;
  background: #010612;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.25);
}

@media (min-width: 769px) {
  #garden-view:not(.hidden) {
    position: fixed;
    top: 0;
    left: 320px;
    width: calc(100vw - 320px);
    height: 100vh;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background:
      linear-gradient(rgba(0, 243, 255, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 243, 255, 0.04) 1px, transparent 1px),
      #01060f;
    background-size: 28px 28px;
    overflow: hidden;
  }

  #garden-canvas {
    width: min(100%, 1120px) !important;
    height: auto !important;
    max-height: calc(100vh - 135px) !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
}

/* =========================================================
   ASTRAL PET / TAMAGOTCHI STYLES
   ========================================================= */

.pet-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: calc(100% - 40px);
}

.pet-hud {
  font-size: 13px;
  color: #8fe8ff;
  font-weight: bold;
  letter-spacing: 1px;
  text-align: center;
}

#astral-pet-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid #00e5ff;
  background: #020712;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
  touch-action: none;
}

.pet-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.action-btn {
  background: #061e36;
  border: 1px solid #00e5ff;
  color: #8fe8ff;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #00e5ff;
  color: #010612;
  box-shadow: 0 0 12px #00e5ff;
}

.glow-gold {
  border-color: #ffcf5e !important;
  color: #ffcf5e !important;
}

.glow-gold:hover {
  background: #ffcf5e !important;
  color: #010612 !important;
  box-shadow: 0 0 12px #ffcf5e !important;
}

/* Mobile Auto-Rotate Portrait View */
/* Mobile Native Portrait View (Tamagotchi Style) */
@media (max-width: 768px) and (orientation: portrait) {
  #astral-pet-view:not(.hidden) {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important; /* Removes 90deg rotation */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 10px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }

  /* Compact Pet Canvas for Portrait Stack */
  #astral-pet-canvas {
    width: 100% !important;
    max-width: 400px !important; /* Fits portrait screen comfortably */
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    touch-action: none !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.25) !important;
    border: 1px solid rgba(0, 229, 255, 0.4) !important;
  }
}

/* =========================================================
   GALACTIC STAR MINER ENGINE - MAIN MENU OVERLAY STYLES
   ========================================================= */

/* Launch Button Styling */
.starmap-launch-btn {
  background: #061e36;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  padding: 12px 24px;
  font-family: monospace;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
  transition: all 0.2s ease;
}

.starmap-launch-btn:hover {
  background: #00e5ff;
  color: #010612;
  box-shadow: 0 0 25px #00e5ff;
}

.train-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: #050014;
  display: flex;
  align-items: center;
  justify-content: center;
}

.train-transition-overlay.hidden {
  display: none !important;
}

.train-transition-frame {
  width: 100vw;
  height: 100vh;
  border: 0;
  background: #050014;
}

.fashionista-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  padding: 16px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(circle at 14% 18%, rgba(0, 229, 255, 0.14), transparent 44%),
    radial-gradient(circle at 82% 72%, rgba(255, 112, 205, 0.12), transparent 42%),
    linear-gradient(rgba(0, 229, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.07) 1px, transparent 1px),
    rgba(1, 8, 16, 0.76);
  background-size: auto, auto, 24px 24px, 24px 24px, auto;
}

.fashionista-overlay.hidden {
  display: none !important;
}

.fashionista-shell {
  width: min(1500px, calc(100% - 8px));
  height: calc(100% - 8px);
  border: 1px solid rgba(0, 229, 255, 0.42);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.22), inset 0 0 18px rgba(0, 229, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(4, 20, 36, 0.92), rgba(2, 10, 20, 0.96));
  display: grid;
  grid-template-rows: 44px 1fr;
  overflow: hidden;
}

.fashionista-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.24);
  background: rgba(3, 16, 32, 0.92);
  padding: 0 10px;
}

.fashionista-shell-header h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 1.3px;
  color: #aaf5ff;
}

.fashionista-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.fashionista-close-btn {
  position: static;
  z-index: 1;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: #ff7a7a;
  color: #ffd2d2;
  background: rgba(118, 18, 18, 0.62);
}

.fashionista-close-btn:hover {
  background: rgba(255, 92, 92, 0.95);
  color: #170304;
}

#spaceport-overlay {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(1, 8, 16, 0.9);
}

#spaceport-overlay .fashionista-shell {
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: none;
  background: #010509;
}

#spaceport-overlay .fashionista-shell-header {
  padding: 0 12px;
}

#spaceport-overlay .fashionista-frame {
  background: #010509;
}

@media (max-width: 900px) {
  .fashionista-overlay {
    padding: 6px;
  }

  .fashionista-shell {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 768px) {
  #spaceport-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    z-index: 1000001;
  }

  #spaceport-overlay .fashionista-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-rows: 1fr;
  }

  #spaceport-overlay .fashionista-shell-header,
  #spaceport-close-btn {
    display: none !important;
  }
}

.collections-modal-content {
  max-width: 1220px;
  width: min(1220px, 96vw);
}

.node-players-modal-content {
  width: min(360px, calc(100vw - 28px));
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 18, 14, 0.82), rgba(1, 10, 13, 0.9)),
    url("images/Navcom15.avif") center center / cover no-repeat;
}

.node-players-modal-content::before,
.node-players-modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.node-players-modal-content::before {
  z-index: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(132, 255, 222, 0.12) 0,
      rgba(132, 255, 222, 0.12) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 5px
    ),
    radial-gradient(circle at 50% 50%, rgba(92, 255, 206, 0.18) 0, rgba(7, 20, 17, 0.72) 78%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.node-players-modal-content::after {
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(150, 255, 228, 0) 0%,
    rgba(150, 255, 228, 0.24) 44%,
    rgba(150, 255, 228, 0) 100%
  );
  transform: translateY(-110%);
  animation: radarScannerSweep 3.2s linear infinite;
}

.node-players-modal-content > * {
  position: relative;
  z-index: 2;
}

@keyframes radarScannerSweep {
  0% {
    transform: translateY(-110%);
    opacity: 0;
  }
  10% {
    opacity: 0.78;
  }
  62% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(110%);
    opacity: 0;
  }
}

#node-players-list {
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 8px;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  max-height: none;
  overflow: hidden;
  margin-top: 12px;
  padding-right: 4px;
}

.collection-item {
  border: 1px solid rgba(0, 229, 255, 0.42);
  background: linear-gradient(180deg, rgba(3, 20, 36, 0.86), rgba(2, 12, 25, 0.9));
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.12), inset 0 0 10px rgba(0, 229, 255, 0.07);
}

.collection-item img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border: 1px solid rgba(0, 229, 255, 0.22);
  background: rgba(1, 7, 15, 0.9);
}

.collection-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.collection-actions button {
  font-size: 10px;
  letter-spacing: 0.4px;
  padding: 6px 4px;
  min-height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-actions .collection-bg-btn {
  grid-column: 1 / -1;
}

.collections-nav-row {
  grid-column: 1 / -1;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.collections-nav-btn {
  min-width: 44px;
  font-size: 14px;
  padding: 7px 0;
}

.collections-nav-indicator {
  min-width: 82px;
  text-align: center;
  font-size: 10px;
  color: #93dbf3;
  letter-spacing: 0.7px;
}

@media (max-width: 768px) {
  .collections-modal-content {
    width: min(98vw, 560px);
    max-height: 92vh;
    padding: 14px;
    gap: 10px;
    overflow: hidden;
  }

  .collections-grid {
    grid-template-columns: 1fr;
    max-height: 58vh;
    overflow-y: auto;
    margin-top: 6px;
    padding-right: 2px;
  }

  .collection-item img {
    height: 220px;
  }

  .collection-actions {
    grid-template-columns: 1fr;
  }

  .collection-actions .collection-bg-btn {
    grid-column: auto;
  }

  .modal-actions {
    margin-top: auto;
    justify-content: stretch;
    width: 100%;
  }

  #close-collections-modal {
    width: 100%;
    min-height: 38px;
  }
}

.stragahorn-launch-btn {
  background: #2a0707;
  border: 1px solid #ff7272;
  color: #ff9e9e;
  padding: 12px 24px;
  font-family: monospace;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 74, 74, 0.5), inset 0 0 10px rgba(255, 74, 74, 0.22);
  animation: stragahornMenaceNodeFlicker 1.9s steps(2, end) infinite;
}

.stragahorn-launch-btn:hover {
  background: #4a0b0b;
  color: #ffd3d3;
  box-shadow: 0 0 24px rgba(255, 84, 84, 0.82), inset 0 0 14px rgba(255, 102, 102, 0.4);
}

/* Fullscreen Overlay Wrapper (Hidden by default) */
#starmap-overlay-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: #01040d;
  display: none; /* Stays hidden until JS triggers active/display: block */
  font-family: monospace;
  color: #00e5ff;
  user-select: none;
  touch-action: none;
}

#starmap-overlay-wrapper.active {
  display: block !important;
}

/* Room Selector Modal Card */
#room-selector-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: rgba(1, 6, 18, 0.98);
  border: 2px solid #00e5ff;
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.5);
  padding: 20px;
  color: #00e5ff;
  font-family: monospace;
  z-index: 1000002;
  display: none; /* Controlled by JS when launcher is clicked */
  text-align: center;
  backdrop-filter: blur(10px);
}

#room-selector-modal.active {
  display: block !important;
}

.room-grid-btn {
  width: 100%;
  background: #061e36;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  padding: 10px;
  font-family: monospace;
  font-weight: bold;
  margin-top: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  transition: all 0.2s;
}

.room-grid-btn:hover {
  background: #00e5ff;
  color: #010612;
  box-shadow: 0 0 15px #00e5ff;
}

/* HUD Top Left Panel */
#starmap-hud {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 1000000;
  background: rgba(1, 6, 18, 0.92);
  border: 1px solid #00e5ff;
  padding: 14px;
  color: #00e5ff;
  font-size: 12px;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
  backdrop-filter: blur(6px);
  width: 275px;
}

/* Target Scanner Bottom Right Card */
#target-scanner-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: rgba(1, 6, 18, 0.95);
  border: 1px solid #00e5ff;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.3);
  padding: 14px;
  color: #8fe8ff;
  z-index: 1000001;
  backdrop-filter: blur(8px);
  display: none;
}

#target-scanner-card.active {
  display: block !important;
}

/* Progress Meters & Fuel/Shield Bars */
.starmap-meter-bg {
  width: 100%;
  background: #061e36;
  height: 8px;
  border: 1px solid #00e5ff;
  margin-top: 3px;
}

.starmap-meter-fill {
  width: 100%;
  height: 100%;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
}

.shield-fill {
  background: #ff00dd !important;
  box-shadow: 0 0 8px #ff00dd !important;
}

/* Buttons */
.starmap-btn {
  width: 100%;
  background: #061e36;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  padding: 6px;
  font-family: monospace;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.starmap-btn-danger {
  border-color: #ff0055 !important;
  color: #ff0055 !important;
  margin-top: 10px;
}

.starmap-btn-danger:hover {
  background: #ff0055 !important;
  color: #fff !important;
}

/* Canvas Element */
#starmap-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  image-rendering: pixelated !important;
  image-rendering: crisp-edges !important;
  image-rendering: -webkit-optimize-contrast;
}






