/* ═══════════════════════════════════════════════════════════════════════════
   MisterIA — THEME v2 · "Estadio Nocturno"
   ───────────────────────────────────────────────────────────────────────────
   Capa visual compartida. Se enlaza DESPUÉS del <style> propio de cada página
   para poder refinar el aspecto sin tocar la estructura ni el JavaScript.

   IMPORTANTE: este archivo solo cambia APARIENCIA (color, sombra, brillo,
   tipografía, movimiento). No modifica layout, ids, clases ni comportamiento.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. PALETA ────────────────────────────────────────────────────────── */
:root {
    /* Fondos */
    --bg-dark:        #070b16;
    --bg:             #070b16;
    --bg-deep:        #04070f;
    --bg-surface:     #111a2e;
    --surface:        #111a2e;
    --surface-hover:  #18243d;
    --bg-elevated:    #16223a;
    --bg-card:        rgba(17, 26, 46, 0.72);
    --bg-card-hover:  rgba(26, 40, 68, 0.85);

    /* Marca */
    --primary:        #22d3ee;
    --primary-deep:   #06b6d4;
    --primary-hover:  #0891b2;
    --accent:         #a3e635;
    --accent-dark:    #65a30d;
    --violet:         #8b5cf6;

    /* Semánticos */
    --danger:         #f43f5e;
    --rival:          #f43f5e;
    --success:        #10b981;
    --warning:        #fbbf24;
    --whatsapp:       #25D366;

    /* Texto */
    --text-main:      #f1f5f9;
    --text:           #f1f5f9;
    --text-muted:     #93a3bd;
    --text-dim:       #5f6f8c;

    /* Bordes y radios */
    --glass-border:   1px solid rgba(255, 255, 255, 0.10);
    --border:         1px solid rgba(255, 255, 255, 0.10);
    --radius-sm:      10px;
    --radius-md:      14px;
    --radius-lg:      20px;
    --radius-xl:      28px;

    /* Profundidad */
    --shadow:         0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg:      0 18px 50px rgba(0, 0, 0, 0.60);
    --glow-primary:   0 0 28px rgba(34, 211, 238, 0.35);
    --glow-accent:    0 0 28px rgba(163, 230, 53, 0.30);

    --ease:           cubic-bezier(0.22, 1, 0.36, 1);
    --transition:     all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── 2. FONDO AMBIENTAL ───────────────────────────────────────────────── */
/* El color base se traslada a <html> para que las capas decorativas del body
   (z-index negativo) queden visibles por debajo del contenido.               */
html {
    background-color: var(--bg-deep);
}

body {
    background-color: transparent !important;
    background-image: none !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Auroras de color: dan profundidad sin cargar la vista */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(38vw 38vw at 12% 8%,  rgba(34, 211, 238, 0.16), transparent 62%),
        radial-gradient(42vw 42vw at 88% 4%,  rgba(139, 92, 246, 0.14), transparent 60%),
        radial-gradient(46vw 46vw at 78% 92%, rgba(163, 230, 53, 0.10), transparent 62%),
        radial-gradient(50vw 50vw at 20% 88%, rgba(6, 182, 212, 0.10), transparent 65%),
        var(--bg-dark);
    animation: mi-aurora 26s ease-in-out infinite alternate;
}

@keyframes mi-aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-2%, 1.5%, 0) scale(1.06); }
    100% { transform: translate3d(2%, -1.5%, 0) scale(1.02); }
}

/* Rejilla técnica + viñeta: textura sutil de "pizarra de estadio" */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 44px 44px, 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
            mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── 3. TIPOGRAFÍA ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
    letter-spacing: -0.02em;
}

h1 { font-weight: 800; }

::selection {
    background: rgba(34, 211, 238, 0.30);
    color: #fff;
}

/* Texto con degradado de marca (utilidad opcional) */
.mi-gradient-text {
    background: linear-gradient(100deg, #ffffff 0%, #a5f3fc 45%, var(--accent) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── 4. SUPERFICIES / TARJETAS ────────────────────────────────────────── */
.box, .card {
    background: var(--bg-card);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
}

/* Filo luminoso superior: el detalle que da sensación de "cristal" */
.box::before, .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55), transparent);
    pointer-events: none;
}

.card-hover:hover {
    background: var(--bg-card-hover);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: var(--shadow-lg), var(--glow-primary);
    transform: translateY(-3px);
}

/* ─── 5. BOTONES ───────────────────────────────────────────────────────── */
button, .btn, .action-btn {
    font-family: 'Kanit', sans-serif;
    letter-spacing: 0.04em;
    transition: transform 0.15s var(--ease),
                box-shadow 0.25s var(--ease),
                filter 0.25s var(--ease),
                background 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}

button:active, .btn:active, .action-btn:active { transform: scale(0.97); }

button.primary, .btn-primary {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 55%, #6366f1 100%);
    color: #04121a;
    font-weight: 700;
    box-shadow: 0 6px 22px rgba(34, 211, 238, 0.30),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
button.primary:hover, .btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* Barrido de brillo al pasar el cursor */
button.primary::after, .btn-primary::after, .btn-glow::after {
    content: "";
    position: absolute;
    top: 0;
    left: -140%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.65s var(--ease);
    pointer-events: none;
}
button.primary:hover::after, .btn-primary:hover::after, .btn-glow:hover::after { left: 140%; }

button.secondary, .btn-secondary {
    background: rgba(163, 230, 53, 0.08);
    color: var(--accent);
    border: 1px solid rgba(163, 230, 53, 0.28);
}
button.secondary:hover, .btn-secondary:hover {
    background: rgba(163, 230, 53, 0.16);
    box-shadow: var(--glow-accent);
}

button.outline, .btn-outline {
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: var(--primary);
}
button.outline:hover, .btn-outline:hover {
    background: rgba(34, 211, 238, 0.14);
    border-color: var(--primary);
}

button.whatsapp, .btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.30);
}

button.vote-btn {
    background: linear-gradient(135deg, #a3e635 0%, #22c55e 100%);
    color: #052e16;
    box-shadow: 0 6px 22px rgba(163, 230, 53, 0.30);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.35);
}

/* ─── 6. FORMULARIOS ───────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"],
select, textarea {
    background: rgba(7, 12, 24, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(7, 12, 24, 0.92);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--primary) 50%),
        linear-gradient(135deg, var(--primary) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 2px), calc(100% - 15px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

/* ─── 7. DETALLES DE INTERFAZ ──────────────────────────────────────────── */
.player-row {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.player-row:hover {
    background: rgba(34, 211, 238, 0.07);
    border-color: rgba(34, 211, 238, 0.22);
}

.rating-badge {
    background: radial-gradient(circle at 30% 25%, #1e293b, #070b16);
    border: 1px solid rgba(163, 230, 53, 0.35);
    color: var(--accent);
    box-shadow: inset 0 0 10px rgba(163, 230, 53, 0.12);
}

.tag, .badge {
    border-radius: 6px;
    letter-spacing: 0.06em;
}

.avatar {
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.progress-bar, .vote-progress-container {
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.progress-fill, .vote-progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 14px rgba(163, 230, 53, 0.4);
}

.share-link-box {
    background: rgba(7, 12, 24, 0.8);
    border: 1px dashed rgba(34, 211, 238, 0.45);
    border-radius: var(--radius-md);
}

.modal-box {
    background: rgba(17, 26, 46, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
}

hr, .divider { border-color: rgba(255, 255, 255, 0.08); }

/* ─── 8. SCROLLBAR ─────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(34, 211, 238, 0.35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.28);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.5); }

/* ─── 9. UTILIDADES DE ENTRADA ─────────────────────────────────────────── */
@keyframes mi-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mi-rise { animation: mi-rise 0.55s var(--ease) both; }
.mi-d1 { animation-delay: 0.06s; }
.mi-d2 { animation-delay: 0.12s; }
.mi-d3 { animation-delay: 0.18s; }
.mi-d4 { animation-delay: 0.24s; }
.mi-d5 { animation-delay: 0.30s; }

/* Pulso suave para elementos "en vivo" */
@keyframes mi-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
.mi-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: mi-pulse 1.4s ease-in-out infinite;
}

/* ─── 10. ACCESIBILIDAD ────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 6px;
}
