/* =============================================
   BASE.CSS — variables, reset, body, keyframes,
   scanline, container, loading, screen, title
   ============================================= */

:root {
    --pixel-bg: #0f0f23;
    --pixel-primary: #00ff41;
    --pixel-secondary: #ff00ff;
    --pixel-accent: #00ffff;
    --pixel-warning: #ffff00;
    --pixel-danger: #ff0055;
    --pixel-text: #c7c7c7;
    --pixel-locked: #ff6b6b;
    --pixel-unlocked: #51cf66;
    /* Control de fuente — modificado por font-control.js */
    --font-scale: 1;
    font-size: calc(16px * var(--font-scale));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

body {
    font-family: 'VT323', monospace;
    background: var(--pixel-bg);
    color: var(--pixel-text);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(100px);
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 9998;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pixel-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#loading-screen.hidden {
    display: none;
}

.loading-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--pixel-primary);
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#mode-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.title-pixel {
    font-family: 'Press Start 2P', cursive;
    font-size: min(2.5rem, 40px);
    color: var(--pixel-primary);
    text-shadow: 0 0 10px var(--pixel-primary), 0 0 20px var(--pixel-primary), 4px 4px 0 rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    line-height: 1.5;
    animation: glow 2s ease-in-out infinite alternate;
    word-break: break-word;
    overflow-wrap: break-word;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px var(--pixel-primary), 0 0 20px var(--pixel-primary), 4px 4px 0 rgba(0, 0, 0, 0.5);
    }

    to {
        text-shadow: 0 0 20px var(--pixel-primary), 0 0 40px var(--pixel-primary), 4px 4px 0 rgba(0, 0, 0, 0.5);
    }
}

@keyframes flashIn {
    0%   { opacity: 0; transform: scale(1.4); }
    60%  { opacity: 1; transform: scale(1.05); }
    100% { transform: scale(1); }
}

.subtitle-pixel {
    font-size: 1.3rem;
    color: var(--pixel-accent);
    margin-bottom: 3rem;
}

.mode-buttons {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Eliminate 300ms tap delay on all interactive elements */
button, a, input, select, textarea, [onclick] {
    touch-action: manipulation;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(0, 255, 65, 0.1);
    border: 3px solid var(--pixel-primary);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* =============================================
   BASE RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .container {
        padding: 0.8rem;
    }
    .screen-header {
        padding: 0.8rem 1rem;
        margin-bottom: 1rem;
    }
    #mode-selector {
        padding: 1rem;
    }
    .subtitle-pixel {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    .mode-buttons {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    .mode-buttons .btn-pixel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    .screen-header {
        padding: 0.6rem 0.8rem;
    }
}
