/* ===========================================================
   Cobblemon Tournaments — sistema de diseño
   Paleta adaptada al logo: negro/carbón (fondo header/oscuro),
   gris acero (superficies medias/texto secundario), rojo (acento
   primario, del pokeball del logo), granate (acento secundario /
   vs / alertas), blanco hueso (fondo de contenido), casi-negro (texto).
   Tipografía: Baloo 2 (display, redondeada y con peso), Inter (texto
   de lectura/forms), JetBrains Mono (datos: usuarios, marcadores, IDs).
   =========================================================== */

:root {
    --bosque: #141414;
    --bosque-2: #202020;
    --musgo: #5c6167;
    --hierba: #dc2626;
    --hierba-fuerte: #b91c1c;
    --brasa: #8a1c1c;
    --brasa-suave: #e8b4b0;
    --crema: #f5f5f4;
    --crema-2: #e7e5e4;
    --tinta: #181818;
    --tinta-suave: #6b6f76;
    --borde: rgba(20, 20, 20, 0.14);
    --sombra: 0 6px 20px rgba(20, 20, 20, 0.12);
    --radio: 16px;
    --radio-chico: 10px;
    --oro: #ca8a04;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--crema);
    background-image: radial-gradient(circle at 1px 1px, rgba(28, 25, 23, 0.07) 1px, transparent 0);
    background-size: 26px 26px;
    background-attachment: fixed;
    color: var(--tinta);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 780px) {
    body {
        /* background-attachment: fixed da problemas de rendimiento/render en Safari iOS */
        background-attachment: scroll;
    }
}

h1, h2, h3, h4 {
    font-family: 'Baloo 2', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.5em;
    color: var(--bosque);
}

a {
    color: var(--musgo);
    text-decoration: none;
}

a:hover {
    color: var(--hierba-fuerte);
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

:focus-visible {
    outline: 3px solid var(--brasa);
    outline-offset: 2px;
}

/* ---------- Layout general ---------- */

.site-header {
    background: linear-gradient(180deg, var(--bosque) 0%, var(--bosque-2) 100%);
    color: var(--crema);
    padding: 18px 24px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: var(--sombra);
}

.site-header .wrap {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--crema);
}

.brand:hover {
    color: var(--hierba);
}

.brand-mark-img {
    height: 52px;
    width: auto;
    flex: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--crema-2);
}

.site-nav a:hover {
    color: var(--hierba);
}

.site-nav .btn {
    color: var(--crema);
}

.site-nav .btn:hover {
    color: var(--crema);
}

.nav-user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: var(--hierba);
    font-family: 'Baloo 2', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.nav-user:hover {
    color: var(--crema);
}

.nav-caret {
    font-size: 0.65em;
    transition: transform 0.15s ease;
}

.nav-user[aria-expanded="true"] .nav-caret {
    transform: rotate(180deg);
}

.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #fff;
    border-radius: var(--radio-chico);
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
    min-width: 175px;
    padding: 6px;
    z-index: 30;
    display: flex;
    flex-direction: column;
}

.nav-user-dropdown[hidden] {
    display: none;
}

.nav-user-dropdown a {
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--tinta);
    font-size: 0.9rem;
}

.nav-user-dropdown a:hover {
    background: var(--crema);
    color: var(--musgo);
}

/* ---------- Campana de notificaciones ---------- */

.nav-notif-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--crema-2);
}

.nav-notif-btn:hover {
    color: var(--hierba);
}

.nav-notif-label {
    display: none;
}

.nav-notif-badge {
    position: absolute;
    top: -3px;
    right: -7px;
    background: var(--brasa);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--bosque);
}

.nav-notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -8px;
    background: #fff;
    border-radius: var(--radio-chico);
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: 420px;
    overflow-y: auto;
    z-index: 30;
}

.nav-notif-dropdown[hidden] {
    display: none;
}

.nav-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--borde);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    color: var(--tinta);
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: #fff;
}

.nav-notif-header a {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--musgo);
}

.nav-notif-vacio {
    padding: 20px 14px;
    text-align: center;
    color: var(--tinta-suave);
    font-size: 0.85rem;
    margin: 0;
}

.nav-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--crema-2);
    color: var(--tinta);
}

.nav-notif-item:last-child {
    border-bottom: none;
}

.nav-notif-item:hover {
    background: var(--crema);
    color: var(--tinta);
}

.nav-notif-item-no-leida {
    background: rgba(220, 38, 38, 0.06);
}

.nav-notif-icono {
    flex: none;
    font-size: 1.1rem;
    line-height: 1.3;
}

.nav-notif-texto {
    font-size: 0.82rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-notif-texto small {
    color: var(--tinta-suave);
    font-size: 0.72rem;
}

/* ---------- Página /notificaciones.php ---------- */

.notif-lista {
    display: flex;
    flex-direction: column;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 6px;
    border-bottom: 1px solid var(--crema-2);
    color: var(--tinta);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    color: var(--tinta);
}

.notif-item-no-leida {
    background: rgba(220, 38, 38, 0.05);
    border-radius: var(--radio-chico);
}

.notif-icono {
    flex: none;
    font-size: 1.3rem;
    margin-top: 2px;
}

.notif-cuerpo {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notif-mensaje {
    font-size: 0.92rem;
}

.notif-fecha {
    font-size: 0.75rem;
    color: var(--tinta-suave);
}

.notif-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hierba);
    margin-top: 6px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex: none;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--crema);
    border-radius: 2px;
}

@media (max-width: 820px) {
    .wrap {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .site-nav.nav-abierta {
        display: flex;
    }

    .site-nav a {
        padding: 10px 4px;
    }

    .site-nav .btn {
        width: 100%;
        justify-content: center;
        margin-top: 6px;
    }

    .nav-user-menu {
        width: 100%;
        order: -2;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
        padding: 10px 4px;
    }

    .nav-user-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0 0 0 12px;
        margin-top: 0;
        min-width: 0;
    }

    .nav-notif-menu {
        width: 100%;
        order: -1;
    }

    .nav-notif-btn {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        padding: 10px 4px;
        font-size: 1rem;
        color: var(--crema-2);
    }

    .nav-notif-label {
        display: inline;
        font-family: 'Baloo 2', sans-serif;
        font-size: 0.9rem;
    }

    .nav-notif-badge {
        position: static;
        box-shadow: none;
        margin-left: auto;
    }

    .nav-notif-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        width: 100%;
        max-width: none;
        max-height: none;
        padding: 0 0 0 12px;
        margin-top: 0;
    }

    .nav-notif-header {
        position: static;
    }
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

main > section:last-child {
    margin-bottom: 0;
}

.site-footer {
    background: linear-gradient(180deg, var(--bosque) 0%, var(--bosque-2) 100%);
    color: var(--crema-2);
    margin-top: 40px;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 32px;
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.footer-logo-link:hover {
    color: var(--hierba);
}

.footer-logo {
    height: 120px;
    width: auto;
}

.footer-tagline {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: var(--crema-2);
    opacity: 0.75;
    max-width: 34ch;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    color: var(--crema-2);
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-col a:hover {
    color: var(--hierba);
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 18px 24px;
    font-size: 0.78rem;
    color: var(--crema-2);
    opacity: 0.6;
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 36px 20px 24px;
    }
}

/* ---------- Hero ---------- */

.hero {
    padding: 28px 0 44px;
    border-bottom: 1px solid var(--borde);
    margin-bottom: 40px;
}

.hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--musgo);
    margin-bottom: 10px;
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    max-width: 16ch;
}

.hero p {
    max-width: 56ch;
    color: var(--tinta-suave);
    font-size: 1.05rem;
}

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radio-chico);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    background: var(--hierba);
    color: var(--crema);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
    background: var(--hierba-fuerte);
    color: var(--crema);
    transform: translateY(-1px);
    box-shadow: var(--sombra);
}

.btn-ghost {
    background: transparent;
    color: var(--bosque);
    box-shadow: inset 0 0 0 2px var(--borde);
}

.btn-ghost:hover {
    box-shadow: inset 0 0 0 2px var(--musgo);
    background: transparent;
    color: var(--musgo);
}

.btn-brasa {
    background: var(--brasa);
    color: var(--crema);
}

.btn-brasa:hover {
    background: #c8451f;
    color: var(--crema);
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-discord {
    background: #5865f2;
    color: #fff;
    width: 100%;
    justify-content: center;
}

.btn-discord:hover {
    background: #4752c4;
    color: #fff;
}

.discord-mark {
    width: 18px;
    height: 18px;
    flex: none;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'><path d='M107.7 8.07A105.15 105.15 0 0081.47 0a72.06 72.06 0 00-3.36 6.83 97.68 97.68 0 00-29.11 0A72.37 72.37 0 0045.64 0a105.89 105.89 0 00-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0032.17 16.15 77.7 77.7 0 006.89-11.11 68.42 68.42 0 01-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0064.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 01-10.87 5.19 77 77 0 006.89 11.1 105.25 105.25 0 0032.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15zM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.05 12.69-11.43 12.69z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'><path d='M107.7 8.07A105.15 105.15 0 0081.47 0a72.06 72.06 0 00-3.36 6.83 97.68 97.68 0 00-29.11 0A72.37 72.37 0 0045.64 0a105.89 105.89 0 00-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0032.17 16.15 77.7 77.7 0 006.89-11.11 68.42 68.42 0 01-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0064.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 01-10.87 5.19 77 77 0 006.89 11.1 105.25 105.25 0 0032.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15zM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.05 12.69-11.43 12.69z'/></svg>");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.separador {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--tinta-suave);
    font-size: 0.8rem;
}

.separador::before,
.separador::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--borde);
}

/* ---------- Tarjetas de torneo ---------- */

.grid-torneos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
}

.card-torneo {
    background: #fff;
    border-radius: var(--radio);
    padding: 22px;
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: card-torneo-entrada 0.5s ease both;
}

.card-torneo:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(20, 20, 20, 0.14);
}

@keyframes card-torneo-entrada {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .card-torneo {
        animation: none;
        transition: none;
    }

    .card-torneo:hover {
        transform: none;
    }
}

.card-torneo h3 {
    margin: 0;
    font-size: 1.25rem;
}

.equipo-estrella {
    margin-right: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 999px;
    width: fit-content;
}

.badge-inscripciones { background: rgba(220, 38, 38, 0.14); color: var(--hierba-fuerte); }
.badge-en_curso { background: rgba(20, 20, 20, 0.85); color: #fff; }
.badge-finalizado { background: rgba(107, 111, 118, 0.16); color: var(--tinta-suave); }
.badge-admin { background: rgba(20, 20, 20, 0.85); color: #fff; }

.badge-en_curso::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: badge-pulso 1.6s ease-in-out infinite;
}

@keyframes badge-pulso {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
    .badge-en_curso::before {
        animation: none;
    }
}

.card-torneo-campeon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px dashed var(--borde);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--bosque);
}

.card-torneo-campeon-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    font-size: 0.9rem;
}

.card-torneo .meta {
    font-size: 0.85rem;
    color: var(--tinta-suave);
}

.card-torneo p.desc {
    color: var(--tinta-suave);
    font-size: 0.92rem;
    flex: 1;
}

.card-torneo-banner {
    margin: -22px -22px 4px;
    border-radius: var(--radio) var(--radio) 0 0;
    overflow: hidden;
    aspect-ratio: 16 / 8;
}

.destacado-card .card-torneo-banner {
    margin: -28px -28px 6px;
}

.card-torneo-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.card-torneo:hover .card-torneo-banner img {
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .card-torneo-banner img {
        transition: none;
    }

    .card-torneo:hover .card-torneo-banner img {
        transform: none;
    }
}

.torneo-banner {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radio);
    margin-bottom: 20px;
}

.torneo-hero-grid {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 320px);
    gap: 32px;
    align-items: start;
}

.torneo-ganador-card {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.torneo-ganador-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(202, 138, 4, 0.28);
}

.torneo-ganador-header {
    background: linear-gradient(135deg, var(--oro) 0%, #eab308 100%);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px;
}

.torneo-ganador-body {
    padding: 24px;
    background: linear-gradient(180deg, #fdf6e3 0%, #fff 70%);
}

.torneo-ganador-card a {
    color: inherit;
    display: block;
}

.torneo-ganador-card .avatar-preview {
    margin: 0 auto 12px;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--oro), 0 10px 22px rgba(202, 138, 4, 0.35);
}

.torneo-ganador-nombre {
    margin: 0;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--bosque);
}

.torneo-ganador-lugar {
    margin: 4px 0 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--oro);
}

.torneo-ganador-equipo-label {
    margin: 0 0 10px;
    padding-top: 16px;
    border-top: 1px dashed var(--borde);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tinta-suave);
}

@media (max-width: 780px) {
    .torneo-hero-grid {
        grid-template-columns: 1fr;
    }
}

.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: var(--tinta-suave);
    background: #fff;
    border: 1px dashed var(--borde);
    border-radius: var(--radio);
}

/* ---------- Formularios ---------- */

.panel {
    background: #fff;
    border-radius: var(--radio);
    padding: 28px;
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
    overflow-x: auto;
}

.form-grid {
    display: grid;
    gap: 16px;
    max-width: 480px;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--bosque);
}

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radio-chico);
    border: 1.5px solid var(--borde);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--crema);
    color: var(--tinta);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--musgo);
    outline: none;
    background: #fff;
}

input[type="file"] {
    padding: 6px;
    font-size: 0.85rem;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border-radius: var(--radio-chico);
    border: none;
    background: var(--hierba);
    color: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.12s ease;
}

input[type="file"]::file-selector-button:hover {
    background: var(--hierba-fuerte);
}

.hint {
    font-size: 0.8rem;
    color: var(--tinta-suave);
    margin-top: 4px;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--musgo);
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--hierba-fuerte);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    max-width: 360px;
    padding: 14px 40px 14px 18px;
    border-radius: var(--radio-chico);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    animation: toast-entrada 0.25s ease;
}

.toast-ok { background: #2f7a3f; }
.toast-error { background: var(--hierba); }

.toast-cerrar {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 4px 8px;
}

.toast-cerrar:hover {
    opacity: 1;
}

.toast-oculto {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toast-entrada {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .toast {
        left: 16px;
        right: 16px;
        top: 12px;
        max-width: none;
    }
}

.modo-equipo-toggle {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.modo-equipo-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--tinta);
    cursor: pointer;
}

.modo-equipo-toggle input {
    width: auto;
}

/* ---------- Tabla de jugadores ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--borde);
}

th {
    font-family: 'Baloo 2', sans-serif;
    color: var(--bosque);
    font-size: 0.85rem;
}

td.mono, th.mono {
    font-size: 0.85rem;
}

/* ===========================================================
   Ruta de Liga — visualización del bracket.
   Cada ronda es una columna encabezada por una insignia (badge)
   hexagonal; las insignias se iluminan a medida que la ronda
   se completa, como las medallas de gimnasio de una Liga Pokémon.
   =========================================================== */

.gran-final-box {
    background: var(--crema-2);
    border-radius: var(--radio);
    padding: 24px 28px;
}

.gran-final-box h2 {
    margin-top: 0;
}

.ruta-liga {
    display: flex;
    gap: 36px;
    overflow-x: auto;
    padding: 20px 4px 28px;
}

.ronda-col {
    display: flex;
    flex-direction: column;
    min-width: 240px;
    flex: none;
}

.ronda-header {
    margin-bottom: 18px;
}

.ronda-insignia {
    display: none;
}

.ronda-header h4 {
    margin: 0;
    padding: 10px 14px;
    background: var(--crema-2);
    border: 1px solid var(--borde);
    border-radius: var(--radio-chico);
    color: var(--bosque);
    font-size: 0.8rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'JetBrains Mono', monospace;
}

.ronda-insignia.final ~ h4 {
    color: var(--oro);
    border-color: var(--oro);
}

.ronda-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 26px;
    flex: 1;
}

.match-card {
    background: #fff;
    border: 1px solid var(--borde);
    box-shadow: var(--sombra);
    border-radius: var(--radio-chico);
    overflow: hidden;
    position: relative;
}

.match-card.es-final {
    box-shadow: 0 0 0 2px var(--oro);
    border-radius: var(--radio-chico);
}

.match-card.es-final .match-slot {
    background: var(--crema-2);
}

.match-card.es-final .match-slot.ganador {
    background: rgba(220, 38, 38, 0.16);
}

.match-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.88rem;
    background: #fff;
}

.match-slot + .match-slot {
    border-top: 1px solid var(--borde);
}

.match-slot.ganador {
    background: rgba(220, 38, 38, 0.08);
}

.match-slot-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: none;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px var(--borde);
}

.match-slot-icon-vacio {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--musgo);
    color: var(--crema);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
}

.match-slot .nombre {
    font-family: 'Baloo 2', sans-serif;
    font-size: 0.88rem;
    color: var(--tinta);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-slot.ganador .nombre {
    color: var(--hierba-fuerte);
    font-weight: 700;
}

.match-slot .mc {
    font-size: 0.72rem;
    color: var(--tinta-suave);
    display: block;
}

.match-slot .vacio {
    color: var(--tinta-suave);
    font-style: italic;
    font-size: 0.82rem;
    flex: 1;
}

.match-puntaje {
    flex: none;
    min-width: 24px;
    text-align: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.82rem;
    background: var(--crema-2);
    color: var(--tinta-suave);
}

.match-puntaje.gana {
    background: var(--hierba);
    color: #fff;
}

.match-marcador {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--tinta-suave);
    padding: 6px 4px;
    border-top: 1px solid var(--borde);
}

.match-vs {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--hierba);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 0 0 3px var(--crema);
}

.match-card.pendiente .match-vs {
    display: flex;
}

/* ---------- Admin ---------- */

.calendario-lista {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.calendario-ronda h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.calendario-partidos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendario-partido {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio-chico);
    padding: 12px 16px;
    box-shadow: var(--sombra);
}

.calendario-jugador {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    color: var(--tinta);
}

.calendario-vs {
    color: var(--tinta-suave);
    font-size: 0.75rem;
}

.calendario-resultado {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--hierba-fuerte);
    font-weight: 600;
}

.equipo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.equipo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--crema);
    border-radius: 999px;
    border-left: 3px solid transparent;
    padding: 3px 10px 3px 6px;
    font-size: 0.8rem;
}

.equipo-chip .pokemon-sprite {
    width: 22px;
    height: 22px;
}

.admin-shell {
    display: grid;
    gap: 24px;
}

.admin-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.resultado-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--borde);
}

.resultado-form select,
.resultado-form input {
    width: auto;
}

.match-card .resultado-form {
    margin-top: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--borde);
    background: var(--crema);
}

.login-shell {
    max-width: 380px;
    margin: 60px auto;
}

/* ---------- Perfil / avatar ---------- */

.perfil-publico-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.perfil-publico-header .hero-eyebrow {
    margin-bottom: 0;
}

.perfil-publico-header h1 {
    font-size: 2rem;
    max-width: none;
}

.perfil-banner-wrap {
    position: relative;
    margin-bottom: 20px;
}

.perfil-banner-wrap .torneo-banner {
    margin-bottom: 0;
}

.perfil-banner-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    border-radius: 0 0 var(--radio) var(--radio);
    pointer-events: none;
}

.perfil-banner-wrap .perfil-publico-header {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 16px;
    z-index: 1;
}

.perfil-banner-wrap .avatar-preview {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 0 3px #fff;
}

.perfil-banner-wrap.banner-oscuro::after {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0) 100%);
}

.perfil-banner-wrap.banner-oscuro .perfil-publico-header .hero-eyebrow {
    color: rgba(255, 255, 255, 0.85);
}

.perfil-banner-wrap.banner-oscuro .perfil-publico-header h1 {
    color: #fff;
}

.perfil-banner-wrap.banner-claro::after {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
}

.perfil-banner-wrap.banner-claro .perfil-publico-header .hero-eyebrow {
    color: var(--musgo);
}

.perfil-banner-wrap.banner-claro .perfil-publico-header h1 {
    color: var(--bosque);
}

.perfil-banner-preview {
    aspect-ratio: 16 / 5;
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
}

.perfil-banner-preview .torneo-banner {
    height: 100%;
    max-height: none;
    border-radius: 0;
}

.perfil-banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bosque) 0%, var(--bosque-2) 55%, var(--musgo) 150%);
}

.perfil-subseccion {
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px dashed var(--borde);
}

.perfil-subseccion:first-of-type {
    padding-top: 0;
    margin-top: 4px;
    border-top: none;
}

.perfil-subseccion h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--musgo);
}

.perfil-banner-placeholder {
    cursor: pointer;
}

.banner-upload-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 1;
    pointer-events: none;
}

.banner-botonera {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.btn-icono-banner {
    border: none;
    background: rgba(20, 20, 20, 0.55);
    color: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s ease;
    white-space: nowrap;
}

.btn-icono-banner:hover {
    background: rgba(20, 20, 20, 0.78);
}

.banner-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.banner-editor-modal[hidden] {
    display: none;
}

.banner-editor-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.72);
}

.banner-editor-modal-box {
    position: relative;
    background: #fff;
    border-radius: var(--radio);
    padding: 24px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.banner-editor-modal-box h3 {
    margin: 0 0 4px;
}

.banner-editor-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    overflow: hidden;
    border-radius: var(--radio-chico);
    border: 1px solid var(--borde);
    margin: 14px 0;
    background: var(--tinta);
    touch-action: none;
    cursor: grab;
}

.banner-editor-viewport:active {
    cursor: grabbing;
}

.banner-editor-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.banner-editor-zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.banner-editor-zoom-row input[type="range"] {
    flex: 1;
    width: auto;
}

.banner-editor-modal-botones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.avatar-click-wrap {
    position: relative;
    cursor: pointer;
    flex: none;
}

.avatar-editar-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--hierba);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 0 0 2px #fff;
}

.input-file-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Modal genérico (admin: editar usuario) ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.72);
}

.modal-box {
    position: relative;
    background: #fff;
    border-radius: var(--radio);
    padding: 24px;
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
}

.modal-cerrar {
    flex: none;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--crema-2);
    color: var(--tinta);
    font-size: 1rem;
    cursor: pointer;
}

.modal-cerrar:hover {
    background: var(--crema);
}

.modal-seccion {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--borde);
}

.modal-seccion h4 {
    margin: 0 0 10px;
}

.modal-avatar-banner {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.modal-banner-preview {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 16 / 5;
    border-radius: var(--radio-chico);
    overflow: hidden;
    border: 1px solid var(--borde);
    background: var(--tinta);
}

.modal-banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-equipo-fila {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--borde);
    flex-wrap: wrap;
}

.modal-equipo-fila:last-child {
    border-bottom: none;
}

.perfil-settings {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

.perfil-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--crema-2);
    border-radius: var(--radio);
    padding: 10px;
    position: sticky;
    top: 90px;
}

.perfil-settings-nav button {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radio-chico);
    border: none;
    background: none;
    text-align: left;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--tinta-suave);
    cursor: pointer;
    width: 100%;
    transition: background 0.12s ease, color 0.12s ease;
}

.perfil-settings-nav button:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--bosque);
}

.perfil-settings-nav button.activa {
    background: var(--hierba);
    color: #fff;
}

.perfil-settings-panel {
    display: none;
}

.perfil-settings-panel.activa {
    display: block;
}

@media (max-width: 780px) {
    .perfil-settings {
        grid-template-columns: 1fr;
    }

    .perfil-settings-nav {
        flex-direction: row;
        overflow-x: auto;
        position: static;
        gap: 6px;
    }

    .perfil-settings-nav button {
        white-space: nowrap;
        width: auto;
    }
}

@media (max-width: 640px) {
    .perfil-banner-preview {
        aspect-ratio: 16 / 9;
    }
}

.perfil-publico-header .avatar-preview {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
}

.nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 6px;
}

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--sombra);
}

.avatar-vacio {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hierba) 0%, var(--musgo) 100%);
    color: #fff;
    font-family: 'Baloo 2', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
}

/* ---------- Noticias (Discord) ---------- */

.noticias-lista {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.noticia-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio-chico);
    padding: 14px 16px;
    box-shadow: var(--sombra);
}

.noticia-cuerpo {
    min-width: 0;
    flex: 1;
}

.noticia-meta {
    font-size: 0.78rem;
    color: var(--tinta-suave);
    margin-bottom: 4px;
}

.noticia-texto h4,
.noticia-texto h5,
.noticia-texto h6 {
    margin: 10px 0 4px;
    color: var(--tinta);
}

.noticia-texto h4 { font-size: 1.15rem; }
.noticia-texto h5 { font-size: 1.05rem; }
.noticia-texto h6 { font-size: 0.98rem; }

.discord-emoji {
    width: 1.3em;
    height: 1.3em;
    vertical-align: middle;
    object-fit: contain;
}

.embed-video {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--borde);
    border-left: 4px solid var(--hierba);
    border-radius: var(--radio-chico);
    background: var(--crema);
    color: inherit;
    max-width: 480px;
}

.embed-video:hover {
    background: var(--crema-2);
}

.embed-video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radio-chico);
}

.embed-video-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.embed-video-marca {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hierba-fuerte);
    font-weight: 700;
}

.embed-video-titulo {
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.1rem;
    color: var(--tinta);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.embed-video-autor {
    font-size: 0.85rem;
    color: var(--tinta-suave);
}

.noticia-texto {
    margin: 0;
    font-size: 0.92rem;
    color: var(--tinta);
    white-space: pre-line;
}

.comentario-editar-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.comentario-editar-form .btn {
    align-self: flex-start;
}

/* ---------- Composer de comentarios estilo Discord ---------- */

.discord-composer {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f2f2f2;
    border: 1px solid var(--borde);
    border-radius: 18px;
    padding: 10px 10px 10px 18px;
}

.discord-composer-input {
    flex: 1;
    resize: none;
    background: transparent;
    border: none;
    color: var(--tinta);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 6px 0;
    max-height: 160px;
    overflow-y: auto;
}

.discord-composer-input::placeholder {
    color: var(--tinta-suave);
}

.discord-composer-input:focus {
    outline: none;
    background: transparent;
    border: none;
}

.discord-composer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
    padding-bottom: 4px;
}

.discord-emoji-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--tinta-suave);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.discord-emoji-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--tinta);
}

.discord-emoji-picker {
    position: absolute;
    z-index: 999;
    width: min(280px, 90vw);
    max-height: 220px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: var(--bosque-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.discord-emoji-picker[hidden] {
    display: none;
}

.discord-emoji-opcion {
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px 0;
    cursor: pointer;
    transition: background 0.15s ease;
}

.discord-emoji-opcion:hover {
    background: rgba(255, 255, 255, 0.1);
}

.comentario-editar-form[hidden] {
    display: none;
}

/* ---------- Multimedia ---------- */

.multimedia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 24px;
}

.multimedia-card {
    background: #fff;
    border-radius: var(--radio);
    padding: 14px;
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
}

.multimedia-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: var(--radio-chico);
    overflow: hidden;
    background: var(--bosque);
}

.multimedia-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.multimedia-card h3 {
    margin: 12px 0 0;
    font-size: 1rem;
}

/* ---------- Selector de Pokémon (equipos, Hall of Fame) ---------- */

.pokemon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: 12px;
}

.pokemon-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--crema);
    border: 1.5px solid var(--borde);
    border-radius: var(--radio-chico);
    padding: 10px;
}

.pokemon-slot-sprite {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.pokemon-slot-input {
    width: 100%;
    text-align: center;
}

/* ---------- Pokémon (ranking, Hall of Fame) ---------- */

.pokemon-sprite {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
    image-rendering: -webkit-optimize-contrast;
}

.tipo-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 2px;
    flex: none;
}

.tipo-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    flex: none;
}

.fama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
}

.fama-card {
    background: #fff;
    border-radius: var(--radio);
    padding: 22px;
    box-shadow: var(--sombra);
    border: 1px solid var(--borde);
    border-top: 3px solid var(--oro);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: card-torneo-entrada 0.5s ease both;
}

.fama-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(202, 138, 4, 0.22);
}

.fama-card-reciente {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--oro);
    color: #1c1917;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: calc(100% - 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
    .fama-card {
        animation: none;
        transition: none;
    }

    .fama-card:hover {
        transform: none;
    }
}

.fama-banner {
    width: calc(100% + 44px);
    margin: -22px -22px 16px;
    max-height: 140px;
    object-fit: cover;
    display: block;
}

.fama-banner-preview {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: var(--radio-chico);
    margin-bottom: 14px;
}

.fama-anio {
    font-size: 0.78rem;
    color: var(--tinta-suave);
    margin: 0 0 6px;
}

.fama-torneo {
    color: var(--musgo);
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.6em;
}

.fama-campeon {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-family: 'Baloo 2', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bosque);
    margin: 0;
    min-height: 2.6em;
}

.fama-campeon span:last-child,
.fama-campeon a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: inherit;
}

.fama-campeon a:hover {
    color: var(--hierba-fuerte);
}

.fama-podio {
    list-style: none;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--borde);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fama-podio li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--tinta-suave);
}

.fama-medalla {
    font-size: 1.15em;
    line-height: 1;
}

.fama-equipo {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fama-equipo li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    padding: 6px 8px 6px 9px;
    background: var(--crema);
    border-radius: var(--radio-chico);
    border-left: 3px solid transparent;
}

/* ---------- Landing ---------- */

.landing-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(160deg, var(--bosque) 0%, var(--bosque-2) 55%, var(--musgo) 150%);
    border-radius: 24px;
    padding: 64px 32px;
    margin: 0 0 48px;
    text-align: center;
    color: var(--crema);
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background: radial-gradient(circle at 50% 15%, rgba(220, 38, 38, 0.4), transparent 60%);
    animation: hero-glow-pulso 6s ease-in-out infinite;
}

.landing-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 2px, transparent 2px, transparent 42px);
}

.landing-hero-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.landing-logo {
    width: 110px;
    height: auto;
    margin-bottom: 4px;
    filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.35));
    animation: hero-entrada 0.7s ease both, logo-flotar 4s ease-in-out 0.7s infinite;
}

.landing-hero .hero-eyebrow {
    color: var(--hierba);
    animation: hero-entrada 0.6s ease 0.15s both;
}

.landing-hero h1 {
    color: #fff;
    font-size: clamp(2.3rem, 5.5vw, 3.4rem);
    margin: 4px 0;
    animation: hero-entrada 0.6s ease 0.25s both;
}

.landing-sub {
    color: var(--crema-2);
    font-size: 1.05rem;
    max-width: 52ch;
    margin: 0 0 6px;
    animation: hero-entrada 0.6s ease 0.35s both;
}

.landing-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
    animation: hero-entrada 0.6s ease 0.45s both;
}

@keyframes hero-entrada {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logo-flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes hero-glow-pulso {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-logo,
    .landing-hero .hero-eyebrow,
    .landing-hero h1,
    .landing-sub,
    .landing-cta,
    .landing-hero::before,
    .landing-hero::after {
        animation: none;
    }
}

.btn-ghost-invertido {
    background: transparent;
    color: var(--crema);
    box-shadow: inset 0 0 0 2px rgba(246, 239, 220, 0.4);
}

.btn-ghost-invertido:hover {
    box-shadow: inset 0 0 0 2px var(--hierba);
    color: var(--crema);
    background: rgba(220, 38, 38, 0.16);
    transform: translateY(-1px);
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.stat-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 18px;
    text-align: left;
    box-shadow: var(--sombra);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    animation: stat-tile-entrada 0.5s ease both;
}

.stat-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(20, 20, 20, 0.16);
}

.stat-tile:nth-child(1) { animation-delay: 0s; }
.stat-tile:nth-child(2) { animation-delay: 0.08s; }
.stat-tile:nth-child(3) { animation-delay: 0.16s; }
.stat-tile:nth-child(4) { animation-delay: 0.24s; }

@keyframes stat-tile-entrada {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-icon {
    flex: none;
    font-size: 1.8rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.stat-tile:hover .stat-icon {
    transform: scale(1.15) rotate(-6deg);
}

@media (prefers-reduced-motion: reduce) {
    .stat-tile {
        animation: none;
        transition: none;
    }

    .stat-tile:hover {
        transform: none;
    }

    .stat-icon {
        transition: none;
    }

    .stat-tile:hover .stat-icon {
        transform: none;
    }
}

.stat-texto {
    min-width: 0;
}

.icono-pokebola {
    display: inline-block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(
        to bottom,
        var(--hierba) 0%, var(--hierba) 46%,
        var(--tinta) 46%, var(--tinta) 54%,
        #fff 54%, #fff 100%
    );
    box-shadow: inset 0 0 0 2px var(--tinta);
    position: relative;
    vertical-align: middle;
}

.icono-pokebola::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid var(--tinta);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.stat-num {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--brasa);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--tinta-suave);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-bar-compacta {
    grid-template-columns: repeat(auto-fit, minmax(min(88px, 100%), 1fr));
    gap: 10px;
}

.stats-bar-compacta .stat-tile {
    display: block;
    text-align: center;
    padding: 12px 6px;
}

.stats-bar-compacta .stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(20, 20, 20, 0.12);
}

.stats-bar-compacta .stat-num {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.stats-bar-compacta .stat-label {
    font-size: 0.66rem;
}

.destacado-wrap {
    margin-bottom: 48px;
}

.destacado-card {
    display: block;
    background: linear-gradient(135deg, #fff 0%, var(--crema) 100%);
    border: 2px solid var(--hierba);
    border-radius: var(--radio);
    padding: 28px;
    box-shadow: var(--sombra);
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 16px;
}

.destacado-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(20, 40, 32, 0.18);
}

.destacado-card h2 {
    margin: 10px 0 8px;
}

.destacado-link {
    display: inline-block;
    margin-top: 14px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    color: var(--hierba-fuerte);
}

.teaser-fama {
    margin-bottom: 48px;
}

.teaser-fama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 14px;
    margin-top: 16px;
}

.teaser-fama-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: var(--radio-chico);
    padding: 14px 16px;
    box-shadow: var(--sombra);
}

.teaser-fama-card .fama-medalla {
    font-size: 1.6rem;
}

.teaser-fama-nombre {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 600;
    color: var(--bosque);
}

.teaser-fama-torneo {
    font-size: 0.8rem;
    color: var(--tinta-suave);
}

@media (max-width: 640px) {
    main {
        padding: 28px 16px 60px;
    }

    .landing-hero {
        padding: 44px 20px;
        border-radius: 18px;
    }

    .login-shell {
        margin: 24px auto;
    }

    .ronda-col {
        min-width: 210px;
    }
}
