/* ==========================================================================
   cresa-game-feel.css
   FASE GAME FEEL PREMIUM — microinteracciones visuales ligeras y seguras.
   Solo presentación: hover/press, cards, rarezas, XP, emblemas.
   Performance-first: sin brightness(), sin blur pesado, sin JS.
   ========================================================================== */

/* ——— 1. Botones premium (hover / press) ——— */
.kid-dash-play,
.kid-dash-cta-knights,
.kid-dash-battle-arena__btn,
.kid-dash-battle-mode__mega-cta,
.mp-btn,
.gamer-profile-btn,
.gamer-account-btn,
.cresa-auth-btn,
.cresa-gamer-modal__btn,
.gh-btn,
.battle-pve-cta,
.battle-pve__back,
.cresa-install-btn {
    transition:
        transform var(--cresa-duration-normal) var(--cresa-ease-spring),
        box-shadow var(--cresa-duration-normal) ease,
        border-color var(--cresa-duration-fast) ease,
        opacity var(--cresa-duration-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
    .kid-dash-play:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-2px);
        filter: none !important;
    }

    .kid-dash-cta-knights:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-2px);
        filter: none !important;
    }

    .mp-btn--primary:hover:not(:disabled) {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-1px);
        filter: none !important;
        box-shadow:
            0 0 0 2px rgba(14, 165, 233, 0.3),
            0 5px 0 #0369a1,
            0 0 22px rgba(56, 189, 248, 0.38),
            0 9px 16px rgba(0, 0, 0, 0.28),
            inset 0 2px 0 rgba(255, 255, 255, 0.55);
    }

    .mp-btn--accent:hover:not(:disabled) {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-1px);
        filter: none !important;
        box-shadow:
            0 0 0 2px rgba(250, 204, 21, 0.32),
            0 5px 0 #92400e,
            0 0 24px rgba(250, 204, 21, 0.34),
            0 10px 18px rgba(0, 0, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.55);
    }

    .mp-btn--ghost:hover:not(:disabled) {
        transform: scale(var(--cresa-btn-scale-hover));
        filter: none !important;
        border-color: rgba(125, 211, 252, 0.55);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            0 0 16px rgba(56, 189, 248, 0.18);
    }

    .gamer-profile-btn:hover:not(:disabled),
    .gamer-account-btn:hover:not(:disabled) {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-1px);
        filter: none !important;
    }

    .gh-btn--sky:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-2px);
        filter: none !important;
    }

    .kid-dash-battle-arena__btn:hover,
    .kid-dash-battle-mode__mega-cta:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-2px);
        filter: none !important;
        box-shadow:
            0 0 0 2px rgba(56, 189, 248, 0.28),
            0 8px 0 #0c4a6e,
            0 0 26px rgba(56, 189, 248, 0.42),
            0 14px 24px rgba(0, 0, 0, 0.38),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
    }

    .kid-dash-battle-mode--mp .kid-dash-battle-mode__mega-cta:hover {
        box-shadow:
            0 0 0 2px rgba(167, 139, 250, 0.35),
            0 8px 0 #581c87,
            0 0 28px rgba(167, 139, 250, 0.4),
            0 14px 24px rgba(0, 0, 0, 0.38),
            inset 0 2px 0 rgba(255, 255, 255, 0.4);
    }

    .battle-pve-cta:hover,
    .battle-pve__back:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-1px);
        filter: none !important;
    }

    .battle-pve-option:hover:not(:disabled) {
        filter: none !important;
        border-color: rgba(56, 189, 248, 0.55);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 18px rgba(56, 189, 248, 0.22),
            0 6px 16px rgba(0, 0, 0, 0.32);
    }

    .cresa-install-btn:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-2px);
        filter: none !important;
        box-shadow:
            0 0 0 2px #1e3a8a,
            0 0 20px rgba(59, 130, 246, 0.35),
            0 8px 18px rgba(30, 58, 138, 0.45);
    }

    .cresa-auth-btn:hover {
        transform: scale(var(--cresa-btn-scale-hover)) translateY(-1px);
        filter: none !important;
        box-shadow:
            0 0 0 2px rgba(250, 204, 21, 0.28),
            0 6px 0 #92400e,
            0 0 22px rgba(250, 204, 21, 0.3),
            0 10px 20px rgba(0, 0, 0, 0.32),
            inset 0 2px 0 rgba(255, 255, 255, 0.45);
    }
}

/* Press consistente */
.kid-dash-play:active,
.kid-dash-cta-knights:active,
.mp-btn:active,
.battle-pve-cta:active,
.battle-pve__back:active {
    transform: scale(var(--cresa-btn-scale-press)) translateY(2px);
    filter: none !important;
}

/* ——— 2. Tarjetas interactivas ——— */
.kid-dash-card:not(.kid-dash-card--wide):not(.kid-dash-card--lg):not(.battle-pve-card),
.kid-dash-battle-mode,
.mp-card,
.gh-card,
.cresa-player-hero {
    transition:
        transform var(--cresa-duration-normal) var(--cresa-ease-smooth),
        box-shadow var(--cresa-duration-normal) ease,
        border-color var(--cresa-duration-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
    .kid-dash-card:not(.kid-dash-card--wide):not(.kid-dash-card--lg):not(.battle-pve-card):hover {
        transform: translateY(var(--cresa-card-lift));
        filter: none !important;
        box-shadow:
            0 0 0 2px #7c5a12,
            0 0 0 5px #f4c430,
            0 0 28px rgba(246, 213, 92, 0.32),
            0 16px 0 #0a1628,
            0 26px 38px rgba(0, 0, 0, 0.56),
            inset 0 2px 0 rgba(255, 255, 255, 0.24),
            inset 0 -3px 0 rgba(0, 0, 0, 0.35);
    }

    .kid-dash-battle-mode--pve:hover {
        border-color: rgba(56, 189, 248, 0.62);
        box-shadow:
            var(--cresa-shadow-energy-cyan),
            0 10px 26px rgba(0, 0, 0, 0.42),
            inset 0 1px 0 rgba(255, 255, 255, 0.14);
    }

    .kid-dash-battle-mode--mp:hover {
        border-color: rgba(216, 180, 254, 0.72);
        box-shadow:
            var(--cresa-shadow-energy-violet),
            0 12px 28px rgba(0, 0, 0, 0.46),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);
    }

    .mp-card:hover {
        transform: translateY(var(--cresa-card-lift));
        border-color: rgba(125, 211, 252, 0.48);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            var(--cresa-shadow-energy-cyan),
            0 12px 28px rgba(0, 0, 0, 0.36);
    }

    .gh-card:hover {
        transform: translateY(var(--cresa-card-lift));
        border-color: rgba(250, 204, 21, 0.58);
        box-shadow:
            0 5px 0 rgba(11, 29, 54, 0.85),
            0 0 20px rgba(250, 204, 21, 0.16),
            var(--cresa-inset-highlight),
            var(--cresa-inset-depth);
    }

    .kid-dash-card.battle-pve-card:hover {
        box-shadow:
            0 0 0 1px rgba(56, 189, 248, 0.28),
            0 0 32px rgba(56, 189, 248, 0.18),
            0 0 48px rgba(139, 92, 246, 0.12),
            0 18px 42px rgba(0, 0, 0, 0.52);
    }
}

/* ——— 3. Rarezas más vivas ——— */
.cresa-player-hero--rarity-common {
    box-shadow:
        var(--cresa-inset-highlight),
        0 0 0 1px rgba(0, 0, 0, 0.28),
        0 10px 28px rgba(0, 0, 0, 0.3),
        0 0 12px var(--cresa-rarity-common-glow);
}

.cresa-player-hero--rarity-rare {
    box-shadow:
        var(--cresa-inset-highlight),
        0 0 0 1px rgba(56, 189, 248, 0.18),
        0 10px 28px rgba(0, 0, 0, 0.3),
        0 0 20px var(--cresa-rarity-rare-glow);
}

.cresa-player-hero--rarity-epic {
    box-shadow:
        var(--cresa-inset-highlight),
        0 0 0 1px rgba(167, 139, 250, 0.2),
        0 10px 28px rgba(0, 0, 0, 0.3),
        0 0 22px var(--cresa-rarity-epic-glow);
}

.cresa-player-hero--rarity-legendary {
    box-shadow:
        var(--cresa-inset-highlight),
        0 0 0 1px rgba(250, 204, 21, 0.22),
        0 10px 28px rgba(0, 0, 0, 0.3),
        0 0 24px var(--cresa-rarity-legendary-glow);
}

.cresa-player-hero__rarity--rare {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 10px rgba(56, 189, 248, 0.18);
}

.cresa-player-hero__rarity--epic {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 12px rgba(167, 139, 250, 0.2);
}

.cresa-player-hero__rarity--legendary {
    box-shadow:
        var(--cresa-inset-highlight),
        0 0 14px var(--cresa-gold-glow-soft);
}

.cresa-circular-emblem--rarity-rare {
    --cce-glow-accent: rgba(56, 189, 248, 0.1);
    --cce-glow-gold-halo: rgba(56, 189, 248, 0.1);
}

.cresa-circular-emblem--rarity-epic {
    --cce-glow-accent: rgba(167, 139, 250, 0.12);
    --cce-glow-gold-halo: rgba(167, 139, 250, 0.12);
}

.cresa-circular-emblem--rarity-legendary {
    --cce-glow-accent: rgba(250, 204, 21, 0.14);
    --cce-glow-gold-halo: rgba(251, 191, 36, 0.16);
}

.gamer-avatar-pick--rarity-rare:hover:not(:disabled) {
    filter: none !important;
    box-shadow: 0 0 16px var(--cresa-rarity-rare-glow);
}

.gamer-avatar-pick--rarity-epic:hover:not(:disabled) {
    filter: none !important;
    box-shadow: 0 0 18px var(--cresa-rarity-epic-glow);
}

.gamer-avatar-pick--rarity-legendary:hover:not(:disabled) {
    filter: none !important;
    box-shadow: 0 0 20px var(--cresa-rarity-legendary-glow);
}

/* ——— 4. Progress bars — XP más viva ——— */
.cresa-player-hero__xp-bar,
.battle-pve-progress__bar,
.kid-dash-battle-progress__bar,
.game-quiz-progress-bar {
    position: relative;
    overflow: hidden;
}

.cresa-player-hero__xp-bar::after,
.battle-pve-progress__bar::after,
.kid-dash-battle-progress__bar::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.22) 48%,
        transparent 100%
    );
    transform: translateX(-120%);
    animation: cresa-xp-shimmer 4.2s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.55;
}

.cresa-player-hero__xp-bar {
    background: linear-gradient(
        90deg,
        var(--cph-accent, var(--cresa-rarity-rare-accent)) 0%,
        #a5f3fc 100%
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 10px var(--cph-glow, var(--cresa-glow-primary));
}

.battle-pve-progress__bar,
.kid-dash-battle-progress__bar {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 14px rgba(56, 189, 248, 0.38);
}

@keyframes cresa-xp-shimmer {
    0%,
    72%,
    100% {
        transform: translateX(-120%);
        opacity: 0;
    }

    82% {
        opacity: 0.55;
    }

    92% {
        transform: translateX(220%);
        opacity: 0;
    }
}

/* ——— 5. Emblemas — hover premium + selección ——— */
.cresa-circular-emblem--interactive {
    transition:
        transform var(--cresa-duration-normal) var(--cresa-ease-smooth),
        filter var(--cresa-duration-normal) ease;
}

@media (hover: hover) and (pointer: fine) {
    .cresa-circular-emblem--interactive:hover {
        transform: scale(1.04);
    }

    .cresa-circular-emblem--interactive.cresa-circular-emblem--rarity-rare:hover {
        filter:
            drop-shadow(0 0 4px rgba(56, 189, 248, 0.35))
            drop-shadow(0 0 8px rgba(56, 189, 248, 0.18));
    }

    .cresa-circular-emblem--interactive.cresa-circular-emblem--rarity-epic:hover {
        filter:
            drop-shadow(0 0 4px rgba(167, 139, 250, 0.38))
            drop-shadow(0 0 8px rgba(167, 139, 250, 0.2));
    }

    .cresa-circular-emblem--interactive.cresa-circular-emblem--rarity-legendary:hover {
        filter:
            drop-shadow(0 0 5px rgba(250, 204, 21, 0.42))
            drop-shadow(0 0 10px rgba(250, 204, 21, 0.22));
    }
}

.cresa-identity-hub__emblem-pick:hover:not(.cresa-identity-hub__emblem-pick--locked) {
    transform: translateY(-2px);
}

.cresa-identity-hub__emblem-pick--rarity-rare:hover:not(.cresa-identity-hub__emblem-pick--locked) {
    border-color: rgba(56, 189, 248, 0.62);
    box-shadow: var(--cresa-shadow-energy-cyan);
}

.cresa-identity-hub__emblem-pick--rarity-epic:hover:not(.cresa-identity-hub__emblem-pick--locked) {
    border-color: rgba(167, 139, 250, 0.62);
    box-shadow: var(--cresa-shadow-energy-violet);
}

.cresa-identity-hub__emblem-pick--rarity-legendary:hover:not(.cresa-identity-hub__emblem-pick--locked) {
    border-color: rgba(250, 204, 21, 0.58);
    box-shadow: var(--cresa-shadow-energy-gold);
}

.cresa-identity-hub__emblem-pick:has(input:checked) {
    animation: cresa-emblem-selected-pulse 3s ease-in-out infinite;
}

@keyframes cresa-emblem-selected-pulse {
    0%,
    100% {
        box-shadow:
            0 0 0 1px rgba(250, 204, 21, 0.35),
            0 0 16px rgba(250, 204, 21, 0.18);
    }

    50% {
        box-shadow:
            0 0 0 1px rgba(250, 204, 21, 0.48),
            0 0 22px rgba(250, 204, 21, 0.28);
    }
}

/* ——— Mobile: sin brightness ni filtros pesados ——— */
@media (max-width: 767.98px), (hover: none), (pointer: coarse) {
    .kid-dash-play:hover,
    .kid-dash-cta-knights:hover,
    .mp-btn:hover,
    .kid-dash-battle-arena__btn:hover,
    .kid-dash-battle-mode__mega-cta:hover,
    .battle-pve-cta:hover,
    .battle-pve__back:hover,
    .battle-pve-option:hover:not(:disabled),
    .kid-dash-card:not(.kid-dash-card--wide):not(.kid-dash-card--lg):hover,
    .kid-dash-battle-mode:hover,
    .mp-card:hover,
    .gh-card:hover,
    .gamer-avatar-pick:hover:not(:disabled),
    .cresa-circular-emblem--interactive:hover {
        filter: none !important;
        transform: none;
    }

    .cresa-circular-emblem--interactive:active {
        transform: scale(1.02);
    }

    .kid-dash-play:active,
    .kid-dash-cta-knights:active,
    .mp-btn:active,
    .kid-dash-battle-mode__mega-cta:active {
        transform: scale(var(--cresa-btn-scale-press));
        opacity: 0.94;
    }
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
    .cresa-player-hero__xp-bar::after,
    .battle-pve-progress__bar::after,
    .kid-dash-battle-progress__bar::after {
        animation: none;
        display: none;
    }

    .cresa-identity-hub__emblem-pick:has(input:checked) {
        animation: none;
    }

    .kid-dash-play,
    .kid-dash-cta-knights,
    .mp-btn,
    .kid-dash-card,
    .kid-dash-battle-mode,
    .mp-card,
    .gh-card,
    .cresa-circular-emblem--interactive {
        transition: none;
    }
}
