@import url('https://fonts.bunny.net/css2?family=Fredoka:wght@600;700&family=Nunito:wght@700;800&display=swap');

/* ==========================================================================
   gamer-identity.css
   Navbar + identidad gamer GLOBAL.
   Pensado para ser AUTOSUFICIENTE: NO depende del build de Tailwind, así
   sigue funcionando aunque el manifest de Vite no esté actualizado.
   Incluye al final una pequeña capa de "utility shims" usados por Blade.
   ========================================================================== */

/* ========== Identidad gamer: avatar + marcos por rareza (Fase 1C.1) ========== */
.gamer-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9999px;
    overflow: hidden;
    box-sizing: border-box;
    background: linear-gradient(145deg, #1e3a5f 0%, #152a46 100%);
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* ——— Rareza: común ——— */
.gamer-avatar--rarity-common {
    border-color: rgba(148, 163, 184, 0.82);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.75),
        0 1px 4px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ——— Rareza: raro (cyan gamer) ——— */
.gamer-avatar--rarity-rare {
    border-color: #38bdf8;
    box-shadow:
        0 0 0 1px rgba(8, 47, 73, 0.85),
        0 0 10px rgba(56, 189, 248, 0.42),
        0 2px 4px rgba(0, 0, 0, 0.32);
}

/* ——— Rareza: épico (violeta mágico) ——— */
.gamer-avatar--rarity-epic {
    border-color: #a78bfa;
    box-shadow:
        0 0 0 1px rgba(76, 29, 149, 0.55),
        0 0 12px rgba(167, 139, 250, 0.48),
        0 2px 5px rgba(0, 0, 0, 0.35);
}

/* ——— Rareza: legendario (dorado aspiracional) ——— */
.gamer-avatar--rarity-legendary {
    border-color: #fde047;
    box-shadow:
        0 0 0 1px rgba(120, 53, 15, 0.55),
        0 0 14px rgba(251, 191, 36, 0.5),
        0 0 6px rgba(250, 204, 21, 0.32),
        0 2px 5px rgba(0, 0, 0, 0.35);
}

/* ——— Tier premium / élite (unlockable): acento púrpura + gold sutil ——— */
.gamer-avatar--tier-premium.gamer-avatar--rarity-common,
.gamer-avatar--tier-premium.gamer-avatar--rarity-rare {
    border-color: #7dd3fc;
    box-shadow:
        0 0 0 1px rgba(49, 46, 129, 0.45),
        0 0 10px rgba(56, 189, 248, 0.38),
        0 0 6px rgba(192, 132, 252, 0.22);
}

.gamer-avatar--tier-premium.gamer-avatar--rarity-epic,
.gamer-avatar--tier-premium.gamer-avatar--rarity-legendary {
    box-shadow:
        0 0 0 1px rgba(91, 33, 182, 0.5),
        0 0 12px rgba(167, 139, 250, 0.45),
        0 0 8px rgba(250, 204, 21, 0.22),
        0 2px 5px rgba(0, 0, 0, 0.32);
}

.gamer-avatar--tier-unlockable {
    border-color: #c4b5fd;
}

.gamer-avatar--tier-unlockable.gamer-avatar--rarity-epic,
.gamer-avatar--tier-unlockable.gamer-avatar--rarity-legendary {
    border-color: #e9d5ff;
    box-shadow:
        0 0 0 1px rgba(91, 33, 182, 0.65),
        0 0 14px rgba(167, 139, 250, 0.48),
        0 0 10px rgba(250, 204, 21, 0.28),
        0 2px 5px rgba(0, 0, 0, 0.35);
}

.gamer-avatar--tier-unlockable.gamer-avatar--rarity-rare {
    border-color: #a5b4fc;
    box-shadow:
        0 0 0 1px rgba(67, 56, 202, 0.55),
        0 0 11px rgba(129, 140, 248, 0.45),
        0 0 7px rgba(250, 204, 21, 0.2);
}

/* Inset premium (sin filtros ni animaciones) */
.gamer-avatar--tier-premium::after,
.gamer-avatar--tier-unlockable::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
}

.gamer-avatar--tier-premium::after {
    box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.28);
}

.gamer-avatar--tier-unlockable::after {
    box-shadow:
        inset 0 0 0 1px rgba(250, 204, 21, 0.35),
        inset 0 0 6px rgba(124, 58, 237, 0.18);
}

/* Mobile-first: glow más compacto en xs/sm (lobby, rankings, Arena HUD) */
.gamer-avatar--xs.gamer-avatar--rarity-rare,
.gamer-avatar--sm.gamer-avatar--rarity-rare {
    box-shadow:
        0 0 0 1px rgba(8, 47, 73, 0.8),
        0 0 6px rgba(56, 189, 248, 0.38);
}

.gamer-avatar--xs.gamer-avatar--rarity-epic,
.gamer-avatar--sm.gamer-avatar--rarity-epic {
    box-shadow:
        0 0 0 1px rgba(76, 29, 149, 0.5),
        0 0 7px rgba(167, 139, 250, 0.42);
}

.gamer-avatar--xs.gamer-avatar--rarity-legendary,
.gamer-avatar--sm.gamer-avatar--rarity-legendary {
    box-shadow:
        0 0 0 1px rgba(120, 53, 15, 0.5),
        0 0 8px rgba(251, 191, 36, 0.45);
}

.gamer-avatar--xs.gamer-avatar--tier-unlockable.gamer-avatar--rarity-legendary,
.gamer-avatar--sm.gamer-avatar--tier-unlockable.gamer-avatar--rarity-legendary {
    box-shadow:
        0 0 0 1px rgba(91, 33, 182, 0.55),
        0 0 8px rgba(167, 139, 250, 0.4),
        0 0 5px rgba(250, 204, 21, 0.22);
}

/* Sin marco (casos excepcionales) */
.gamer-avatar--bare {
    border-color: transparent !important;
    box-shadow: none !important;
}

.gamer-avatar--bare::after {
    display: none !important;
}

/* Hover / profundidad (solo puntero fino; sin animaciones pesadas) */
@media (hover: hover) and (pointer: fine) {
    .gamer-avatar--interactive {
        transition:
            transform 0.2s ease,
            box-shadow 0.2s ease,
            border-color 0.2s ease;
    }

    .gamer-avatar--interactive:hover {
        transform: translateY(-2px) scale(1.03);
    }

    .gamer-avatar--interactive.gamer-avatar--rarity-rare:hover {
        box-shadow:
            0 0 0 1px rgba(8, 47, 73, 0.85),
            0 0 14px rgba(56, 189, 248, 0.55),
            0 4px 10px rgba(0, 0, 0, 0.35);
    }

    .gamer-avatar--interactive.gamer-avatar--rarity-epic:hover {
        box-shadow:
            0 0 0 1px rgba(76, 29, 149, 0.55),
            0 0 16px rgba(167, 139, 250, 0.58),
            0 4px 10px rgba(0, 0, 0, 0.35);
    }

    .gamer-avatar--interactive.gamer-avatar--rarity-legendary:hover {
        box-shadow:
            0 0 0 1px rgba(120, 53, 15, 0.55),
            0 0 18px rgba(251, 191, 36, 0.58),
            0 4px 10px rgba(0, 0, 0, 0.35);
    }
}

/* Hero: avatar protagonista un poco más grande que lg estándar */
.gamer-avatar--hero.gamer-avatar--lg {
    width: 5rem;
    height: 5rem;
    min-width: 5rem;
    min-height: 5rem;
    font-size: 1.85rem;
}

.gamer-avatar--hero.gamer-avatar--xl {
    width: 6.75rem;
    height: 6.75rem;
    min-width: 6.75rem;
    min-height: 6.75rem;
    font-size: 2.35rem;
}

.gamer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
}

.gamer-avatar img.is-image-missing {
    visibility: hidden;
    opacity: 0;
}

.gamer-avatar__fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-weight: 800;
    color: #fef08a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, #1e40af 0%, #1e3a8a 100%);
}

.gamer-avatar--xs { width: 1.65rem; height: 1.65rem; font-size: 0.75rem; }
.gamer-avatar--sm { width: 2rem;    height: 2rem;    font-size: 0.85rem; }
.gamer-avatar--md { width: 3rem;    height: 3rem;    font-size: 1.1rem;  }
.gamer-avatar--lg { width: 4.5rem;  height: 4.5rem;  font-size: 1.65rem; }
.gamer-avatar--xl { width: 6.5rem;  height: 6.5rem;  font-size: 2.25rem; }

.gamer-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.gamer-nav-trigger__name {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Shell global (sustituye fondo gris Breeze) ========== */
.cresa-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: linear-gradient(165deg, #0f2847 0%, #152a46 40%, #0d2137 100%);
}

.dark .cresa-shell {
    background: linear-gradient(165deg, #0b1426 0%, #1a1035 55%, #0d2137 100%);
}

/* ==========================================================================
   NAVBAR PRINCIPAL — Academia CRESA
   Layout 100% nativo (no depende de Tailwind utilities)
   ========================================================================== */
.cresa-nav {
    position: relative;
    z-index: 40;
    flex-shrink: 0;
    padding-top: env(safe-area-inset-top, 0px);
    border-bottom: 3px solid #f6d55c;
    background: linear-gradient(180deg, #1c4a6e 0%, #123456 55%, #0f2d4a 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 4px 10px rgba(0, 0, 0, 0.28);
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
}

.cresa-nav *,
.cresa-nav *::before,
.cresa-nav *::after {
    box-sizing: border-box;
}

.cresa-nav__bar {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .cresa-nav__bar { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .cresa-nav__bar { padding-left: 2rem; padding-right: 2rem; }
}

.cresa-nav__row {
    display: flex;
    height: auto;
    min-height: 3.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cresa-nav__left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.cresa-nav__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    text-decoration: none !important;
    color: #fef9c3 !important;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    filter: none;
}

.cresa-nav__brand-link:hover {
    color: #fde047 !important;
    filter: none;
}

.cresa-nav__brand-mark,
.cresa-nav .academy-brand--compact {
    display: block;
    width: auto;
    height: 36px;
    max-width: 54px;
    max-height: 36px;
    flex: 0 0 auto;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: none;
}

.cresa-nav__brand-title {
    min-width: 0;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    filter: none;
}

.cresa-nav__brand-link:hover .cresa-nav__brand-title {
    filter: none;
}

.cresa-nav__brand-title strong {
    color: #fde047;
    font-weight: 800;
}

/* Enlaces escritorio (ocultos en mobile y tablet).
   El corte de modo es 1024px: por debajo, hamburguesa.
   640px metía Admin + Laboratorio + apodo + Cerrar sesión en una sola fila. */
.cresa-nav__links {
    display: none;
    margin-left: 1.35rem;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
    gap: 0.15rem 0.85rem;
}

/* Bloque usuario (avatar + dropdown + cerrar sesión) */
.cresa-nav__user {
    display: none;
    align-items: center;
    flex-shrink: 0;
    gap: 0.65rem;
}

/* Botón cerrar sesión (mismo estilo gamer que el panel admin) */
.cresa-nav-logout {
    margin: 0;
}

.cresa-nav-logout button {
    cursor: pointer;
    touch-action: manipulation;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    border: 3px solid #991b1b;
    color: #fff !important;
    background: linear-gradient(180deg, #f87171 0%, #dc2626 45%, #b91c1c 100%);
    box-shadow:
        0 0 0 2px #450a0a,
        0 6px 0 #7f1d1d,
        0 10px 18px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.28);
    transition:
        transform 0.18s cubic-bezier(0.34, 1.35, 0.64, 1),
        filter 0.18s ease;
}

.cresa-nav-logout button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.cresa-nav-logout button:active {
    transform: translateY(2px);
}

.cresa-nav-logout--block button {
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .cresa-nav-logout button {
        transition: none;
    }

    .cresa-nav-logout button:hover,
    .cresa-nav-logout button:active {
        transform: none;
    }
}

/* Botón hamburguesa (visible en mobile) */
.cresa-nav__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.65rem;
    border: 2px solid rgba(250, 204, 21, 0.45);
    background: rgba(15, 40, 71, 0.75);
    padding: 0.45rem;
    color: #fef9c3;
    cursor: pointer;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cresa-nav__menu-btn:hover,
.cresa-nav__menu-btn:focus-visible {
    border-color: #fde047;
    background: rgba(30, 58, 95, 0.9);
    color: #fff;
    outline: none;
}

.cresa-nav__menu-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.cresa-nav__menu-btn .cresa-nav__icon-close {
    display: none;
}

#cresa-mobile-toggle:checked ~ .cresa-nav__bar .cresa-nav__menu-btn .cresa-nav__icon-open {
    display: none;
}

#cresa-mobile-toggle:checked ~ .cresa-nav__bar .cresa-nav__menu-btn .cresa-nav__icon-close {
    display: block;
}

/* Escritorio: enlaces, usuario y logout. Hamburguesa y drawer, no. */
@media (min-width: 1024px) {
    .cresa-nav__links { display: flex; }
    .cresa-nav__user { display: flex; }
    .cresa-nav__menu-btn { display: none; }
    .cresa-nav-mobile { display: none !important; }
}

/* Disparador del dropdown (avatar + nickname) */
.cresa-nav-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 0.65rem;
    border: 2px solid rgba(250, 204, 21, 0.55);
    background: linear-gradient(180deg, rgba(30, 58, 95, 0.95) 0%, rgba(15, 36, 62, 0.98) 100%);
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fef9c3 !important;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.25),
        0 4px 0 rgba(10, 22, 40, 0.9);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cresa-nav-user-trigger:hover,
.cresa-nav-user-trigger:focus-visible {
    border-color: #fde047;
    outline: none;
    box-shadow: 0 4px 0 rgba(10, 22, 40, 0.9);
}

.cresa-nav-user-trigger svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: #fde68a;
}

/* Control móvil (sin Alpine en la barra: un solo menú) */
.cresa-nav-mobile-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========== Menú móvil ========== */
/* Por defecto OCULTO. En móvil se abre con #cresa-mobile-toggle (checkbox). */
.cresa-nav-mobile {
    display: none;
    border-top: 2px solid rgba(250, 204, 21, 0.35);
    background: rgba(8, 20, 40, 0.96);
}

/* Por debajo de 1024px esta hoja tiene que ganar al snapshot viejo
   que Vite dejó en public/build (min-width:640px). El !important del
   cajón anula el display:none !important de ese snapshot. */
@media (max-width: 1023.98px) {
    .cresa-nav__links { display: none; }
    .cresa-nav__user { display: none; }
    .cresa-nav__menu-btn { display: inline-flex; }
    #cresa-mobile-toggle:checked ~ .cresa-nav-mobile {
        display: block !important;
    }
}

.cresa-nav-mobile__section {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.cresa-nav-mobile__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-top: 1px solid rgba(250, 204, 21, 0.22);
    padding: 0.75rem 1rem 0.5rem;
    min-width: 0;
}

.cresa-nav-mobile__user-text {
    min-width: 0;
    flex: 1 1 auto;
}

.cresa-nav-mobile__name {
    font-weight: 800;
    color: #fef9c3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cresa-nav-mobile__email {
    font-size: 0.875rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Cabecera de página ========== */
.cresa-page-header {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    border-bottom: 3px solid rgba(246, 213, 92, 0.85);
    background: linear-gradient(180deg, rgba(28, 74, 110, 0.98) 0%, rgba(15, 45, 74, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.3),
        0 4px 10px rgba(0, 0, 0, 0.28);
}

.cresa-page-header__inner {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    max-width: min(80rem, 100%);
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1rem 1.1rem;
}

@media (max-width: 480px) {
    .cresa-page-header__inner {
        padding: 0.85rem 0.65rem 0.95rem;
        gap: 0.55rem 0.75rem;
    }
}

@media (min-width: 640px) {
    .cresa-page-header__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
    .cresa-page-header__inner { padding-left: 2rem; padding-right: 2rem; }
}

.cresa-page-header__identity {
    display: flex;
    min-width: 0;
    flex: 1 1 12rem;
    align-items: center;
    gap: 0.65rem 0.85rem;
}

.cresa-page-header__avatar-ring {
    flex-shrink: 0;
    padding: 3px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #d97706 100%);
    box-shadow:
        0 0 0 2px rgba(15, 40, 71, 0.95),
        0 0 18px rgba(250, 204, 21, 0.35),
        0 6px 14px rgba(0, 0, 0, 0.4);
}

.cresa-page-header__avatar-ring:has(> .gamer-avatar--rarity-common) {
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    box-shadow:
        0 0 0 2px rgba(15, 40, 71, 0.95),
        0 0 10px rgba(148, 163, 184, 0.28);
}

.cresa-page-header__avatar-ring:has(> .gamer-avatar--rarity-rare) {
    background: linear-gradient(135deg, #7dd3fc 0%, #0284c7 100%);
    box-shadow:
        0 0 0 2px rgba(15, 40, 71, 0.95),
        0 0 14px rgba(56, 189, 248, 0.4);
}

.cresa-page-header__avatar-ring:has(> .gamer-avatar--rarity-epic) {
    background: linear-gradient(135deg, #c4b5fd 0%, #7c3aed 100%);
    box-shadow:
        0 0 0 2px rgba(15, 40, 71, 0.95),
        0 0 16px rgba(167, 139, 250, 0.42);
}

.cresa-page-header__avatar-ring:has(> .gamer-avatar--rarity-legendary),
.cresa-page-header__avatar-ring:has(> .gamer-avatar--tier-unlockable) {
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 50%, #d97706 100%);
    box-shadow:
        0 0 0 2px rgba(15, 40, 71, 0.95),
        0 0 18px rgba(250, 204, 21, 0.38);
}

.cresa-page-header__avatar-ring .gamer-avatar {
    border-width: 0;
    box-shadow: none;
}

.cresa-page-header__avatar-ring .gamer-avatar::after {
    display: none;
}

.cresa-page-header__titles {
    min-width: 0;
}

.cresa-page-header__title {
    margin: 0;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-size: clamp(1.15rem, 3.2vw, 1.35rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fde047;
    text-shadow:
        0 1px 0 #92400e,
        0 2px 6px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cresa-page-header__subtitle {
    margin: 0.15rem 0 0;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #cbd5e1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cresa-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.cresa-page-header__actions .cresa-link-muted {
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 800;
    color: #7dd3fc !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.cresa-page-header__actions .cresa-link-muted:hover {
    color: #bae6fd !important;
    text-decoration: underline !important;
}

/* Anillo ranking / listas — color según rareza del avatar interior */
.gamer-avatar-rank-ring {
    display: inline-flex;
    padding: 2px;
    border-radius: 9999px;
    background: linear-gradient(145deg, #fde047 0%, #d97706 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 14px rgba(250, 204, 21, 0.35);
}

.gamer-avatar-rank-ring:has(> .gamer-avatar--rarity-common) {
    background: linear-gradient(145deg, #e2e8f0 0%, #94a3b8 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 8px rgba(148, 163, 184, 0.3);
}

.gamer-avatar-rank-ring:has(> .gamer-avatar--rarity-rare) {
    background: linear-gradient(145deg, #7dd3fc 0%, #0284c7 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 12px rgba(56, 189, 248, 0.38);
}

.gamer-avatar-rank-ring:has(> .gamer-avatar--rarity-epic) {
    background: linear-gradient(145deg, #c4b5fd 0%, #7c3aed 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 14px rgba(167, 139, 250, 0.4);
}

.gamer-avatar-rank-ring:has(> .gamer-avatar--rarity-legendary) {
    background: linear-gradient(145deg, #fde047 0%, #d97706 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 16px rgba(251, 191, 36, 0.45);
}

.gamer-avatar-rank-ring:has(> .gamer-avatar--tier-unlockable) {
    background: linear-gradient(145deg, #e9d5ff 0%, #7c3aed 55%, #f59e0b 100%);
    box-shadow:
        0 0 0 1px rgba(15, 40, 71, 0.9),
        0 0 14px rgba(167, 139, 250, 0.38),
        0 0 8px rgba(250, 204, 21, 0.22);
}

.gamer-avatar-rank-ring .gamer-avatar {
    border-width: 0;
    box-shadow: none;
}

.gamer-avatar-rank-ring .gamer-avatar::after {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .gamer-avatar {
        transition: none;
    }
}

/* Enlaces de navegación escritorio */
.cresa-nav-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 3px solid transparent;
    padding: 0.25rem 0.15rem;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.25rem;
    color: #cbd5e1 !important;
    opacity: 1 !important;
    white-space: nowrap;
    text-decoration: none !important;
    transition: color 0.15s ease, border-color 0.15s ease;
}

/* El snapshot de Vite repite el hover dorado. Esta regla, misma
   especificidad y posterior, lo apaga. El tinte vive solo en puntero. */
.cresa-nav-link:hover {
    color: #cbd5e1 !important;
    border-bottom-color: transparent;
    background-color: transparent;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .cresa-nav-link:hover {
        color: #e0f2fe !important;
        border-bottom-color: rgba(125, 211, 252, 0.55);
        background-color: rgba(56, 189, 248, 0.08);
    }
}

.cresa-nav-link--active {
    color: #bae6fd !important;
    border-bottom-color: rgba(34, 211, 238, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Menú móvil — links */
.cresa-nav-link-mobile {
    display: block;
    width: 100%;
    border-left: 4px solid transparent;
    padding: 0.65rem 1rem;
    text-align: start;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #e2e8f0 !important;
    opacity: 1 !important;
    text-decoration: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cresa-nav-link-mobile:hover,
.cresa-nav-link-mobile:focus-visible {
    background: rgba(30, 58, 95, 0.65);
    color: #fef9c3 !important;
    outline: none;
}

.cresa-nav-link-mobile--active {
    border-left-color: #fde047;
    background: rgba(30, 58, 95, 0.85);
    color: #fde047 !important;
}

.cresa-nav-mobile__section .cresa-nav-link-mobile + .cresa-nav-link-mobile {
    margin-top: 0;
}

.cresa-nav-mobile__form {
    margin: 0;
}

/* Dropdown usuario */
.cresa-dropdown-panel {
    overflow: hidden;
    border-radius: 0.65rem;
    border: 2px solid rgba(250, 204, 21, 0.5);
    background: linear-gradient(180deg, #1c4a6e 0%, #0f2d4a 100%);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(250, 204, 21, 0.12);
}

.cresa-dropdown-link {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: start;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25rem;
    color: #fef9c3 !important;
    text-decoration: none !important;
    transition: background 0.12s ease;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.cresa-dropdown-link:hover {
    background: rgba(15, 40, 71, 0.85);
    color: #fff !important;
}

.cresa-dropdown-form {
    margin: 0;
}

@media (max-width: 1023.98px) {
    .cresa-nav__brand-link {
        flex-shrink: 1;
        max-width: calc(100% - 3.5rem);
    }
}

/* 1024–1279: la fila de escritorio ya cabe con el isotipo, los enlaces de admin,
   el apodo (tope 10rem) y Cerrar sesión. El wordmark no. Vuelve desde 1280px
   (1366 y 1920 conservan la barra aprobada). */
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .cresa-nav__brand-title { display: none; }
}

@media (max-width: 380px) {
    .cresa-nav__brand-title { font-size: 0.82rem; }
}

@media (max-width: 340px) {
    .cresa-nav__brand-title { display: none; }
}

/* ==========================================================================
   UTILITY SHIMS
   Pequeños fallbacks para clases utilitarias usadas por las vistas Blade
   por si Tailwind no está cargado / no compilado todavía. NO sustituyen
   a Tailwind cuando sí está, simplemente garantizan layout decente.
   ========================================================================== */
[x-cloak] { display: none !important; }

.cresa-nav .min-w-0,
.cresa-page-header .min-w-0,
.gamer-profile-wrap .min-w-0 { min-width: 0 !important; }

.cresa-nav .shrink-0,
.cresa-page-header .shrink-0 { flex-shrink: 0 !important; }

.cresa-nav .truncate,
.cresa-page-header .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cresa-nav .flex          { display: flex; }
.cresa-nav .inline        { display: inline; }
.cresa-nav .inline-flex   { display: inline-flex; }
.cresa-nav .items-center  { align-items: center; }
.cresa-nav .h-4           { height: 1rem; }
.cresa-nav .w-4           { width: 1rem; }
.cresa-nav .h-5           { height: 1.25rem; }
.cresa-nav .w-5           { width: 1.25rem; }
.cresa-nav .h-6           { height: 1.5rem; }
.cresa-nav .w-6           { width: 1.5rem; }
.cresa-nav .space-y-0 > * + * { margin-top: 0 !important; }
.cresa-nav .pb-3          { padding-bottom: 0.75rem; }

/* Layout shims para que cresa-shell/main/header se comporten aunque
   Tailwind no esté presente. */
.cresa-shell > main,
.cresa-shell > .admin-gamer-shell,
.cresa-shell .flex-1 {
    flex: 1 1 auto;
}

.cresa-shell > .cresa-page-header,
.cresa-shell .shrink-0 {
    flex-shrink: 0;
}

/* Profile / general utility shims (alcance acotado para no pisar Tailwind) */
.gamer-profile-wrap .truncate,
.cresa-page-header .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dashboard: onboarding avatar (Fase 1A) */
.kid-dash-avatar-setup {
    margin: 0 auto 1.25rem;
    max-width: 42rem;
    padding: 0 0.5rem;
}

.kid-dash-avatar-setup__card {
    padding: 1.1rem 1rem 1.25rem;
    border-radius: 1.15rem;
    border: 2px solid rgba(250, 204, 21, 0.45);
    background:
        radial-gradient(ellipse 90% 70% at 50% 0%, rgba(56, 189, 248, 0.14), transparent 62%),
        linear-gradient(160deg, rgba(15, 45, 74, 0.92), rgba(15, 23, 42, 0.88));
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.kid-dash-avatar-setup__kicker {
    margin: 0;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #93c5fd;
}

.kid-dash-avatar-setup__title {
    margin: 0.35rem 0 0;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    font-weight: 700;
    color: #fef08a;
}

.kid-dash-avatar-setup__sub {
    margin: 0.45rem 0 0.9rem;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #cbd5e1;
}

.kid-dash-avatar-setup__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

@media (min-width: 640px) {
    .kid-dash-avatar-setup__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.7rem;
    }
}

.kid-dash-avatar-setup__pick {
    cursor: pointer;
}

.kid-dash-avatar-setup__pick input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kid-dash-avatar-setup__pick-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
    border-radius: 0.85rem;
    border: 2px solid rgba(125, 211, 252, 0.28);
    background: rgba(15, 23, 42, 0.55);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.kid-dash-avatar-setup__pick:has(input:checked) .kid-dash-avatar-setup__pick-inner {
    border-color: rgba(250, 204, 21, 0.85);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.22);
    transform: translateY(-1px);
}

.kid-dash-avatar-setup__pick-name {
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #e2e8f0;
    text-align: center;
}

.kid-dash-avatar-setup__submit {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 999px;
    font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(180deg, #fde047, #f59e0b);
    box-shadow: 0 6px 0 #92400e, 0 10px 22px rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.kid-dash-avatar-setup__hint {
    margin: 0.75rem 0 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
}

.kid-dash-avatar-setup__hint a {
    color: #7dd3fc;
}

.kid-dash-avatar-setup-flash {
    margin: 0 auto 1rem;
    max-width: 42rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(52, 211, 153, 0.45);
    background: rgba(6, 78, 59, 0.35);
    color: #a7f3d0;
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
}
