/**
 * Location Hunter Game - CSS COMPLETO CORREGIDO
 * Todas las clases del HTML + todas las clases del JS
 * Mejoras UX/UI, responsive design y optimizaciones de rendimiento
 */

/* ==================== RESET Y BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a0a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.4;
    min-height: 100vh;
    margin: 0;
}

/* ==================== VARIABLES CSS ==================== */
:root {
    --primary-green: #00ff00;
    --secondary-cyan: #00ffff;
    --accent-magenta: #ff00ff;
    --warning-yellow: #ffff00;
    --error-red: #ff0000;
    --background-dark: #0a0a0a;
    --background-light: rgba(0, 255, 0, 0.05);
    --border-width: 2px;
    --border-radius: 4px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --shadow-glow: 0 0 20px rgba(0, 255, 0, 0.3);
    --shadow-glow-strong: 0 0 30px rgba(0, 255, 0, 0.5);
}

/* ==================== SCANLINES OPTIMIZADAS ==================== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 50%, rgba(0, 255, 0, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1000;
    will-change: transform;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(0px); }
    100% { transform: translateY(4px); }
}

/* ==================== CONTAINERS ==================== */
.container,
.lh-game-wrapper,
.lh-game-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 0 10px;
}

.lh-game-wrapper {
    min-height: auto;
    max-height: 100vh;
    overflow: hidden;
}

/* ==================== INITIAL LOADING ==================== */
.initial-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2em;
    color: var(--secondary-cyan);
    animation: pulse 2s infinite;
}

/* ==================== ERROR CONTAINER ==================== */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 20px;
}

.error-content {
    background: var(--background-dark);
    border: var(--border-width) solid var(--error-red);
    padding: 40px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
    animation: errorPulse 2s infinite;
}

@keyframes errorPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 0, 0, 0.5); }
}

.error-icon {
    font-size: 3em;
    margin-bottom: 20px;
    animation: shake 1s infinite;
}

.error-title {
    font-size: 2em;
    color: var(--error-red);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.error-message {
    font-size: 1.2em;
    color: var(--warning-yellow);
    margin-bottom: 20px;
}

.error-help {
    font-size: 1em;
    opacity: 0.8;
    margin-bottom: 30px;
}

.btn-retry {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--error-red);
    color: var(--error-red);
}

.btn-retry:hover {
    background: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* ==================== HEADER MEJORADO ==================== */
.header,
.game-header {
    text-align: center;
    border: var(--border-width) solid var(--primary-green);
    padding: 15px;
    margin-bottom: 15px;
    background: var(--background-light);
    box-shadow: var(--shadow-glow);
    animation: headerPulse 3s infinite;
    border-radius: var(--border-radius);
}

@keyframes headerPulse {
    0%, 100% { box-shadow: var(--shadow-glow); }
    50% { box-shadow: var(--shadow-glow-strong); }
}

.header h1,
.header-title,
.glitch-text {
    font-size: 2em;
    text-shadow: 0 0 10px var(--primary-green);
    margin-bottom: 8px;
    letter-spacing: 2px;
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
}

.glitch-text::before {
    animation: glitchTop 3s linear infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after {
    animation: glitchBottom 3s linear infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
    2%, 64% { transform: translate2d(2px, -2px) skew(-80deg); }
    4%, 60% { transform: translate2d(-2px, -2px) skew(80deg); }
    62% { transform: translate2d(0px, -2px) skew(5deg); }
}

@keyframes glitchBottom {
    2%, 64% { transform: translate2d(-2px, 0px) skew(-80deg); }
    4%, 60% { transform: translate2d(-2px, 0px) skew(80deg); }
    62% { transform: translate2d(-22px, 5px) skew(21deg); }
}

.header .status,
.header-status {
    color: var(--secondary-cyan);
    font-size: 0.9em;
    opacity: 0.8;
}

/* ==================== PROGRESO DEL JUEGO ==================== */
.game-progress {
    margin-top: 10px;
    border-top: 1px solid var(--primary-green);
    padding-top: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.progress-bar-container {
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--primary-green);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-cyan));
    width: 0;
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px var(--primary-green);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==================== TERMINAL MEJORADO ==================== */
.terminal,
.terminal-summary {
    background: var(--background-dark);
    border: var(--border-width) solid var(--primary-green);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-glow);
    max-height: 120px;
    overflow: hidden;
    border-radius: var(--border-radius);
    position: relative;
}

.terminal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-green), var(--secondary-cyan), var(--primary-green));
    z-index: -1;
    border-radius: var(--border-radius);
    opacity: 0.5;
}

.terminal-line {
    margin-bottom: 8px;
    line-height: 1.6;
    animation: typeIn 0.5s ease-in;
}

@keyframes typeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.prompt {
    color: var(--accent-magenta);
    font-weight: bold;
}

.error {
    color: var(--error-red);
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.success {
    color: var(--secondary-cyan);
    text-shadow: 0 0 5px var(--secondary-cyan);
}

.warning {
    color: var(--warning-yellow);
}

/* ==================== CHALLENGE CONTAINER MEJORADO ==================== */
.challenge-container {
    background: rgba(0, 0, 0, 0.7);
    border: var(--border-width) solid var(--primary-green);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-glow);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    color: var(--secondary-cyan);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--primary-green);
}

.challenge-type {
    font-size: 0.8em;
    opacity: 0.8;
    padding: 4px 8px;
    border: 1px solid var(--secondary-cyan);
    border-radius: var(--border-radius);
    background: rgba(0, 255, 255, 0.1);
}

.challenge-text,
.challenge-question {
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.4;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.timer {
    color: var(--warning-yellow);
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 12px;
    border: 1px solid var(--warning-yellow);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 0, 0.1);
    display: inline-block;
    text-shadow: 0 0 5px var(--warning-yellow);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.2);
}

.timer.warning {
    color: #ff8800;
    border-color: #ff8800;
    background: rgba(255, 136, 0, 0.15);
    animation: timerPulse 1s infinite;
    box-shadow: 0 0 15px rgba(255, 136, 0, 0.3);
}

.timer.critical {
    color: var(--error-red);
    border-color: var(--error-red);
    background: rgba(255, 0, 0, 0.15);
    animation: timerCritical 0.5s infinite;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes timerCritical {
    0%, 100% { 
        background: rgba(255, 0, 0, 0.1);
        transform: scale(1);
    }
    50% { 
        background: rgba(255, 0, 0, 0.3);
        transform: scale(1.05);
    }
}

/* ==================== OPTIONS MEJORADAS ==================== */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}

.option,
.option-btn {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    position: relative;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.option::before,
.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
    transition: left var(--transition-normal);
}

.option:hover::before,
.option-btn:hover::before {
    left: 100%;
}

.option-letter {
    font-weight: bold;
    margin-right: 15px;
    color: var(--accent-magenta);
    font-size: 1.1em;
}

.option-text {
    flex: 1;
}

.option:hover,
.option-btn:hover {
    background: rgba(0, 255, 0, 0.15);
    transform: translateX(10px);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    border-color: var(--secondary-cyan);
}

.option.selected,
.option-btn.selected {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--secondary-cyan);
    color: var(--secondary-cyan);
    font-weight: bold;
    transform: translateX(10px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.option.correct,
.option-btn.correct {
    background: rgba(0, 255, 0, 0.3);
    border-color: var(--primary-green);
    animation: correctPulse 1s;
    color: #ffffff;
}

.option.incorrect,
.option-btn.incorrect {
    background: rgba(255, 0, 0, 0.2);
    border-color: var(--error-red);
    color: var(--error-red);
    animation: shake 0.5s;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1) translateX(10px); }
    50% { transform: scale(1.05) translateX(15px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== FILE UPLOAD MEJORADO ==================== */
.file-upload {
    border: 2px dashed var(--primary-green);
    padding: 40px 30px;
    text-align: center;
    background: rgba(0, 255, 0, 0.05);
    margin: 20px 0;
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.file-upload::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(0, 255, 0, 0.1), transparent);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.file-upload:hover::before,
.file-upload.drag-over::before {
    opacity: 1;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.file-upload-content {
    position: relative;
    z-index: 1;
}

.file-upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--secondary-cyan);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.file-upload-label {
    display: inline-block;
    padding: 15px 30px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--primary-green);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Courier New', monospace;
    border-radius: var(--border-radius);
    font-weight: bold;
    letter-spacing: 1px;
}

.file-upload-label:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

.file-upload.drag-over {
    border-color: var(--secondary-cyan);
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.02);
}

.file-info {
    margin-top: 15px;
    color: var(--secondary-cyan);
    font-size: 0.9em;
}

.file-info.success {
    color: var(--primary-green);
    font-weight: bold;
}

.file-info.error {
    color: var(--error-red);
    font-weight: bold;
}

/* ==================== BUTTONS MEJORADOS ==================== */
.btn,
.button,
.action-btn {
    padding: 12px 30px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: var(--border-width) solid var(--primary-green);
    background: transparent;
    color: var(--primary-green);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 8px 4px;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    font-weight: bold;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    transition: left var(--transition-normal);
}

.btn:hover:not(:disabled)::before {
    left: 100%;
}

.btn:hover:not(:disabled),
.button:hover:not(:disabled),
.action-btn:hover:not(:disabled) {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: var(--shadow-glow-strong);
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--primary-green);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.1);
    border-color: #666;
    color: #666;
}

.btn-primary {
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-secondary {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--secondary-cyan);
    color: var(--secondary-cyan);
}

.btn-skip {
    background: rgba(255, 255, 0, 0.1);
    border-color: var(--warning-yellow);
    color: var(--warning-yellow);
}

.btn-map {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--secondary-cyan);
    color: var(--secondary-cyan);
    text-decoration: none;
    display: inline-block;
    margin: 10px;
}

.btn-map:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6);
    transform: scale(1.05);
}

.btn-share {
    background: rgba(255, 0, 255, 0.1);
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

/* ==================== CHALLENGE ACTIONS ==================== */
.challenge-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== COORDINATES / RESULTS MEJORADO ==================== */
.coordinates,
.results,
.final-screen,
.final-coordinates {
    border: var(--border-width) solid var(--primary-green);
    padding: 30px;
    text-align: center;
    background: var(--background-light);
    margin: 20px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-glow);
}

.final-header {
    margin-bottom: 30px;
}

.final-header h2 {
    font-size: 2.5em;
    color: var(--secondary-cyan);
    margin-bottom: 15px;
    text-shadow: 0 0 20px var(--secondary-cyan);
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1em;
    margin-top: 15px;
}

.coordinates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.coord-item {
    border: 1px solid var(--secondary-cyan);
    padding: 20px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
}

.coord-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.2);
}

.coord-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.coord-label,
.coordinate-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
    color: var(--secondary-cyan);
}

.coord-value,
.coordinate-value {
    font-size: 1.5em;
    color: var(--primary-green);
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-green);
}

.final-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ==================== LOADING SCREEN MEJORADO ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn var(--transition-normal);
}

.loading-screen.fade-out {
    animation: fadeOut var(--transition-slow) forwards;
}

.loading-content {
    text-align: center;
    width: 90%;
    max-width: 700px;
    padding: 40px;
}

.loading-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px var(--primary-green);
    letter-spacing: 5px;
    animation: pulse 2s infinite;
}

.loading-console {
    text-align: left;
    margin-bottom: 30px;
    min-height: 200px;
    background: var(--background-dark);
    border: 1px solid var(--primary-green);
    padding: 20px;
    border-radius: var(--border-radius);
    max-height: 250px;
    overflow-y: auto;
}

.loading-line {
    margin: 8px 0;
    font-size: 0.9em;
    opacity: 0;
    animation: fadeIn var(--transition-normal) forwards;
}

.loading-line.success { 
    color: var(--secondary-cyan); 
    text-shadow: 0 0 5px var(--secondary-cyan);
}

.loading-line.warning { 
    color: var(--warning-yellow); 
}

.loading-line.error { 
    color: var(--error-red); 
}

.loading-progress {
    margin-top: 30px;
}

.progress-text {
    margin-top: 10px;
    color: var(--primary-green);
    font-size: 1.1em;
    font-weight: bold;
}

/* ==================== RADAR SYSTEM ==================== */
.radar-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 30px auto;
    border: 2px solid var(--primary-green);
    border-radius: 50%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 255, 0, 0.1) 70%);
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 45%;
    background: linear-gradient(to top, var(--primary-green), transparent);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    animation: radarSweep 2s linear infinite;
}

@keyframes radarSweep {
    from { transform: translate(-50%, -100%) rotate(0deg); }
    to { transform: translate(-50%, -100%) rotate(360deg); }
}

.radar-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.radar-circle {
    position: absolute;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
}

.radar-circle:nth-child(1) {
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
}

.radar-circle:nth-child(2) {
    top: 12.5%;
    left: 12.5%;
    width: 75%;
    height: 75%;
}

.radar-circle:nth-child(3) {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--primary-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--primary-green);
    animation: pulse 1s infinite;
}

.radar-blip {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--secondary-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: blipAppear 1s ease-out;
    box-shadow: 0 0 15px var(--secondary-cyan);
}

@keyframes blipAppear {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* ==================== FEEDBACK OVERLAY MEJORADO ==================== */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn var(--transition-normal);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.feedback-overlay.fade-out {
    animation: fadeOut var(--transition-normal) forwards;
}

.feedback-content {
    text-align: center;
    padding: 50px 40px;
    border: var(--border-width) solid;
    background: rgba(0, 0, 0, 0.95);
    max-width: 500px;
    border-radius: var(--border-radius);
    transform: scale(0.8);
    animation: feedbackAppear var(--transition-normal) forwards;
}

@keyframes feedbackAppear {
    to {
        transform: scale(1);
    }
}

.feedback-content.correct {
    border-color: var(--primary-green);
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.6);
}

.feedback-content.incorrect {
    border-color: var(--error-red);
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.6);
}

.feedback-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: feedbackIcon 0.5s ease-out;
}

@keyframes feedbackIcon {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.2) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.feedback-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.feedback-content.correct .feedback-title {
    color: var(--primary-green);
    text-shadow: 0 0 20px var(--primary-green);
}

.feedback-content.incorrect .feedback-title {
    color: var(--error-red);
    text-shadow: 0 0 20px var(--error-red);
}

.feedback-message {
    font-size: 1.2em;
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0.9;
}

.feedback-stats {
    font-size: 0.9em;
    opacity: 0.7;
    color: var(--secondary-cyan);
}

/* ==================== MAP FULLSCREEN MEJORADO ==================== */
.map-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    z-index: 9998;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn var(--transition-normal);
}

.map-fullscreen-content {
    max-width: 1400px;
    margin: 0 auto;
    animation: slideUp var(--transition-normal);
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.map-wrapper {
    border: var(--border-width) solid var(--primary-green);
    padding: 30px;
    background: rgba(0, 255, 0, 0.03);
    box-shadow: var(--shadow-glow-strong);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.map-header {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    color: var(--secondary-cyan);
    text-shadow: 0 0 20px var(--secondary-cyan);
    letter-spacing: 3px;
    animation: pulse 3s infinite;
}

.coordinates-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.coordinate-item {
    border: 1px solid var(--secondary-cyan);
    padding: 20px;
    background: rgba(0, 255, 255, 0.1);
    text-align: center;
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.coordinate-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(0, 255, 255, 0.1), transparent);
    animation: rotate 6s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.coordinate-item:hover::before {
    opacity: 1;
}

.coordinate-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 255, 255, 0.3);
}

.map-container {
    margin: 20px 0;
    border: 2px solid var(--secondary-cyan);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    background: var(--background-dark);
}

.map-iframe-fullscreen {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border: none;
    display: block;
    transition: all var(--transition-normal);
}

.map-container:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.map-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.map-actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== START SCREEN MEJORADO ==================== */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn var(--transition-normal);
}

.start-screen.fade-out {
    animation: fadeOut var(--transition-normal) forwards;
}

.start-content {
    text-align: center;
    max-width: 800px;
    padding: 50px 40px;
    border: var(--border-width) solid var(--primary-green);
    background: rgba(0, 255, 0, 0.03);
    box-shadow: var(--shadow-glow-strong);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.start-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(0, 255, 0, 0.1), transparent);
    animation: rotate 8s linear infinite;
}

.start-title {
    font-size: 2.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 20px var(--primary-green);
    letter-spacing: 3px;
    animation: titlePulse 3s infinite;
    position: relative;
    z-index: 1;
}

@keyframes titlePulse {
    0%, 100% { 
        text-shadow: 0 0 30px var(--primary-green);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 50px var(--primary-green), 0 0 80px var(--primary-green);
        transform: scale(1.05);
    }
}

.start-subtitle {
    font-size: 1.3em;
    color: var(--secondary-cyan);
    margin-bottom: 30px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.start-terminal {
    background: var(--background-dark);
    border: 1px solid var(--primary-green);
    padding: 25px;
    margin: 30px 0;
    text-align: left;
    border-radius: var(--border-radius);
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
    position: relative;
    z-index: 1;
}

.start-terminal .terminal-line {
    margin: 12px 0;
    font-size: 0.95em;
    animation: typeIn 0.5s ease-out;
}

.btn-start {
    font-size: 1.4em;
    padding: 25px 60px;
    margin: 30px 0;
    animation: startButtonPulse 2s infinite;
    position: relative;
    z-index: 1;
    background: rgba(0, 255, 0, 0.1);
    box-shadow: var(--shadow-glow);
}

@keyframes startButtonPulse {
    0%, 100% { 
        box-shadow: var(--shadow-glow);
        transform: scale(1);
    }
    50% { 
        box-shadow: var(--shadow-glow-strong), 0 0 40px rgba(0, 255, 0, 0.8);
        transform: scale(1.05);
    }
}

.btn-arrow {
    display: inline-block;
    margin-right: 15px;
    animation: arrowBounce 1.5s infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

.start-footer {
    margin-top: 30px;
    font-size: 1em;
    color: var(--primary-green);
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

.start-footer small {
    display: block;
    margin-top: 10px;
    font-size: 0.8em;
    color: var(--secondary-cyan);
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: rgba(0, 0, 0, 0.95);
    border: var(--border-width) solid;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    z-index: 10001;
    transition: right var(--transition-normal);
    max-width: 350px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.notification.show {
    right: 20px;
}

.notification-info {
    border-color: var(--secondary-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.notification-success {
    border-color: var(--primary-green);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.notification-error {
    border-color: var(--error-red);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
}

.notification-warning {
    border-color: var(--warning-yellow);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.3);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.2em;
    font-weight: bold;
}

.notification-info .notification-icon {
    color: var(--secondary-cyan);
}

.notification-success .notification-icon {
    color: var(--primary-green);
}

.notification-error .notification-icon {
    color: var(--error-red);
}

.notification-warning .notification-icon {
    color: var(--warning-yellow);
}

/* ==================== RADAR ANIMATION ÉPICA ==================== */
.radar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0%, rgba(0, 20, 0, 0.95) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: radarFadeIn 0.5s ease-in;
}

.radar-overlay.zoom-out {
    animation: epicZoomOut 1s ease-in forwards;
}

@keyframes radarFadeIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes epicZoomOut {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% { 
        transform: scale(3);
        opacity: 0;
    }
}

.radar-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.radar-title {
    font-size: 2.5em;
    color: var(--primary-green);
    margin-bottom: 30px;
    text-shadow: 0 0 30px var(--primary-green);
    letter-spacing: 5px;
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    from { 
        text-shadow: 0 0 30px var(--primary-green);
        transform: scale(1);
    }
    to { 
        text-shadow: 0 0 50px var(--primary-green), 0 0 80px var(--primary-green);
        transform: scale(1.05);
    }
}

.radar-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 30px auto;
    border: 3px solid var(--primary-green);
    border-radius: 50%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 255, 0, 0.1) 70%);
    animation: radarPulse 3s infinite;
}

@keyframes radarPulse {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 60px rgba(0, 255, 0, 0.8), 0 0 100px rgba(0, 255, 0, 0.3);
        transform: scale(1.02);
    }
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 48%;
    background: linear-gradient(to top, var(--primary-green), transparent);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    animation: radarSweepEpic 1.5s linear infinite;
    box-shadow: 0 0 20px var(--primary-green);
}

@keyframes radarSweepEpic {
    from { transform: translate(-50%, -100%) rotate(0deg); }
    to { transform: translate(-50%, -100%) rotate(360deg); }
}

.radar-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.radar-circle {
    position: absolute;
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 50%;
    animation: radarRings 4s ease-in-out infinite;
}

.radar-circle:nth-child(1) {
    top: 37.5%;
    left: 37.5%;
    width: 25%;
    height: 25%;
    animation-delay: 0s;
}

.radar-circle:nth-child(2) {
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    animation-delay: 0.3s;
}

.radar-circle:nth-child(3) {
    top: 12.5%;
    left: 12.5%;
    width: 75%;
    height: 75%;
    animation-delay: 0.6s;
}

.radar-circle:nth-child(4) {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation-delay: 0.9s;
}

@keyframes radarRings {
    0%, 100% { 
        opacity: 0.4;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--primary-green);
    animation: centerPulse 1s infinite;
}

@keyframes centerPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px var(--primary-green);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.5);
        box-shadow: 0 0 40px var(--primary-green);
    }
}

.radar-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid var(--error-red);
    transform: translate(-50%, -50%);
    animation: reticleZoom 2s ease-in-out 1.8s forwards;
    opacity: 0;
}

@keyframes reticleZoom {
    0% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-color: var(--warning-yellow);
    }
    30% {
        opacity: 1;
        border-color: var(--warning-yellow);
    }
    60% {
        border-color: var(--accent-magenta);
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 1;
        border-color: var(--error-red);
        box-shadow: 0 0 30px var(--error-red);
    }
}

.reticle-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid;
    border-color: inherit;
}

.reticle-corner:nth-child(1) {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
}

.reticle-corner:nth-child(2) {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
}

.reticle-corner:nth-child(3) {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
}

.reticle-corner:nth-child(4) {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
}

.radar-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8em;
    color: var(--error-red);
    text-shadow: 0 0 20px var(--error-red);
    animation: statusAlert 0.8s ease-in-out 3.5s infinite;
    opacity: 0;
}

@keyframes statusAlert {
    0%, 100% { 
        opacity: 0;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
        color: var(--primary-green);
        text-shadow: 0 0 30px var(--primary-green);
    }
}

.scanning-text {
    margin-top: 40px;
    font-size: 1.2em;
    color: var(--secondary-cyan);
}

.scan-line {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.5s ease;
    margin: 8px 0;
    text-shadow: 0 0 10px var(--secondary-cyan);
}

.radar-blip {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--secondary-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: blipEpic 0.8s ease-out;
    box-shadow: 0 0 20px var(--secondary-cyan);
}

@keyframes blipEpic {
    0% {
        opacity: 0;
        transform: scale(0);
        background: var(--warning-yellow);
    }
    30% {
        opacity: 1;
        transform: scale(2);
        background: var(--secondary-cyan);
    }
    70% {
        opacity: 0.8;
        transform: scale(1.5);
        background: var(--primary-green);
    }
    100% {
        opacity: 0;
        transform: scale(1);
        background: var(--primary-green);
    }
}
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn var(--transition-normal);
}

.fade-out {
    animation: fadeOut var(--transition-normal) forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

.blink {
    animation: blink 1.5s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    to { 
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

/* ==================== RESPONSIVE DESIGN MEJORADO ==================== */

/* Tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .lh-game-wrapper,
    .container {
        max-width: 95%;
        padding: 0 20px;
    }
    
    .coordinates-display {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .final-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .challenge-actions,
    .final-actions,
    .map-actions {
        gap: 10px;
    }
    
    .start-title {
        font-size: 2.8em;
    }
    
    .loading-title {
        font-size: 2em;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }
    
    .container,
    .lh-game-wrapper,
    .lh-game-container {
        max-width: 100%;
        margin: 0;
    }
    
    .header,
    .game-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .header h1,
    .header-title {
        font-size: 1.8em;
        letter-spacing: 1px;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .challenge-container {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .challenge-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .challenge-text,
    .challenge-question {
        font-size: 1.1em;
    }
    
    .options-container {
        gap: 8px;
    }
    
    .option,
    .option-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .option:hover,
    .option-btn:hover {
        transform: translateX(5px);
    }
    
    .file-upload {
        padding: 30px 20px;
    }
    
    .file-upload-icon {
        font-size: 2.5em;
    }
    
    .btn,
    .button {
        width: 100%;
        margin: 8px 0;
        padding: 12px 20px;
        font-size: 0.9em;
    }
    
    .challenge-actions,
    .final-actions,
    .map-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .terminal,
    .terminal-summary {
        max-height: 200px;
        padding: 15px;
        font-size: 0.85em;
    }
    
    .loading-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .loading-title {
        font-size: 1.8em;
        letter-spacing: 2px;
    }
    
    .loading-console {
        padding: 15px;
        min-height: 150px;
        font-size: 0.8em;
    }
    
    .radar-container {
        width: 150px;
        height: 150px;
    }
    
    .feedback-content {
        padding: 30px 25px;
        margin: 0 20px;
    }
    
    .feedback-title {
        font-size: 2em;
    }
    
    .feedback-message {
        font-size: 1em;
    }
    
    .map-fullscreen {
        padding: 10px;
    }
    
    .map-wrapper {
        padding: 20px 15px;
    }
    
    .map-header {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .coordinates-display {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coordinate-item {
        padding: 15px;
    }
    
    .coordinate-value {
        font-size: 1.2em;
    }
    
    .map-iframe-fullscreen {
        height: 50vh;
        min-height: 300px;
    }
    
    .map-links,
    .map-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-map {
        width: 100%;
        padding: 12px 20px;
        margin: 5px 0;
    }
    
    .start-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .start-title {
        font-size: 2.2em;
        letter-spacing: 2px;
    }
    
    .start-subtitle {
        font-size: 1.1em;
    }
    
    .start-terminal {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .start-terminal .terminal-line {
        font-size: 0.85em;
        margin: 8px 0;
    }
    
    .btn-start {
        font-size: 1.1em;
        padding: 18px 40px;
        margin: 20px 0;
    }
    
    .notification {
        right: -300px;
        max-width: 280px;
        margin: 0 10px;
    }
    
    .notification.show {
        right: 10px;
    }
    
    .final-header h2 {
        font-size: 2em;
    }
    
    .final-stats {
        flex-direction: column;
        gap: 10px;
        font-size: 1em;
    }
    
    .coordinates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coord-value {
        font-size: 1.3em;
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    body {
        padding: 5px;
        font-size: 13px;
    }
    
    .start-title {
        font-size: 1.8em;
    }
    
    .loading-title {
        font-size: 1.5em;
    }
    
    .challenge-text,
    .challenge-question {
        font-size: 1em;
    }
    
    .option,
    .option-btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .btn,
    .button {
        padding: 10px 15px;
        font-size: 0.85em;
    }
    
    .final-header h2 {
        font-size: 1.6em;
    }
    
    .map-header {
        font-size: 1.5em;
    }
    
    .coordinate-value {
        font-size: 1.1em;
    }
    
    .feedback-title {
        font-size: 1.6em;
    }
    
    .feedback-message {
        font-size: 0.9em;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
    /* Ya estamos en modo oscuro por defecto */
}

/* ==================== HIGH CONTRAST MODE ==================== */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #00ff00;
        --secondary-cyan: #00ffff;
        --error-red: #ff0000;
        --warning-yellow: #ffff00;
        --accent-magenta: #ff00ff;
    }
    
    .scanlines {
        opacity: 0.8;
    }
    
    .option:hover,
    .btn:hover {
        border-width: 3px;
    }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scanlines {
        animation: none;
        background: none;
    }
    
    .glitch-text::before,
    .glitch-text::after {
        display: none;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .scanlines,
    .loading-screen,
    .feedback-overlay,
    .start-screen {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .lh-game-wrapper {
        max-width: 100%;
    }
    
    .terminal,
    .challenge-container,
    .coordinates {
        border-color: black;
        box-shadow: none;
    }
}

/* ==================== FOCUS STYLES FOR ACCESSIBILITY ==================== */
.btn:focus,
.option:focus,
.file-upload-label:focus {
    outline: 3px solid var(--secondary-cyan);
    outline-offset: 2px;
}

/* ==================== OPTIMIZACIONES DE RENDIMIENTO ==================== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Optimizar animaciones críticas */
.progress-fill,
.loading-line,
.radar-sweep {
    will-change: transform, opacity;
}

/* GPU acceleration para animaciones complejas */
.scanlines,
.glitch-text::before,
.glitch-text::after {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==================== ESTILOS PARA RADAR FULLSCREEN AUTOMÁTICO ==================== */
.radar-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.radar-fullscreen.active {
    opacity: 1;
}

.radar-fullscreen.fade-out {
    opacity: 0;
}

.radar-fullscreen-content {
    text-align: center;
    color: var(--primary-green);
    font-family: var(--font-mono);
}

.radar-title {
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px var(--primary-green);
    letter-spacing: 2px;
}

.radar-container {
    position: relative;
    width: 300px;
    height: 300px;
    border: 2px solid var(--primary-green);
    border-radius: 50%;
    margin: 0 auto 30px;
    overflow: hidden;
}

.radar-line {
    position: absolute;
    background: var(--primary-green);
    opacity: 0.3;
}

.radar-line.horizontal {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.radar-line.vertical {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.radar-circle {
    position: absolute;
    border: 1px solid var(--primary-green);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

.radar-circle-1 { width: 80%; height: 80%; }
.radar-circle-2 { width: 60%; height: 60%; }
.radar-circle-3 { width: 40%; height: 40%; }

.radar-sweep {
    position: absolute;
    width: 2px;
    height: 50%;
    background: linear-gradient(to bottom, var(--primary-green), transparent);
    left: 50%;
    top: 50%;
    transform-origin: bottom center;
    animation: radarSweepAuto 2s linear infinite;
    will-change: transform;
}

.radar-target {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--danger-red);
    border-radius: 50%;
    top: 30%;
    left: 60%;
    transform: translate(-50%, -50%);
    display: none;
    box-shadow: 0 0 10px var(--danger-red);
    will-change: transform, opacity;
}

.radar-target.target-detected {
    display: block;
    background: var(--warning-yellow);
    box-shadow: 0 0 15px var(--warning-yellow);
    animation: targetBlinkAuto 0.5s ease-in-out infinite;
}

.radar-target.target-calculating {
    background: var(--warning-orange);
    box-shadow: 0 0 15px var(--warning-orange);
    animation: targetPulseAuto 0.3s ease-in-out infinite;
}

.radar-target.target-locked {
    background: var(--primary-green);
    box-shadow: 0 0 20px var(--primary-green);
    animation: targetLockAuto 0.2s ease-in-out 3;
}

.radar-coords {
    position: absolute;
    font-size: 0.8em;
    opacity: 0.5;
    color: var(--secondary-cyan);
}

.radar-coords-nw { top: 5px; left: 5px; }
.radar-coords-ne { top: 5px; right: 5px; }
.radar-coords-sw { bottom: 5px; left: 5px; }
.radar-coords-se { bottom: 5px; right: 5px; }

.radar-status {
    font-size: 1.2em;
    margin-bottom: 20px;
    min-height: 30px;
}

.radar-status-text {
    color: var(--secondary-cyan);
}

.radar-status-text.success {
    color: var(--primary-green);
    text-shadow: 0 0 10px var(--primary-green);
}

.radar-progress {
    width: 300px;
    margin: 0 auto;
}

.radar-progress-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.radar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-cyan));
    width: 0%;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    will-change: width;
}

/* ==================== ANIMACIONES DEL RADAR ==================== */
@keyframes radarSweepAuto {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes targetBlinkAuto {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes targetPulseAuto {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes targetLockAuto {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.5); }
}

/* ==================== ESTILOS PARA MAPA AUTOMÁTICO ==================== */
.map-header-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    border: 1px solid var(--secondary-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.map-title {
    font-size: 1.8em;
    color: var(--primary-green);
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--primary-green);
}

.map-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.leaflet-map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    background: #222;
    border: 2px solid var(--secondary-cyan);
    min-height: 400px;
}

.map-iframe-fallback {
    border-radius: 8px;
    border: none;
    background: #333;
}

/* ==================== ESTILOS LEAFLET PERSONALIZADOS ==================== */
.leaflet-popup-content {
    color: #000 !important;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.leaflet-popup-content-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-tip {
    background: #fff;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.8) !important;
    color: var(--primary-green) !important;
    font-size: 0.7em;
    border-radius: 3px;
}

.leaflet-control-attribution a {
    color: var(--secondary-cyan) !important;
}

.leaflet-control-zoom a {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: var(--primary-green) !important;
    border: 1px solid var(--primary-green) !important;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(0, 255, 0, 0.2) !important;
}

/* ==================== RESPONSIVE PARA RADAR Y MAPA ==================== */
@media (max-width: 768px) {
    .radar-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    
    .radar-container {
        width: 250px;
        height: 250px;
    }
    
    .radar-progress {
        width: 250px;
    }
    
    .map-title {
        font-size: 1.4em;
    }
    
    .leaflet-map-container {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .radar-container {
        width: 200px;
        height: 200px;
    }
    
    .radar-progress {
        width: 200px;
    }
    
    .radar-title {
        font-size: 1.2em;
    }
    
    .map-title {
        font-size: 1.2em;
    }
}