/* ==========================================================================
   TRUCACHO GD - PANTALLA DE CARGA (js/sistemas/carga.js)  [2026-11-19]
   Cartel de CARGANDO entre niveles + barra en la portada. Solo transform/opacity: liviano en celular.
   ========================================================================== */
#tg-cargando {
    position: absolute; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 45%, #3a1d0e 0%, #140805 70%, #070302 100%);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .25s ease, visibility 0s linear .25s;
    font-family: var(--tg-fuente-titulo, 'Arial Black', sans-serif);
    color: #ffe9b8;
}
#tg-cargando.tg-visible { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease; }
.tg-carga-centro { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vh, 14px); width: min(70%, 460px); }

/* tres cartas que se barajan */
.tg-carga-mazo { position: relative; width: clamp(46px, 9vh, 78px); aspect-ratio: 300 / 470; margin-bottom: 6px; }
.tg-carga-mazo i {
    position: absolute; inset: 0; border-radius: 8%;
    background: #b3202a url('../img/cartas/dorso.png') center / cover no-repeat;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 233, 184, .85);
    animation: tgCargaBaraja 1.5s cubic-bezier(.5, 0, .3, 1) infinite;
    will-change: transform;
}
.tg-carga-mazo i:nth-child(2) { animation-delay: .5s; }
.tg-carga-mazo i:nth-child(3) { animation-delay: 1s; }
@keyframes tgCargaBaraja {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    30% { transform: translate(-70%, -6%) rotate(-14deg); }
    60% { transform: translate(70%, -6%) rotate(14deg); }
}

.tg-carga-titulo {
    font-size: clamp(20px, 5vh, 40px); letter-spacing: .08em;
    color: #ffd23f; text-shadow: 0 3px 0 #7a2a12, 0 0 18px rgba(255, 170, 40, .35);
}
.tg-carga-titulo span { display: inline-block; animation: tgCargaPunto 1.2s ease-in-out infinite; }
.tg-carga-titulo span:nth-child(2) { animation-delay: .2s; }
.tg-carga-titulo span:nth-child(3) { animation-delay: .4s; }
@keyframes tgCargaPunto { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-25%); } }

.tg-carga-lugar { font-size: clamp(11px, 2.4vh, 18px); letter-spacing: .14em; color: #e8c9a0; opacity: .85; text-align: center; }

.tg-carga-barra, .tg-intro-barra {
    position: relative; width: 100%; height: clamp(8px, 1.6vh, 12px); border-radius: 99px; overflow: hidden;
    background: rgba(0, 0, 0, .55); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .8), 0 0 0 2px rgba(255, 210, 63, .45);
}
.tg-carga-barra b, .tg-intro-barra b {
    position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0);
    background: linear-gradient(90deg, #f39c12, #ffd23f 60%, #fff3b0);
    transition: transform .2s ease-out;
}
.tg-carga-pct { font-size: clamp(11px, 2.2vh, 16px); color: #ffd23f; opacity: .9; }

/* portada: la barra aparece debajo de "CARGANDO… N%" y se va cuando está todo */
.tg-intro-barra { width: min(60vw, 420px); margin: 10px auto 0; transition: opacity .4s ease; }
.tg-intro-barra.tg-lista { opacity: 0; }
#intro-screen.tg-intro-cargando { cursor: progress; }
#intro-screen.tg-intro-cargando .texto-continuar { animation: none; opacity: .9; }

/* ==========================================================================
   RENDIMIENTO: calidad LIVIANA (js/sistemas/rendimiento.js pone html.tg-liviano)
   Saca lo que más le cuesta a un celular modesto sin cambiar el dibujo: desenfoques de lo que hay detrás
   (backdrop-filter) y la doble sombra difusa del mazo. Las partículas se reducen desde js/sistemas/vida.js.
   ========================================================================== */
html.tg-liviano *, html.tg-liviano *::before, html.tg-liviano *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.tg-liviano #mesa-juego-screen > img { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .8)) !important; }

/* ==========================================================================
   RELLENO DE LOS COSTADOS (js/sistemas/carga.js → vigilarRelleno)
   Con la mesa a la vista, lo que sobra alrededor del escenario 16:9 muestra el fondo del nivel desenfocado y oscuro.
   ========================================================================== */
html.tg-en-mesa body::before {
    content: ''; position: fixed; inset: -60px; z-index: -1; pointer-events: none;
    background: #000 var(--tg-relleno, none) center / cover no-repeat;
    filter: blur(22px) brightness(.38) saturate(1.15);
}
html.tg-en-mesa #pantalla-juego { box-shadow: 0 0 40px 10px rgba(0, 0, 0, .85); }
/* el negro va en <html> y el <body> queda transparente: con el zoom de la versión celular (html.tg-zoom) el fondo negro del body
   quedaba arriba del relleno */
html.tg-en-mesa { background: #000; }
html.tg-en-mesa body { background: transparent; }

/* Portada en pantallas bajas (celular apaisado): el logo de Bola Ocho medía más que la pantalla y "HACÉ CLICK PARA CONTINUAR"
   quedaba encima de "Gaming". Ahora el logo nunca pasa del 58% del alto y el texto se achica con la pantalla. */
#intro-screen .img-intro-chica { width: min(550px, 55%); height: auto; max-height: 58%; object-fit: contain; margin-bottom: 7%; }
#intro-screen .texto-continuar { font-size: clamp(1.05rem, 5.6vh, 2.2rem); }
#intro-screen .derechos-pochin { font-size: clamp(.7rem, 2.6vh, .95rem); }
#intro-screen .contenido-intro { padding-bottom: clamp(12px, 5vh, 40px); }

/* en pantallas bajas el rótulo de versión de la barra inferior se montaba sobre "Todos los Derechos Reservados" */

/* portada: mientras carga se ve "CARGANDO… N%"; después, el texto de siempre */
#intro-screen .tg-txt-cargando { display: none; }
#intro-screen.tg-intro-cargando .tg-txt-cargando { display: inline; }
#intro-screen.tg-intro-cargando .tg-txt-listo { display: none; }
#intro-screen .tg-pct { font-style: normal; }
