@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

:root {
  --eva-orange: #FF6600;
  --eva-gray: #A9A9A9;
  --eva-green: #00FF8D;
  --eva-brown: #964B00;
  --eva-blue: #00CCFF;
  --eva-red: #FF3333;
  --eva-yellow: #FFD100;
  --infinite-gold: #FFD100;
  --eva-purple: #9D00FF;
  --nerv-dark-blue: #0A0F2C;
  --nerv-black: #000000;
  --terminal-green: #00FF8D;
  --warning-striped: repeating-linear-gradient(45deg, #000000, #000000 10px, #FFD100 10px, #FFD100 20px);
  --glass-background: rgba(0, 14, 27, 0.8);
  --glass-border: rgba(0, 150, 150, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 50, 70, 0.4);
  --screen-glow: 0 0 10px rgba(0, 200, 150, 0.4);
  --screen-lines: repeating-linear-gradient(transparent, transparent 2px, rgba(0, 255, 140, 0.03) 3px, transparent 3px);
  --crt-vignette: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  --terminal-green-rgb: 0, 255, 140;
}

/* Override Bootstrap's text colors */
.bg-light {
  background-color: var(--nerv-dark-blue) !important;
  color: var(--eva-green) !important;
}

/* Override any default text colors with high contrast */
.text-dark, .text-body {
  color: var(--terminal-green) !important;
}

body {
  background-color: var(--nerv-black);
  position: relative;
  margin: 0;
  padding: 0;
  font-family: 'Share Tech Mono', monospace;
  color: var(--terminal-green);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Projects Panel Styles */
.projects-panel {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 400px;
  max-height: 80vh;
  background: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 15px;
  font-family: 'Share Tech Mono', monospace;
  color: var(--terminal-green);
  z-index: 999; /* Decreased from 1000 to be below settings menu */
  backdrop-filter: blur(10px);
  box-shadow: var(--glass-shadow);
  overflow-y: auto;
}

.projects-panel h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  text-align: center;
  color: var(--eva-orange);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

.projects-content {
  font-size: 11px;
  line-height: 1.4;
}

.projects-summary {
  margin-bottom: 15px;
  padding: 8px;
  background: rgba(0, 50, 70, 0.3);
  border-radius: 4px;
}

.summary-stats {
  display: flex;
  justify-content: space-between;
}

.summary-stats .completed {
  color: var(--eva-green);
}

.summary-stats .active {
  color: var(--eva-yellow);
}

.faction-projects {
  margin-bottom: 20px;
}

.faction-projects h5 {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: bold;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 4px;
}

.project {
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid;
}

.project.completed {
  border-left-color: var(--eva-green);
  background: rgba(0, 255, 140, 0.1);
}

.project.active {
  border-left-color: var(--eva-yellow);
  background: rgba(255, 209, 0, 0.1);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.project-name {
  font-weight: bold;
  font-size: 11px;
}

.project-status.completed {
  color: var(--eva-green);
}

.project-status.pending {
  color: var(--eva-yellow);
}

.project-description {
  font-size: 10px;
  color: var(--eva-gray);
  margin-bottom: 6px;
  font-style: italic;
}

.project-requirements {
  margin-bottom: 6px;
}

.resource-requirements, .territory-requirements {
  margin-bottom: 4px;
}

.resource-req, .territory-req {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 9px;
}

.resource-req.met, .territory-req.met {
  background: rgba(0, 255, 140, 0.2);
  color: var(--eva-green);
}

.resource-req.unmet, .territory-req.unmet {
  background: rgba(255, 51, 51, 0.2);
  color: var(--eva-red);
}

.joint-requirement {
  font-size: 9px;
  color: var(--eva-blue);
  font-style: italic;
}

.project-effects {
  margin-top: 6px;
}

.effect {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 3px;
  background: rgba(0, 150, 150, 0.2);
  border-radius: 2px;
  font-size: 9px;
  color: var(--eva-blue);
}

.completion-info {
  font-size: 9px;
  color: var(--eva-green);
  margin-top: 4px;
  font-style: italic;
}

/* CRT screen effect for background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    var(--screen-lines),
    var(--crt-vignette);
  background-size: 100% 100%;
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

/* Add NERV hexagon pattern to background */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><path d="M20 4L33.6 14V34L20 44L6.4 34V14L20 4Z" stroke-width="0.5" stroke="rgba(0, 200, 150, 0.15)" fill="none"/></svg>');
  background-size: 60px 60px;
  opacity: 0.2;
  z-index: -2;
}

/* Territory Assignment: enlarge minimap container */
#taMinimapContainer {
  width: 100%;
  max-width: 1280px; /* expand horizontal width */
  height: 640px;     /* increase decision container size */
  margin: 0 auto;
}

/* Decision buttons: use navy/gold theme consistently */
.decision-panel .decision-option-btn {
  background-color: var(--nerv-dark-blue) !important;
  border: 2px solid var(--infinite-gold) !important;
  color: var(--infinite-gold) !important;
  border-radius: 0 !important;
  text-transform: uppercase;
}
.decision-panel .decision-option-btn:hover {
  background-color: rgba(255, 209, 0, 0.15) !important;
}

.eight-bit-title {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--infinite-gold), 0 0 20px rgba(255, 209, 0, 0.5);
  color: var(--infinite-gold);
  letter-spacing: 1px;
  font-weight: 700;
  position: relative;
}

.eight-bit-title::before {
  content: '';
  position: absolute;
  left: -10px;
  top: -3px;
  height: calc(100% + 6px);
  width: 5px;
  background-color: var(--infinite-gold);
  box-shadow: 0 0 8px var(--infinite-gold);
}

.no-side-line::before {
  display: none !important;
}

.eight-bit-text-header {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--infinite-gold);
  text-shadow: 0 0 8px rgba(255, 209, 0, 0.6);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
}

.eight-bit-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--terminal-green);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.eight-bit-text-alert {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--eva-red);
  text-shadow: 0 0 8px rgba(255, 50, 50, 0.7);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  padding: 5px 10px;
  /* background: var(--warning-striped); */ /* Removed background */
  display: inline-block;
  animation: warning-flash 1s infinite alternate;
}

@keyframes warning-flash {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* 3D Globe Styles */
.three-d-globe {
  width: 850px;
  height: 850px;
  margin: 0 auto;
  position: relative;
  /* Removed border, box-shadow, background-color, and background-image */
  border-radius: 0;
  overflow: hidden;
  cursor: grab;
}

/* Removed the ::before pseudo-element that displayed "INFINITE SYSTEM TERRAFORMING ANALYSIS" */

/* Removed the ::after pseudo-element that displayed the CRT vignette effect */

.three-d-globe:active {
  cursor: grabbing;
}

.territory-tooltip {
  position: absolute;
  display: none;
  padding: 10px;
  background-color: rgba(0, 10, 20, 0.9);
  border: 1px solid var(--infinite-gold);
  border-radius: 0;
  box-shadow: 0 0 15px rgba(255, 209, 0, 0.3);
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  z-index: 900;
  pointer-events: none;
  min-width: 180px;
  text-align: left;
  animation: tooltipFadeIn 0.2s ease-in-out;
  transition: opacity 0.2s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.territory-tooltip::before {
  content: 'DATA';
  position: absolute;
  top: -10px;
  left: 0;
  background-color: var(--infinite-gold);
  color: black;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Territory detail panel styles */
.territory-detail-panel {
  position: fixed;
  z-index: 1001;
  background-color: rgba(10, 16, 33, 0.9);
  border: 2px solid var(--infinite-gold);
  box-shadow: 0 0 20px rgba(255, 209, 0, 0.4);
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  animation: panelFadeIn 0.3s ease-in-out;
  /* Fixed positioning and styling */
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 8px;
  padding: 12px;
  width: 280px;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Visual feedback when panel is in "sticky" mode */
.territory-detail-panel.sticky-mode {
  border-color: var(--eva-green);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.territory-detail-panel h3 {
  color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.territory-detail-panel h4 {
  color: var(--eva-blue);
  font-family: 'VT323', monospace;
  letter-spacing: 1px;
  font-size: 14px;
  text-transform: uppercase;
  margin-top: 0;
}

.territory-detail-panel button {
  background: var(--eva-yellow);
  color: var(--nerv-dark-blue);
  box-shadow: 0 0 15px var(--eva-yellow);
  transition: all 0.3s ease;
  padding: 12px 24px;
  text-transform: uppercase;
  z-index: 1;
}

.territory-detail-panel button:hover {
  background: var(--eva-yellow);
  color: var(--nerv-dark-blue);
  box-shadow: 0 0 15px var(--eva-yellow);
}

/* Territory panel toggle buttons */
.territory-panel-toggles {
  pointer-events: auto !important; /* Allow clicks on toggle container */
}

#territoryNewsContent {
  pointer-events: auto !important; /* Allow scrolling in news content */
}

/* Territory Panel Split Navigation Styling - smaller version of the main split nav */
.territory-split-nav {
  min-width: 140px !important;
  height: 28px !important;
  font-size: 0.75rem !important;
}

.territory-split-nav .split-nav-side {
  height: 26px !important;
  padding: 4px 6px !important;
  font-size: 0.75rem !important;
  white-space: nowrap !important;
  background-color: rgba(255, 255, 255, 0.1) !important; /* Light translucent background for inactive state */
  color: rgba(255, 255, 255, 0.7) !important; /* Light gray text for inactive state */
}

.territory-split-nav .split-nav-side.active {
  background-color: var(--infinite-gold) !important;
  color: #000 !important;
}

/* News feed styling */
.news-feed-container {
  scrollbar-width: thin;
  scrollbar-color: var(--eva-green) rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background-color: var(--nerv-dark-blue);
  padding: 8px;
  margin: 4px 0;
  /* Slightly widen within the parent without changing the panel width */
  margin-left: -12px;
  margin-right: -12px;
}

.news-feed-container::-webkit-scrollbar {
  width: 8px;
}

.news-feed-container::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.news-feed-container::-webkit-scrollbar-thumb {
  background: var(--eva-green);
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
}

.news-feed-container::-webkit-scrollbar-thumb:hover {
  background: var(--infinite-gold);
}

.news-item {
  margin-bottom: 8px;
  word-wrap: break-word;
}



.news-item:last-child {
  border-bottom: none !important;
}

.main-action-btn {
  padding: 12px 24px;
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--infinite-gold);
  color: var(--infinite-gold);
  box-shadow: 0 0 15px rgba(255, 209, 0, 0.5);
  text-shadow: 0 0 8px rgba(255, 209, 0, 0.5);
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 0, 0.4), transparent);
  animation: shimmer 2s infinite;
}

/* Slower shimmer variant for decision buttons */
.btn-shimmer-slow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 0, 0.35), transparent);
  animation: shimmer 3s infinite; /* slow down from 2s to 3s */
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}

.main-action-btn:hover {
  background-color: rgba(255, 209, 0, 0.2);
  box-shadow: 0 0 20px rgba(255, 209, 0, 0.7);
  transform: translateY(-2px);
  color: var(--infinite-gold);
}

.main-action-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(255, 209, 0, 0.3);
}

.faction-panel {
  background-color: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 15px;
  position: relative;
  box-shadow: var(--glass-shadow), var(--screen-glow);
  overflow: hidden;
}

#mainScreenPanel {
  background-color: var(--glass-background);
  border: 2px solid var(--infinite-gold);
  position: relative;
  overflow-y: hidden;
  padding-top: 25px;
  max-height: calc(100vh - 120px);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

#mainScreenPanel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.99);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

/* Ensure endgame modal can contain the stars background */
#endGameModal {
  position: fixed;
  overflow: hidden;
}

.modal-content {
  background-color: var(--nerv-dark-blue);
  width: 85%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  border: 2px solid var(--infinite-gold);
  box-shadow: 0 0 30px rgba(255, 209, 0, 0.5);
  padding: 25px 20px 20px;
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  background-image: var(--screen-lines);
  z-index: 1101;
}

/* NEW: Styles for the dedicated header bar */
/*
.modal-header-bar {
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  background-color: var(--infinite-gold); 
  padding: 0 10px; 
  height: 22px; 
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box; 
  z-index: 2; 
}

.modal-title-text {
  color: black; 
  font-family: 'VT323', monospace;
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 22px; 
}
*/

/* Adjust modal content padding to account for the new absolute header */
.modal-content {
  /* Keep existing styles */
  padding-top: 32px; /* Add padding to push content below the new header (22px height + 10px space) */
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--infinite-gold);
  border-radius: 0;
}

#intentionsPanel {
  background-color: rgba(0, 20, 30, 0.6);
  border: 1px solid var(--glass-border);
  padding: 15px;
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  border-left: 3px solid var(--infinite-gold);
  height: 450px;
  overflow-y: auto;
}

#territoryDescription {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  background-color: rgba(0, 20, 30, 0.6);
  border-left: 3px solid var(--eva-yellow);
  padding: 10px;
  margin-bottom: 15px;
  color: var(--terminal-green);
  position: relative;
}

#territoryDescription::before {
  content: 'TERRAIN ANALYSIS';
  position: absolute;
  top: -18px;
  left: 0;
  font-size: 0.7rem;
  background-color: var(--eva-yellow);
  color: black;
  padding: 0 5px;
  font-weight: bold;
}

#territory-id, #territory-resources {
  color: var(--infinite-gold);
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 209, 0, 0.5);
  font-family: 'VT323', monospace;
}

.btn {
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  border-radius: 0;
  letter-spacing: 1px;
  opacity: 1;
}

.btn-primary {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--infinite-gold);
  color: var(--infinite-gold);
}

.btn-primary:hover {
  background-color: rgba(255, 209, 0, 0.2);
  border-color: var(--infinite-gold);
  color: var(--infinite-gold);
}

.btn-secondary {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--eva-blue);
  color: var(--eva-blue);
}

.btn-secondary:hover {
  background-color: rgba(0, 200, 255, 0.2);
  border-color: var(--eva-blue);
  color: var(--eva-blue);
}

.btn-success {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--eva-green);
  color: var(--eva-green);
}

.btn-success:hover {
  background-color: rgba(0, 255, 140, 0.2);
  border-color: var(--eva-green);
  color: var(--eva-green);
}

.btn-warning {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--eva-yellow);
  color: var(--eva-yellow);
}

.btn-warning:hover {
  background-color: rgba(255, 209, 0, 0.2);
  border-color: var(--eva-yellow);
  color: var(--eva-yellow);
}

.futuristic-audio-btn {
  padding: 6px 12px;
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--infinite-gold);
  color: var(--eva-green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.futuristic-audio-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.4), transparent);
  animation: none; /* Turn off shimmer animation */
}

.futuristic-audio-btn:hover {
  background-color: rgba(0, 200, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

.audio-icon {
  margin-right: 8px;
  animation: pulse 1.5s infinite;
  font-size: 1rem;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* NERV UI Overlays */
.nerv-overlay {
  position: fixed;
  z-index: 10002; /* Increased from 100 to be above projects panel and allow settings to show on top */
  color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  pointer-events: auto;
}

/* Make the audio button clickable inside the overlay */
.nerv-overlay #toggleAudioBtn,
.nerv-overlay #settingsBtn,
.nerv-overlay .settings-option {
  pointer-events: auto;
}

.nerv-top-overlay {
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between; /* Changed from default/none */
  padding: 0 20px;
  border-bottom: 2px solid var(--infinite-gold);
  position: relative;
}

.nerv-top-overlay .worlds-fair-logo {
  /* position: absolute; */ /* Removed */
  /* left: 20px; */ /* Removed */
  margin-right: 0; /* Remove margin that was pushing other elements */
}

.nerv-top-overlay .nerv-text {
  /* position: absolute; */ /* Removed */
  /* left: 50%; */ /* Removed */
  /* transform: translateX(-50%); */ /* Removed */
  text-align: center;
  width: auto;
  /* z-index: 5; */ /* Removed */
}

.nerv-top-overlay .timestamp-container {
  display: flex;
  align-items: center;
  gap: 15px;
  /* position: absolute; */ /* Removed */
  /* right: 20px; */ /* Removed */
}

/* Center the fairness approach text between title and settings button */
.nerv-top-overlay #playerFairnessDisplay {
  /* position: absolute; */ /* Removed */
  /* left: 65%; */ /* Removed */
  /* top: 50%; */ /* Removed */
  /* transform: translate(-22%, -50%); */ /* Removed */
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--eva-green);
  /* z-index: 5; */ /* Removed */
  /* Add flex-grow if needed to help centering, but space-between might be enough */
  /* flex-grow: 1; */
}

.nerv-bottom-overlay {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 2px solid var(--infinite-gold);
}

.worlds-fair-logo {
  width: 40px;
  height: 40px;
  background-image: url('assets/worlds_fair_logo.jpg');
  background-repeat: no-repeat;
  background-size: contain;
}

.nerv-text {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  color: var(--infinite-gold);
  text-shadow: 0 0 10px rgba(255, 209, 0, 0.5);
  white-space: nowrap; /* Prevent text wrapping */
}

.timestamp {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--infinite-gold);
  letter-spacing: 2px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--eva-green);
  box-shadow: 0 0 10px var(--eva-green);
  animation: blink 2s infinite alternate;
}

@keyframes blink {
  0%, 80% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { opacity: 1; }
}

.status-text {
  font-size: 0.8rem;
  color: var(--terminal-green);
  letter-spacing: 1px;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(0, 255, 140, 0.7);
  opacity: 0.7;
  box-shadow: 0 0 10px var(--eva-green);
  animation: scanline 6s linear infinite;
}

@keyframes scanline {
  0% { top: 0; }
  100% { top: 100vh; }
}

/* NERV Monitor Corners */
.eva-monitor-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid var(--infinite-gold);
  z-index: 10;
  pointer-events: none;
}

.eva-monitor-tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

.eva-monitor-tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}

.eva-monitor-bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}

.eva-monitor-br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

.eva-monitor-scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.2;
  pointer-events: none;
  z-index: 2;
  animation: scanlines 10s linear infinite;
}

@keyframes scanlines {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

/* Terminal-like text effect */
.terminal-text {
  font-family: 'VT323', monospace;
  color: var(--terminal-green);
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
}

.terminal-line {
  font-family: 'VT323', monospace;
  color: var(--terminal-green);
  letter-spacing: 1px;
  line-height: 1.5;
  position: relative;
  display: block;
  padding-left: 15px;
}

.terminal-line::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--infinite-gold);
}

.terminal-header {
  color: black;
  background-color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  padding: 3px 5px;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 10px;
}

/* Warning strips for modals */
.modal-warning-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background-color: var(--infinite-gold);
  z-index: 10;
}

.caution-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

.caution-stripes {
  width: 80px;
  height: 20px;
  background: var(--warning-striped);
  margin: 0 15px;
}

/* Portrait frame with Evangelion style */
.eva-portrait-frame {
  position: relative;
  padding: 3px;
  background-color: black;
  border: 2px solid var(--infinite-gold);
}

.eva-portrait-frame img {
  display: block;
  image-rendering: pixelated;
}

.eva-portrait-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--screen-lines);
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

/* Center and size the companion avatar in its circular frame */
#turnModal .eva-portrait-frame {
  border-radius: 50%;
  overflow: hidden;
  margin-top: 5px;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#turnModal .eva-portrait-frame img {
  width: 110%;
  height: 110%;
  object-fit: cover;
}

/* Style for danger alerts */
.eva-alert {
  background-color: rgba(0, 0, 0, 0.8) !important;
  color: var(--eva-red) !important;
  border: none !important;
  border-left: 4px solid var(--eva-red) !important;
  padding: 10px 15px !important;
  font-family: 'Share Tech Mono', monospace !important;
  position: relative;
  overflow: hidden;
}

.eva-alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--warning-striped);
  opacity: 0.1;
  pointer-events: none;
}

/* Style for selection form elements */
.form-check-input {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--infinite-gold);
}

.form-check-input:checked {
  background-color: var(--infinite-gold);
  border-color: var(--infinite-gold);
}

.form-check-label {
  font-family: 'Share Tech Mono', monospace;
  color: var(--eva-blue);
  letter-spacing: 0.5px;
}

.form-select {
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--infinite-gold);
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  border-radius: 0;
}

.form-select option {
  background-color: var(--nerv-dark-blue);
  color: var(--terminal-green);
}

/* Specific styles for elements */
.close {
  color: black; /* Make close button black */
  font-size: 1.6rem; /* Slightly larger */
  font-weight: bold;
  line-height: 1; /* Adjust line height for better vertical alignment */
  transition: color 0.3s;
  opacity: 0.7; /* Make it slightly less prominent */
  padding: 0; /* Remove default padding if any */
  margin: 0; /* Remove default margin if any */
  cursor: pointer;
}

.close:hover {
  color: var(--eva-red); /* Keep red hover */
  text-decoration: none;
  opacity: 1;
}

/* Selection modal styles */
.selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 5px;
  position: relative;
  margin-top: 0;
}

.selection-header h2 {
  color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

.selection-body {
  display: flex;
  gap: 25px;
  max-height: 640px;
}

.territory-view {
  flex: 1;
  min-width: 350px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  flex-basis: 40%;
}

/* Ensure the right panel fills available space even with minimal content */
.selection-right-panel {
  flex: 1;
  min-width: 0;
}

.quick-stats {
  background-color: rgba(0, 20, 30, 0.6);
  border-left: 3px solid var(--infinite-gold);
  padding: 10px;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.faction-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background-color: rgba(0, 20, 30, 0.6);
  border: 1px solid rgba(255, 209, 0, 0.3);
}

#confirmSelectionBtn {
  padding: 12px 24px;
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--eva-green);
  color: var(--eva-green);
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

#confirmSelectionBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 140, 0.4), transparent);
  animation: shimmer 2s infinite;
}

#confirmSelectionBtn:hover {
  background-color: rgba(0, 255, 140, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 140, 0.5);
}

/* Faction-specific styling with Evangelion theme */
.faction-toggle-btn {
  background-color: var(--nerv-dark-blue);
  border: 1px solid var(--faction-color, var(--infinite-gold));
  border-radius: 0;
  color: var(--faction-color, var(--infinite-gold));
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
  padding: 6px 10px;
}

.faction-toggle-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.faction-toggle-btn:hover {
  background-color: rgba(255, 209, 0, 0.2);
}

.faction-toggle-btn.active {
  box-shadow: 0 0 15px rgba(255, 209, 0, 0.5);
}

.faction-toggle-btn.active::after {
  background-color: var(--faction-color, var(--infinite-gold));
}

/* Faction colors inspired by Evangelion units and characters */
.faction-toggle-btn[data-faction-id="0"] {
  --faction-color: var(--eva-purple);
  border-color: var(--eva-purple);
  color: var(--eva-purple);
}

.faction-toggle-btn[data-faction-id="0"].active {
  background-color: rgba(157, 0, 255, 0.2);
  box-shadow: 0 0 15px rgba(157, 0, 255, 0.5);
}

.faction-toggle-btn[data-faction-id="1"] {
  --faction-color: var(--eva-blue);
  border-color: var(--eva-blue);
  color: var(--eva-blue);
}

.faction-toggle-btn[data-faction-id="1"].active {
  background-color: rgba(0, 204, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 204, 255, 0.5);
}

.faction-toggle-btn[data-faction-id="2"] {
  --faction-color: var(--eva-gray);
  border-color: var(--eva-gray);
  color: var(--eva-gray);
}

.faction-toggle-btn[data-faction-id="2"].active {
  background-color: rgba(255, 204, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.faction-toggle-btn[data-faction-id="3"] {
  --faction-color: var(--eva-brown);
  border-color: var(--eva-brown);
  color: var(--eva-brown);
}

.faction-toggle-btn[data-faction-id="3"].active {
  background-color: rgba(0, 255, 141, 0.2);
  box-shadow: 0 0 15px rgba(0, 255, 141, 0.5);
}

.faction-intentions {
  background-color: rgba(0, 10, 20, 0.8);
  border-left: 3px solid var(--faction-color, var(--infinite-gold));
  padding: 12px;
  margin-bottom: 15px;
  position: relative;
}

.faction-intentions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--screen-lines);
  opacity: 0.2;
  pointer-events: none;
  z-index: 1;
}

.faction-intentions[data-faction-id="0"] {
  border-left-color: var(--eva-purple);
  box-shadow: 0 0 10px --eva-purple;
}

.faction-intentions[data-faction-id="1"] {
  border-left-color: var(--eva-blue);
  box-shadow: 0 0 10px --eva-blue;
}

.faction-intentions[data-faction-id="2"] {
  border-left-color: var(--eva-gray);
  box-shadow: 0 0 10px --eva-gray;
}

.faction-intentions[data-faction-id="3"] {
  border-left-color: var(--eva-brown);
  box-shadow: 0 0 10px --eva-brown;
}

.faction-header {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--faction-color, var(--infinite-gold));
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: bold;
  border-bottom: 1px solid var(--faction-color, var(--infinite-gold));
  padding-bottom: 5px;
}

.resource-intentions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.resource-intention {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.resource-emoji {
  font-size: 1.2em;
  margin-right: 8px;
  filter: drop-shadow(0 0 3px var(--faction-color, var(--infinite-gold)));
}

.resource-priority {
  display: inline-block;
  padding: 3px 8px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--faction-color, var(--infinite-gold));
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* Custom faction metric displays */
.metric-gauge {
  position: relative;
  width: 60px;
  height: 60px;
  /* margin: 0 auto; */ /* Removed general auto margin */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Apply auto margin specifically for centering in Quick Faction Panel */
#mainScreenPanel .metric-gauge {
  margin: 0 auto;
}

/* Set specific margin for gauges in Memory Log Modal */
.memory-log-section .metric-gauge {
  margin: 0; /* Explicitly set margin to 0, adjust if needed */
}

/* Project completion gauges - smaller version for project indicators */
.project-completion-gauge {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.metric-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  box-sizing: border-box;
}

.metric-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: 4px solid var(--progress-color, var(--infinite-gold));
  border-radius: 50%;
  box-sizing: border-box;
  background: conic-gradient(
    var(--progress-color, var(--infinite-gold)) 0%, 
    var(--progress-color, var(--infinite-gold)) var(--progress-percent, 0%), 
    transparent var(--progress-percent, 0%)
  );
  transition: background 2.5s ease-out, border-color 2.5s ease-out;
}

.project-gauge-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  box-sizing: border-box;
}

.project-gauge-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  border: 2px solid var(--progress-color, var(--infinite-gold));
  border-radius: 50%;
  box-sizing: border-box;
  background: conic-gradient(
    var(--progress-color, var(--infinite-gold)) 0%, 
    var(--progress-color, var(--infinite-gold)) var(--progress-percent, 0%), 
    transparent var(--progress-percent, 0%)
  );
  transition: background 1.5s ease-out, border-color 1.5s ease-out;
}

.metric-value {
  position: relative;
  z-index: 2;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  text-shadow: 0 0 5px rgba(255, 209, 0, 0.5);
  display: none; /* Hide the numerical value */
  filter: drop-shadow(0 0 3px var(--progress-color, var(--infinite-gold)));
}

.metric-label {
  font-size: 0.9rem;
  color: var(--eva-green); 
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  position: absolute;
  top: 100%;
  margin-top: 5px;
  margin-bottom: 5px; /* Added margin below the label */
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
}

.metric-icon {
  font-size: 1.5rem; /* Slightly larger icon */
  position: absolute;
  top: -31px; /* Position above the ring */
  z-index: 3;
  filter: drop-shadow(0 0 3px var(--progress-color, var(--infinite-gold)));
}

/* In the quick faction panel, place the icon next to the label text */
#mainScreenPanel .metric-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#mainScreenPanel .metric-label .metric-icon {
  position: static;
  top: auto;
  font-size: 1.2rem;
}

/* Spotlight effect for animated gauges */
.metric-gauge.gauge-spotlight .metric-ring::before {
  box-shadow: 0 0 15px 5px var(--spotlight-color, var(--infinite-gold));
  transition: box-shadow 0.3s ease-in-out;
}

/* Styling for metric ranges */
.metric-low .metric-value {
  color: var(--eva-red);
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
}

.metric-low .metric-ring::before {
  border-color: var(--eva-red);
}

.metric-high .metric-value {
  color: var(--eva-green);
  text-shadow: 0 0 5px rgba(0, 255, 141, 0.5);
}

.metric-high .metric-ring::before {
  border-color: var(--eva-green);
}

/* NERV AT field visual effect for selected items */
.at-field-effect {
  position: relative;
  overflow: hidden;
}

.at-field-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 30%, rgba(255, 209, 0, 0.7) 70%, transparent 71%);
  mix-blend-mode: overlay;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  animation: at-field-pulse 2s ease-in-out;
}

@keyframes at-field-pulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Fix padding for main container to prevent overlap with NERV overlays */
#mainContainer {
  padding-top: 50px; /* Top overlay height (50px) + 10px extra space */
  padding-bottom: 40px; /* Bottom overlay height (30px) + 10px extra space */
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}

/* Ensure the overlay elements don't interfere with clicking */
.nerv-overlay {
  pointer-events: auto;
}

.nerv-overlay * {
  pointer-events: auto;
}

/* Add a horizontal flex container for the development and sustainability metrics */
.metrics-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 20px 0;
  margin-top: 8px; 
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Colony metrics container styling */
.colony-metrics {
  border-bottom: 1px solid rgba(255, 209, 0, 0.3);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

/* Center the Land/Resource emoji over values in Faction Quick Panel */
.resource-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 5px;
  margin-right: 13px; /* Add more space between resources */
  min-width: 40px; /* Ensure consistent width */
  position: relative;
}

.resource-icon {
  font-size: 0.75rem;
  text-align: center;
  margin-bottom: 2px;
}

.resource-count {
  font-size: 0.75rem;
  text-align: center;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--eva-green); 
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  position: absolute;
  top: 100%;
  margin-top: 5px;
  margin-bottom: 5px; /* Added margin below the label */
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
}

/* Make Faction Emoji and Name bigger */
.faction-name {
  font-weight: bold;
  font-size: 1.2rem; /* Increase font size */
}

/* Faction Color Names */
.faction-container .faction-name {
  color: var(--faction-color, var(--terminal-green));
}

/* Faction Buttons - Border and Text Color */
.faction-toggle-btn {
  padding: 23.4px 12px;
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--faction-color, var(--infinite-gold));
  border-radius: 0;
  color: var(--faction-color, var(--infinite-gold));
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Faction Border Colors for Images */
.faction-container img {
  border: 2px solid var(--faction-color, var(--infinite-gold)) !important;
}

/* Make Territory Assignment page text white */
.quick-stats {
  font-family: 'Share Tech Mono', monospace;
  color: #FFFFFF; /* Make text white */
  background-color: rgba(0, 20, 30, 0.6);
  border-left: 3px solid var(--infinite-gold);
  padding: 10px;
  font-size: 0.9rem;
}

.intentions-message {
  color: #FFFFFF !important; /* Make "select one or more factions" white */
}

/* Make ID number and resource emojis bigger with more space */
#territory-id {
  font-size: 1.5rem; /* Make ID bigger */
}

#territory-resources {
  font-size: 1.5rem; /* Make resource emojis bigger */
  letter-spacing: 0.5em; /* Add more space between emojis */
}

/* Make faction intention text white */
.resource-priority p {
  color: #FFFFFF !important; /* Force white color for intention text */
  margin: 0;
}

/* Faction header in intentions panel */
.faction-intentions .faction-header {
  color: var(--faction-color, var(--infinite-gold));
}

/* Assign correct faction color variable */
.faction-container[data-faction-id="0"], 
.faction-intentions[data-faction-id="0"] {
  --faction-color: var(--eva-purple);
}

.faction-container[data-faction-id="1"], 
.faction-intentions[data-faction-id="1"] {
  --faction-color: var(--eva-blue);
}

.faction-container[data-faction-id="2"], 
.faction-intentions[data-faction-id="2"] {
  --faction-color: var(--eva-gray);
}

.faction-container[data-faction-id="3"], 
.faction-intentions[data-faction-id="3"] {
  --faction-color: var(--eva-brown);
}

/* Faction Memory Log Modal Styles */
.memory-log-section {
  background-color: rgba(0, 20, 40, 0.5);
  border: 1px solid rgba(255, 209, 0, 0.3);
  border-radius: 4px;
  padding: 15px;
}

.memory-log-section h4 {
  color: var(--infinite-gold);
  border-bottom: 1px solid rgba(255, 209, 0, 0.3);
  padding-bottom: 8px;
  margin-bottom: 15px;
}

.memory-log-section p {
  color: #FFFFFF;
  margin-bottom: 8px;
}

.memory-log-section strong {
  color: var(--infinite-gold);
}

.memory-log-section .resource-indicator {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 5px;
  min-width: 60px;
}

.memory-log-section .resource-indicator.abundance {
  border-left: 3px solid #28a745;
}

.memory-log-section .resource-indicator.scarcity {
  border-left: 3px solid #dc3545;
}

/* Enhanced Narrative Styles */
.memory-log-entry {
  background-color: rgba(0, 10, 30, 0.7);
  border-radius: 4px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.memory-log-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.memory-log-entry strong {
  font-size: 0.9rem;
  display: block;
  padding: 8px 12px 0;
}

.memory-log-entry p {
  padding: 5px 12px 8px;
  font-style: italic;
  line-height: 1.4;
}

.quote-banner {
  background-color: rgba(0, 20, 40, 0.5);
  border-left: 3px solid;
  padding: 12px;
  margin-bottom: 16px;
  font-style: italic;
  text-align: center;
}

/* Narrative event animations */
@keyframes fadeInNarrative {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.narrative-content {
  animation: fadeInNarrative 0.5s ease-out;
}

.reaction-text-1, .reaction-text-2, .reaction-text-3, 
.reaction-text-4, .reaction-text-5 {
  animation: fadeInNarrative 0.5s ease-out;
  animation-fill-mode: both;
}

.reaction-text-1 { animation-delay: 0.1s; }
.reaction-text-2 { animation-delay: 0.3s; }
.reaction-text-3 { animation-delay: 0.5s; }
.reaction-text-4 { animation-delay: 0.7s; }
.reaction-text-5 { animation-delay: 0.9s; }

/* Intro Modal Styles */
.intro-background {
  animation: subtle-pulse 10s infinite alternate;
}

@keyframes subtle-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.intro-section.fade-in {
  opacity: 1 !important;
  transform: translate(-50%, -50%) !important;
}

.faction-intro.fade-in {
  opacity: 1 !important;
  transform: translate(-50%, -50%) !important;
}

@keyframes narrative-typing {
  from { width: 0; }
  to { width: 100%; }
}

/* NEW: Class for the blinking cursor effect */
.typing-cursor::after {
  content: '|';
  display: inline-block;
  margin-left: 0.1em;
  background-color: var(--terminal-green); /* Cursor color */
  animation: blink-caret 0.75s step-end infinite;
  color: var(--terminal-green); /* Make sure cursor is visible */
  opacity: 1;
}

@keyframes blink-caret {
  from, to { background-color: transparent; color: transparent; opacity: 0; } /* Blink effect */
  50% { background-color: var(--terminal-green); color: var(--terminal-green); opacity: 1; } /* Visible cursor */
}

@keyframes panBackground {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-5px) translateY(-5px); }
  50% { transform: translateX(0) translateY(-10px); }
  75% { transform: translateX(5px) translateY(-5px); }
  100% { transform: translateX(0) translateY(0); }
}

.intro-background img {
  animation: panBackground 30s ease-in-out infinite;
}

/* Better responsive layout for intro modal on smaller screens */
@media (max-width: 768px) {
  .faction-intro-content {
    flex-direction: column;
  }
  
  .faction-image, .faction-text {
    width: 100%;
    text-align: center;
  }
  
  .faction-text {
    margin-top: 20px;
  }
}

/* Settings Menu Styles */
.settings-container {
  position: relative;
  display: inline-block;
  z-index: 10001; /* Ensure the entire settings system is on top */
}

/* Hide settings UI entirely in general-facing builds */
body.general-ui .settings-container {
  display: none !important;
}

.settings-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: var(--nerv-dark-blue);
  border: 2px solid var(--eva-blue);
  box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
  z-index: 10000; /* Increased from 1000 to ensure it's always on top */
  display: none;
  margin-top: 5px;
}

.settings-menu.show {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-item {
  padding: 5px;
  border-bottom: 1px solid rgba(0, 200, 255, 0.3);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-option {
  width: 100%;
  padding: 8px 10px;
  background-color: transparent;
  border: none;
  color: var(--eva-blue);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.settings-option:hover {
  background-color: rgba(0, 200, 255, 0.2);
}

.settings-icon,
.tooltip-icon {
  margin-right: 8px;
  font-size: 1rem;
}

.active-tooltip {
  color: var(--eva-green);
}

.inactive-tooltip {
  color: var(--eva-red);
}

/* Animation for the skip intro button */
#skipIntroBtn {
  transition: opacity 0.3s ease;
}

#skipIntroBtn:hover {
  opacity: 1 !important;
}

.intro-next-btn {
  font-family: 'Share Tech Mono', monospace;
  padding: 8px 20px;
  background-color: var(--nerv-dark-blue);
  color: var(--infinite-gold);
  border: 1px solid var(--infinite-gold);
  box-shadow: 0 0 10px rgba(255, 209, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  /* Let it flow naturally in the document */
  display: block; /* Ensure it takes its own line */
  margin: 30px auto 0; /* Center horizontally with top margin */
  transition: all 0.3s ease;
  z-index: 101;
}

.intro-next-btn:hover {
  background-color: var(--infinite-gold);
  color: var(--nerv-dark-blue);
  box-shadow: 0 0 15px var(--infinite-gold);
}

.intro-next-btn:active {
  transform: scale(0.95); /* Only apply scale on click */
}

@keyframes studioFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.studio-intro-fade-out {
  animation: studioFadeOut 700ms ease forwards;
}

@keyframes studioFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.studio-text-pulse {
  animation: studioPulse 1400ms ease-in-out infinite;
}

@keyframes studioPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(255,209,0,0.4); }
  50% { text-shadow: 0 0 16px rgba(255,209,0,0.85); }
}

/* Style for the new minimap title element */
.minimap-title {
  color: var(--eva-blue);
  font-family: 'VT323', monospace;
  font-size: 0.7rem;
  text-shadow: 0 0 5px rgba(0, 200, 255, 0.5);
  margin-bottom: 5px; /* Space between title and minimap */
  padding-left: 5px; /* Align slightly with the minimap's left border */
  /* No absolute positioning needed now, should flow above */
}

/* Added styles previously injected from main.ts */
.portrait-shine {
  position: relative;
  overflow: hidden;
  border-radius: 50%;
}

.portrait-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right, 
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 2s infinite;
  pointer-events: none; /* Make sure it doesn't interfere with clicks */
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(30deg);
  }
}

/* Hover Tips System */
.hover-tip {
  position: absolute;
  padding: 9px 14px; 
  background-color: rgba(0, 10, 20, 0.95);
  border: 1px solid var(--infinite-gold); 
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem; 
  z-index: 9999;
  pointer-events: auto; /* Change to auto to allow clicks */
  cursor: pointer; /* Add cursor to indicate clickable */
  max-width: 338px; 
  box-shadow: 0 0 17px rgba(255, 209, 0, 0.4); 
  animation: tooltipFadeIn 0.2s ease-in-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: flex-start;
}

.hover-tip.active {
  opacity: 1;
  visibility: visible;
}

.hover-tip::before {
  content: 'INFO';
  position: absolute;
  top: -11px; 
  left: 0;
  background-color: var(--infinite-gold);
  color: black;
  padding: 0 5px; 
  font-size: 0.8rem; 
  font-weight: bold;
}

.hover-tip-avatar {
  width: 45px; 
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--infinite-gold); 
  margin-right: 11px; 
  flex-shrink: 0;
}

.hover-tip-content {
  flex: 1;
}

.hover-tip-dismiss {
  display: block;
  text-align: right;
  margin-top: 5px; 
  font-size: 0.8rem; 
  color: var(--infinite-gold);
  font-style: italic;
}

/* --- Faction Intentions Styling --- */
#intentionsPanel {
  padding: 10px;
  max-height: 450px; /* Limit height and allow scroll */
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.3); /* Slightly darker background for focus */
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.narrator-statement {
    text-align: center;
    font-style: italic;
    color: #aaa;
    margin: 20px;
    transition: opacity 0.5s ease-out;
    opacity: 1;
}

.faction-intentions-slide {
  position: relative;
  background: linear-gradient(135deg, rgba(10, 20, 40, 0.7), rgba(20, 30, 50, 0.9));
  border: 2px solid var(--faction-color, #FFD100);
  color: #eee;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 5px var(--faction-color);
  transform: translateY(30px);
  opacity: 0;
  /* Use animation defined below */
}

.faction-intentions-slide.animate-in {
    animation: slideUpFade 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

@keyframes slideUpFade {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.intentions-hero-banner {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.intentions-avatar {
  border-radius: 50%; /* Circular avatar */
  border: 2px solid var(--faction-color, #fff);
  margin-right: 15px;
  image-rendering: pixelated;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.intentions-hero-banner h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--faction-color, #fff);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.intentions-body {
    padding-top: 10px;
}

.mission-statement {
  font-size: 1.05rem;
  font-style: italic;
  padding: 10px 15px;
  border-left: 4px solid var(--faction-color);
  background-color: rgba(0, 0, 0, 0.2);
  margin: 10px 0 15px 0;
  color: #ccc;
  border-radius: 0 4px 4px 0;
}

.desired-resources h5 {
    color: var(--faction-color);
    margin-bottom: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resource-detail {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
  opacity: 0; /* Start hidden for animation */
  transform: translateX(-10px); /* Start slightly to the left */
  /* Use animation defined below */
}

.resource-detail.animate-delay {
    animation: slideInFadeResource 0.5s ease-out forwards;
}

@keyframes slideInFadeResource {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.resource-icon {
  font-size: 1.5rem; /* Slightly larger icon */
  display: inline-block;
  transform: scale(0.7);
  opacity: 0;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; /* Apply pop animation */
  animation-delay: inherit; /* Inherit delay from parent .resource-detail */
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; } 
  70% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.resource-detail small {
    margin-left: 5px;
    font-style: italic;
    color: #aaa;
}

/* Responsiveness for smaller screens */
@media (max-width: 768px) {
  #intentionsPanel {
      max-height: 300px; /* Adjust height for smaller screens */
  }
  .faction-intentions-slide {
      padding: 10px 15px;
  }
  .intentions-hero-banner h3 {
      font-size: 1.2rem;
  }
  .mission-statement {
      font-size: 0.95rem;
  }
  .resource-icon {
      font-size: 1.3rem;
  }
}

/* Ensure main screen panel is above spotlight overlay */
body.spotlight-active div#mainScreenPanel.faction-panel {
  z-index: 1500 !important; /* Increase z-index further */
  opacity: 1 !important; 
  filter: none !important; /* Ensure no dimming filter is applied */
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.9) !important; /* Enhanced glow */
  background-color: var(--glass-background) !important; /* Explicitly set background */
}

.intentions-panel {
  flex-grow: 1;
  position: relative;
  overflow-y: auto;
  background-color: rgba(0, 10, 20, 0.8);
  border: 1px solid rgba(255, 209, 0, 0.3);
  padding: 8px;
}

.reason-stack { min-height:48px; background:rgba(255,255,255,.05); }
.reason-stack .badge:hover { opacity:0.7; }
#rationalePanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;        /* center panel within parent */
  max-width: 260px;      /* constrain panel width */
  text-align: center;    /* center text and inline items */
}
#tagRack .btn { font-size:.8rem; line-height:1.2rem; }
#confirmSelectionBtn[disabled] { opacity:0.5; cursor:not-allowed; }

.debug-panel{
  position:fixed; top:70px; right:20px;
  width:400px; height:80vh; padding:12px 14px;
  background:rgba(10,15,25,.92); color:#eee;
  font-family: "Share Tech Mono", monospace;
  font-size:14px; overflow-y:auto; z-index:1300;
  border:2px solid #39f; border-radius:6px;
  box-shadow:0 0 10px rgba(0,153,255,.6);
}

/* Add animation for winding alarm */
@keyframes winding-alarm {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

/* Keep the warning emoji static but apply a pulsing effect instead */
.winding-alarm {
  display: inline-block;
  color: var(--eva-red);
  animation: warning-flash 1s infinite alternate;
}

/* --- Add Margin to Side Chat Avatar FRAME --- */
#sideChatModal .eva-portrait-frame { /* Target the frame container */
  margin-top: 10px; /* Add a small top margin to push the frame down */
}
/* ---------------------------------------- */

/* --- Add Margin to Side Chat Faction Name --- */
#sideChatModal #sideChatFactionName {
  margin-top: 10px; /* Match the portrait frame's margin */
}
/* ------------------------------------------ */

/* Squeaky wheel faction styling */
.squeaky-wheel-faction {
  background: linear-gradient(90deg, 
    rgba(255, 0, 0, 0.3), 
    rgba(100, 0, 0, 0.2), 
    rgba(255, 0, 0, 0.3)
  );
  animation: squeaky-pulse 2s infinite alternate;
  border-left: 3px solid var(--eva-red) !important;
}

@keyframes squeaky-pulse {
  0% { background-color: rgba(255, 0, 0, 0.1); }
  100% { background-color: rgba(255, 0, 0, 0.3); }
}

/* EVE Alert Animation - centered on screen */
.eve-alert-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 9999;
  max-width: 400px;
  width: 90%;
  background-color: rgba(0, 0, 0, 0.9);
  border-left: 4px solid var(--eva-red);
  color: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  font-family: 'Share Tech Mono', monospace;
}

.eve-alert-container.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.eve-alert-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.eve-alert-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--infinite-gold);
  margin-right: 10px;
}

.eve-alert-title {
  color: var(--eva-red);
  font-weight: bold;
  margin: 0;
  font-size: 1rem;
}

.eve-alert-content {
  font-size: 0.9rem;
  color: var(--terminal-green);
}

.eve-alert-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--warning-striped);
  opacity: 0.05;
  pointer-events: none;
}

/* Metric Imbalance Drain Effect */
.metric-imbalance-drain .metric-ring {
  animation: drain-pulse 1.5s infinite alternate;
  border-color: var(--eva-red) !important; /* Make the ring red */
}

.metric-imbalance-drain .metric-label {
  color: var(--eva-red);
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
}

@keyframes drain-pulse {
  0% { box-shadow: 0 0 5px rgba(255, 51, 51, 0.4); opacity: 0.8; }
  100% { box-shadow: 0 0 15px rgba(255, 51, 51, 0.8); opacity: 1; }
}

/* High Development Warning Effect */
.metric-high-dev-warning {
  animation: high-dev-pulse 0.8s infinite alternate;
  background: linear-gradient(90deg, 
    rgba(255, 0, 0, 0.4), 
    rgba(200, 0, 0, 0.2), 
    rgba(255, 0, 0, 0.4)
  );
  border-radius: 50%; /* Ensure background is circular */
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
  position: relative;
  overflow: visible;
}

.metric-high-dev-warning::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 0, 0, 0.6);
  animation: high-dev-glow 1.2s infinite alternate;
  z-index: -1;
}

.metric-high-dev-warning .metric-ring {
  border-color: var(--eva-red) !important; /* Make the ring red */
  box-shadow: 0 0 10px var(--eva-red);
}

.metric-high-dev-warning .metric-label {
  color: var(--eva-red);
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.8);
  animation: label-pulse 0.8s infinite alternate;
  font-weight: bold;
}

@keyframes high-dev-pulse {
  0% { background-color: rgba(255, 0, 0, 0.2); transform: scale(1); }
  100% { background-color: rgba(255, 0, 0, 0.5); transform: scale(1.05); }
}

@keyframes high-dev-glow {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

@keyframes label-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* High Sustainability Warning Effect - Inverse of High Development */
.metric-high-sus-warning {
  animation: high-sus-pulse 0.8s infinite alternate;
  background: linear-gradient(90deg, 
    rgba(0, 255, 100, 0.4), 
    rgba(0, 180, 80, 0.2), 
    rgba(0, 255, 100, 0.4)
  );
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 255, 100, 0.6);
  position: relative;
  overflow: visible;
}

.metric-high-sus-warning::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(0, 255, 100, 0.6);
  animation: high-sus-glow 1.2s infinite alternate;
  z-index: -1;
}

.metric-high-sus-warning .metric-ring {
  border-color: var(--eva-green) !important;
  box-shadow: 0 0 10px var(--eva-green);
}

.metric-high-sus-warning .metric-label {
  color: var(--eva-green);
  text-shadow: 0 0 5px rgba(0, 255, 100, 0.8);
  animation: label-sus-pulse 0.8s infinite alternate;
  font-weight: bold;
}

@keyframes high-sus-pulse {
  0% { background-color: rgba(0, 255, 100, 0.2); transform: scale(1); }
  100% { background-color: rgba(0, 255, 100, 0.5); transform: scale(1.05); }
}

@keyframes high-sus-glow {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

@keyframes label-sus-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* grid layout */
.intro-factions-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:30px;
  align-items:center;
  justify-items:center;
}

/* faction card baseline */
.faction-card{
  width:100%;
  max-width:600px; /* Increased width */
  height: 380px; /* Increased fixed height to show full copy */
  display: flex; /* Use flexbox for internal alignment */
  flex-direction: column; /* Stack elements vertically */
  justify-content: flex-start; /* Align content to the top */
  align-items: center; /* Center items horizontally */
  overflow: hidden; /* Hide any content that overflows */
  padding:12px;
  text-align:center;
  background:rgba(0,0,0,.55);
  border:2px solid rgba(255,255,255,.1);
  border-radius:8px;
  opacity:0;                 /* start hidden – we'll fade-in with JS */
  transform:translateY(20px);
}

/* nice fade-up */
@keyframes fadeUp{from{opacity:0;transform:translateY(20px)}
                  to  {opacity:1;transform:translateY(0)}}
.faction-card.fade-in{animation:fadeUp .7s ease forwards}

/* image helper */
.faction-img{width:200px;height:200px;object-fit:cover;border-radius:6px;
             box-shadow:0 0 18px rgba(0,0,0,.6);margin-bottom:10px}
.faction-name{font-family:var(--header-font, 'VT323', monospace);margin:10px 0 6px}
.faction-blurb{font-size:0.9rem;line-height:1.2;color:white;margin:0;padding-top:4px;}

/* Move intro factions up so next button appears */
#introFactions {
  top: 48% !important; /* Moved down slightly */
}

/* Restore NEXT button on the factions intro screen */
#introFactions .intro-next-btn {
  position: absolute !important;
  bottom: -45px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* Reaction-modal tracker cards must be fully visible immediately */
#resourceReactionModal .faction-card {
  opacity: 1 !important;         /* defeat the intro's default */
  transition: none !important;   /* don't animate here */
}

/* Reaction-modal tracker overrides */
#resourceReactionModal .faction-card       { display:block; }    /* let it flow normally   */
#resourceReactionModal .progress           { width:100%; }       /* bar gets full width    */

/* ─── Satisfaction tracker ──────────────────────────────── */
.faction-tracker-item .faction-card {        /* only cards inside a tracker */
  display: block;            /* let the content flow vertically          */
  opacity: 1;                /* override the intro-card fade-in default  */
}

.faction-tracker-item .progress {            /* coloured bar */
  width: 100%;               /* full width instead of min-content (0px) */
}

#satisfactionTrackerContainer{
  margin-bottom:2.5rem;      /* ≈ 40 px pushes the whole grid up */
}

#missionTicker { color:#9de0ff; font-family:var(--bs-font-sans-serif); } /* Use --bs-font-sans-serif for consistency */

/* Optional pulse for EVE alerts */
.eve-alert-title { animation:pulsePhase 1.2s infinite alternate; }
@keyframes pulsePhase { from{letter-spacing:1px} to{letter-spacing:3px} }

/* Special styling for project completion alerts */
.eve-alert-container[data-type="project-completion"] {
  border-left: 4px solid var(--eva-green);
  box-shadow: 0 0 20px rgba(0, 255, 100, 0.4);
}

.eve-alert-container[data-type="project-completion"] .eve-alert-title {
  color: var(--eva-green);
}

.eve-alert-container[data-type="project-completion"] .eve-alert-content p:last-child {
  color: var(--eva-green) !important;
}

/* ───── Boot-Up Animation States ───── */
.boot-up-hidden {
  opacity: 0;
  filter: blur(4px);
  transform: scale(1.02);
  transition: opacity 0.6s ease-out, filter 0.6s ease-out, transform 0.6s ease-out;
}

@keyframes onlineFlicker {
  0%  { opacity: 0; }
  40% { opacity: 1; }
  55% { opacity: 0.6; }
  70% { opacity: 1; }
  100%{ opacity: 1; }
}

.boot-up-online {
  animation: onlineFlicker 0.6s ease-out;
}

/* Slower transition for specific elements */
#gameBoard.boot-up-hidden,
#rightInfoPanel.boot-up-hidden {
  transition-duration: 5.2s;
}

/* Medium transition for header */
.nerv-top-overlay.boot-up-hidden {
  transition-duration: 2.5s;
}

/* Longer transition for footer */
.nerv-bottom-overlay.boot-up-hidden {
  transition-duration: 1.2s;
}

/* Slower animation for specific elements */
#gameBoard.boot-up-online,
#rightInfoPanel.boot-up-online {
  animation-duration: 2.2s;
}

/* Medium animation for header */
.nerv-top-overlay.boot-up-online {
  animation-duration: 1.5s;
}

/* Longer animation for footer */
.nerv-bottom-overlay.boot-up-online {
  animation-duration: 1.2s;
}

/* --- Territory Assignment Redesign --- */
.assignment-redesign-main-screen {
  width: 80vw; /* Approx from mockup */
  height: 75vh; /* Approx from mockup */
  background-color: rgba(10, 15, 40, 0.9); /* Dark blue, slightly transparent */
  border: 3px solid var(--infinite-gold);
  border-radius: 15px; /* Rounded corners like a CRT screen */
  box-shadow: 0 0 25px rgba(255, 209, 0, 0.3), inset 0 0 30px rgba(10, 20, 50, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  /* overflow: hidden; */ /* To contain space dots - MOVED to .assignment-redesign-space-dots-background */
  position: relative; /* For z-index stacking context */
  z-index: 1; /* To be above the dots background */
}

/* Immersive video mode: remove frame/border when deliberation video is playing */
.assignment-redesign-main-screen.immersive-video-mode {
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* Hide corner portraits and any extra chrome when immersive video is active */
.assignment-redesign-main-screen.immersive-video-mode .corner-faction-portrait {
  display: none !important;
}

/* Remove inner blue frame and padding around the video area while immersive */
.assignment-redesign-main-screen.immersive-video-mode #deliberationPanel .speaker-text-area {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  overflow: hidden;
}

/* Ensure only the video shows (hide helper message under video while immersive) */
.assignment-redesign-main-screen.immersive-video-mode #deliberationVideoContainer p {
  display: none;
}

/* Hide active speaker info while immersive video is playing */
.assignment-redesign-main-screen.immersive-video-mode #activeSpeakerInfo {
  display: none !important;
}

.assignment-redesign-space-dots-background {
  position: absolute; /* Fill the entire modal container */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* Behind main screen content, but above modal's direct background */
  overflow: hidden; /* To contain space dots */
  /* Particles will be added here by JS */
}

.corner-faction-portrait {
  position: absolute;
  width: 90px; /* Adjust as per mockup proportions */
  height: 90px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent; /* Changed from var(--infinite-gold) to transparent - will be set dynamically */
  border-radius: 50%; /* Circular */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: 2;
  box-shadow: 0 0 10px rgba(255, 209, 0, 0.4); /* Will be updated dynamically too */
}

.corner-faction-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.corner-faction-portrait.top-left { top: -46px; left: -46px; }
.corner-faction-portrait.top-right { top: -46px; right: -46px; }
.corner-faction-portrait.bottom-left { bottom: -46px; left: -46px; }
.corner-faction-portrait.bottom-right { bottom: -46px; right: -46px; }

.assignment-redesign-timer-area {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  width: 200px; /* Adjust as needed */
}

.timer-bar-visual {
  width: 100%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--infinite-gold);
  border-radius: 5px;
  margin-bottom: 5px;
  overflow: hidden; /* Keep this if the inner div might exceed rounded corners before width is 0 */
}

/* Remove properties from ::after as the fill is now a real div controlled by JS */
/* .timer-bar-visual::after { 
  /* content: ''; - No longer needed */
  /* display: block; - No longer needed */
  /* height: 100%; - No longer needed */
  /* width: 100%; - No longer needed, JS controls .timer-bar-actual-fill */
  /* background-color: var(--eva-green); - No longer needed */
  /* border-radius: 5px; - No longer needed */
  /* transition: width 0.5s linear; - No longer needed */
/* } */

.timer-text-digital {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  color: var(--eva-green);
  text-shadow: 0 0 5px var(--eva-green);
}

.assignment-redesign-content {
  flex-grow: 1;
  margin-top: 0; /* Was 60px, for internal timer */
  margin-bottom: 0; /* Was 40px, for internal nav dots */
  position: relative;
  z-index: 1;
  overflow-y: auto; /* If panel content is too long */
  padding: 10px;
  border: 1px solid rgba(var(--infinite-gold), 0.2);
  border-radius: 10px;
  background-color: rgba(0,0,0,0.3);
}

.assignment-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--terminal-green);
  font-family: 'Share Tech Mono', monospace;
}

/* REMOVED old .panel-header-text as it's no longer used inside panels */
/* .panel-header-text {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: var(--infinite-gold);
  margin-bottom: 15px;
  text-transform: uppercase;
} */

/* NEW External Panel Header Style */
.panel-header-text-external {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: var(--infinite-gold);
  text-transform: uppercase;
  text-align: center;
  margin-top: 10px; /* Space below timer */
  margin-bottom: 15px; /* Space above main panel screen */
  width: 100%; /* Ensure it takes full width for centering */
}

.assignment-redesign-navigation {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; /* Keep all controls on a single row */
  flex-wrap: nowrap;
  align-items: center;
  gap: 15px;
  z-index: 2;
  justify-content: center;
}

.assignment-redesign-navigation #eveReportModalBtn {
  margin-right: 0; /* Remove the auto margin */
}


.assignment-redesign-navigation #confirmAssignmentRedesignBtn {
  position: static; /* Remove absolute positioning */
  margin-left: 0; /* Remove the margin */
  transform: none; /* Remove transform */
}

/* Uniform button sizing for all navigation buttons */
.assignment-redesign-navigation #eveReportModalBtn,
.assignment-redesign-navigation #confirmAssignmentRedesignBtn,
.assignment-redesign-navigation #toggleDelibPrefsBtn,
.assignment-redesign-navigation #toggleVideoTextBtn {
  min-width: 160px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 0 12px;
  letter-spacing: 0.5px;
}

.assignment-redesign-navigation .split-nav-button {
  min-width: 140px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure split nav sides fill the button evenly */
.split-nav-side {
  flex: 1;
  height: 38px; /* Slightly smaller to account for border */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  font-weight: bold;
  background-color: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-dot {
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.3);
  border: 1px solid var(--infinite-gold);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.nav-dot.active {
  background-color: var(--eva-green);
  box-shadow: 0 0 8px var(--eva-green);
}

/* Split Navigation Button Styles */
.split-nav-button {
  display: flex;
  border: 1px solid var(--infinite-gold);
  border-radius: 6px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.1);
}

.split-nav-side:hover {
  background-color: rgba(255, 209, 0, 0.2);
  color: var(--infinite-gold);
}

.split-nav-side.active {
  background-color: var(--infinite-gold);
  color: #000;
  text-shadow: none;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

.split-nav-side.left-side {
  border-right: 1px solid var(--infinite-gold);
}

.split-nav-side.right-side {
  border-left: none;
}

/* Styles for the confirm button - no longer absolutely positioned */

#confirmAssignmentRedesignBtn:disabled {
  background-color: var(--nerv-dark-blue);
  border-color: rgba(255, 209, 0, 0.4);
  color: rgba(255, 209, 0, 0.6);
  box-shadow: 0 0 8px rgba(255, 209, 0, 0.2);
  text-shadow: none;
  opacity: 0.8;
  cursor: not-allowed;
}

/* Deliberation Panel Specific */
#deliberationPanel {
  position: relative; /* Needed for absolute positioning of the arrow */
}

.speaker-text-area {
  width: 95%;
  /* Let this area flex within the panel instead of forcing full height */
  flex: 1 1 auto;
  min-height: 0; /* allow inner scrolling without overflow glitches */
  border: 1px solid var(--eva-blue);
  padding: 15px;
  overflow-y: auto;
  text-align: left;
  font-size: 1.1rem;
  line-height: 1.6;
  background-color: rgba(0, 10, 20, 0.5);
  border-radius: 8px;
}

/* Ensure deliberation video scales without cropping */
#deliberationVideoContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#deliberationVideoContainer video {
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain; /* avoid cutting off edges */
}

.active-speaker-info {
  margin-top: 15px;
  display: flex;
  align-items: center;
  /* Styles for speaker portrait and name */
}

/* Overlay label for territories that have decayed */
.decay-label {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #ccc;
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-shadow: 0 0 4px black;
}


/* Territory Assignment Panel Specific */
.territory-assignment-layout {
  display: flex;
  width: 100%;
  /* height: calc(100% - 60px); */ /* Adjust for button - REMOVED, flex-grow will handle this */
  flex-grow: 1; /* NEW: Allow this layout to take available vertical space */
  min-height: 0; /* NEW: Flexbox fix for nested height:100% */
  gap: 15px;
}

/* Decision Panels (Turn 4/5) */
.decision-panel {
  width: 100%;
  padding: 16px 18px;
  
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  
  
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%; /* Use vertical space gracefully */
  justify-content: center;
}

.decision-header {
  text-align: center;
  margin-bottom: 10px; /* add a bit more space under the header */
}

.decision-panel .eight-bit-text-header::before {
  display: none; /* hide leading green caret inside decision panels */
}

.decision-subtext {
  margin: 8px 0 6px 0;
  font-size: 0.95rem;
  color: #bcd;
}

/* Larger variant for single-line hero messages */
.decision-hero {
  font-size: 1.4rem;
}

.decision-options {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.decision-options.two {
  grid-template-columns: repeat(2, 1fr);
}

.decision-options.three {
  grid-template-columns: repeat(3, 1fr);
}

.decision-option-btn {
  height: 88px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  text-align: left;
  cursor: pointer;
}

.decision-option-btn .emoji {
  grid-row: 1 / span 2;
  grid-column: 1;
  font-size: 28px;
}

.decision-option-btn .label {
  grid-column: 2;
  font-weight: 700;
  color: var(--infinite-gold);
}

.decision-option-btn .sub {
  grid-column: 2;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

/* Allocation subpanel (Turn 4/5 Decision resource overviews) */
.allocation-resources {
  margin-top: 8px;
  border: none; /* remove dotted/blue outline */
  border-radius: 8px;
  padding: 10px;
  background: var(--nerv-dark-blue); /* default navy background */
}

/* Tighter, centered visualization for decision resource overview */
.allocation-resources.resources-overview {
  padding: 8px 12px;
  margin: 10px auto 12px auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: none;
  vertical-align: middle;
}

.allocation-resources.resources-overview .allocation-title {
  text-align: center;
  margin-bottom: 0;
}

.allocation-resources.resources-overview .allocation-row {
  padding: 4px 0;
  border-bottom: none; /* less visual noise */
  gap: 10px;
  justify-content: center; /* keep name and counts right next to each other */
  align-items: center;
}

.allocation-resources.resources-overview .allocation-row .name,
.allocation-resources.resources-overview .allocation-row .amount {
  display: inline-flex;
  align-items: center;
}

.allocation-resources.resources-overview .allocation-row .name {
  font-weight: 700;
  color: var(--eva-blue);
  margin-right: 8px; /* small space between name and counts */
}

.allocation-resources.resources-overview .allocation-row .amount {
  justify-content: center;
}

.allocation-resources.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 90%;
  margin: 12px auto; /* center the outlined block within the panel */
  padding: 10px 16px; /* slightly increased padding */
}

.allocation-resources.centered .allocation-title {
  display: none; /* hide mini-header in centered lists (Reserve/No Deal) */
}

.allocation-title {
  color: var(--eva-blue);
  font-weight: 700;
  margin-bottom: 8px;
}

.allocation-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.allocation-row.centered {
  justify-content: center;
  text-align: center;
}

/* Triple font size for centered allocation rows */
.allocation-row.centered .name,
.allocation-row.centered .amount {
  font-size: 3em;
}

/* Tighter centered rows for compromise/overview */
.allocation-row.tight {
  padding: 2px 0;
}

.allocation-resources.compromise-overview {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  margin: 4px auto 8px auto;
}

.allocation-select.centered {
  justify-content: center;
}

.allocation-row:last-child { border-bottom: none; }

.allocation-select {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.styled-select {
  background: rgba(0, 0, 0, 0.6);
  color: var(--terminal-green);
  border: 1px solid var(--infinite-gold);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: 'Share Tech Mono', monospace;
}

/* Make decision buttons feel like buttons without heavy gold borders */
.decision-panel .decision-option-btn {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--glass-border);
  color: #e2f8f2;
  box-shadow: none;
  text-shadow: none;
}
.decision-panel .decision-option-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--eva-blue);
  box-shadow: 0 0 10px rgba(0, 200, 255, 0.15);
  transform: translateY(-1px);
}
.decision-panel .decision-option-btn:active {
  transform: translateY(0);
}

/* Selected decision: gold background vs default navy; stop shimmer */
.decision-option-btn.selected {
  background-color: var(--infinite-gold) !important;
  color: var(--nerv-dark-blue) !important;
  border-color: var(--infinite-gold) !important;
  text-shadow: none !important;
}
.decision-option-btn.selected::before { display: none !important; }

.decision-option-btn.selected .label,
.decision-option-btn.selected .sub,
.decision-option-btn.selected .emoji {
  color: var(--nerv-dark-blue) !important;
  text-shadow: none !important;
}

/* Inline confirm row under decision buttons */
.decision-confirm-row {
  margin-top: 12px;
}

/* Staggered fade-in for decision elements */
.fade-in { opacity: 0; transform: translateY(4px); animation: fadeInUp 260ms ease forwards; }
.stagger-1 { animation-delay: 80ms; }
.stagger-2 { animation-delay: 160ms; }
.stagger-3 { animation-delay: 240ms; }
.stagger-4 { animation-delay: 320ms; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* Faction select grid for Turn 4 compromise */
.faction-select-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-top: 8px;
}
.faction-select-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.faction-select-card:hover { transform: translateY(-1px); border-color: var(--eva-blue); box-shadow: 0 0 10px rgba(0,200,255,.12); }
.faction-select-card.selected { border-color: var(--eva-green); box-shadow: 0 0 10px rgba(0,255,141,.15), inset 0 0 0 1px rgba(0,255,141,.2); }
.faction-select-card img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--faction-color, #fff); margin-bottom: 6px; object-fit: cover; }
.faction-select-card .name { font-weight: 700; color: var(--faction-color, var(--infinite-gold)); font-size: 0.9rem; text-align: center; }

/* Decision tiles: territory thumbnails with resources */
.decision-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.decision-tile {
  position: relative; height: 140px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--glass-border); background: rgba(0,0,0,0.3);
}
.decision-tile .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .55; filter: saturate(1.1); }
.decision-tile .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,.1)); }
.decision-tile .meta { position: absolute; left: 8px; right: 8px; bottom: 6px; display: flex; justify-content: space-between; align-items: flex-end; }
.decision-tile .name { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); font-size: 0.9rem; }
.decision-tile .res { font-size: 1.1rem; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

.allocation-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.territory-info-column, .instructions-column {
  flex: 1;
  padding: 10px;
  border: 1px dashed var(--eva-blue);
  background-color: rgba(0, 10, 20, 0.5);
  border-radius: 8px;
  overflow-y: auto;
}

.minimap-container-redesign {
  /* flex: 3; */ /* REMOVED - Minimap takes more space - No longer relevant as it aims for 100% of its parent */
  width: 100%; /* NEW: Ensure it takes full width of its parent */
  height: 100%; /* NEW: Ensure it takes full height of its parent */
  border: 1px solid var(--eva-green);
  background-color: rgba(0, 20, 10, 0.5);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Remove green border and special bg when showing decisions */
#taMinimapContainer.decision-mode {
  border: none !important;
  background: var(--nerv-dark-blue) !important;
}

/* Turn 4: Fenix portrait beside territory overview */
.turn4-fenix-context { display: inline-flex; align-items: center; gap: 12px; justify-content: center; width: 100%; flex-wrap: nowrap; }
.turn4-fenix-context.tight { gap: 8px; }
.fenix-portrait-block img { width: 84px; height: 84px; border-radius: 8px; border: 2px solid var(--glass-border); object-fit: cover; image-rendering: pixelated; box-shadow: 0 0 10px rgba(255,255,255,0.08); }

/* Turn 4 single territory enlarged card */
.territory-detail { display: inline-block; }
.decision-tile.large { width: 384px; height: 240px; }
.decision-tile.single .meta.top { position: absolute; left: 12px; right: 12px; top: 10px; bottom: auto; display: flex; justify-content: center; }
.decision-tile.single .meta.top .name { font-size: 1.8rem; }
.decision-tile.single .content { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 48px 14px 14px 14px; }
.decision-tile.single .resource-rows { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.decision-tile.single .resource-row { display: flex; justify-content: center; align-items: center; padding: 2px 4px; background: transparent; border: none; border-radius: 0; width: 100%; }
.decision-tile.single .resource-row .r-line { font-weight: 700; color: #fff; text-align: center; font-size: 1.8rem; line-height: 1.15; }

/* Overlay portrait for assigned/representative appearance */
.assigned-portrait-overlay { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: 50px; height: 50px; border-radius: 8px; border: 2px solid var(--glass-border); box-shadow: 0 0 10px rgba(0,0,0,0.5); overflow: hidden; z-index: 2; }
.assigned-portrait-overlay img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.fade-in-portrait { animation: fadeInPortrait 400ms ease forwards; opacity: 0; }
@keyframes fadeInPortrait { to { opacity: 1; } }

/* Dual portrait row (Fenix + partner) */
.dual-portrait-row { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.dual-portrait-row .portrait { width: 50px; height: 50px; border-radius: 8px; border: 2px solid var(--glass-border); overflow: hidden; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.dual-portrait-row .portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* Turn 5: force 3 tiles in one row */
.allocation-resources.resources-overview.turn5 { display: block; width: 100%; }
.allocation-resources.resources-overview.turn5 .decision-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Ensure Turn 5 tiles do not overlap the heading/subtext or each other */
.allocation-resources.resources-overview.turn5 .decision-tile {
  width: 100%;
  height: 220px; /* shorter than standard to fit three across comfortably */
}
.allocation-resources.resources-overview.turn5 .decision-tile.single,
.allocation-resources.resources-overview.turn5 .decision-tile.large.single {
  width: 100%;
  height: 220px;
}

/* Eve's Report Panel Specific */
.eve-report-layout {
  display: flex;
  width: 100%;
  /* height: calc(100% - 40px); */ /* Adjusted: flex-grow will manage height within panel */
  flex-grow: 1; /* Allow layout to fill available vertical space */
  min-height: 0; /* Flexbox fix for nested elements */
  gap: 15px;
}

.faction-stats-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Increased gap between faction blocks */
  padding: 10px;
  /* border: 1px dashed var(--eva-blue); */ /* Keep for debug if needed, mockup has no border */
  /* background-color: rgba(0, 10, 20, 0.5); */ /* Keep for debug, mockup has no distinct bg */
  border-radius: 8px;
  overflow-y: auto;
  max-height: 100%; /* Ensure it doesn't overflow parent */
}

.faction-stat-block {
  padding: 15px;
  border: 1px solid var(--eva-purple);
  border-radius: 6px;
  background-color: rgba(10, 0, 20, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.faction-stat-block h5 {
  margin-bottom: 8px !important; /* Ensure proper spacing below header */
  font-size: 1.1rem; /* Slightly larger faction name */
}

.faction-stat-block p {
  font-size: 0.85rem !important; /* Standardized text size */
  margin-bottom: 2px !important;
}

.eve-report-center-content {
  flex: 2; /* Takes twice the space of a sidebar */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* Consistent gap */
  padding: 10px;
  /* border: 1px dashed var(--eva-green); */ /* Keep for debug */
  /* background-color: rgba(0, 20, 10, 0.5); */ /* Keep for debug */
  border-radius: 8px;
  overflow-y: auto; /* Allow scrolling if content is too long */
  max-height: 100%;
}

.eve-portrait-container {
  width: 80px; /* As per mockup */
  height: 80px; /* As per mockup */
  border: 2px solid var(--infinite-gold);
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 10px; /* Space below portrait */
  flex-shrink: 0; /* Prevent shrinking */
}

.eve-portrait-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.eve-recommendation,
.prediction-engine-display {
  width: 100%;
  padding: 12px; /* Increased padding */
  border: 1px solid var(--eva-blue); /* Consistent border */
  border-radius: 6px;
  background-color: rgba(0, 10, 20, 0.75); /* Slightly more opaque */
  text-align: left; /* Align text to left as per mockup for these sections */
}

.eve-recommendation h4,
.prediction-engine-display h4 {
  text-align: center; /* Center the main headers of these sections */
  font-size: 1.1rem; /* Adjusted font size from TS */
  margin-bottom: 10px;
}

.prediction-engine-display h5 {
  font-size: 0.95rem; /* Slightly smaller for sub-headers */
  margin-top: 8px;
  margin-bottom: 4px;
}

.prediction-engine-display ul {
  padding-left: 5px; /* Align with mockup */
}

.prediction-engine-display li {
  margin-bottom: 4px; /* Spacing for list items */
  font-size: 0.85rem; /* Consistent text size */
}

.prediction-engine-display p {
  font-size: 0.85rem; /* Consistent text size */
  margin-top: 8px;
}

.colony-metrics-display { /* This is for the 'Colony Status Overview' section */
  width: 100%;
  padding: 12px;
  /* border: 1px solid var(--eva-yellow); */ /* No distinct border in mockup for this block inside center */
  /* background-color: rgba(20,15,0,0.5); */ /* No distinct background in mockup */
  border-radius: 8px;
  margin-top: 15px; /* Space above this section */
  text-align: center;
}

.colony-metrics-display h4 {
  font-size: 1.1rem; /* Adjusted font size from TS */
  margin-bottom: 10px;
  padding-top: 10px; /* Space above text from border */
  border-top: 1px solid rgba(255, 209, 0, 0.3); /* Gold border from mockup */
}

.colony-metrics-display div div { /* Targeting the inner divs holding Dev/Sus scores */
  text-align: left; /* Align text to left within each score block */
}

.colony-metrics-display p {
  font-size: 0.9rem; /* Consistent text size */
  margin-bottom: 1px;
}

.colony-metrics-display strong {
  font-size: 1.05em; /* Make score slightly larger */
}

.colony-metrics-display span {
  font-size: 0.8rem; /* Smaller descriptive text */
}


/* Draggable Faction Portrait Hint */
.corner-faction-portrait.draggable {
  cursor: grab;
}
.corner-faction-portrait.dragging {
  cursor: grabbing;
  transform: scale(1.1);
  /* box-shadow will be set dynamically based on faction color */
}

/* --- New Drag and Drop Visual Feedback Styles --- */
.corner-faction-portrait img[draggable="true"] {
  cursor: grab;
}

.corner-faction-portrait.dragging img {
  transform: scale(1.15);
  /* box-shadow will be set dynamically based on faction color */
  cursor: grabbing;
}

.corner-faction-portrait.draggable-active-glow {
  /* Applied to all corner portraits when any drag starts */
  /* box-shadow will be set dynamically */
  transition: box-shadow 0.3s ease-in-out;
}

.mini-map-cell-redesign.droppable-hover {
  background-color: rgba(0, 255, 141, 0.15); /* Direct RGB for --eva-green with alpha */
  outline: none; /* avoid overlap between neighbors */
  box-shadow: inset 0 0 0 3px var(--eva-green), inset 0 0 10px rgba(0, 255, 160, 0.25);
  transform: none;
}
/* --- End New Drag and Drop Visual Feedback Styles --- */

/* --- Timer Pulsing Animation --- */
@keyframes pulse-timer-text {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.timer-text-pulsing {
  animation: pulse-timer-text 0.8s infinite ease-in-out;
}

/* CSS for the new center column in EVE's Report */
.eve-report-center-column-NEW {
  flex: 2; /* Takes twice the space of a sidebar */
  display: flex;
  flex-direction: column;
  align-items: center; /* To center the global metrics container if its content is not full width */
  gap: 15px; /* Consistent gap between its children (global metrics, recommendation, prediction) */
  padding: 10px;
  border-radius: 8px;
  overflow-y: auto; /* Allow scrolling if content is too long */
  max-height: 100%; /* Ensure it doesn't overflow parent */
  /* background-color: rgba(0, 10, 20, 0.5); /* Optional: if a distinct background is desired, like sidebars */
  /* border: 1px dashed var(--eva-green);  /* Optional: for debugging layout */
}

/* Adjustments for global metrics container when in the new center column */
.eve-report-center-column-NEW #eveReportGlobalMetricsContainer {
  margin-top: 0; /* Remove top margin from original metrics-container style */
  margin-bottom: 10px; /* Add bottom margin */
  width: 100%; /* Ensure it spans the width of the center column for proper centering of its items */
}

/* --- Timer Pulsing Animation --- */
@keyframes pulse-timer-text {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Styles for Held Territory Cards in Faction Stats */
.held-territories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px; /* Small gap between cards */
  margin-top: 4px; /* Space below "Territories Held" line */
  /* margin-bottom: 4px; /* Space before "Total Resources" line - handled by margin-top on Total Resources paragraph now */
}

.held-territory-card {
  background-color: rgba(var(--terminal-green-rgb), 0.1); /* Use RGB version for alpha */
  border: 1px solid rgba(var(--terminal-green-rgb), 0.3);
  border-radius: 3px;
  padding: 2px 5px; /* Compact padding */
  font-size: 0.7rem; /* Smaller font for territory names */
  color: var(--terminal-green);
  white-space: nowrap; /* Prevent names from wrapping within the card */
}

/* Styles for Faction Resource Breakdown in Faction Stats */
.faction-resource-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px; /* Gap between resource items */
  margin-top: 4px; /* Space below the "Resources:" title */
}

.resource-item-display {
  background-color: rgba(var(--terminal-green-rgb), 0.05); /* Very subtle background */
  border: 1px solid rgba(var(--terminal-green-rgb), 0.2);
  border-radius: 3px;
  padding: 1px 4px; /* Compact padding */
  font-size: 0.8em; /* Consistent small font size */
  color: var(--terminal-green);
  display: flex; /* To align emoji and count if needed */
  align-items: center;
  gap: 3px; /* Space between emoji and count */
}

/* Make Faction Emoji and Name bigger */
.faction-name {
  font-weight: bold;
  font-size: 1.2rem; /* Increase font size */
}

/* Styles for Prediction Engine Layout in EVE's Report */
.prediction-layout-container {
  display: flex;
  flex-direction: row; /* Arrange columns side-by-side */
  gap: 20px; /* Gap between the left and right columns */
  align-items: flex-start; /* Align columns to the top */
}

.prediction-column {
  display: flex;
  flex-direction: column;
  gap: 5px; /* Vertical gap between items within a column (e.g., header and list) */
}

.prediction-column-left {
  flex: 1; /* Give slightly more space to faction shifts, adjust as needed */
}

.prediction-column-right {
  flex: 1; /* Takes remaining space */
}

/* Specific adjustments for lists within the new layout if needed */
.prediction-column ul {
  margin-top: 0; /* Remove default top margin from ul if it creates too much space after header */
}

/* --- End Game Carousel Styles --- */
.endGameCarouselContainer .modal-content {
  /* Override default modal content to allow for larger carousel */
  max-width: 95vw; /* Adjusted max-width to be more flexible with viewport */
  width: 1400px; /* Fixed width for better card aspect ratio - Significantly Increased */
  max-height: 800px; /* Adjusted max-height */
  height: auto; /* Auto height to fit content without scrolling */
  min-height: 650px; /* Minimum height to maintain a good aspect ratio */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Pushes nav to bottom */
}

.carousel-track-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin-bottom: 15px; /* Space before navigation */
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: fit-content; /* Let content determine height */
}

.carousel-card {
  min-width: 100%;
  min-height: 50vh; /* Minimum height for consistency */
  max-height: 70vh; /* Maximum height before scrolling */
  
  background-color: rgba(10, 25, 50, 0.85); /* Darker, richer blue */
  border-radius: 10px; /* More modern rounded corners */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; */
  /* opacity: 0.7; */ /* Non-active cards are slightly faded */
  /* transform: scale(0.95); */
  overflow-y: auto; /* Allow scrolling within a card if content overflows - keep for safety but aim to avoid */
}

/* .carousel-card.active-card { 
  opacity: 1;
  transform: scale(1);
} */

.carousel-card-title {
  font-family: 'VT323', monospace;
  font-size: 2rem; /* Slightly Larger titles */
  color: var(--infinite-gold);
  margin-bottom: 20px; /* Increased margin */
  text-shadow: 0 0 8px rgba(255, 209, 0, 0.6);
}

.carousel-card-content {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.05rem; /* Slightly increased font size */
  line-height: 1.7; /* Increased line height */
  color: var(--terminal-green);
  width: 95%; /* Content can span more of the card width */
  margin-bottom: auto; /* Pushes content to top, and eve-commentary (if any) to bottom */
  flex-grow: 1; /* Allow content to take available space */
}

.carousel-card-content p,
.carousel-card-content ul,
.carousel-card-content li {
  text-align: left; /* Align paragraphs and lists to the left for readability */
  margin-bottom: 10px;
}

.carousel-card-content ul {
  padding-left: 20px;
}

.carousel-card-content strong {
  color: var(--eva-yellow);
}

.eve-commentary {
  margin-top: 20px; /* Increased margin */
  padding: 15px; /* Increased padding */
  background-color: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--eva-green);
  font-style: italic;
  color: #b0f0d0; /* Lighter green for EVE */
  font-size: 1rem; /* Slightly increased font size */
  width: 95%; /* Wider */
  text-align: left;
}

.carousel-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 20px; /* Space between card and nav */
  position: absolute; /* Position relative to modal-container */
  bottom: 30px; /* Position it at the bottom */
  left: 0;
}

.carousel-navigation .btn {
  background-color: #0a1932;
  border: 1px solid var(--infinite-gold);
  color: var(--infinite-gold);
  margin: 0 15px;
}

.carousel-dots {
  display: flex;
  gap: 10px;
  background-color: #0a1932;
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--infinite-gold);
}

.carousel-dot {
  width: 15px;
  height: 15px;
  background-color: rgba(255, 209, 0, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: 1px solid rgba(255, 209, 0, 0.6);
}

.carousel-dot.active {
  background-color: var(--infinite-gold);
}

#restartGameBtn {
  /* Ensure it is properly styled to be centered and visible when needed */
  /* display: block; /* Changed to none initially in HTML, JS will control */
  /* margin: 20px auto 0; /* Centering if it were a block element taking full width */
  /* width: fit-content; /* If we want it to not span full width */
  padding: 10px 25px;
}

.scroll-to-bottom-arrow {
  position: absolute;
  bottom: 20px; 
  left: 50%;
  transform: translateX(-50%); /* Center horizontally */
  /* right: 25px; - Removed */
  width: 45px;
  height: 45px;
  background-color: black; /* var(--eva-blue) with some transparency */
  border: 1px solid var(--eva-blue);
  border-radius: 50%;
  color: var(--infinite-gold);
  font-size: 45px;
  text-align: center;
  line-height: 45px; /* Vertically center the arrow character */
  cursor: pointer;
  z-index: 100; /* Ensure it's above the text area content and scrollbars */
  display: none; /* Hidden by default */
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.scroll-to-bottom-arrow:hover {
  background-color: var(--eva-blue);
  opacity: 1;
}

.scroll-to-bottom-arrow::after {
  content: '▼'; /* Downward arrow character */
}

/* Active Speaker Info - ensure it doesn't overlap with a potentially full-height speaker text area */
.active-speaker-info {
  margin-top: 15px;
  display: flex;
  align-items: center;
  /* Styles for speaker portrait and name */
}

/* ─── Combined Reaction Modal Horizontal Layout ──────────────── */
#resourceReactionModal .modal-content {
  max-height: 85vh; /* Prevent modal from being too tall */
  overflow-y: auto;
}

/* Ensure the colony impact and faction satisfaction sections have equal height */
#resourceReactionModal .row > [class*="col-"] > div {
  height: 100%;
}

/* Make the metrics container stack vertically in the colony impact section */
#resourceReactionModal .metrics-container {
  flex-direction: column;
  align-items: center;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 767px) {
  #resourceReactionModal .modal-content {
    max-width: 95% !important;
  }
  
  /* Stack sections vertically on small screens */
  #resourceReactionModal .row {
    flex-direction: column;
  }
  
  #resourceReactionModal .col-md-4,
  #resourceReactionModal .col-md-8 {
    width: 100%;
    max-width: 100%;
  }
}

/* Large screens - show all 4 factions in one row */
@media (min-width: 1200px) {
  #resourceReactionModal #satisfactionTrackerContainer {
    --bs-gutter-x: 0.5rem;
  }
  
  #resourceReactionModal .faction-tracker-item {
    padding: 0 0.25rem;
  }
}

#satisfactionTrackerContainer{
  margin-bottom:2.5rem;      /* ≈ 40 px pushes the whole grid up */
}

/* Drumroll Animation Styles */
.drumroll-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

.drumroll-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.drumroll-dots {
  font-size: 3rem;
  color: var(--infinite-gold);
  animation: drumroll-pulse 1.5s ease-in-out infinite;
}

.drumroll-dots span {
  animation: drumroll-bounce 2s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 0.3s);
}

.drumroll-dots span:nth-child(1) { --delay: 0; }
.drumroll-dots span:nth-child(2) { --delay: 1; }
.drumroll-dots span:nth-child(3) { --delay: 2; }

.drumroll-text {
  font-size: 1.4rem;
  color: var(--terminal-green);
  animation: drumroll-text-fade 3s ease-in-out infinite;
  margin: 0;
}

.faction-silhouettes {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.silhouette {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, rgba(255, 209, 0, 0.3), rgba(255, 209, 0, 0.1));
  border: 2px solid var(--infinite-gold);
  border-radius: 50%;
  position: relative;
  animation: silhouette-pulse 2s ease-in-out infinite;
}

.silhouette.pulse {
  animation-delay: calc(var(--delay, 0) * 0.5s);
}

.silhouette:nth-child(1) { --delay: 0; }
.silhouette:nth-child(2) { --delay: 1; }
.silhouette:nth-child(3) { --delay: 2; }

.winner-anticipation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.golden-silhouette {
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, rgba(255, 215, 0, 0.5), rgba(255, 165, 0, 0.3));
  border: 3px solid var(--infinite-gold);
  border-radius: 50%;
  position: relative;
  animation: golden-pulse 1.8s ease-in-out infinite;
}

.pulse-gold {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.4);
}

.spotlight-effect {
  width: 200px;
  height: 40px;
  background: linear-gradient(to right, 
    transparent 0%, 
    rgba(255, 215, 0, 0.3) 25%, 
    rgba(255, 215, 0, 0.6) 50%, 
    rgba(255, 215, 0, 0.3) 75%, 
    transparent 100%);
  border-radius: 50px;
  animation: spotlight-sweep 2.5s ease-in-out infinite;
}

/* Keyframe Animations */
@keyframes drumroll-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes drumroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes drumroll-text-fade {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes silhouette-pulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 10px rgba(255, 209, 0, 0.3);
  }
  50% { 
    transform: scale(1.05); 
    box-shadow: 0 0 20px rgba(255, 209, 0, 0.6);
  }
}

@keyframes golden-pulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
  50% { 
    transform: scale(1.1) rotate(5deg); 
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
  }
}

@keyframes spotlight-sweep {
  0% { transform: translateX(-100px); opacity: 0; }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translateX(100px); opacity: 0; }
}

/* Reveal card special styling */
.carousel-card#endGameCard5,
.carousel-card#endGameCard7 {
  background: rgba(10, 25, 50, 0.85);
  border: none;
}

.carousel-card#endGameCard7 {
  background: linear-gradient(135deg, rgba(30, 20, 10, 0.95), rgba(60, 40, 20, 0.95));
  border: 3px solid gold;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
}

/* Enhanced Mario Party-style animations */
.drumroll-dots span {
  animation: mario-party-bounce 1.5s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0) * 0.2s);
  display: inline-block;
  text-shadow: 2px 2px 4px rgba(255, 215, 0, 0.8);
}

.drumroll-text {
  font-size: 1.4rem;
  color: var(--terminal-green);
  animation: mario-party-text-pulse 2s ease-in-out infinite;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(0, 255, 0, 0.6);
}

.silhouette {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, rgba(255, 209, 0, 0.4), rgba(255, 209, 0, 0.2));
  border: 3px solid var(--infinite-gold);
  border-radius: 50%;
  position: relative;
  animation: mario-party-silhouette 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 209, 0, 0.5);
}

.golden-silhouette {
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, rgba(255, 215, 0, 0.6), rgba(255, 165, 0, 0.4));
  border: 4px solid gold;
  border-radius: 50%;
  position: relative;
  animation: mario-party-winner-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
}

.spotlight-effect {
  width: 300px;
  height: 60px;
  background: linear-gradient(to right, 
    transparent 0%, 
    rgba(255, 215, 0, 0.4) 20%, 
    rgba(255, 215, 0, 0.8) 50%, 
    rgba(255, 215, 0, 0.4) 80%, 
    transparent 100%);
  border-radius: 50px;
  animation: mario-party-spotlight 2s ease-in-out infinite;
  filter: blur(2px);
}

/* Enhanced Keyframe Animations */
@keyframes mario-party-bounce {
  0%, 100% { 
    transform: translateY(0) scale(1); 
    opacity: 0.8;
  }
  25% { 
    transform: translateY(-15px) scale(1.2); 
    opacity: 1;
  }
  50% { 
    transform: translateY(-25px) scale(1.1); 
    opacity: 1;
  }
  75% { 
    transform: translateY(-10px) scale(1.15); 
    opacity: 0.9;
  }
}

@keyframes mario-party-text-pulse {
  0%, 100% { 
    opacity: 0.7; 
    transform: scale(1);
  }
  25% { 
    opacity: 1; 
    transform: scale(1.05);
  }
  50% { 
    opacity: 0.9; 
    transform: scale(1.1);
  }
  75% { 
    opacity: 1; 
    transform: scale(1.02);
  }
}

@keyframes mario-party-silhouette {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    box-shadow: 0 0 15px rgba(255, 209, 0, 0.5);
  }
  25% { 
    transform: scale(1.1) rotate(2deg); 
    box-shadow: 0 0 25px rgba(255, 209, 0, 0.7);
  }
  50% { 
    transform: scale(1.15) rotate(-1deg); 
    box-shadow: 0 0 30px rgba(255, 209, 0, 0.9);
  }
  75% { 
    transform: scale(1.05) rotate(1deg); 
    box-shadow: 0 0 20px rgba(255, 209, 0, 0.6);
  }
}

@keyframes mario-party-winner-pulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.4);
  }
  25% { 
    transform: scale(1.2) rotate(3deg); 
    box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.6);
  }
  50% { 
    transform: scale(1.25) rotate(-2deg); 
    box-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 215, 0, 0.8);
  }
  75% { 
    transform: scale(1.1) rotate(2deg); 
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.9), 0 0 70px rgba(255, 215, 0, 0.5);
  }
}

@keyframes mario-party-spotlight {
  0% { 
    transform: translateX(-150px) scaleX(0.5); 
    opacity: 0; 
  }
  15% { 
    opacity: 0.8; 
    transform: translateX(-100px) scaleX(0.8);
  }
  50% { 
    opacity: 1; 
    transform: translateX(0px) scaleX(1);
  }
  85% { 
    opacity: 0.8; 
    transform: translateX(100px) scaleX(0.8);
  }
  100% { 
    transform: translateX(150px) scaleX(0.5); 
    opacity: 0; 
  }
}

/* Hide header and footer overlays when any modal is active */
body.modal-active .nerv-top-overlay,
body.modal-active .nerv-bottom-overlay {
  display: none !important;
}

@keyframes mario-party-spotlight {
  0% {
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.8) 50%, transparent 70%);
    transform: translateX(-300px) rotate(45deg);
  }
  100% {
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.8) 50%, transparent 70%);
    transform: translateX(300px) rotate(45deg);
  }
}

/* Faction Rankings Styles - Spotify-inspired design */
.rankings-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: linear-gradient(135deg, rgba(45, 0, 85, 0.3), rgba(0, 20, 40, 0.4));
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.8s ease;
  position: relative;
  overflow: hidden;
}

.ranking-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.ranking-item:hover::before {
  transform: translateX(100%);
}

.ranking-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--infinite-gold);
  margin-right: 20px;
  min-width: 60px;
  text-align: center;
  font-family: 'VT323', monospace;
  text-shadow: 0 0 10px rgba(255, 209, 0, 0.5);
}

.faction-info {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 15px;
}

.faction-avatar-container {
  position: relative;
  min-width: 80px;
  height: 80px;
}

.faction-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--terminal-green);
  object-fit: cover;
  transition: all 0.3s ease;
}

.faction-details {
  flex: 1;
}

.faction-name {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--terminal-green);
  margin-bottom: 5px;
  font-family: 'VT323', monospace;
}

.faction-representative {
  font-size: 1rem;
  color: var(--eva-gray);
  font-family: 'Share Tech Mono', monospace;
}

.satisfaction-score {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--infinite-gold);
  min-width: 100px;
  text-align: right;
  font-family: 'VT323', monospace;
}

/* Champion-specific styles */
.ranking-item.champion {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.1));
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  position: relative;
}

.ranking-item.champion::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.3), transparent);
  border-radius: 12px;
  z-index: -1;
  animation: champion-glow 3s ease-in-out infinite alternate;
}

.champion-number {
  color: gold !important;
  font-size: 3rem !important;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8) !important;
}

.champion-avatar {
  position: relative;
}

.champion-avatar .faction-avatar {
  border: 4px solid gold !important;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

.crown-overlay {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
  animation: crown-bob 2s ease-in-out infinite alternate;
}

.champion-name {
  color: gold !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6) !important;
}

.champion-score {
  color: gold !important;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6) !important;
}

/* Suspense pause styling */
.ranking-item.suspense-pause {
  border: 2px solid rgba(255, 165, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.1), rgba(255, 100, 0, 0.05));
}

/* Champion Spotlight Card Styles */
.champion-spotlight-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 100%;
}

.champion-main-display {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.05));
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
}

.champion-main-display::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.1), transparent, rgba(255, 215, 0, 0.1), transparent);
  animation: champion-rotate 10s linear infinite;
  z-index: -1;
}

.fairness-reflection {
  padding: 20px 25px; /* Adjusted padding */
  background: rgba(0, 20, 40, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(5px);
  width: 90%; /* Ensure it fits well */
  max-width: 800px; /* Max width for readability */
}

.reflection-title {
  color: var(--infinite-gold);
  font-family: 'VT323', monospace;
  font-size: 1.5rem; /* Adjusted font size */
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 209, 0, 0.4);
}

.reflection-text {
  font-family: 'Share Tech Mono', monospace;
  line-height: 1.65; /* Adjusted line height */
  color: var(--terminal-green);
  font-size: 1rem; /* Adjusted font size */
  text-align: left; /* Ensure text alignment is left */
}

.reflection-text p {
  margin-bottom: 12px; /* Adjusted margin */
}

.reflection-text strong {
  color: var(--infinite-gold);
  text-shadow: 0 0 5px rgba(255, 209, 0, 0.3);
}

/* Fade-in animations for ranking reveals */
@keyframes ranking-fade-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes champion-glow {
  from {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  }
  to {
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
  }
}

@keyframes crown-bob {
  from {
    transform: translateX(-50%) translateY(0px);
  }
  to {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes champion-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ranking-item {
    padding: 12px 15px;
    gap: 10px;
  }
  
  .ranking-number {
    font-size: 2rem;
    margin-right: 15px;
    min-width: 50px;
  }
  
  .faction-avatar-container,
  .faction-avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
  }
  
  .faction-name {
    font-size: 1.2rem;
  }
  
  .faction-representative {
    font-size: 0.9rem;
  }
  
  .satisfaction-score {
    font-size: 1.4rem;
    min-width: 80px;
  }
  
  .champion-spotlight-container {
    gap: 20px;
  }
  
  .champion-main-display {
    padding: 20px;
  }
  
  .fairness-reflection {
    padding: 20px;
  }
  
  .reflection-title {
    font-size: 1.4rem;
  }
}

body.modal-active .nerv-top-overlay,
body.modal-active .nerv-bottom-overlay {
  display: none !important;
}

/* Longer animation for footer */
.nerv-bottom-overlay.boot-up-online {
  animation-duration: 1.2s;
}

/* ───── Project Completion Animations ───── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Project completion video container */
#project-completion-video {
  animation: fadeIn 0.3s ease-in;
}

/* Territory spotlight container */
#territory-spotlight {
  animation: fadeIn 0.5s ease-in;
}

/* Pulse animation for territory spotlight */
@keyframes spotlightPulse {
  0% { box-shadow: 0 0 30px rgba(0, 255, 100, 0.3); }
  50% { box-shadow: 0 0 50px rgba(0, 255, 100, 0.6); }
  100% { box-shadow: 0 0 30px rgba(0, 255, 100, 0.3); }
}

#territory-spotlight .spotlight-info {
  animation: spotlightPulse 2s infinite;
}

/* ---------------------------------------- */

#openEveReportBtn.eight-bit-text-header::before {
  content: '';
}

#eveReportCloseBtn.eight-bit-text-header::before {
  content: '';
}

#eveReportModal .modal-content {
  overflow-y: hidden;
}

.scrollable-territories {
  max-height: 130px;
  overflow-y: auto;
  padding-right: 5px; /* Add some space for the scrollbar if it appears */
  position: relative;
}

.scrollable-territories.scrolling {
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* Faction Reactions Styling */
.faction-reaction {
  font-size: 0.8rem;
  font-style: italic;
  color: #ccc;
  margin-top: 4px;
  margin-left: 50px;
  margin-right: 10px;
  line-height: 1.3;
  opacity: 0.9;
  animation: fadeInReaction 0.5s ease-in;
  border-left: 2px solid rgba(255, 255, 255, 0.2);
  padding-left: 8px;
}

@keyframes fadeInReaction {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animatable-metric-block {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
    border-radius: 8px; /* For better box-shadow appearance */
}

#eveReportModal .modal-content.spotlight-active .animatable-metric-block {
    opacity: 0.3;
    transform: scale(0.98);
}

#eveReportModal .modal-content.spotlight-active .animatable-metric-block.spotlight {
    opacity: 1;
    transform: scale(1.02); /* A slight zoom in */
    /* Use faction-specific glow when available; fallback to yellow for non-faction blocks */
    box-shadow: 0 0 15px 5px var(--faction-color, var(--eva-yellow));
}

.held-territories-container {
  margin-top: 5px;
  max-height: 80px; /* Adjust as needed */
  overflow-y: auto;
  padding: 5px;
}

.held-territory-card {
  padding: 3px 6px;
  margin: 1px 0;
  border: 1px solid var(--eva-green);
  border-radius: 3px;
  background: rgba(0,255,127,0.1);
}

.held-territory-card.new-territory-stamp {
    opacity: 0;
    transform: scale(1.5) rotate(-10deg);
    transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.held-territory-card.new-territory-stamp.stamped {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.scrollable-territories {
  max-height: 100px; /* Or any other suitable value */
  overflow-y: auto;
}

/* Territory Review Panel Styles */
.territory-review-panel {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 520px;
  max-height: 80vh;
  background: var(--nerv-dark-blue);
  border: 2px solid #FFD100;
  border-radius: 8px;
  padding: 20px;
  color: white;
  font-family: 'Share Tech Mono', monospace;
  box-shadow: 0 0 20px rgba(0, 255, 100, 0.3);
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: slideInFromRight 0.5s ease-out;
}

@keyframes slideInFromRight {
  from {
    transform: translateY(-50%) translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
}

.territory-review-btn {
  transition: all 0.3s ease;
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.territory-review-btn:hover {
  background: rgba(0, 255, 100, 0.1) !important;
  box-shadow: 0 0 15px rgba(0, 255, 100, 0.5) !important;
  transform: scale(1.05);
}

.news-item-animated {
  border-radius: 4px;
  margin-bottom: 8px;
}

.news-item-animated:hover {
  background: rgba(0, 255, 100, 0.05);
}

/* Add vertical scrolling to end game card content */
.carousel-card {
  overflow-y: auto !important; /* Enable vertical scrolling */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05); /* Firefox */
}

.carousel-card::-webkit-scrollbar {
  width: 8px;
}

.carousel-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.carousel-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.carousel-card::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Ensure content doesn't overflow */
.carousel-card-content {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.carousel-card-content::-webkit-scrollbar {
  width: 8px;
}

.carousel-card-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.carousel-card-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-card-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar support */
@supports (scrollbar-width: thin) {
  .carousel-card-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
  }
}
/* Typography overrides for the "Understanding This World" section in the intro modal */
#introExplainers .eight-bit-text{font-size:1.3rem !important;line-height:1.4 !important;}

/* Typography override for E.V.E. intro paragraph */
#introCompanion .eight-bit-text{font-size:1.3rem !important;line-height:1.4 !important;}
#finalObservationCloseBtn {
  border-color: var(--eva-green) !important;
  color: var(--eva-green) !important;
  box-shadow: 0 0 15px rgba(0, 255, 100, 0.5) !important;
  text-shadow: 0 0 8px rgba(0, 255, 100, 0.5) !important;
  background-color: rgba(0, 0, 0, 0.2) !important;
}
#finalObservationCloseBtn:hover {
  background-color: rgba(0, 255, 100, 0.2) !important;
  box-shadow: 0 0 20px rgba(0, 255, 100, 0.7) !important;
}
#finalObservationCloseBtn:active {
  box-shadow: 0 0 10px rgba(0, 255, 100, 0.3) !important;
}
.reserved-overlay { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: 50px; height: 50px; border-radius: 8px; border: 2px solid var(--glass-border); box-shadow: 0 0 10px rgba(0,0,0,0.5); background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 32px; }

/* When a bottom overlay exists, nudge text/content upward to make room */
.mini-map-cell-redesign.has-bottom-overlay { padding-bottom: 64px; padding-top: 6px; justify-content: flex-start; }
.mini-map-cell-redesign.has-bottom-overlay .mini-map-label { margin-top: 2px; }
.mini-map-cell-redesign.has-bottom-overlay .resource-icons-mini { margin-top: 2px !important; }
