/* ===== COMPLETE TERMINAL STYLESHEET ===== */
/* Core Variables */
:root {
  --terminal-green: #00ff00;
  --terminal-dark: #001100;
  --terminal-error: #ff5555;
  --terminal-border: rgba(0, 80, 0, 0.5);
  --terminal-glow: rgba(0, 255, 0, 0.3);
  --scanline-color: rgba(0, 0, 0, 0.3);
  --transition-duration: 0.6s;
}

/* Font Setup */
@font-face {
  font-family: "TerminalFont";
  src: url("fixedsys.woff") format("woff");
  font-display: swap;
}
/* Coordinate Finder */
#coord-finder {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 1000;
    background: rgba(0, 20, 0, 0.7);
    color: #0f0;
    padding: 5px 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

/* Legend */
.map-legend {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    z-index: 1000;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: rgba(0, 30, 0, 0.9);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #0f0;
    width: 80%;
    max-width: 600px;
    color: #0f0;
    font-family: "TerminalFont", monospace;
}

.close-modal {
    color: #0f0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #ff0;
}

#modal-details {
    margin-top: 15px;
}

#modal-details p {
    margin: 5px 0;
}

::selection {

background: #00ff00;

color: #000;

}

html {
  overflow: hidden;
  background: #000;
}

body {
  background: #000;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: 'TerminalFont', monospace;
}

/* Base CRT Display Style - Applied to both boot and main terminal */
.crt-display {
  position: fixed;
  width: 100%;
  height: 100vh;
  background: var(--terminal-dark);
  color: var(--terminal-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: 
    crtPowerOn 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    crtHum 0.3s ease-out 2.3s forwards;
}

/* Scanlines - Enhanced for both screens */
.crt-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    var(--scanline-color) 51%
  );
  background-size: 100% 4px;
  animation: scanlines 1s steps(60) infinite;
}

.crt-scanlines::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--scanline-color);
  opacity: 0.75;
  animation: scanline 6s linear infinite;
  transform: translate3d(0, -100%, 0);
}

/* Screen Curvature */
.crt-curvature {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
  border-radius: 2% / 1%;
  overflow: hidden;
}

/* CRT Border */
.crt-border {
  position: fixed;
  inset: 0;
  border: 4px solid var(--terminal-border);
  box-shadow: 
    inset 0 0 10px var(--terminal-glow),
    inset 0 0 20px rgba(0, 255, 0, 0.2);
  animation: borderFlicker 8s linear infinite;
  border-radius: 2% / 1%;
  pointer-events: none;
  z-index: 1001;
}

/* CRT Text Display - Consistent for both screens */
.crt-text {
  position: relative;
  z-index: 10;
  white-space: pre;
  text-shadow: 0 0 8px var(--terminal-green);
  padding: 2rem;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  opacity: 0;
  transform: translateY(10px);
  animation: 
    textAppear 1s ease-out 0.7s forwards,
    textGlowPulse 3s ease-in-out infinite 1.5s;
}

/* Terminal Content - Now with same CRT effects */
.terminal-content {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: auto;
  opacity: 0;
  transform: translateY(10px);
  animation: 
    textAppear 1s ease-out 0.7s forwards,
    textGlowPulse 3s ease-in-out infinite 1.5s;
}

/* Boot Screen Specific - Now identical to main terminal */
.boot-screen {
  composes: crt-display;
}

.boot-content {
  composes: crt-text;
}

/* Main Terminal - Now matches boot screen */
.error-terminal {
  composes: crt-display;
  display: none; /* Initial state */
}

/* Animations - Unified for both screens */
@keyframes crtPowerOn {
  0% { 
    opacity: 0; 
    background-color: #000;
    filter: brightness(0) contrast(0) saturate(0);
  }
  20% {
    opacity: 0.2;
    filter: brightness(0.4) contrast(400%) saturate(200%);
  }
  50% {
    opacity: 0.8;
    filter: brightness(1) contrast(300%) saturate(150%);
    background-color: var(--terminal-dark);
  }
  80% {
    filter: brightness(1.1) contrast(200%) saturate(120%);
  }
  100% {
    opacity: 1;
    filter: brightness(1) contrast(150%) saturate(100%);
    background-color: var(--terminal-dark);
  }
}

@keyframes crtHum {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.5px); }
}

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

@keyframes textGlowPulse {
  0%, 100% { text-shadow: 0 0 8px var(--terminal-green); }
  50% { text-shadow: 0 0 15px var(--terminal-green); }
}

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

@keyframes scanline {
  0% { transform: translate3d(0, -100%, 0); }
  100% { transform: translate3d(0, 100vh, 0); }
}

@keyframes borderFlicker {
  0%, 60%, 62%, 64%, 66%, 68%, 100% {
    box-shadow: 
      inset 0 0 10px var(--terminal-glow),
      inset 0 0 20px rgba(0, 255, 0, 0.2);
  }
  61%, 63%, 65%, 67%, 69% {
    box-shadow: 
      inset 0 0 12px rgba(0, 255, 0, 0.4),
      inset 0 0 24px rgba(0, 255, 0, 0.3);
  }
}

/* Utility Classes */
.blink { animation: blink 0.7s infinite; }
.text-center { text-align: center; }
.hidden { display: none; }
/* Marker Styles with Image Fallbacks */
.map-marker {
    position: absolute;
    z-index: 10;
    transform-origin: center center;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Fallback shapes (will only show if images fail to load) */
.capital-marker { background-color: #ff0; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 0, 0.7); }
.town-marker { background-color: #0f0; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.military-marker { background-color: #f00; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.power-marker { background-color: #0af; clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
.tech-marker { background-color: #a0f; clip-path: polygon(0% 0%, 100% 50%, 0% 100%); }
.farm-marker { background-color: #8f4; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.mine-marker { background-color: #a0a; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.vault-marker { background-color: #0ff; clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%); }

/* RADSTORM COUNTDOWN STYLES */
.radstorm-countdown {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid rgba(255, 100, 0, 0.5);
    padding: 10px;
    font-family: "TerminalFont", monospace;
    color: #ff6400;
    text-shadow: 0 0 5px #ff6400;
    z-index: 1000;
}

.radstorm-header {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.radstorm-timer {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

.radstorm-warning {
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: center;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}
body, html { /* Ensure parent fills the viewport */
    height: 100%;
    margin: 0;
    background: #000;
}

.map-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* True center */
    width: 90%;
    max-width: 1000px;
    height: 60vh;
    max-height: 600px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    background: rgba(0, 0, 0, 0.5);
    animation: mapFadeIn 1.5s ease-out;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

/* Keep .map-content and .fallout-map styles the same as above */
/* Legend marker styles */
.legend-marker {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
@keyframes blink {
  50% { opacity: 0; }
}