/* =========================================================================
   pantalla-carga.css
   Pantalla de carga reutilizable: barra de progreso, tips, neblina y
   partículas de fuego. NO incluye logo ni sonido de empresa — eso vive
   en splash-empresa.css / splash-empresa.js, que solo se usa al ENTRAR
   AL JUEGO. Esta pantalla es la que se usa siempre que hay que cargar
   algo (entrada al juego, después del logo, y también al entrar a una
   partida).
   ========================================================================= */

:root {
    --pc-bg-bar: #161a20;        /* Fondo oscuro exterior de la barra */
    --pc-border-bar: #232a35;    /* Borde gris azulado exterior */
    --pc-fill-top: #2c93ff;      /* Azul claro arriba */
    --pc-fill-bottom: #0056ff;   /* Azul más oscuro abajo */
    --pc-text-outline: #000000;
    --pc-tip-yellow: #feca34;
    --pc-tip-gray: #a8a9ab;
}

#pantalla-carga {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #000;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#pantalla-carga.pc-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Marco que respeta la proporción 9:16, igual en móvil que en escritorio */
.pc-frame {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 56.25vh; /* 9/16 */
    max-height: 100vh;
    background-color: #111;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 3vh;
    box-sizing: border-box;
}

@media (min-aspect-ratio: 9/16) {
    .pc-frame {
        width: 56.25vh;
        height: 100vh;
    }
}

/* Neblina inferior */
.pc-fog-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    z-index: 1;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 20%, rgba(0,0,0,0) 100%);
}

.pc-fog, .pc-fog2 {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
    background: transparent url('https://raw.githubusercontent.com/danielstuart14/CSS_FOG_ANIMATION/master/fog1.png') repeat-x;
    background-size: contain;
    opacity: 0.6;
    animation: pc-fogAnim 40s linear infinite;
}

.pc-fog2 {
    bottom: -5%;
    height: 120%;
    background-image: url('https://raw.githubusercontent.com/danielstuart14/CSS_FOG_ANIMATION/master/fog2.png');
    opacity: 0.4;
    animation: pc-fogAnim 30s linear infinite reverse;
}

@keyframes pc-fogAnim {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* Canvas de partículas de fuego */
.pc-fire-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* UI: título, barra y tip */
.pc-ui-container {
    position: relative;
    z-index: 10;
    width: 85%;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-title {
    color: white;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    font-weight: 900;
    text-shadow:
        -2px -2px 0 var(--pc-text-outline),
         2px -2px 0 var(--pc-text-outline),
        -2px  2px 0 var(--pc-text-outline),
         2px  2px 0 var(--pc-text-outline),
         0px  3px 0 var(--pc-text-outline);
}

.pc-title.pc-error {
    color: #ff6b6b;
}

.pc-progress-wrapper {
    background-color: var(--pc-bg-bar);
    border: 3px solid var(--pc-border-bar);
    border-radius: 12px;
    padding: 3px;
    height: 35px;
    position: relative;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.6), 0 5px 15px rgba(0,0,0,0.5);
}

.pc-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 6px;
    background: linear-gradient(to bottom, var(--pc-fill-top) 0%, var(--pc-fill-bottom) 100%);
    border-top: 2px solid rgba(255, 255, 255, 0.4);
    box-sizing: border-box;
    transition: width 0.1s ease-out;
    position: relative;
    overflow: hidden;
}

.pc-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    animation: pc-shine 2s infinite linear;
}

@keyframes pc-shine {
    100% { left: 200%; }
}

.pc-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow:
        -1px -1px 0 var(--pc-text-outline),
         1px -1px 0 var(--pc-text-outline),
        -1px  1px 0 var(--pc-text-outline),
         1px  1px 0 var(--pc-text-outline),
         0px  2px 2px rgba(0,0,0,0.8);
    z-index: 2;
}

.pc-tip-container {
    margin-top: 2px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
}

.pc-tip-label {
    color: var(--pc-tip-yellow);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
}

.pc-tip-text {
    color: var(--pc-tip-gray);
    text-transform: uppercase;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.9);
    transition: opacity 0.5s ease;
}

@media (max-width: 350px) {
    .pc-title { font-size: 0.9rem; }
    .pc-progress-wrapper { height: 32px; }
    .pc-progress-text { font-size: 1.1rem; }
    .pc-tip-container { font-size: 0.7rem; }
}
