/*
 * Juego «Cruza Quito» — estilo holográfico steampunk (línea Éter Eléctrico, la misma de Curaduría
 * y la puerta de Quito Secreto). Se carga DESPUÉS de estilo.css y todo cuelga de body.juego-steam,
 * así no toca ninguna otra página. El tablero en sí lo dibuja assets/js/juego.js en el canvas;
 * aquí va todo lo que lo rodea: fondo, HUD, pantallas, botones, premio y ranking.
 * Paleta: fondo #050a10, cian #5ee6ff, ámbar #ffb056, latón #c9a24b en filos finos, verde #3ddc84.
 */

.juego-steam {
    --ju-cian: #5ee6ff;
    --ju-ambar: #ffb056;
    --ju-laton: #c9a24b;
    --ju-verde: #3ddc84;
    --ju-tenue: #a9c4cf;
    --ju-mono: 'JetBrains Mono', ui-monospace, 'DejaVu Sans Mono', 'Courier New', monospace;
    --ju-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* ---------- Fondo y cabecera ---------- */
.juego-steam.fondo-textura {
    background:
        repeating-linear-gradient(0deg, rgba(94, 230, 255, .03) 0 1px, transparent 1px 3px),
        linear-gradient(rgba(94, 230, 255, .045) 1px, transparent 1px) 0 0 / 60px 60px,
        linear-gradient(90deg, rgba(94, 230, 255, .045) 1px, transparent 1px) 0 0 / 60px 60px,
        radial-gradient(900px 520px at 80% 0%, rgba(94, 230, 255, .16), transparent 65%),
        radial-gradient(700px 520px at 0% 70%, rgba(255, 154, 60, .07), transparent 60%),
        #050a10;
}
.juego-steam .sitio-header-detalle {
    background: rgba(5, 10, 16, .82);
    border-bottom: 1px solid rgba(94, 230, 255, .35);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 1px 18px rgba(94, 230, 255, .12);
}
.juego-steam .sitio-header-detalle .volver {
    border-radius: 0;
    border: 1px solid rgba(94, 230, 255, .55);
    color: var(--ju-cian);
    background: rgba(94, 230, 255, .08);
    font-family: var(--ju-mono);
    font-size: .8rem;
    letter-spacing: .04em;
}

/* ---------- Título, subtítulo y HUD ---------- */
.juego-steam .contenedor-juego h1 {
    font-family: var(--ju-serif);
    color: #fff;
    letter-spacing: .06em;
    text-shadow: 0 0 26px rgba(94, 230, 255, .55);
}
.juego-steam .subtitulo-juego { color: #bcd2db; }
.juego-steam .juego-hud {
    justify-content: center;
    gap: 8px 10px;
    font-family: var(--ju-mono);
    font-weight: 600;
    font-size: .76rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.juego-steam .juego-hud span {
    padding: 9px 12px;
    background: linear-gradient(180deg, rgba(94, 230, 255, .12), rgba(5, 10, 16, .8));
    border: 1px solid rgba(94, 230, 255, .4);
    color: #cdf8ff;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.juego-steam #juego-nivel { color: var(--ju-ambar); border-color: rgba(255, 176, 86, .45); }
.juego-steam .wrap-btn-compartir-juego .btn {
    border-radius: 0;
    border: 1px solid rgba(94, 230, 255, .4);
    color: var(--ju-tenue);
    background: transparent;
    font-family: var(--ju-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* ---------- Marco del tablero: cielo con estrellas y el ovni de fiesta ---------- */
.juego-steam .juego-canvas-wrap {
    border: 1px solid rgba(94, 230, 255, .45);
    box-shadow: 0 0 0 1px #000, 0 0 30px rgba(94, 230, 255, .22), inset 0 0 40px rgba(94, 230, 255, .05);
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='190' height='190'><g fill='%23cdf8ff'><circle cx='14' cy='31' r='1.1' opacity='.5'/><circle cx='63' cy='9' r='.8' opacity='.35'/><circle cx='112' cy='48' r='1.3' opacity='.55'/><circle cx='151' cy='17' r='.9' opacity='.4'/><circle cx='39' cy='84' r='1' opacity='.45'/><circle cx='175' cy='75' r='1.2' opacity='.3'/><circle cx='88' cy='117' r='.8' opacity='.5'/><circle cx='22' cy='146' r='1.2' opacity='.35'/><circle cx='133' cy='156' r='1' opacity='.45'/><circle cx='169' cy='128' r='.7' opacity='.55'/><circle cx='58' cy='172' r='.9' opacity='.3'/><circle cx='104' cy='83' r='.7' opacity='.3'/></g></svg>") repeat,
        linear-gradient(180deg, #081420 0%, #050c13 70%, #050a10 100%);
}
/* Ovni con dos aliens de fiesta (el dibujo está en juego.php). Todo se mueve aquí, con CSS,
   en clave sutil: movimientos lentos y cortos, colores suaves, para que acompañe sin distraer del juego. */
.ovni-juego {
    position: absolute;
    top: 14px;
    left: 50%;
    width: 190px;
    margin-left: -78px;
    pointer-events: none;
    opacity: .92;
    animation: ov-flota 10s ease-in-out infinite alternate;
}
.ovni-juego svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes ov-flota {
    0% { transform: translate(0, 0) rotate(-1deg); }
    50% { transform: translate(-14px, 5px) rotate(.8deg); }
    100% { transform: translate(-28px, 2px) rotate(-.5deg); }
}

/* Los aliens se mecen suave, cada uno a contratiempo del otro */
.ov-alien { transform-box: fill-box; transform-origin: 50% 100%; animation: ov-baile 1.2s ease-in-out infinite alternate; }
.ov-alien-b { animation-direction: alternate-reverse; }
@keyframes ov-baile {
    0% { transform: translateY(0) rotate(-3deg); }
    100% { transform: translateY(-1.2px) rotate(3deg); }
}
/* Brazos arriba con un vaivén corto (giran desde el hombro) */
.ov-brazo { transform-box: fill-box; animation: 1.2s ease-in-out infinite alternate; }
.ov-brazo-i { transform-origin: 100% 100%; animation-name: ov-brazo-i; }
.ov-brazo-d { transform-origin: 0% 100%; animation-name: ov-brazo-d; }
.ov-alien-b .ov-brazo { animation-delay: -.6s; }
@keyframes ov-brazo-i { 0% { transform: rotate(-7deg); } 100% { transform: rotate(5deg); } }
@keyframes ov-brazo-d { 0% { transform: rotate(7deg); } 100% { transform: rotate(-5deg); } }

/* Haz de luz: cian, rosa y verde se funden despacio, sin destellos */
.ov-haz { opacity: 0; animation: ov-haz 9s ease-in-out infinite; }
.ov-haz-1 { animation-delay: -6s; }
.ov-haz-2 { animation-delay: -3s; }
.ov-haz-3 { animation-delay: 0s; }
@keyframes ov-haz {
    0% { opacity: 0; }
    20%, 33% { opacity: .42; }
    53%, 100% { opacity: 0; }
}

/* Luces del borde: respiran en cadena, sin apagarse del todo */
.ov-luz { opacity: .55; animation: ov-luz 3.5s ease-in-out infinite; }
.ov-l1 { animation-delay: 0s; }
.ov-l2 { animation-delay: -3s; }
.ov-l3 { animation-delay: -2.5s; }
.ov-l4 { animation-delay: -2s; }
.ov-l5 { animation-delay: -1.5s; }
.ov-l6 { animation-delay: -1s; }
.ov-l7 { animation-delay: -.5s; }
@keyframes ov-luz {
    0%, 100% { opacity: .5; }
    50% { opacity: .95; }
}

/* Destellos de la bola de discoteca y sus reflejos de color sobre el cristal */
.ov-destello { animation: ov-destello 2.2s ease-in-out infinite alternate; }
.ov-d2 { animation-delay: -1.1s; }
.ov-d3 { animation-delay: -.5s; animation-duration: 3s; }
.ov-d4 { animation-delay: -1.6s; animation-duration: 2.6s; }
.ov-d5 { animation-delay: -1.2s; animation-duration: 3.4s; }
@keyframes ov-destello { 0% { opacity: .1; } 100% { opacity: .6; } }

/* Dos notas musicales que suben despacio y se desvanecen */
.ov-nota { opacity: 0; animation: ov-nota 5s ease-out infinite; }
.ov-n2 { animation-delay: -2.5s; }
@keyframes ov-nota {
    0% { transform: translate(0, 3px); opacity: 0; }
    25% { opacity: .6; }
    100% { transform: translate(3px, -12px); opacity: 0; }
}

/* Unos pocos papelitos de confeti que caen lento */
.ov-conf { transform-box: fill-box; transform-origin: center; opacity: 0; animation: ov-conf 4.5s linear infinite; }
.ov-c3 { animation-delay: -1.5s; }
.ov-c5 { animation-delay: -3s; }
@keyframes ov-conf {
    0% { transform: translate(0, -4px) rotate(0); opacity: 0; }
    20% { opacity: .55; }
    100% { transform: translate(3px, 18px) rotate(180deg); opacity: 0; }
}

/* ---------- Pantallas de inicio y fin ---------- */
.juego-steam .juego-overlay { background: rgba(5, 10, 16, .87); backdrop-filter: blur(3px); }
.juego-steam .juego-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 3px);
}
.juego-steam .juego-overlay > * { position: relative; }
.juego-steam .juego-instrucciones {
    font-family: var(--ju-mono);
    font-size: .8rem !important;
    color: #cdf8ff !important;
    letter-spacing: .04em;
    line-height: 2;
}
.juego-steam .juego-overlay h2 {
    font-family: var(--ju-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #eaffff;
    text-shadow: -1.5px 0 rgba(255, 80, 120, .55), 1.5px 0 rgba(94, 230, 255, .9), 0 0 14px rgba(94, 230, 255, .8);
}
.juego-steam .etiqueta-color-rana {
    font-family: var(--ju-mono);
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ju-cian);
}
.juego-steam .swatch-rana {
    border-radius: 0;
    border: 1px solid rgba(94, 230, 255, .5);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
/* La paleta nueva de la rana autómata: verde, cobre, ámbar y cian */
.juego-steam .swatch-rana-verde { background: #3ddc84; }
.juego-steam .swatch-rana-roja { background: #ff6a3c; }
.juego-steam .swatch-rana-amarilla { background: #ffb056; }
.juego-steam .swatch-rana-negra { background: #5ee6ff; border-color: rgba(94, 230, 255, .5); }
.juego-steam .swatch-rana.activo { border-color: #fff; outline: 2px solid var(--ju-cian); outline-offset: 2px; transform: scale(1.08); }
.juego-steam #btn-iniciar-juego {
    min-height: 54px;
    min-width: 220px;
    border: 0;
    border-radius: 0;
    background: var(--ju-verde);
    color: #04170c;
    font-family: var(--ju-mono);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .06em;
    text-transform: uppercase;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.juego-steam #btn-iniciar-juego:hover { background: #55e99a; }
.juego-steam #puntaje-final { color: var(--ju-ambar); text-shadow: 0 0 12px rgba(255, 176, 86, .6); }
.juego-steam #form-puntaje input {
    background: rgba(5, 10, 16, .85);
    border: 1px solid rgba(94, 230, 255, .4);
    border-radius: 0;
    color: #e6fbff;
    font-family: var(--ju-mono);
    font-size: 14px;
    caret-color: var(--ju-cian);
}
.juego-steam #form-puntaje input:focus-visible { outline: 2px solid var(--ju-cian); outline-offset: 1px; }
.juego-steam #form-puntaje .btn-primario {
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #ffc27a, #f08a24);
    color: #1d0f02;
    font-family: var(--ju-mono);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .05em;
    text-transform: uppercase;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.juego-steam #btn-jugar-de-nuevo {
    border-radius: 0;
    border: 1px solid rgba(94, 230, 255, .5);
    background: transparent;
    color: var(--ju-cian);
    font-family: var(--ju-mono);
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.juego-steam .aviso-puntaje-guardado { color: var(--ju-verde); font-family: var(--ju-mono); }

/* ---------- Controles táctiles ---------- */
.juego-steam .juego-controles-touch button {
    border-radius: 0;
    border: 1px solid rgba(94, 230, 255, .5);
    background: linear-gradient(180deg, rgba(94, 230, 255, .12), rgba(5, 10, 16, .7));
    color: var(--ju-cian);
    font-family: var(--ju-mono);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    box-shadow: 0 0 10px rgba(94, 230, 255, .15);
}
.juego-steam .juego-controles-touch button:active { background: rgba(94, 230, 255, .2); }
.juego-steam .control-congelar {
    background: linear-gradient(180deg, rgba(125, 211, 252, .18), rgba(5, 10, 16, .7)) !important;
    border-color: rgba(125, 211, 252, .5) !important;
    color: #9bd9ff !important;
}
.juego-steam .control-bomba {
    background: linear-gradient(180deg, rgba(255, 176, 86, .16), rgba(5, 10, 16, .7)) !important;
    border-color: rgba(255, 176, 86, .5) !important;
    color: var(--ju-ambar) !important;
}

/* ---------- Premio y ranking ---------- */
.juego-steam .seccion-destacados h2 {
    font-family: var(--ju-mono);
    font-size: 1rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ju-cian);
}
.juego-steam .tarjeta-premio-juego {
    position: relative;
    background: linear-gradient(180deg, rgba(94, 230, 255, .08), rgba(5, 10, 16, .7));
    border: 1px solid rgba(94, 230, 255, .35);
    border-radius: 0;
    overflow: hidden;
}
.juego-steam .tarjeta-premio-juego::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ju-cian), transparent);
}
.juego-steam .imagen-premio-principal, .juego-steam .imagen-premio-secundaria { border-radius: 0; }
.juego-steam .marca-premio strong { color: var(--ju-ambar); }
.juego-steam .lista-ranking li { font-family: var(--ju-mono); font-size: .85rem; color: #bcd2db; }
.juego-steam .lista-ranking li strong { color: var(--ju-ambar); }

/* ---------- Quien pide menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
    .ovni-juego, .ovni-juego * { animation: none !important; }
    /* quieto, pero sigue de fiesta: el haz cian encendido, las luces y las notas visibles */
    .ov-haz-1 { opacity: .35; }
    .ov-nota, .ov-conf { opacity: .5; }
}
