/* ═══════════════════════════════════════════════════════════════════════════
   WOPR TERMINAL - WarGames (1983) CRT Interface
   "SHALL WE PLAY A GAME?"
   ═══════════════════════════════════════════════════════════════════════════ */

/* CSS Variables for theming */
:root {
    /* Authentic WOPR colors - pale cyan/blue-gray on black */
    --phosphor-primary: #7dd3fc;      /* Main text - pale cyan */
    --phosphor-bright: #bae6fd;       /* Bright highlights */
    --phosphor-dim: #38bdf8;          /* Dimmed text */
    --phosphor-glow: #0ea5e9;         /* Glow effect base */
    --phosphor-dark: #0c4a6e;         /* Very dim */
    --bg-black: #000000;              /* Pure black background */
    --bg-dark: #020617;               /* Slightly lighter black */
    --crt-green: #22d3ee;             /* Alternative green phosphor */
    --amber: #fbbf24;                 /* Amber accent */
    --warning-red: #ef4444;           /* Alert red */
    
    /* Typography */
    --font-terminal: 'VT323', 'Share Tech Mono', 'Courier New', monospace;
    --font-size-base: 1.4rem;
    --line-height: 1.4;
    
    /* CRT effect intensities */
    --scanline-opacity: 0.08;
    --flicker-intensity: 0.03;
    --glow-intensity: 1;
    --curvature: 8px;
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #000000 50%, #0a0a0a 100%);
    font-family: var(--font-terminal);
    font-size: var(--font-size-base);
    color: var(--phosphor-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CRT MONITOR CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.crt-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background: var(--bg-black);
    border-radius: var(--curvature);
    overflow: hidden;
    
    /* CRT screen curvature simulation */
    box-shadow: 
        /* Inner glow */
        inset 0 0 100px rgba(14, 165, 233, 0.1),
        inset 0 0 50px rgba(14, 165, 233, 0.05),
        /* Outer bezel shadow */
        0 0 0 3px #1a1a1a,
        0 0 0 6px #0d0d0d,
        0 0 30px rgba(0, 0, 0, 0.8),
        /* Ambient glow */
        0 0 80px rgba(14, 165, 233, 0.15);
}

/* Screen curvature effect */
.crt-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 100;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CRT EFFECTS OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.crt-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

/* Scanlines effect */
.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, var(--scanline-opacity)) 0px,
        rgba(0, 0, 0, var(--scanline-opacity)) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanline-scroll 10s linear infinite;
}

@keyframes scanline-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Flicker effect */
.flicker {
    position: absolute;
    inset: 0;
    background: transparent;
    animation: flicker 0.15s infinite;
    opacity: var(--flicker-intensity);
}

@keyframes flicker {
    0%, 100% { opacity: var(--flicker-intensity); }
    50% { opacity: calc(var(--flicker-intensity) * 0.5); }
    92% { opacity: calc(var(--flicker-intensity) * 1.5); }
}

/* RGB shift / chromatic aberration */
.rgb-shift {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, 
            rgba(255, 0, 0, 0.02) 0%, 
            transparent 3%, 
            transparent 97%, 
            rgba(0, 0, 255, 0.02) 100%
        );
}

/* ═══════════════════════════════════════════════════════════════════════════
   TERMINAL SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.terminal-screen {
    position: relative;
    width: 100%;
    height: calc(100% - 40px);
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--phosphor-dim) var(--bg-black);
}

.terminal-screen::-webkit-scrollbar {
    width: 8px;
}

.terminal-screen::-webkit-scrollbar-track {
    background: var(--bg-black);
}

.terminal-screen::-webkit-scrollbar-thumb {
    background: var(--phosphor-dark);
    border-radius: 4px;
}

.terminal-screen::-webkit-scrollbar-thumb:hover {
    background: var(--phosphor-dim);
}

/* Terminal output area */
.terminal-output {
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: var(--line-height);
    max-width: 100%;
}

/* Text with phosphor glow effect */
.terminal-output,
.terminal-input,
.prompt {
    text-shadow: 
        0 0 2px var(--phosphor-primary),
        0 0 5px var(--phosphor-glow),
        0 0 10px rgba(14, 165, 233, 0.5),
        0 0 20px rgba(14, 165, 233, 0.3);
}

/* Different text styles */
.text-bright {
    color: var(--phosphor-bright);
    text-shadow: 
        0 0 3px var(--phosphor-bright),
        0 0 8px var(--phosphor-primary),
        0 0 15px rgba(14, 165, 233, 0.7);
}

.text-dim {
    color: var(--phosphor-dim);
    text-shadow: 
        0 0 2px var(--phosphor-dim),
        0 0 4px rgba(14, 165, 233, 0.3);
}

.text-warning {
    color: var(--amber);
    text-shadow: 
        0 0 3px var(--amber),
        0 0 8px rgba(251, 191, 36, 0.5);
}

.text-error {
    color: var(--warning-red);
    text-shadow: 
        0 0 3px var(--warning-red),
        0 0 8px rgba(239, 68, 68, 0.5);
    animation: error-pulse 1s ease-in-out infinite;
}

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

/* System messages */
.system-line {
    color: var(--phosphor-dim);
    margin: 5px 0;
}

.user-line {
    color: var(--phosphor-bright);
    margin: 10px 0 5px 0;
}

.response-line {
    color: var(--phosphor-primary);
    margin: 5px 0 15px 0;
}

/* ASCII art styling */
.ascii-art {
    color: var(--phosphor-bright);
    font-size: clamp(0.5rem, 2vw, 0.9rem);
    line-height: 1.1;
    margin: 15px 0;
    white-space: pre;
    overflow-x: auto;
    text-shadow: 
        0 0 5px var(--phosphor-primary),
        0 0 10px var(--phosphor-glow);
}

/* Map lines for Global Thermonuclear War - progressive scan effect */
.map-line {
    color: var(--phosphor-bright);
    font-family: var(--font-terminal);
    font-size: clamp(0.5rem, 1.5vw, 0.85rem);
    line-height: 1.0;
    white-space: pre;
    letter-spacing: 0;
    display: block;
    animation: map-scan-in 0.3s ease-out forwards;
    text-shadow: 
        0 0 3px var(--phosphor-primary),
        0 0 8px var(--phosphor-glow),
        0 0 15px rgba(14, 165, 233, 0.4);
}

@keyframes map-scan-in {
    0% {
        opacity: 0.3;
        filter: brightness(2);
    }
    50% {
        opacity: 0.8;
        filter: brightness(1.5);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

/* PNG War Maps - Movie-accurate USA/USSR display with scan reveal */
.war-map-container {
    position: relative;
    width: 100%;
    max-width: 1050px;
    margin: 1rem auto;
    overflow: hidden;
    /* Fixed aspect ratio based on image 1050:310 */
    aspect-ratio: 1050 / 310;
}

.war-map-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Subtle CRT glow effect - keep lines thin */
    filter: drop-shadow(0 0 1px var(--phosphor-primary))
            drop-shadow(0 0 3px rgba(14, 165, 233, 0.4));
}

/* Scan line - glowing horizontal line for progressive reveal effect */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--phosphor-bright);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px var(--phosphor-glow), 
                0 0 20px var(--phosphor-primary),
                0 0 30px rgba(14, 165, 233, 0.5);
}

/* Map labels container - positioned under maps */
.war-map-labels {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 1050px;
    margin: 0.5rem auto 1rem;
    padding: 0 2%;
}

.war-map-label {
    color: var(--phosphor-primary);
    font-family: var(--font-terminal);
    font-size: 1.2rem;
    text-align: center;
    text-shadow: 
        0 0 2px var(--phosphor-primary),
        0 0 5px var(--phosphor-glow);
}

/* Position labels roughly under each map */
.war-map-label:first-child {
    flex: 0 0 40%;
    text-align: center;
}

.war-map-label:last-child {
    flex: 0 0 55%;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INPUT LINE
   ═══════════════════════════════════════════════════════════════════════════ */

.input-line {
    display: flex;
    align-items: flex-start;
    margin-top: 10px;
    min-height: 30px;
    max-width: 100%;
}

.prompt {
    color: var(--phosphor-bright);
    margin-right: 0;
    white-space: pre;
    flex-shrink: 0;
}

.terminal-input {
    flex: 0 0 auto;
    width: auto;
    min-width: 1ch;
    background: transparent;
    border: none;
    outline: none;
    color: var(--phosphor-primary);
    font-family: var(--font-terminal);
    font-size: var(--font-size-base);
    caret-color: transparent;
    padding: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.terminal-input::selection {
    background: var(--phosphor-dim);
    color: var(--bg-black);
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    width: 12px;
    height: 1.4em;
    background: var(--phosphor-primary);
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: -2px;
    box-shadow: 
        0 0 5px var(--phosphor-primary),
        0 0 10px var(--phosphor-glow);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Hide cursor when input is disabled */
.input-line.disabled .cursor {
    display: none;
}

.input-line.disabled .terminal-input {
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-black) 100%);
    border-top: 1px solid var(--phosphor-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    font-size: 1rem;
    color: var(--phosphor-dim);
    text-shadow: 0 0 3px var(--phosphor-glow);
}

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

.audio-controls {
    gap: 15px;
}

.audio-btn {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-shadow: inherit;
    outline: none;
}

.audio-btn:hover {
    color: var(--phosphor-primary);
}

#connectionStatus {
    transition: color 0.3s ease;
}

#connectionStatus.connected {
    color: #22c55e;
    text-shadow: 0 0 5px #22c55e;
}

#connectionStatus.demo {
    color: #fbbf24;
    text-shadow: 0 0 5px #fbbf24;
}

#connectionStatus.error {
    color: var(--warning-red);
    text-shadow: 0 0 5px var(--warning-red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-black);
    border: 2px solid var(--phosphor-dim);
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 0 30px rgba(14, 165, 233, 0.3),
        inset 0 0 20px rgba(14, 165, 233, 0.05);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--phosphor-dark);
}

.modal-header h2 {
    color: var(--phosphor-bright);
    font-size: 1.3rem;
    font-weight: normal;
    text-shadow: 0 0 5px var(--phosphor-glow);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--phosphor-dim);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--phosphor-bright);
    text-shadow: 0 0 10px var(--phosphor-glow);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--phosphor-dim);
    margin-bottom: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--phosphor-dark);
    color: var(--phosphor-primary);
    font-family: var(--font-terminal);
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--phosphor-primary);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--phosphor-dark);
}

.form-group select option {
    background: var(--bg-black);
    color: var(--phosphor-primary);
}

.toggle-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--phosphor-dim);
    transition: color 0.2s ease;
}

.toggle:hover {
    color: var(--phosphor-primary);
}

.toggle input[type="checkbox"] {
    width: auto;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--phosphor-dim);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.toggle input[type="checkbox"]:checked {
    background: var(--phosphor-glow);
    border-color: var(--phosphor-primary);
    box-shadow: 0 0 10px var(--phosphor-glow);
}

.toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-black);
    font-size: 14px;
}

.provider-hint {
    margin-top: 8px;
    font-size: 0.85rem;
}

.provider-hint a {
    color: #22c55e;
    text-decoration: none;
}

.provider-hint a:hover {
    text-decoration: underline;
}

.demo-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 2px;
    font-size: 0.85rem;
    color: #86efac;
    line-height: 1.4;
}

.demo-note a {
    color: #22c55e;
    text-decoration: none;
}

.demo-note a:hover {
    text-decoration: underline;
}

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid var(--phosphor-dark);
    border-radius: 2px;
    font-size: 0.85rem;
    color: var(--phosphor-dim);
    line-height: 1.4;
}

.security-note .lock-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.security-note a {
    color: var(--phosphor-primary);
    text-decoration: none;
    white-space: nowrap;
}

.security-note a:hover {
    color: var(--phosphor-bright);
    text-decoration: underline;
}

.voice-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--phosphor-dark);
    font-style: italic;
}

.save-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--phosphor-dim);
    color: var(--phosphor-primary);
    font-family: var(--font-terminal);
    font-size: 1.2rem;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.save-btn:hover {
    background: var(--phosphor-glow);
    color: var(--bg-black);
    border-color: var(--phosphor-primary);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPING ANIMATION
   ═══════════════════════════════════════════════════════════════════════════ */

.typing-cursor::after {
    content: '█';
    animation: blink 0.7s step-end infinite;
}

/* Loading dots animation */
.loading::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
    :root {
        --font-size-base: 1.2rem;
    }
    
    body {
        padding: 10px;
    }
    
    .crt-container {
        height: 95vh;
        border-radius: 6px;
    }
    
    .terminal-screen {
        padding: 20px;
    }
    
    .ascii-art {
        font-size: 0.7rem;
    }
}

/* Mobile */
@media (max-width: 600px) {
    :root {
        --font-size-base: 1rem;
        --curvature: 4px;
    }
    
    body {
        padding: 0;
    }
    
    .crt-container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        border-radius: 0;
        max-width: 100%;
    }
    
    .terminal-screen {
        padding: 15px;
        padding-bottom: 5px;
    }
    
    .terminal-output {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .input-line {
        font-size: 1rem;
    }
    
    .prompt {
        font-size: 1rem;
    }
    
    .terminal-input {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    .status-bar {
        height: auto;
        min-height: 36px;
        padding: 8px 15px;
        font-size: 0.8rem;
        flex-wrap: wrap;
        gap: 5px 15px;
        justify-content: center;
    }
    
    .status-item:first-child {
        display: none; /* Hide "WOPR INTERFACE v1.0" on mobile */
    }
    
    .ascii-art {
        font-size: 0.45rem;
        line-height: 1.0;
        letter-spacing: -0.5px;
    }
    
    /* Modal adjustments for mobile */
    .modal {
        width: 95%;
        max-height: 85vh;
        margin: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 10px;
    }
    
    .toggle-group {
        gap: 15px;
    }
    
    .toggle {
        font-size: 0.9rem;
    }
    
    .save-btn {
        font-size: 1rem;
        padding: 12px;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    :root {
        --font-size-base: 0.9rem;
    }
    
    .terminal-screen {
        padding: 10px;
    }
    
    .ascii-art {
        display: none;
    }
    
    .status-bar {
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPECIAL EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Power on effect */
@keyframes power-on {
    0% {
        filter: brightness(50) saturate(0);
        transform: scale(1, 0.01);
    }
    10% {
        filter: brightness(10) saturate(0);
        transform: scale(1, 0.01);
    }
    35% {
        filter: brightness(1) saturate(0);
        transform: scale(1, 1);
    }
    60% {
        filter: brightness(1) saturate(0.5);
    }
    100% {
        filter: brightness(1) saturate(1);
        transform: scale(1, 1);
    }
}

.power-on {
    animation: power-on 1.5s ease-out forwards;
}

/* Glitch effect */
@keyframes glitch {
    0%, 100% { 
        transform: translate(0); 
        filter: none;
    }
    20% { 
        transform: translate(-2px, 2px); 
        filter: hue-rotate(90deg);
    }
    40% { 
        transform: translate(-2px, -2px); 
        filter: hue-rotate(-90deg);
    }
    60% { 
        transform: translate(2px, 2px); 
        filter: hue-rotate(180deg);
    }
    80% { 
        transform: translate(2px, -2px); 
        filter: none;
    }
}

.glitch {
    animation: glitch 0.3s ease-in-out;
}

/* Defcon alert animation */
@keyframes defcon-flash {
    0%, 100% { 
        background: var(--bg-black);
        border-color: var(--phosphor-dim);
    }
    50% { 
        background: rgba(239, 68, 68, 0.1);
        border-color: var(--warning-red);
    }
}

.defcon-alert {
    animation: defcon-flash 0.5s ease-in-out 5;
}

/* No glow mode */
.no-glow .terminal-output,
.no-glow .terminal-input,
.no-glow .prompt,
.no-glow .cursor {
    text-shadow: none !important;
    box-shadow: none !important;
}

/* No scanlines mode */
.no-scanlines .scanlines {
    display: none;
}

/* No flicker mode */
.no-flicker .flicker {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NUCLEAR WAR ANIMATION - WarGames (1983) Endgame Sequence
   ═══════════════════════════════════════════════════════════════════════════ */

.nuclear-war-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    border: 2px solid rgba(34, 211, 238, 0.5);
    border-radius: 8px;
    overflow: hidden;
    background: #0a1628;
    box-shadow: 
        0 0 20px rgba(34, 211, 238, 0.3),
        inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.nuclear-war-map {
    width: 100%;
    height: auto;
    display: block;
}

/* Missile trail animation */
.missile-trail {
    stroke-linecap: round;
    filter: url(#missile-glow);
}

@keyframes missile-pulse {
    0%, 100% { stroke-opacity: 1; }
    50% { stroke-opacity: 0.7; }
}

/* Explosion bloom effect */
.explosion circle {
    transform-origin: center;
}

@keyframes explosion-pulse {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 0.6;
    }
}

.explosion {
    animation: explosion-pulse 0.5s ease-out infinite;
}

/* Strategy text styling */
.strategy-text {
    font-family: var(--font-terminal), monospace;
    text-shadow: 
        0 0 10px rgba(34, 211, 238, 0.8),
        0 0 20px rgba(34, 211, 238, 0.5);
    letter-spacing: 2px;
}

/* Winner text styling */
.winner-text {
    font-family: var(--font-terminal), monospace;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 30px rgba(255, 255, 255, 0.5),
        0 0 50px rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
}

/* Map continent glow effects */
.continent {
    transition: stroke-opacity 0.3s ease;
}

.usa-fill {
    transition: fill-opacity 0.3s ease;
}

.ussr-outline {
    transition: fill-opacity 0.3s ease;
}

/* City dot pulse effect */
.usa-cities circle,
.ussr-cities circle {
    animation: city-pulse 2s ease-in-out infinite;
}

@keyframes city-pulse {
    0%, 100% { 
        r: 3;
        opacity: 1;
    }
    50% { 
        r: 4;
        opacity: 0.8;
    }
}

/* Screen flicker effect during war */
@keyframes war-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

.nuclear-war-container.active {
    animation: war-flicker 0.5s linear infinite;
}

/* Final message styling */
.final-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-terminal);
    font-size: 2rem;
    color: #ffffff;
    text-align: center;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 100;
}

.final-message.visible {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .nuclear-war-container {
        margin: 1rem auto;
        border-width: 1px;
    }
    
    .strategy-text {
        font-size: 16px !important;
    }
    
    .winner-text {
        font-size: 20px !important;
    }
}

