/* ===========================
        LOCAL FONTS
   =========================== */
@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/IBM_Plex_Mono/IBMPlexMono-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VT323';
    src: url('../fonts/VT323/VT323-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===========================
   RESET AND BASIC CONFIGURATION
   =========================== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: "IBM Plex Mono", monospace;
    background-color: #000000;
    color: #A7F2EC;
    line-height: 1.6;
    position: relative;
}

/* ===========================
        WEBGL FILTER
   =========================== */
#webgl-filter-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
    opacity: 1;
}

#webgl-filter-container canvas {
    width: 100%;
    height: 100%;
}

/* ===========================
            RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    :root {
        --loading-bar-width: 60vw;
        --loading-bar-height: 4vh;
        --fuzzy-scale: 0.75;
        --percentage-scale: 0.8;
        --error-scale: 0.75;
    }

    #loading-content{
        width: 95vw;
    }

    #webgl-filter-container{
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    :root {
        --loading-bar-width: 75vw;
        --loading-bar-height: 3.5vh;
        --loading-bar-min-height: 28px;
        --fuzzy-scale: 0.5;
        --percentage-scale: 0.6;
        --error-scale: 0.6;
    }

    #loading-screen {
        z-index: 150; /* Aún más alto en móvil */
    }

    #loading-bar-container {
        border-width: 1.5px;
        box-shadow:
                0 0 8px rgba(0, 255, 65, 0.3),
                inset 0 0 8px rgba(0, 255, 65, 0.1);
    }

    #loading-stats {
        gap: 0.5rem;
    }

    #webgl-filter-container {
        opacity: 0.5;
    }

    #fuzzy-canvas,
    #percentage-canvas,
    .error-line {
        filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.8));
    }
}

@media (max-width: 480px) {
    :root {
        --loading-bar-width: 85vw;
        --loading-bar-height: 3vh;
        --loading-bar-min-height: 25px;
        --fuzzy-scale: 0.4;
        --percentage-scale: 0.5;
        --error-scale: 0.5;
    }

    #loading-content {
        width: 100vw;
        padding: 0 1rem;
    }

    #loading-bar-container {
        border-width: 1px;
        box-shadow:
                0 0 5px rgba(0, 255, 65, 0.3),
                inset 0 0 5px rgba(0, 255, 65, 0.1);
    }

    #loading-warning {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    #error-lines-container {
        padding: 0.5rem !important;
    }

    #webgl-filter-container {
        opacity: 0.3; /* Muy sutil en móviles pequeños */
    }
}

@media (max-width: 896px) and (orientation: landscape) {
    :root {
        --loading-bar-width: 60vw;
        --loading-bar-height: 8vh;
        --loading-bar-min-height: 30px;
    }

    #loading-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    #fuzzy-canvas {
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    :root {
        --fuzzy-scale: 0.35;
        --percentage-scale: 0.45;
        --error-scale: 0.45;
    }

    #loading-bar-container {
        min-height: 20px;
    }
}


@media (hover: none) and (pointer: coarse) {
    #fuzzy-canvas:active,
    #percentage-canvas:active,
    .error-line:active {
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #webgl-filter-container {
        display: none !important;
    }
}

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    #webgl-filter-container {
        opacity: 0.8;
    }
}