/* ======== CONFIGURACIÓN GLOBAL ======== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #05040a;
    /* Darker background from mockup */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(72, 52, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(104, 33, 122, 0.05) 0%, transparent 40%);
    color: white;
    overflow-x: hidden;
    position: relative;
}

body.main-page {
    background-image: url('../images/ui/fondo-main.webp') !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

/* CSS Elemental Particles background container */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.elemental-particle {
    position: absolute;
    opacity: 0.15;
    filter: blur(1px);
    animation: floatParticle 15s infinite linear;
}

@keyframes floatParticle {
    0% {
        transform: translateY(110vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    height: 100% !important;
    padding-right: var(--scrollbar-width, 0px);
}

@keyframes gradientMove {
    0% {
        background-position: 0 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-150%) skewX(-20deg);
    }

    50%,
    100% {
        transform: translateX(150%) skewX(-20deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ======== ENCABEZADO ======== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

header img {
    height: 50px;
}

/* ======== BOTONES ======== */
nav button,
.shop-item button,
.btn-main {
    background: #4834d4;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease-in-out;
}

nav button:hover,
.shop-item button:hover,
.btn-main:hover {
    background: #686de0;
    transform: scale(1.05);
}

/* Botón principal especial */
.btn-main {
    background: #f39c12;
    color: #fff;
    font-size: 1.3rem;
    padding: 1rem 2.5rem;
    border-radius: 25px;
}

.btn-main:hover {
    background: #f1c40f;
}

/* ======== CONTENIDO PRINCIPAL ======== */
main {
    text-align: center;
    padding: 2rem;
}

/* ======== GRID GENERAL ======== */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 2rem;
}

/* ======== TARJETAS ======== */
.card,
.shop-item {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.card:hover,
.shop-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

/* ======== IMÁGENES ======== */
.card img,
.shop-item img {
    width: 100%;
    border-radius: 10px;
    filter: grayscale(0);
}

/* Carta bloqueada */
.card.locked img {
    filter: grayscale(1);
    opacity: 0.5;
}

/* Ajuste para las imágenes de las cajas */
.box-img {
    width: 150px;
    /* Tamaño fijo */
    height: 150px;
    /* Tamaño fijo */
    object-fit: cover;
    /* Asegura que la imagen se recorte bien */
    display: block;
    margin: 0 auto;
    /* Centra la imagen si es más pequeña que el contenedor */
}



/* ======== SLOTS VACÍOS ======== */
.card.empty {
    opacity: 0.6;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* ======== TIENDA ======== */
.shop-item {
    padding: 1rem;
    margin: 0.5rem;
}

.shop-item p {
    margin: 0.5rem 0;
}

.gold {
    color: #f1c40f;
    font-weight: bold;
}


.carta {
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    width: 140px;
    text-align: center;
    background: #f9f9f9;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.carta:hover {
    transform: scale(1.05);
}

.carta.seleccionada {
    border-color: #ffc107;
    background: #fff8e1;
}

.carta-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

/* === MODOS DE COMBATE === */


.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.btn-mode {
    padding: 10px 18px;
    font-size: 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #ccc;
    transition: transform 0.2s, background 0.2s;
}

.btn-mode.mode-unlocked {
    background: #4caf50;
    color: white;
}

.btn-mode.mode-locked {
    background: #777;
    color: #eee;
    cursor: not-allowed;
}

.btn-mode.selected {
    background: #ffb300;
    transform: scale(1.05);
}

/* === OVERLAY === */
.overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.overlay-content {
    background: linear-gradient(180deg, #2d2d44, #1b1b2f);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    color: white;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ===== ARREGLO: Contenedor scrollable de selección ===== */
.overlay-content {
    max-height: 80vh;
    /* limita la altura TOTAL */
    overflow-y: auto;
    /* activa scroll vertical */
    padding-bottom: 120px;
    /* deja sitio para los botones */
    position: relative;
}

/* Los botones siempre visibles */
#btnConfirmarSeleccion,
#btnCancelarSeleccion {
    position: sticky;
    bottom: 15px;
    margin: 5px;
    z-index: 10;
}



/* Scroll estilizado */
.cards-container::-webkit-scrollbar {
    width: 10px;
}

.cards-container::-webkit-scrollbar-track {
    background: rgba(13, 17, 33, 0.85);
    border-radius: 10px;
}

.cards-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

#cards-container .carta {
    background: rgba(13, 17, 33, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 140px;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

#cards-container .carta:hover {
    transform: scale(1.06);
    border-color: #ffd86b;
    background: rgba(255, 215, 0, 0.08);
}

#cards-container .carta.seleccionada {
    border-color: #ffc107;
    background: rgba(255, 215, 0, 0.15);
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;

    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}


.carta:hover {
    transform: scale(1.05);
}

.carta.seleccionada {
    border-color: #ffc107;
    background: #fff8e1;
}

.carta-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}



/* ======== UTILIDADES ======== */
.shadow {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

.text-center {
    text-align: center;
}

.starter-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.starter-cards div {
    text-align: center;
}

.starter-cards img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    transition: transform 0.3s;
}

.starter-cards img:hover {
    transform: scale(1.1);
}

/* ===== MODAL DE BIENVENIDA ÉPICA ===== */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-bg.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: linear-gradient(135deg, #1f1f2b, #4834d4);
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    width: 90%;
    max-width: 700px;
    color: white;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    box-shadow: 0 0 50px rgba(72, 52, 212, 0.7);
}

.modal-bg.show .modal {
    transform: scale(1);
    opacity: 1;
}

/* Título brillante */
.modal h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffb700, 0 0 30px #ff8c00;
    animation: glowText 2s ease-in-out infinite alternate;
}

@keyframes glowText {
    from {
        text-shadow: 0 0 5px #ffd700, 0 0 10px #ffb700;
    }

    to {
        text-shadow: 0 0 15px #ffd700, 0 0 25px #ffb700, 0 0 40px #ff8c00;
    }
}

/* Botón cerrar / comenzar aventura */
.close-btn {
    background: #28a745;
    color: white;
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 25px;
    transition: transform 0.25s, background 0.25s;
}

.close-btn:hover {
    transform: scale(1.05);
    background: #2ecc71;
}

/* Contenedor de cartas iniciales */

.starter-cards div {
    text-align: center;
    transition: transform 0.3s, filter 0.3s;
}

.starter-cards div:hover {
    transform: translateY(-10px) scale(1.05);
    filter: drop-shadow(0 0 20px gold);
}

.starter-cards img {
    width: 130px;
    height: 130px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

/* Texto debajo de las cartas */
.starter-cards p {
    margin-top: 8px;
    font-weight: bold;
    color: #fff8c0;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

body.modal-open {
    overflow: hidden;
}

.ready {
    color: gold;
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.6;
    }
}

.upgrade-btn {
    background-color: gold;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #222;
    font-weight: bold;
    transition: 0.2s;
}

.upgrade-btn:hover {
    background-color: #ffd700;
    transform: scale(1.05);
}

/*Oro */
.user-info {
    font-size: 16px;
    font-weight: bold;
    color: #ffd86b;

    padding: 6px 14px;
    border-radius: 14px;

    background: rgba(255, 215, 0, 0.15);
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ===== EFECTO DE ORO ===== */
.gold-effect {
    position: absolute;
    /* ⬅️ antes era fixed */
    font-size: 3rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.gold-effect.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

/* ===== MONEDAS VOLADORAS ===== */
.gold-coin {
    position: fixed;
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, #fff3b0, #f1c40f, #d4ac0d);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.9),
        inset -3px -3px 6px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    pointer-events: none;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s;
}


/* ===== MAIN HEADER ===== */
.main-header::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0.6;
}

.main-nav {
    display: flex;
    gap: 14px;
}

.main-nav .nav-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.main-nav .nav-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 22px rgba(108, 92, 231, 0.8);
    color: white;
}

.profile-card {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 25px auto;
    padding: 14px 26px;
    max-width: 520px;
    background: linear-gradient(180deg, rgba(35, 28, 70, 0.95), rgba(25, 20, 55, 0.95));
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.profile-card > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.profile-card span {

}

/* Texto fuerte */
.profile-card strong {
    font-size: 20px;
}

/* Oro destacado */
#gold-container strong {
    color: #ffd86b;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

/* Trofeos */
#trophies {
    color: #a8e6ff;
    text-shadow: 0 0 8px rgba(168, 230, 255, 0.6);
}

/* Username */
#username {
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

#slots {
    min-height: 220px;
    padding-bottom: 20px;
}

#slots:empty {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#slots:empty::before {
    content: "🎁";
    position: absolute;
    top: 40px;
    font-size: 4rem;
    opacity: 0.25;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
    animation: floatGift 2.5s ease-in-out infinite;

}

@keyframes floatGift {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

#slots:empty::after {
    content: "No tienes cajas todavía.\A\A Gana combates para conseguir recompensas.";
    white-space: pre-line;
    text-align: center;

    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);

    padding: 30px 40px;
    border-radius: 20px;

    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.06),
            rgba(255, 255, 255, 0.02));

    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.05),
        0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===== COFRES CON VIDA ===== */
#slots .card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 150px;
    height: 200px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

#slots .card .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
}

#slots .card img {
    height: 90px;
    width: auto;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
}

#slots .card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(255, 215, 0, 0.35);
}

#slots .card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 15px;
    pointer-events: none;

    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);

    opacity: 0;
    transition: opacity 0.3s ease;
}

#slots .card:hover::after {
    opacity: 1;
}




/* ===== CENTRADO ===== */
.center {
    text-align: center;
    margin: 20px 0;
}

/* ===== EFECTO DE ORO (+ / -) ===== */

.gold-effect.positive {
    color: #00ffae;
    text-shadow: 0 0 15px #00ffae, 0 0 30px #00ffaa;
}

.gold-effect.negative {
    color: #ff4d4d;
    text-shadow: 0 0 15px #ff4d4d, 0 0 30px #ff0000;
}

/* ===== MONEDAS VOLADORAS ===== */
.flying-coin {
    position: fixed;
    font-size: 28px;
    z-index: 9999;
    pointer-events: none;
    transition:
        left 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.8s,
        transform 0.8s;
}

/* ===== EXPLOSIÓN ELEMENTAL ===== */

.box-explosion {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

/* ===== PARTÍCULAS DE EXPLOSIÓN ===== */
.element-particle {
    position: fixed;
    font-size: 30px;
    pointer-events: none;
    z-index: 9999;

    --x: 0px;
    --y: 0px;

    animation: explode 900ms ease-out forwards;
}

@keyframes explode {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    to {
        transform: translate(var(--x), var(--y)) scale(0.3);
        opacity: 0;
    }
}


/* Sacudida de caja */
.shake {
    animation: shakeBox 0.35s ease-in-out;
}

@keyframes shakeBox {
    0% {
        transform: translate(0);
    }

    25% {
        transform: translate(-5px);
    }

    50% {
        transform: translate(5px);
    }

    75% {
        transform: translate(-5px);
    }

    100% {
        transform: translate(0);
    }
}

/* ===== FLASH DE PANTALLA ===== */
.screen-flash::before {
    content: "";
    position: fixed;
    inset: 0;
    background: white;
    opacity: 0.6;
    z-index: 9998;
    animation: flash 0.15s ease-out forwards;
}

@keyframes flash {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 0;
    }
}

/* ===== PARTÍCULAS EXTREMAS ===== */
.element-particle {
    position: fixed;
    font-size: 34px;
    pointer-events: none;
    z-index: 9999;

    --x: 0px;
    --y: 0px;

    animation: explode 1.2s cubic-bezier(.1, .8, .2, 1) forwards;
    filter: drop-shadow(0 0 12px gold);
}

@keyframes explode {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    to {
        transform: translate(var(--x), var(--y)) scale(0.2);
        opacity: 0;
    }
}

/* ===== FORMULARIO CONTACTO ===== */
form input,
form textarea {
    background: rgba(20, 15, 35, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}


form textarea {
    resize: none;
}

/* ===== CENTRAR GRIDS DE INFO (INDEX) ===== */
.grid-cards {
    justify-content: center;
}

/* Limitar ancho y centrar visualmente */
.grid-cards {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Cartas informativas del index */
.grid-cards .card {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== LIBRO DE COLECCIÓN VIRTUAL (PREMIUM) ===== */
.collection-title-section {
    text-align: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #8da3c0;
}

.book-container {
    position: relative;
    width: 1000px;
    height: 650px;
    margin: 0 auto 50px;
    background: #4a3728;
    /* Cuero oscuro */
    border: 12px solid #3a2a1d;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(0, 0, 0, 0.5);
    display: flex;
    padding: 20px;
}

.book-spine {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 40px;
    transform: translateX(-50%);
    background: linear-gradient(to right, #2a1a0d, #4a3728, #2a1a0d);
    z-index: 10;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.book-page {
    flex: 1;
    background: #fdf6e3;
    /* Papel viejo */
    background-image: radial-gradient(#f4ebd0 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.1);
}

.left-page {
    border-radius: 5px 0 0 5px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.right-page {
    border-radius: 0 5px 5px 0;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* CARTAS EN EL LIBRO */
.collection-grid .carta,
.book-page .carta {
    width: 135px;
    height: auto;
    background: white;
    padding: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.book-page .carta {
    margin: 0 auto;
}

.book-page .carta:hover {
    transform: scale(1.15) translateY(-10px) rotate(2deg);
    z-index: 20;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.carta-img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    /* IMPORTANTE: No cortar imagen */
    border-radius: 3px;
    background: #1a1a2e;
}

.carta-info h3 {
    font-size: 0.9rem;
    margin: 5px 0;
    color: #1a1a2e;
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

/* SILUETA PARA CARTAS NO TENIDAS */
.carta.not-owned {
    filter: brightness(0.1) grayscale(1) opacity(0.6);
    cursor: default;
}

.carta.not-owned:hover {
    transform: none;
}

.carta.not-owned .carta-info,
.carta.not-owned .upgrade-btn,
.carta.not-owned .info-btn-mini {
    display: none;
}

/* CONTROLES DEL LIBRO */
.book-nav {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 100;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-nav:hover {
    background: rgba(255, 215, 0, 0.6);
}

.book-nav.prev {
    left: -70px;
    border-radius: 10px 0 0 10px;
}

.book-nav.next {
    right: -70px;
    border-radius: 0 10px 10px 0;
}

.page-numbers {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #8da3c0;
    font-weight: bold;
}

/* MEJORAS VISUALES STATS */
.card-badges .element-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    color: white;
    font-weight: bold;
}

.card-badges .rarity-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e2e8f0;
    color: #475569;
}

/* Animación de cambio de página */
@keyframes flipPage {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-180deg);
    }
}

.page-flipping {
    animation: flipPage 0.6s ease-in-out;
}

/* BOTON MISIONES PREMIUM (AZUL) */
.btn-missions-premium {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    border: 2px solid #60a5fa !important;
    border-radius: 12px !important;
    padding: 10px 20px !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    text-align: left;
}

.btn-missions-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6) !important;
}

.btn-missions-premium .m-icon {
    font-size: 1.8rem;
}

.btn-missions-premium .m-content {
    display: flex;
    flex-direction: column;
}

.btn-missions-premium .m-title {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.btn-missions-premium .m-desc {
    font-size: 0.7rem;
    opacity: 0.8;
}

.empty-slot {
    border-style: dashed !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.shop-timer {
    text-align: center;
    font-size: 1.1rem;
    margin: 10px 0 25px;
    color: #ffd700;
    font-weight: bold;
    letter-spacing: 1px;
}

/* ===============================
   MODO PRÓXIMAMENTE (3vs3)
   =============================== */

.btn-coming-soon {
    position: relative;
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(80%);
}

/* Tooltip */
.btn-coming-soon::after {
    content: "🚧 Próximamente";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.btn-coming-soon:hover::after {
    opacity: 1;
}

/* ===== HEADER CLARO GAME UI ===== */
/* FINAL MOCKUP HEADER */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 30px;
    background: rgba(13, 11, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-container:hover {
    transform: scale(1.02);
}

.main-logo {
    height: 42px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 0.9;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.4rem;
    /* Added font-size */

    /* Golden Metallic Gradient */
    background: linear-gradient(180deg,
            #fff7a0 0%,
            #d4af37 20%,
            #fbf5b7 45%,
            #8b6508 55%,
            #d4af37 80%,
            #fff7a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Added for compatibility */
    -webkit-text-fill-color: transparent;

    /* Bevel and Outline Effect */
    filter:
        drop-shadow(0px 0px 1px #000) drop-shadow(1px 1px 0px rgba(255, 255, 255, 0.3)) drop-shadow(-1px -1px 0px rgba(0, 0, 0, 0.5)) drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
}

.logo-text span {
    font-size: 1.2rem;
    /* Modified font-size */
    color: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    /* Added for compatibility */
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(13, 17, 33, 0.85);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #ffd700;
}

.admin-btn {
    border-color: rgba(255, 87, 34, 0.3);
    color: #ff5722;
}

.admin-btn:hover {
    background: rgba(255, 87, 34, 0.1);
    color: #ff7043;
}

.logout-btn {
    color: #ff4757;
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.1);
}

/* TROPHY ROAD MINI */
.btn-trophy-road-mini {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid #ffd700;
    color: #ffd700;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-trophy-road-mini:hover {
    background: #ffd700;
    color: #000;
    transform: scale(1.1);
}

/* SETTINGS MODAL */
input[type="range"] {
    accent-color: #ffd700;
    cursor: pointer;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gold-display {
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #ffd700;
    font-size: 0.9rem;
}

/* ===== FONDO RPG ANIMADO (CAPAS) ===== */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}


body::before {
    opacity: 0.25;
}

body::after {
    opacity: 0.15;
}


@keyframes fogMove {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-5%, -10%);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes lightFloat {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 1000px 600px;
    }
}

/* ===== TRANSICIÓN DE PÁGINA ===== */
.page-transition {
    animation: pageFadeIn 0.5s ease forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== SOMBRAS Y VOLUMEN RPG ===== */
.card,
.shop-item,
.profile-card,
.overlay-content {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35),
        inset 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Botones más “cartoon RPG” */
button {
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}

/* PANEL PRINCIPAL RPG */
main {
    position: relative;
}

body:not(.public-page) main::before {
    pointer-events: none !important;
    z-index: -1;
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(20, 15, 35, 0.92),
            rgba(15, 10, 30, 0.95));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

h1 {
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}


/* ===== FLASH DE DAÑO (RECIBIR ATAQUE) ===== */
.damage-flash::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 40, 40, 0.45);
    z-index: 9999;
    pointer-events: none;
    animation: damageFlash 160ms ease-out forwards;
}

@keyframes damageFlash {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 0;
    }
}

/* ===== MODO DE COMBATE ACTIVO (MUY VISIBLE) ===== */
.btn-mode.selected {
    background: linear-gradient(135deg, #ffb300, #ff9800);
    color: #1e1e1e;
    font-weight: 700;

    border: 2px solid #fff3b0;
    box-shadow:
        0 0 12px rgba(255, 193, 7, 0.9),
        0 0 28px rgba(255, 193, 7, 0.6);

    transform: scale(1.1);
}

/* Hover solo si NO está seleccionado */
.btn-mode:not(.selected):hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* ===== FEEDBACK MODO COMBATE ===== */
.mode-feedback {
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffd86b;

    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PANEL RPG PARA PÁGINAS PÚBLICAS ===== */
.rpg-panel {
    max-width: 900px;
    margin: 80px auto;
    padding: 40px 50px;

    background: linear-gradient(180deg,
            rgba(28, 22, 55, 0.92),
            rgba(18, 14, 38, 0.95));

    border-radius: 28px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.04);

    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Títulos más RPG */
.rpg-panel h1,
.rpg-panel h2 {
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

form input,
form textarea {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    border-radius: 14px;
    font-size: 1rem;
}

/* ===== PANEL ORÁCULO (ABOUT) ===== */
.oracle-panel {
    background: linear-gradient(180deg,
            rgba(30, 24, 60, 0.95),
            rgba(20, 15, 40, 0.95));
}

.oracle-panel #quoteText {
    color: #ffd86b;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.oracle-panel #quoteAuthor {
    margin-top: 10px;
    opacity: 0.85;
    font-style: italic;
}

/* 🔧 FIX FONDO NEGRO EN PÁGINAS DE JUEGO */
body.game-page main::before {
    display: none;
}

/* 🔧 FIX CRÍTICO: overlay no bloquea clicks cuando está oculto */
.overlay {
    pointer-events: none;
}

.overlay[style*="display: flex"],
.overlay.active {
    pointer-events: all;
}

/* ===== BOTÓN CAMINO DE TROFEOS ===== */
.btn-trophy-road {
    background: linear-gradient(135deg, #ffd86b, #ffb300);
    color: #1e1e1e;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;

    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 4px 15px rgba(0, 0, 0, 0.4);

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-trophy-road:hover {
    transform: scale(1.15);
    box-shadow:
        0 0 18px rgba(255, 215, 0, 1),
        0 8px 22px rgba(0, 0, 0, 0.6);
}

/* ===============================
   CAMINO DE TROFEOS (TROPHY ROAD)
   =============================== */

/* Contenedor principal */
.trophy-road {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;

    background: linear-gradient(180deg,
            rgba(28, 22, 55, 0.95),
            rgba(18, 14, 38, 0.95));

    border-radius: 30px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.04);

    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Título */
.trophy-road h1 {
    text-align: center;
    color: #ffd86b;
    margin-bottom: 30px;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* Línea vertical */
.trophy-road-track {
    position: relative;
    margin: 0 auto;
    padding-left: 50px;
    border-left: 4px solid rgba(255, 215, 0, 0.4);
}

/* Nodo de recompensa */
.trophy-node {
    position: relative;
    margin-bottom: 40px;
    padding-left: 30px;
}

/* Círculo */
.trophy-node::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 6px;

    width: 22px;
    height: 22px;
    border-radius: 50%;

    background: #555;
    border: 3px solid #999;
}

/* Recompensa bloqueada */
.trophy-node.locked {
    opacity: 0.4;
}

/* Recompensa disponible */
.trophy-node.available::before {
    background: gold;
    border-color: #fff3b0;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
}

/* Recompensa reclamada */
.trophy-node.claimed::before {
    background: #4caf50;
    border-color: #b9ffb9;
}

/* Caja de recompensa */
.trophy-reward {
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    border-radius: 18px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Texto */
.trophy-reward span {
    font-weight: bold;
}

/* Botón reclamar */
.trophy-reward button {
    background: linear-gradient(135deg, #ffd86b, #ffb300);
    border: none;
    border-radius: 14px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    color: #1e1e1e;

    box-shadow:
        0 0 12px rgba(255, 215, 0, 0.8),
        0 4px 15px rgba(0, 0, 0, 0.4);

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trophy-reward button:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 20px rgba(255, 215, 0, 1),
        0 8px 25px rgba(0, 0, 0, 0.6);
}

.trophy-reward button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================
   LEADERBOARD / RANKING
   ========================= */

/* ──────────────────────────────────
   PREMIUM LEADERBOARD UI
────────────────────────────────── */
.leaderboard-header-container {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.premium-title {
    font-size: 3rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 5px 15px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.leaderboard-subtitle {
    color: #a0a0b0;
    font-size: 1.1rem;
    font-style: italic;
}

.leaderboard-modern {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

.premium-leaderboard {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-legend {
    display: flex;
    justify-content: space-between;
    padding: 0 20px 10px 20px;
    color: #6366f1;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    margin-bottom: 10px;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px 25px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Stagger animation based on child position */
.premium-leaderboard li:nth-child(2) { animation-delay: 0.1s; }
.premium-leaderboard li:nth-child(3) { animation-delay: 0.2s; }
.premium-leaderboard li:nth-child(4) { animation-delay: 0.3s; }
.premium-leaderboard li:nth-child(5) { animation-delay: 0.4s; }
.premium-leaderboard li:nth-child(6) { animation-delay: 0.5s; }
.premium-leaderboard li:nth-child(7) { animation-delay: 0.6s; }
.premium-leaderboard li:nth-child(8) { animation-delay: 0.7s; }
.premium-leaderboard li:nth-child(9) { animation-delay: 0.8s; }
.premium-leaderboard li:nth-child(10) { animation-delay: 0.9s; }
.premium-leaderboard li:nth-child(11) { animation-delay: 1.0s; }

.leaderboard-row:hover {
    transform: translateX(10px) translateY(-2px);
    background: rgba(40, 40, 70, 0.8);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), -5px 0 15px rgba(99, 102, 241, 0.3);
}

.col-rank {
    flex: 0 0 60px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #a0a0b0;
    text-align: center;
}

.col-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.player-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

.col-trophies {
    flex: 0 0 120px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.trophy-icon {
    color: #ffd700;
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.5));
}

/* ──────────────────────────────────
   TOP 3 HIGHLIGHTS
────────────────────────────────── */
.rank-gold {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), rgba(30, 30, 50, 0.8));
    border-left: 4px solid #ffd700;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}
.rank-gold .player-name { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.5); }
.rank-gold .player-avatar-mini { background: linear-gradient(135deg, #ffd700, #ff8c00); box-shadow: 0 0 15px rgba(255,215,0,0.6); }
.rank-gold .medal-icon { font-size: 2.2rem; filter: drop-shadow(0 0 10px rgba(255,215,0,0.8)); }

.rank-silver {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), rgba(30, 30, 50, 0.8));
    border-left: 4px solid #c0c0c0;
}
.rank-silver .player-name { color: #e0e0e0; }
.rank-silver .player-avatar-mini { background: linear-gradient(135deg, #e0e0e0, #a0a0a0); box-shadow: 0 0 10px rgba(192,192,192,0.4); color: #333; }
.rank-silver .medal-icon { font-size: 2rem; filter: drop-shadow(0 0 8px rgba(192,192,192,0.6)); }

.rank-bronze {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.15), rgba(30, 30, 50, 0.8));
    border-left: 4px solid #cd7f32;
}
.rank-bronze .player-name { color: #cd7f32; }
.rank-bronze .player-avatar-mini { background: linear-gradient(135deg, #cd7f32, #8b4513); box-shadow: 0 0 10px rgba(205,127,50,0.4); }
.rank-bronze .medal-icon { font-size: 1.8rem; filter: drop-shadow(0 0 6px rgba(205,127,50,0.6)); }

.is-me-row {
    border: 2px solid rgba(0, 255, 136, 0.5) !important;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2), inset 0 0 15px rgba(0, 255, 136, 0.1) !important;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.1), rgba(30, 30, 50, 0.8)) !important;
}

.form-msg.sending {
    color: #ffd86b;
}

.form-msg.success {
    color: #00ffae;
}

.form-msg.error {
    color: #ff6b6b;
}

.public-footer {
    opacity: 0.7;
    margin: 40px 0;
    text-align: center;
}

/* ABOUT */
.page-hero {
    margin-top: 80px;
}

.page-title {
    font-size: 2.8rem;
}

.glow-gold {
    text-shadow: 0 0 20px gold;
}

.page-description {
    max-width: 800px;
    margin: 20px auto;
    font-size: 1.2rem;
}

.oracle-panel {
    border: 2px solid gold;
}

.oracle-quote {
    font-size: 1.4rem;
    font-style: italic;
}

.oracle-author {
    margin-top: 10px;
    opacity: 0.8;
}

/* ===============================
   COMBATE ELEMENTAL (ARENA)
   =============================== */

body.combat-page {
    background: #0f0c29;
    color: #fff;
    font-family: Arial, sans-serif;
    text-align: center;
}


/* ===== LUCHADORES ===== */
.fighter {
    width: 40%;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fighter img {
    max-width: 180px;
    margin: 10px 0;
}

/* ===== BARRA DE VIDA ===== */
.hp-bar {
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}




/* ===== ACCIONES ===== */
.actions {
    margin-top: 20px;
}

.actions button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    margin: 0 6px;
}

.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ===== MENSAJE DE ENCUENTRO ===== */
#encounterMessage {
    display: none;
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 30px 40px;
    border-radius: 16px;
    font-size: 22px;
    z-index: 9999;
}

/* ===== OVERLAY FINAL DE COMBATE ===== */
#endOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#endOverlay>div {
    background: #1e1e2e;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

#btnBackMain {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
}

/* ===============================
   COMBATE
   =============================== */

body.combat-page {
    background: #0f0c29;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

body.combat-page h1 {
    margin-top: 30px;
    color: #ffd86b;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

/* Luchadores */
.fighter {
    width: 40%;
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.fighter img {
    max-width: 180px;
    margin: 10px auto;
}

/* Vida */
.hp-bar {
    background: #333;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.hp {
    height: 20px;
    background: linear-gradient(90deg, #4caf50, #81c784);
    width: 100%;

    transform-origin: left center;
    /* 🔥 CLAVE */
    transform: scaleX(1);

    transition: transform 0.4s ease;
}



/* Acciones */
.actions {
    margin-top: 25px;
}

.actions button {
    margin: 5px;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
}

.actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Overlay final */
#endOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

#endOverlay>div {
    background: #1e1e2e;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

/* ===============================
   GAMEPLAY (INDEX)
   =============================== */

.gameplay-section {
    max-width: 900px;
    margin: 100px auto 0;
    padding: 50px 60px;

    background: linear-gradient(180deg,
            rgba(28, 22, 55, 0.92),
            rgba(18, 14, 38, 0.95));

    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.05);

    text-align: center;
}

.gameplay-section h2 {
    margin-bottom: 20px;
    color: #ffd86b;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.gameplay-desc {
    max-width: 700px;
    margin: 0 auto 35px;
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* Lista en grid */
.gameplay-features {
    list-style: none;
    padding: 0;

    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 18px;

    font-size: 1.1rem;
}

/* Cada punto */
.gameplay-features li {
    background: rgba(255, 255, 255, 0.08);
    padding: 14px 18px;
    border-radius: 14px;

    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 700px) {
    .gameplay-section {
        padding: 35px 25px;
    }

    .gameplay-features {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   ABOUT – SECCIONES NARRATIVAS
   =============================== */

.about-section {
    max-width: 900px;
    margin: 80px auto;
    padding: 45px 55px;

    background: linear-gradient(180deg,
            rgba(28, 22, 55, 0.92),
            rgba(18, 14, 38, 0.95));

    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(255, 255, 255, 0.05);

    text-align: center;
}

.about-section h2 {
    margin-bottom: 22px;
    color: #ffd86b;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.about-text {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.7;
    opacity: 0.95;
}

/* Responsive */
@media (max-width: 700px) {
    .about-section {
        padding: 35px 25px;
    }
}

/* ===============================
   FOOTER PROFESIONAL
   =============================== */

.site-footer {
    background: linear-gradient(180deg,
            rgba(20, 15, 40, 0.95),
            rgba(10, 8, 25, 0.98));
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 80px;
    color: #ddd;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 30px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
}

.footer-block h4 {
    color: #ffd86b;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.footer-block p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-block ul li {
    margin-bottom: 8px;
}

.footer-block ul li a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-block ul li a:hover {
    color: #ffd86b;
}

/* Línea inferior */
.footer-bottom {
    text-align: center;
    padding: 15px 10px;
    font-size: 0.85rem;
    opacity: 0.6;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-bought {
    margin-top: 10px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    font-weight: bold;
}

.shop-item {
    position: relative;
}

.shop-qty {
    font-weight: bold;
    opacity: 0.8;
}

.btn-owned {
    background: #444 !important;
    cursor: not-allowed;
}

.shop-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}

/* =========================
   PACK PREMIUM - TIENDA
   ========================= */

.shop-item.premium {
    position: relative;
    border: 2px solid gold;
    background: linear-gradient(145deg, #1a1a1a, #2a2100);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
    animation: premiumGlow 2s infinite alternate;
}

.shop-item.premium img {
    filter: drop-shadow(0 0 10px gold);
}

.shop-item.premium h3 {
    color: gold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

/* Badge exclusivo */
.shop-item.premium::before {
    content: "EXCLUSIVO";
    position: absolute;
    top: 8px;
    right: 8px;
    background: gold;
    color: #000;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

/* Animación glow */
@keyframes premiumGlow {
    from {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }

    to {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
    }
}

/* =========================
   COLECCIÓN - METADATOS
   ========================= */

.card-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

/* ---------- ELEMENTOS ---------- */

.element-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.el-fire {
    background: linear-gradient(135deg, #ff6a00, #ff3d00);
}

.el-water {
    background: linear-gradient(135deg, #00bcd4, #0288d1);
}

.el-plant {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.el-neutral {
    background: #777;
}

/* ---------- RAREZAS ---------- */

.rarity-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.rarity-common {
    background: #e0e0e0;
    color: #333;
}

.rarity-uncommon {
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #4a2c00;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.6);
}

/* ---------- NIVEL ---------- */

.card-level {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.spend-gold {
    animation: pulse-red 0.6s ease;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== BOTÓN HUIR SIEMPRE ACTIVO ===== */
#btnFlee {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

#btnFlee:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff6b5a, #e84118);
}

/* Nunca mostrar estado disabled visual en huir */
#btnFlee:disabled {
    opacity: 1;
    cursor: pointer;
    filter: none;
}

/* ===== Detalles a los cofres ===== */

@keyframes chestPulse {
    0% {
        transform: translate(0);
    }

    88% {
        transform: translate(0);
    }

    90% {
        transform: translate(-2px, 1px);
    }

    92% {
        transform: translate(2px, -1px);
    }

    94% {
        transform: translate(-1px, 1px);
    }

    96% {
        transform: translate(1px, -1px);
    }

    100% {
        transform: translate(0);
    }
}

#slots .card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 150px;
    height: 200px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

#slots .card .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
}

#slots .card img {
    height: 90px;
    width: auto;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
}

#slots .card:nth-child(1) {
    animation-delay: 0s;
}

#slots .card:nth-child(2) {
    animation-delay: 1.2s;
}

#slots .card:nth-child(3) {
    animation-delay: 2.4s;
}

#slots .card:nth-child(4) {
    animation-delay: 3.6s;
}

#slots .card:nth-child(5) {
    animation-delay: 4.8s;
}

#slots .card::before {
    content: "";
    position: absolute;
    inset: -14px;
    /* tamaño del marco */
    z-index: -1;

    border-radius: 20px;

    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.02));

    box-shadow:
        inset 0 0 25px rgba(255, 255, 255, 0.05),
        0 20px 45px rgba(0, 0, 0, 0.6);
}

#slots .card::after {
    content: "";
    position: absolute;
    inset: -22px;
    z-index: -2;

    border-radius: 28px;

    background: radial-gradient(circle,
            rgba(255, 215, 0, 0.18),
            transparent 65%);

    opacity: 0.6;
    filter: blur(8px);
}

#slots .card:hover::before {
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.08),
        0 25px 60px rgba(0, 0, 0, 0.8);
}

#slots .card:hover::after {
    opacity: 0.9;
}

#slots .card:last-child::after {
    background: radial-gradient(circle,
            rgba(255, 215, 0, 0.28),
            transparent 65%);
}

/* ===============================
   DASHBOARD PRINCIPAL (MAIN)
   =============================== */

.dashboard {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 20px;

    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Columna izquierda (perfil) */
.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Columna principal */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   PANEL MODO COMBATE
   =============================== */



.mode-selection h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #ffd86b;
}

.mode-description {
    font-size: 1.1rem;
    opacity: 0.85;
    margin-bottom: 20px;
}

/* ===============================
   MATCHMAKING
   =============================== */

.matchmaking {
    background: rgba(13, 17, 33, 0.85);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid rgba(255, 200, 80, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(255, 200, 80, 0.1);
    border-radius: 22px;
    padding: 30px;
}

.matchmaking .btn-main {
    font-size: 1.4rem;
    padding: 1.1rem 3rem;
    box-shadow:
        0 0 20px rgba(255, 193, 7, 0.6),
        0 12px 35px rgba(0, 0, 0, 0.6);
}

/* ===============================
   SECCIÓN CAJAS
   =============================== */

.boxes-section {
    margin-top: 50px;
}

.boxes-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 6px;
}

.boxes-info {
    text-align: center;
    opacity: 0.75;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* ===============================
   PREMIUM UTILITIES (NIVEL 4)
   =============================== */

.glass-panel {
    background: rgba(13, 17, 33, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.shimmer-wrapper {
    position: relative;
    overflow: hidden;
}

.shimmer-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2.5s infinite linear;
    pointer-events: none;
}

/* FINAL MOCKUP PROFILE BAR (HORIZONTAL) */
.profile-card.glass-hud {
    background: rgba(13, 17, 33, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 30px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 5px auto 15px;
    width: fit-content;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.user-main-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-square {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4b367c, #2a1b4d);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-stat img {
    width: 18px;
}

.audio-controls {
    display: flex;
    gap: 8px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* BOTON ACCION ADMIN */
.btn-admin-action {
    background: rgba(255, 87, 34, 0.15);
    border: 1px solid rgba(255, 87, 34, 0.4);
    color: #ff7043;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-admin-action:hover {
    background: rgba(255, 87, 34, 0.25);
    border-color: #ff7043;
    transform: translateY(-2px);
}

.btn-audio {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-audio:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* FINAL MOCKUP GAME MODES PANEL */


.mode-selection h2 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.mode-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px;
}

.mode-cards {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mode-card.premium-3d,
.mode-card-locked.premium-3d {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    width: 330px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mode-card-locked.premium-3d {
    opacity: 0.6;
}

.mode-card.premium-3d.active {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.04);
}

.mode-icon-side {
    width: 70px;
    text-align: center;
}

.mode-icon-side img {
    width: 55px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.mode-card-content {
    flex: 1;
}

.mode-card-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.mode-card-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 6px;
}

.status-badge.available {
    background: #27ae60;
    color: #fff;
}

.status-badge.soon {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
}

.mode-lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    opacity: 0.5;
}

/* FINAL MOCKUP MATCHMAKING BUTTON */
.btn-matchmaking.premium-hero {
    background: linear-gradient(to bottom, #f39c12, #e67e22) !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 10px 40px !important;
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    color: #fff !important;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4) !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.btn-matchmaking.premium-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.6) !important;
}

.btn-matchmaking.premium-hero i {
    font-size: 1.2rem;
}

/* CENTRAR TODO MÁS COMPACTO */
.main-center {
    max-width: 800px;
    margin: 0 auto 0;
    padding: 0 10px;
    gap: 2px;
}

/* BOTÓN MATCHMAKING ÉPICO MINI */
.btn-matchmaking.premium-hero {
    font-size: 1.1rem;
    padding: 0.6rem 2rem;
    margin-top: 0 !important;
}





/* GRID DE CAJAS MINI */
#slots {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
    padding: 10px;
}

#slots .card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 150px;
    height: 200px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

#slots .card .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
}

#slots .card img {
    height: 90px;
    width: auto;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
}

#slots .card .box-img {
    width: 90px;
    height: 90px;
    margin-bottom: 5px;
}

#slots .card p {
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-align: center;
}

#slots .card button {
    padding: 5px 15px;
    font-size: 0.8rem;
    width: 100%;
}

.slot-empty {
    width: 130px;
    height: 160px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

/* TEXTO DE AYUDA MÁS SUTIL */
.mode-selection p {
    margin-top: 12px;
}

/* BOTÓN BUSCAR PARTIDA – SOLO POSICIÓN */
.main-center .center {
    margin-top: 10px;
}

/* AJUSTE TÍTULO CAJAS (NO TOCA GRID) */
main>h2 {
    text-align: center;
    margin-top: 40px;
}

/* ===============================
   BOTÓN MÚSICA (EN PERFIL)
   =============================== */

.btn-music {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;

    font-size: 16px;
    padding: 6px 10px;
    border-radius: 12px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-music:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.btn-music:active {
    transform: scale(0.95);
}

/* ===== MODOS DE COMBATE (TARJETAS) ===== */

.mode-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 25px 0;
}

.mode-card {
    width: 220px;
    padding: 22px;
    border-radius: 20px;
    border: 2px solid transparent;

    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.02));

    color: white;
    text-align: center;
    cursor: pointer;

    transition: all 0.25s ease;

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.6),
        inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.mode-card:hover:not(.disabled) {
    transform: translateY(-6px) scale(1.05);
    border-color: #ffd86b;
}

/* Activo (1vs1) */
.mode-card.active {
    border-color: #ffd86b;
    background: linear-gradient(180deg,
            rgba(255, 215, 107, 0.25),
            rgba(255, 180, 0, 0.15));

    box-shadow:
        0 0 25px rgba(255, 215, 0, 0.8),
        0 20px 45px rgba(0, 0, 0, 0.6);
}

.mode-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.mode-text {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 14px;
}

.mode-status {
    font-size: 0.9rem;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 14px;
    display: inline-block;
}

.mode-status.available {
    background: #4caf50;
    color: #fff;
}

.mode-status.soon {
    background: #777;
    color: #eee;
}

/* Deshabilitado */
.mode-card.disabled {
    opacity: 0.45;
    filter: grayscale(80%);
    cursor: not-allowed;
}

/* ===== BOTÓN MATCHMAKING ===== */

/* BOTÓN MATCHMAKING ÉPICO */
.btn-matchmaking.premium-hero {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    font-size: 1.8rem;
    padding: 1.4rem 4rem;
    border-radius: 40px;
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.4), 0 15px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: epicGlow 3s infinite;
}

.btn-matchmaking.premium-hero:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 0 50px rgba(241, 196, 15, 0.6), 0 20px 50px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

@keyframes epicGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(241, 196, 15, 0.7);
    }
}

/* CAJAS MODERN GRID */




@keyframes pulseMatch {
    0% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    }

    50% {
        box-shadow: 0 0 35px rgba(255, 193, 7, 1);
    }

    100% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    }
}

/* ===============================
   FONDO ELEMENTAL ANIMADO (MAIN)
   =============================== */

#elemental-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.particles::before,
.particles::after {
    content: "";
    position: absolute;
    inset: 0;
    background-repeat: repeat;
    opacity: 0.25;
    animation: moveParticles 20s linear infinite;
}

@keyframes moveParticles {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 300px -600px;
    }
}

.particles.fire::before {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 120, 0, 0.6), transparent 40%),
        radial-gradient(circle at 70% 90%, rgba(255, 60, 0, 0.5), transparent 35%);
    animation-duration: 18s;
}

.particles.water::before {
    background-image:
        radial-gradient(circle at 30% 100%, rgba(0, 200, 255, 0.5), transparent 35%),
        radial-gradient(circle at 60% 110%, rgba(0, 150, 255, 0.4), transparent 30%);
    animation-duration: 22s;
}

.particles.plant::before {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(100, 255, 120, 0.4), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(60, 200, 100, 0.35), transparent 35%);
    animation-duration: 26s;
}

.particles::before {
    opacity: 0.15;
    /* recomendado */
}

/* ===============================
   MEJORAS VISUALES COMBATE
   (PARTÍCULAS, VS, MOVIMIENTO, HP COLOR, SHAKE)
   =============================== */

/* "Tu carta" badge */
.you-badge {
    position: absolute;
    top: -12px;
    left: 18px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 180, 0, 0.95));
    color: #1e1e1e;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 12px rgba(255, 200, 60, 0.6);
    transform: translateY(-6px);
    z-index: 10;
    font-size: 0.9rem;
    pointer-events: none;
}

/* ensure fighter has positioning context */
.fighter {
    position: relative;
    overflow: visible;
}

/* floating movement for card images */
.floating-card {
    animation: floatCard 3.6s ease-in-out infinite;
    transform-origin: center;
}

@keyframes floatCard {
    0% {
        transform: translateY(0) rotate(-0.6deg);
    }

    50% {
        transform: translateY(-8px) rotate(0.6deg);
    }

    100% {
        transform: translateY(0) rotate(-0.6deg);
    }
}

/* VS badge */
#vsBadge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    font-weight: 900;
    color: #fff;
    background: radial-gradient(circle at 30% 30%, rgba(255, 200, 60, 0.95), rgba(255, 120, 40, 0.9));
    box-shadow: 0 6px 28px rgba(255, 160, 40, 0.45), inset 0 0 18px rgba(255, 255, 255, 0.15);
    transform: translateY(-8px);
    z-index: 30;
    align-self: center;
    justify-self: center;
    margin: 0 10px;
    animation: vsPulse 1.2s infinite, vsVibrate 600ms infinite;
}

/* pulso y vibración */
@keyframes vsPulse {
    0% {
        box-shadow: 0 6px 28px rgba(255, 160, 40, 0.25);
        transform: scale(0.98);
    }

    50% {
        box-shadow: 0 12px 40px rgba(255, 160, 40, 0.6);
        transform: scale(1.06);
    }

    100% {
        box-shadow: 0 6px 28px rgba(255, 160, 40, 0.25);
        transform: scale(0.98);
    }
}

@keyframes vsVibrate {
    0% {
        transform: translateY(-8px) rotate(-1deg);
    }

    25% {
        transform: translateY(-6px) rotate(1deg);
    }

    50% {
        transform: translateY(-8px) rotate(-1deg);
    }

    75% {
        transform: translateY(-10px) rotate(1deg);
    }

    100% {
        transform: translateY(-8px) rotate(-1deg);
    }
}

/* PARTICULAS (CONTENEDOR) */
.fighter-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

/* partículas simples generadas por JS */
.particle {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    pointer-events: none;
    transform-origin: center;
    will-change: transform, opacity;
    animation: particleRise 2.2s ease-out forwards;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

/* apariencia por tipo */
.particle.fire {
    background: radial-gradient(circle at 40% 35%, rgba(255, 230, 170, 0.95), rgba(255, 90, 20, 0.9));
    box-shadow: 0 0 12px rgba(255, 130, 30, 0.8);
    width: 14px;
    height: 24px;
    border-radius: 6px;
}

.particle.water {
    background: radial-gradient(circle at 40% 40%, rgba(200, 255, 255, 0.95), rgba(0, 160, 255, 0.85));
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.6);
    width: 16px;
    height: 16px;
}

.particle.plant {
    background: radial-gradient(circle at 50% 40%, rgba(180, 255, 190, 0.95), rgba(40, 180, 80, 0.85));
    box-shadow: 0 0 12px rgba(80, 200, 100, 0.5);
    width: 16px;
    height: 16px;
}

/* animación subida y desvanecimiento */
@keyframes particleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }

    60% {
        opacity: 0.95;
        transform: translateY(-70px) scale(0.9) rotate(6deg);
    }

    100% {
        transform: translateY(-140px) scale(0.6) rotate(18deg);
        opacity: 0;
        filter: blur(2px);
    }
}

/* PARTICULAS DE IMPACTO (direccionales) */
.impact-particle {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.9s cubic-bezier(.2, .9, .2, 1), opacity 0.9s;
    transform-origin: center;
}

.impact-particle.fire {
    background: radial-gradient(circle at 35% 30%, rgba(255, 220, 150, 0.98), rgba(255, 80, 10, 0.9));
    box-shadow: 0 0 12px rgba(255, 120, 30, 0.9);
}

.impact-particle.water {
    background: radial-gradient(circle at 35% 35%, rgba(200, 255, 255, 0.98), rgba(0, 130, 255, 0.9));
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.7);
}

.impact-particle.plant {
    background: radial-gradient(circle at 40% 30%, rgba(180, 255, 160, 0.98), rgba(40, 160, 80, 0.9));
    box-shadow: 0 0 10px rgba(40, 180, 80, 0.6);
}

/* ARENA SHAKE (pantalla breve al atacar) */
.arena-shake {
    animation: arenaShake 380ms cubic-bezier(.36, .07, .19, .97);
}

@keyframes arenaShake {
    0% {
        transform: translate(0, 0) rotate(0);
    }

    20% {
        transform: translate(-6px, 4px) rotate(-0.6deg);
    }

    40% {
        transform: translate(6px, -4px) rotate(0.6deg);
    }

    60% {
        transform: translate(-4px, 2px) rotate(-0.4deg);
    }

    80% {
        transform: translate(4px, -2px) rotate(0.4deg);
    }

    100% {
        transform: translate(0, 0) rotate(0);
    }
}

/* BARRA HP: transiciones y colores (estilo pokemon) */
.hp {
    height: 20px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform 0.35s ease, background 0.6s linear;
    border-radius: 10px;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.25);
}

/* tres estados (clases añadidas por JS) */
.hp-high {
    background: linear-gradient(90deg, #4caf50, #81c784);
}

.hp-medium {
    background: linear-gradient(90deg, #ffb300, #ff9800);
}

.hp-low {
    background: linear-gradient(90deg, #ff5e5e, #d73a3a);
}

/* small tweaks: ensure hp-bar's inner div stays clipped */
.hp-bar {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
}

/* ajuste visual de fighter (bordes/gradientes) para que parezca arena) */
.fighter {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.04));
    border-radius: 18px;
    padding: 26px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* sombras/bleeding para enfatizar elemento */
.fighter[data-element="fuego"] {
    box-shadow: 0 20px 50px rgba(255, 120, 40, 0.08), inset 0 0 20px rgba(255, 80, 20, 0.03);
}

.fighter[data-element="agua"] {
    box-shadow: 0 20px 50px rgba(0, 140, 220, 0.06), inset 0 0 20px rgba(0, 100, 200, 0.03);
}

.fighter[data-element="planta"] {
    box-shadow: 0 20px 50px rgba(60, 200, 100, 0.06), inset 0 0 20px rgba(20, 140, 60, 0.03);
}

/* hacer que la imagen se centre y tenga overlay glow */
.fighter img {
    display: block;
    margin: 8px auto;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s;
}

/* arena general (fondo tipo arena elemental) */
body.combat-page {
    background: radial-gradient(circle at 50% 20%, rgba(40, 35, 75, 0.85), rgba(12, 10, 28, 1) 70%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* overlay sutil animado (fondo arena) */
body.combat-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 140, 40, 0.02), transparent 10%),
        radial-gradient(circle at 85% 60%, rgba(30, 150, 255, 0.02), transparent 10%),
        radial-gradient(circle at 50% 85%, rgba(80, 220, 110, 0.02), transparent 10%);
    z-index: -1;
    animation: arenaOverlay 20s linear infinite;
}

@keyframes arenaOverlay {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-20px) scale(1.02);
        opacity: 0.95;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* pequeña responsividad: mantener VS central en móviles (apilar) */
@media (max-width: 880px) {
    .arena {
        flex-direction: column;
        gap: 18px;
        padding: 20px;
    }

    #vsBadge {
        margin: 0;
        width: 64px;
        height: 64px;
    }

    .you-badge {
        left: 12px;
        top: -10px;
        font-size: 0.85rem;
        padding: 5px 8px;
    }
}

/* ===============================
   AURA ELEMENTAL (TIPO KI)
   =============================== */

.fighter {
    position: relative;
    overflow: visible;
}

/* Capa principal del aura */
.fighter::before {
    content: "";
    position: absolute;
    inset: -48px;
    border-radius: 26px;
    z-index: -1;
    opacity: 0.95;
    filter: blur(28px) drop-shadow(0 0 25px currentColor);
    animation: auraPulse 3.5s ease-in-out infinite;
}

/* Capa secundaria (movimiento orgánico) */
.fighter::after {
    content: "";
    position: absolute;
    inset: -78px;
    border-radius: 32px;
    z-index: -2;
    opacity: 0.45;
    filter: blur(45px);
    animation: auraFlow 6s linear infinite;
}

@keyframes auraPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

@keyframes auraFlow {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ===============================
   AURA / VS / PARTÍCULAS - EXTRAS
   (añadir al final de style.css)
   =============================== */

/* intensificar aura cuando tenga clase aura-boost */
.fighter.aura-boost::before {
    animation-duration: 2.2s;
    filter: blur(24px) drop-shadow(0 0 40px currentColor);
    opacity: 1;
    transform-origin: center;
    /* Slightly stronger scale */
    transform: scale(1.04);
}

/* aura violent: más "agresiva" (parpadeo y mayor spread) */
.fighter.aura-violent::before {
    animation: auraPulse 1.6s ease-in-out infinite;
    filter: blur(36px) drop-shadow(0 0 48px currentColor);
    opacity: 1;
    inset: -60px;
}

.fighter.aura-violent::after {
    inset: -100px;
    opacity: 0.65;
    filter: blur(62px);
}

/* auras explosivas momentáneas */
.fighter.aura-explode {
    animation: auraExplode 0.45s ease-out;
}

@keyframes auraExplode {
    0% {
        transform: scale(1);
        filter: blur(28px) drop-shadow(0 0 30px currentColor);
        opacity: 1;
    }

    40% {
        transform: scale(1.35);
        filter: blur(10px) drop-shadow(0 0 70px currentColor);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        filter: blur(28px) drop-shadow(0 0 30px currentColor);
        opacity: 0.9;
    }
}

/* VS badge link / pulse */
#vsBadge.vs-link {
    animation: vsPulse 0.5s ease-in-out, vsVibrate 180ms ease-in-out 2;
    transform: scale(1.12);
    box-shadow: 0 18px 60px rgba(255, 160, 40, 0.85), inset 0 0 28px rgba(255, 255, 255, 0.12);
}

/* VS reacts visually to which side has boost */
#vsBadge.vs-p1-active {
    box-shadow: 0 18px 60px rgba(125, 255, 154, 0.28), inset 0 0 28px rgba(255, 255, 255, 0.06);
    background: radial-gradient(circle at 30% 30%, rgba(100, 230, 110, 0.95), rgba(40, 180, 80, 0.9));
}

#vsBadge.vs-p2-active {
    box-shadow: 0 18px 60px rgba(255, 120, 40, 0.28), inset 0 0 28px rgba(255, 255, 255, 0.06);
    background: radial-gradient(circle at 30% 30%, rgba(255, 180, 60, 0.95), rgba(255, 80, 10, 0.9));
}

/* linked state (both fighters slightly pulse) */
.fighter.vs-linked {
    transform: translateY(-2px) scale(1.005);
    transition: transform 220ms ease;
}

/* impact particle base tweaks */
.impact-particle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    opacity: 1;
    pointer-events: none;
    position: fixed;
    z-index: 9999;
}

/* stronger drop-shadow when aura-violent */
.fighter.aura-violent .particle {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

/* small fade for particles container to reduce visual clutter */
.fighter-particles {
    opacity: 0.98;
}

/* ensure vsBadge classes for mobile shrink */
@media (max-width: 880px) {
    #vsBadge.vs-link {
        transform: scale(1.06);
    }
}

/* ensure hp classes have slight glow when low */
.hp-low {
    box-shadow: inset 0 -6px 12px rgba(215, 58, 58, 0.35), 0 6px 30px rgba(215, 58, 58, 0.06);
}

.hp-medium {
    box-shadow: inset 0 -6px 12px rgba(255, 152, 0, 0.25), 0 6px 30px rgba(255, 152, 0, 0.04);
}

.hp-high {
    box-shadow: inset 0 -6px 12px rgba(76, 175, 80, 0.18), 0 6px 30px rgba(76, 175, 80, 0.03);
}

/* small transition for particle appearance (for better perceived performance) */
.particle {
    transition: transform 0.18s linear;
}

/* optional: reduce particle overflow on very small screens */
@media (max-width: 480px) {
    .particle {
        display: none;
    }

    .impact-particle {
        display: none;
    }
}

/* ===============================
   DADO ELEMENTAL (UI + ANIMACIONES)
   Añadir al final de style.css
   =============================== */

.dice-area {
    margin: 18px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* solo botones manejan entradas */
    height: 78px;
    transition: opacity 240ms ease;
    opacity: 0;
}

.dice-area.show {
    opacity: 1;
    pointer-events: none;
}

.dice-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateY(0);
}

/* contenedor del dado */
.dice {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #ffdca3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 -6px 18px rgba(255, 200, 120, 0.6);
    transform-origin: center;
    will-change: transform;
}

/* cara visible para mostrar número */
.dice-face {
    font-size: 28px;
    transform: translateY(0);
}

/* rotación contínua durante el "tirado" */
@keyframes diceSpin {
    0% {
        transform: rotateX(0deg) rotateY(0deg) translateY(0);
    }

    25% {
        transform: rotateX(200deg) rotateY(120deg) translateY(-4px);
    }

    50% {
        transform: rotateX(360deg) rotateY(240deg) translateY(0);
    }

    75% {
        transform: rotateX(520deg) rotateY(360deg) translateY(4px);
    }

    100% {
        transform: rotateX(720deg) rotateY(480deg) translateY(0);
    }
}

/* pequeña vibración/prueba final */
@keyframes diceBounce {
    0% {
        transform: translateY(0) scale(1);
    }

    40% {
        transform: translateY(-8px) scale(1.06);
    }

    60% {
        transform: translateY(0) scale(0.98);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* resultado centrado (texto) */
.dice-result {
    min-width: 280px;
    text-align: center;
    color: #ffd86b;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    font-size: 0.95rem;
}

/* resultado destacado (cuando sale el número) */
.dice-result .num {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    margin-left: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ocultar en móviles si no cabe */
@media (max-width: 480px) {
    .dice-result {
        display: none;
    }

    .dice {
        width: 58px;
        height: 58px;
        font-size: 22px;
    }
}

/* ---- Temporizadores de combate ---- */
.player-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.player-nick {
    font-size: 0.95rem;
    color: #ddd;
}

.player-timer {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    color: #f0f0f0;
    padding: 6px 10px;
    border-radius: 14px;
    min-width: 56px;
    text-align: center;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

/* temporizador del jugador activo */
.player-timer.active,
.fighter.turn-active .player-timer {
    background: linear-gradient(90deg, rgba(255, 200, 60, 0.12), rgba(255, 120, 40, 0.06));
    box-shadow: 0 6px 18px rgba(255, 140, 25, 0.08);
    transform: translateY(-2px);
}

/* tiempo bajo */
.player-timer.time-low {
    color: #ffdddd;
    background: rgba(255, 30, 30, 0.06);
    box-shadow: 0 6px 18px rgba(255, 30, 30, 0.06);
    animation: pulse-red 900ms infinite alternate;
}

@keyframes pulse-red {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.04);
    }
}

/* pequeño ajuste responsive/posicion */
.player-meta {
    margin-bottom: 8px;
}

/* opciones visuales auxiliares */
.vs-link {
    box-shadow: 0 0 26px rgba(255, 170, 80, 0.08);
}

.arena-shake {
    animation: arenaShake 420ms ease;
}

@keyframes arenaShake {
    0% {
        transform: translateY(0);
    }

    20% {
        transform: translateY(-6px);
    }

    40% {
        transform: translateY(4px);
    }

    60% {
        transform: translateY(-2px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ===========================
   TEMPORIZADOR: VISUAL FUERTE
   Añadir al FINAL de style.css
   =========================== */

/* Asegurar posicionamiento y prioridad base */
#p1_timer,
#p2_timer,
.player-timer {
    position: relative;
    z-index: 60;
    /* por si algo lo cubre */
    min-width: 64px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 14px;
    text-align: center;
    transition: transform .15s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    will-change: transform, box-shadow, background;
}

/* Timer cuando es el turno (ligero destaque) */
.fighter.turn-active .player-timer,
.player-timer.active {
    background: linear-gradient(90deg, rgba(255, 200, 60, 0.12), rgba(255, 140, 40, 0.06)) !important;
    box-shadow: 0 8px 22px rgba(255, 150, 40, 0.10) !important;
    color: #fff !important;
    transform: translateY(-2px) scale(1.02);
}

/* ESTADO CRÍTICO: <= 15s */
#p1_timer.time-low,
#p2_timer.time-low,
.player-timer.time-low,
.fighter.turn-active .player-timer.time-low {
    background: linear-gradient(135deg, rgba(255, 70, 70, 1), rgba(180, 20, 20, 1)) !important;
    color: #fff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.2) !important;
    transform: scale(1.1) !important;
    font-size: 1.06rem !important;
    letter-spacing: 0.5px;
    animation: timerDangerPulse 0.5s infinite alternate;
}


/* anillo externo pulsante (pseudo-element) */
.player-timer.time-low::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
    box-shadow: 0 0 40px rgba(255, 60, 60, 0.65);
    opacity: 0.85;
    filter: blur(8px);
}

/* latido / pulso */
@keyframes timerDangerPulse {
    from {
        transform: scale(1.06);
        filter: saturate(1);
    }

    to {
        transform: scale(1.12);
        filter: saturate(1.15);
    }
}

/* small responsive tweak: si no cabe en móvil, mantenlo legible */
@media (max-width: 480px) {

    #p1_timer,
    #p2_timer,
    .player-timer {
        font-size: 0.95rem;
        padding: 6px 8px;
    }

    .player-timer.time-low {
        transform: scale(1.06) !important;
    }
}

/* ===========================
   PARTICULAS: rendimiento/percepción
   =========================== */
.fighter-particles,
.particle {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* reducir duración máxima para percepción más inmediata */
.particle {
    animation-duration: 850ms !important;
}

/* IMPACT particles slightly faster */
.impact-particle {
    transition-duration: 560ms !important;
}

/* ===========================
   UTILITY: forzar visibilidad si JS pone estilos inline
   (usamos !important para garantizar override si hace falta)
   =========================== */
#p1_timer,
#p2_timer,
.player-timer {
    color: #fff !important;
}

/* ---------- Dice result (scope para evitar choque con .num global) ---------- */
#diceResult {
    font-size: 13px;
    color: #fff;
    display: inline-block;
    padding-left: 6px;
}

#diceResult .dice-num {
    display: inline-block;
    font-weight: 700;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.chat-header {
    padding: 8px 10px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-messages {
    flex: 1;
    padding: 8px 10px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-msg {
    margin-bottom: 8px;
    line-height: 1.25;
    font-size: 13px;
    opacity: 0;
    animation: logFadeIn 240ms forwards;
}

.chat-msg.me {
    color: #a8ffb0;
    text-align: right;
}

.chat-msg.enemy {
    color: #ffd6a5;
    text-align: left;
}

.chat-msg .meta {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.chat-form {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

#chatInput {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 6px 8px;
    color: #fff;
    border-radius: 6px;
}

#chatInput:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 160, 255, 0.06);
}

.combat-chat button {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    padding: 6px 10px;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

/* Los estilos antiguos de timeline y chat han sido eliminados y reemplazados por .combat-unified al final del archivo */


/* ================= CHAT (DERECHA, ESQUINA INFERIOR) ================= */
.combat-chat {
    position: fixed;
    right: var(--side-gap);
    bottom: 24px;
    width: min(420px, calc(var(--side-width) + 40px));
    max-width: 44vw;
    height: calc(36vh);
    min-height: 200px;
    background: linear-gradient(180deg, rgba(8, 8, 10, 0.45), rgba(5, 5, 8, 0.28));
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 900;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 13px;
    color: #fff;
    pointer-events: auto;
}

/* Asegúrate que el chat no interfiere visualmente: */
.combat-chat .chat-header {
    padding: 10px 12px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0));
}

.combat-chat .chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* evitar animaciones inesperadas cuando ya hay mensajes */
.combat-chat .chat-msg {
    margin: 0;
    line-height: 1.25;
    font-size: 13px;
    word-break: break-word;
    white-space: normal;
    opacity: 1 !important;
    animation: none !important;
}

.combat-chat .chat-msg.me {
    color: #a8ffb0;
    text-align: right;
}

.combat-chat .chat-msg.enemy {
    color: #ffd6a5;
    text-align: left;
}

.combat-chat .chat-form {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.02));
}

/* input */
.combat-chat #chatInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 10px;
    color: #fff;
    border-radius: 8px;
}

/* ================= ACCESSIBILITY / AVOID OVERLAP FALLBACK ================= */
/* Si hay overlays o botones fijos en la derecha, prevenir que el chat los cubra
   subiendo el chat ligeramente (prioridad visual) */
@media (min-width: 1200px) {
    .combat-chat {
        bottom: 28px;
    }
}

/* Pantallas medianas/pequeñas: no robar espacio de la arena, reducir side widths */
@media (max-width: 1200px) {
    :root {
        --side-width: 300px;
    }

    .combat-chat {
        width: min(360px, 40vw);
        height: calc(34vh);
    }

    .combat-timeline {
        width: var(--side-width);
        top: 100px;
        height: calc(44vh);
    }

    .arena {
        margin-left: calc(var(--side-width) + var(--side-gap));
        margin-right: calc(var(--side-width) + var(--side-gap));
    }
}

/* En móvil muy pequeño: apilar y usar layout vertical (chat vuelve a la derecha pero con menos ancho) */
@media (max-width: 880px) {
    .arena {
        margin-left: 20px;
        margin-right: 20px;
        padding: 20px;
    }

    .combat-timeline {
        left: 12px;
        top: 90px;
        width: 300px;
        height: calc(42vh);
    }

    .combat-chat {
        right: 12px;
        width: 320px;
        height: 260px;
        bottom: 18px;
    }
}

/* style_cleaned.css — Versión limpiada y consolidada
   Ubicación prevista: C:\xampp\htdocs\proyecto-daw\assets\css\style.css
   He consolidado duplicados, corregido sintaxis crítica y reducido tamaños de mensaje
   para evitar solapamientos (especialmente mensajes tras atacar / tirar dados).
   Si quieres que siga afinando o dividir en partes, dime y continúo.
*/

:root {
    --side-width: 320px;
    /* Ajustable (reduce para centrar más la arena) */
    --side-gap: 20px;
    --accent-gold: #ffd86b;
    --bg-1: #1a0f2e;
    --bg-2: #302b63;
}

/* ===== RESET Y CONFIG GLOBAL ===== */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2), #0f0c29);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
    min-height: 100vh;
}

@keyframes gradientMove {
    0% {
        background-position: 0 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0 50%
    }
}

/* ----- tipografías y utilidades ----- */
.text-center {
    text-align: center
}

.shadow {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4)
}

.center {
    margin: 20px 0;
    text-align: center
}

/* ===== ENCABEZADO Y NAV ===== */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.06)
}

header img {
    height: 50px
}

.main-nav {
    display: flex;
    gap: 14px
}

.main-nav button {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.5);
    transition: transform .2s, box-shadow .2s
}

.main-nav button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 22px rgba(108, 92, 231, 0.8)
}

/* ===== BOTONES GENERALES ===== */
button {
    cursor: pointer;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4)
}

nav button,
.shop-item button,
.btn-main {
    background: #4834d4;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 700;
    transition: all .25s
}

nav button:hover,
.shop-item button:hover,
.btn-main:hover {
    transform: scale(1.05)
}

.btn-main {
    background: #f39c12;
    color: #fff;
    font-size: 1.15rem;
    padding: .9rem 2rem;
    border-radius: 22px
}

.btn-main:hover {
    background: #f1c40f
}

/* ===== LAYOUT PRINCIPAL ===== */
main {
    flex: 1;
    padding: 2rem;
    text-align: center
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto
}

.card,
.shop-item {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    padding: 10px;
    transition: all .25s;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3)
}

.card:hover,
.shop-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1)
}

.card img,
.shop-item img {
    width: 100%;
    border-radius: 10px
}

.card.locked img {
    filter: grayscale(1);
    opacity: .5
}

/* ===== CAJAS / SLOTS ===== */
#slots {
    min-height: 220px;
    padding-bottom: 20px
}

#slots:empty {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center
}

#slots:empty::before {
    content: '🎁';
    position: absolute;
    top: 40px;
    font-size: 4rem;
    opacity: .25;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, .4));
    animation: floatGift 2.5s ease-in-out infinite
}

@keyframes floatGift {
    0% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-10px)
    }

    100% {
        transform: translateY(0)
    }
}

#slots:empty::after {
    content: "No tienes cajas todavía.\A\A Gana combates para conseguir recompensas.";
    white-space: pre-line;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    padding: 24px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02), 0 10px 30px rgba(0, 0, 0, 0.4)
}

/* ===== MODALES / OVERLAYS ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none
}

.overlay.active {
    pointer-events: all
}

.overlay-content {
    background: linear-gradient(180deg, #2d2d44, #1b1b2f);
    border-radius: 16px;
    padding: 24px;
    max-width: 900px;
    width: 92%;
    color: #fff;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.06);
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 120px
}

#btnConfirmarSeleccion,
#btnCancelarSeleccion {
    position: sticky;
    bottom: 15px;
    margin: 5px;
    z-index: 10
}

/* ===== TOOLS / BADGES ===== */
.you-badge {
    position: absolute;
    top: -12px;
    left: 18px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 180, 0, 0.95));
    color: #1e1e1e;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .45), 0 0 12px rgba(255, 200, 60, .6);
    transform: translateY(-6px);
    z-index: 10;
    font-size: .9rem;
    pointer-events: none
}

/* ===== PERFIL / HUD ===== */
.profile-card {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 25px auto;
    padding: 14px 26px;
    max-width: 520px;
    background: linear-gradient(180deg, rgba(35, 28, 70, 0.95), rgba(25, 20, 55, 0.95));
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.03)
}

.profile-card>div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #fff
}

#gold-container strong {
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, .7)
}

/* ===== TIENDA / PACK PREMIUM ===== */
.shop-item.premium {
    position: relative;
    border: 2px solid gold;
    background: linear-gradient(145deg, #1a1a1a, #2a2100);
    box-shadow: 0 0 20px rgba(255, 215, 0, .6);
    transform: scale(1.02);
    animation: premiumGlow 2s infinite alternate
}

@keyframes premiumGlow {
    from {
        box-shadow: 0 0 15px rgba(255, 215, 0, .4)
    }

    to {
        box-shadow: 0 0 30px rgba(255, 215, 0, .9)
    }
}

/* ===== RAREZAS / METADATA ===== */
.element-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.el-fire {
    background: linear-gradient(135deg, #ff6a00, #ff3d00)
}

.el-water {
    background: linear-gradient(135deg, #00bcd4, #0288d1)
}

.el-plant {
    background: linear-gradient(135deg, #4caf50, #2e7d32)
}

.rarity-badge {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600
}

.rarity-uncommon {
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #4a2c00
}

/* ===== ANIMACIONES GLOBALES PARTICULAS / EXPLOSIONES ===== */
.box-explosion {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden
}

.element-particle {
    position: fixed;
    font-size: 30px;
    pointer-events: none;
    z-index: 9999;
    --x: 0px;
    --y: 0px;
    animation: explode 900ms cubic-bezier(.1, .8, .2, 1) forwards
}

@keyframes explode {
    from {
        transform: translate(0, 0) scale(1);
        opacity: 1
    }

    to {
        transform: translate(var(--x), var(--y)) scale(.25);
        opacity: 0
    }
}

@keyframes pulse-red {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 12px rgba(255, 0, 0, .6)
    }

    100% {
        transform: scale(1)
    }
}

/* ===== FORMULARIO / ORACLE / UI VARIOS ===== */
form input,
form textarea {
    background: rgba(20, 15, 35, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px;
    border-radius: 14px;
    width: 100%
}

.form-msg.sending {
    color: var(--accent-gold)
}

.form-msg.success {
    color: #00ffae
}

.form-msg.error {
    color: #ff6b6b
}

/* ===== ARENA / COMBAT PAGE ===== */
body.combat-page {
    background: #0a0a0f radial-gradient(circle at 50% 30%, #1e1b3a 0%, #050510 100%);
    background-attachment: fixed;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

body.combat-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 120, 0, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(0, 200, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(100, 255, 100, 0.03) 0%, transparent 50%);
    z-index: -1;
    animation: arenaOverlay 10s ease-in-out infinite alternate;
}

@keyframes arenaOverlay {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.arena {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    /* Reducida la separación entre cartas */
    margin: 40px auto;
    max-width: 1100px;
    perspective: 1000px;
}

/* ===== FIGHTERS / HP BAR (RPG STYLE RE-DESIGN) ===== */
.fighter-pedestal {
    position: relative;
    width: 320px;
    background: radial-gradient(circle at top, rgba(30, 30, 45, 0.4), rgba(10, 10, 15, 0.6));
    border-radius: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Pedestal 3D Base */
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 2px 2px rgba(255, 255, 255, 0.08);
}

.fighter-pedestal::after {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 80%;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
    z-index: -1;
}

/* Identidad Superior (Top Bar) */
.player-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    border-radius: 20px 20px 0 0;
    box-sizing: border-box;
}

.player-top-bar.reverse {
    flex-direction: row-reverse;
}

.player-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-identity.reverse {
    flex-direction: row-reverse;
}

.fighter-nick {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

/* Zona de la Carta (Centro) */
.card-zone {
    position: relative;
    width: 100%;
    height: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    z-index: 2;
}

.card-shadow {
    position: absolute;
    bottom: 70px;
    width: 120px;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: shadowPulse 3.6s ease-in-out infinite;
}

@keyframes shadowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

.floating-card {
    position: relative;
    width: 175px;
    border-radius: 12px;
    z-index: 3;
    animation: floatCard 3.6s ease-in-out infinite;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.5));
}

.fighter-pedestal.ko-defeated {
    animation: koPedestalPulse 0.55s ease-in-out 2;
}

.floating-card.ko-card-fall {
    animation: koCardFall 1.65s cubic-bezier(0.18, 0.89, 0.32, 1.1) forwards !important;
    filter: grayscale(1) brightness(0.45) drop-shadow(0 22px 18px rgba(0, 0, 0, 0.85)) !important;
}

.ko-impact-label {
    position: absolute;
    left: 50%;
    top: 43%;
    z-index: 80;
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    color: #fff;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 1000;
    letter-spacing: 0.08em;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.95),
        0 0 30px rgba(255, 54, 54, 0.85),
        0 12px 22px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.ko-impact-label.show {
    animation: koLabelBurst 1.45s ease-out forwards;
}

@keyframes koCardFall {
    0% {
        transform: translateY(0) rotate(-1.5deg) scale(1);
        opacity: 1;
    }
    18% {
        transform: translateY(-16px) rotate(4deg) scale(1.04);
        opacity: 1;
    }
    42% {
        transform: translateY(18px) rotate(-11deg) scale(0.98);
        opacity: 0.9;
    }
    100% {
        transform: translateY(72px) rotate(-24deg) scale(0.84);
        opacity: 0.38;
    }
}

@keyframes koPedestalPulse {
    0%, 100% {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 60px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 20px 70px rgba(255, 55, 55, 0.42), inset 0 0 90px rgba(255, 55, 55, 0.18);
    }
}

@keyframes koLabelBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.35);
        filter: blur(6px);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.16);
        filter: blur(0);
    }
    72% {
        opacity: 1;
        transform: translate(-50%, -58%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -72%) scale(0.92);
    }
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0) rotate(-1.5deg);
    }

    50% {
        transform: translateY(-12px) rotate(1.5deg);
    }
}

/* Info de Carta Flotante */
.card-info-floating {
    position: absolute;
    bottom: 25px;
    background: rgba(15, 15, 20, 0.9);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 10;
    transform: translateY(10px);
}

.card-name-title {
    margin: 0;
    font-size: 1.1rem;
    color: #ffd700;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.card-stats-row {
    display: flex;
    gap: 8px;
}

/* Barra de Vida Rediseñada */
.hp-container {
    width: 90%;
    padding: 15px 0 25px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 3;
}

.hp-bar.glass {
    width: 100%;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hp {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.6s linear;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), inset 0 -4px 8px rgba(0, 0, 0, 0.3);
}

.hp::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.hp-text {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.hp-high {
    background: linear-gradient(90deg, #2e7d32, #4caf50);
}

.hp-medium {
    background: linear-gradient(90deg, #f57c00, #ffb300);
}

.hp-low {
    background: linear-gradient(90deg, #c62828, #ff5252);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), inset 0 -4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 0, 0, 0.6);
}

/* Auras Elementales del Pedestal (Vistas en el Suelo y Bordes) */
.fighter-pedestal[data-element='fuego'] {
    border-bottom: 3px solid #ff3d00;
    box-shadow: 0 20px 50px rgba(255, 60, 0, 0.15), inset 0 -30px 60px rgba(255, 60, 0, 0.08);
}

.fighter-pedestal[data-element='agua'] {
    border-bottom: 3px solid #00cfff;
    box-shadow: 0 20px 50px rgba(0, 207, 255, 0.15), inset 0 -30px 60px rgba(0, 207, 255, 0.08);
}

.fighter-pedestal[data-element='planta'] {
    border-bottom: 3px solid #4caf50;
    box-shadow: 0 20px 50px rgba(76, 175, 80, 0.15), inset 0 -30px 60px rgba(76, 175, 80, 0.08);
}


/* VS badge (Jewel central) */
.vs-jewel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    z-index: 5;
}

#vsBadge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 1.8rem;
    color: #fff;
    background: radial-gradient(circle at 30% 30%, #ffdf00, #ff8c00);
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 -5px 15px rgba(0, 0, 0, 0.4), inset 0 5px 15px rgba(255, 255, 255, 0.8);
    transform: translateY(-20px);
    z-index: 30;
    animation: vsPulseJewel 2s infinite ease-in-out;
}

@keyframes vsPulseJewel {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 -5px 15px rgba(0, 0, 0, 0.4), inset 0 5px 15px rgba(255, 255, 255, 0.8);
        transform: translateY(-20px) scale(0.98);
    }

    50% {
        box-shadow: 0 15px 40px rgba(255, 160, 40, 0.6), inset 0 -5px 15px rgba(0, 0, 0, 0.4), inset 0 5px 15px rgba(255, 255, 255, 0.8);
        transform: translateY(-20px) scale(1.02);
    }
}

@keyframes vsVibrate {
    0% {
        transform: translateY(-8px) rotate(-1deg)
    }

    25% {
        transform: translateY(-6px) rotate(1deg)
    }

    50% {
        transform: translateY(-8px) rotate(-1deg)
    }

    75% {
        transform: translateY(-10px) rotate(1deg)
    }

    100% {
        transform: translateY(-8px) rotate(-1deg)
    }
}

/* arena shake */
.arena-shake {
    animation: arenaShake .38s cubic-bezier(.36, .07, .19, .97)
}

.arena {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px;
    padding: 20px;
    width: 100%;
    margin: 0 auto;
    max-width: 1400px;
}

@keyframes arenaShake {
    0% {
        transform: translate(0, 0) rotate(0)
    }

    20% {
        transform: translate(-6px, 4px) rotate(-.6deg)
    }

    40% {
        transform: translate(6px, -4px) rotate(.6deg)
    }

    60% {
        transform: translate(-4px, 2px) rotate(-.4deg)
    }

    80% {
        transform: translate(4px, -2px) rotate(.4deg)
    }

    100% {
        transform: translate(0, 0) rotate(0)
    }
}

/* ===== PARTICULAS (JS) ===== */
.fighter-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
    will-change: opacity
}

.particle {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    pointer-events: none;
    transform-origin: center;
    will-change: transform, opacity;
    animation: particleRise .85s ease-out forwards;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45))
}

.particle.fire {
    background: radial-gradient(circle at 40% 35%, rgba(255, 230, 170, .95), rgba(255, 90, 20, .9));
    box-shadow: 0 0 12px rgba(255, 130, 30, .8);
    width: 14px;
    height: 24px;
    border-radius: 6px
}

.particle.water {
    background: radial-gradient(circle at 40% 40%, rgba(200, 255, 255, .95), rgba(0, 160, 255, .85));
    box-shadow: 0 0 12px rgba(0, 170, 255, .6)
}

.particle.plant {
    background: radial-gradient(circle at 50% 40%, rgba(180, 255, 190, .95), rgba(40, 180, 80, .85));
    box-shadow: 0 0 12px rgba(80, 200, 100, .5)
}

@keyframes particleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1
    }

    60% {
        opacity: .95;
        transform: translateY(-70px) scale(.9) rotate(6deg)
    }

    100% {
        transform: translateY(-140px) scale(.6) rotate(18deg);
        opacity: 0;
        filter: blur(2px)
    }
}

/* impact particles */
.impact-particle {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform .56s cubic-bezier(.2, .9, .2, 1), opacity .56s
}

/* ===== DICE AREA ===== */
.dice-area {
    margin: 18px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    height: 78px;
    transition: opacity 240ms ease;
    opacity: 0
}

.dice-area.show {
    opacity: 1
}

.dice {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #ffdca3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 -6px 18px rgba(255, 200, 120, .6);
    transform-origin: center
}

@keyframes diceSpin {
    0% {
        transform: rotateX(0) rotateY(0)
    }

    25% {
        transform: rotateX(200deg) rotateY(120deg) translateY(-4px)
    }

    50% {
        transform: rotateX(360deg) rotateY(240deg)
    }

    75% {
        transform: rotateX(520deg) rotateY(360deg) translateY(4px)
    }

    100% {
        transform: rotateX(720deg) rotateY(480deg)
    }
}

@keyframes diceBounce {
    0% {
        transform: translateY(0) scale(1)
    }

    40% {
        transform: translateY(-8px) scale(1.06)
    }

    60% {
        transform: translateY(0) scale(.98)
    }

    100% {
        transform: translateY(0) scale(1)
    }
}

.dice-result {
    min-width: 220px;
    text-align: center;
    color: var(--accent-gold);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, .6);
    font-size: .95rem
}

.dice-result .num {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    margin-left: 8px;
    font-size: 14px;
    font-weight: 800
}

/* ===== TIMERS / PLAYER META ===== */
.player-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px
}

.player-nick {
    font-size: .95rem;
    color: #ddd
}

/* TIMERS ORDINARIOS */
.player-timer {
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
    font-size: .95rem;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 6px 12px;
    border-radius: 14px;
    min-width: 65px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all .3s ease;
}

/* Resaltado del turno activo */
.fighter.turn-active .player-timer {
    background: linear-gradient(135deg, #6c5ce7, #4834d4) !important;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.6);
    transform: scale(1.05);
}

.fighter.turn-active .player-nick {
    color: #ffd86b;
    font-weight: 800;
}

/* TEXTOS DE HP */
.hp-text-container {
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 5px;
}

/* forzar color blanco si JS inyecta inline */
#p1_timer,
#p2_timer,
.player-timer {
    color: #fff !important
}

/* ===== MENSAJES DE ENCUENTRO / LOG / CHAT ===== */
/* Mensaje central tras atacar / encuentro: reducir tamaño para evitar solapamientos */
#encounterMessage {
    display: none;
    position: fixed;
    top: 28%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .85);
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.3;
    z-index: 9999;
    max-width: 80vw;
    word-break: break-word
}

/* Registro redundante eliminado */


/* ===== END OVERLAY (REDISEÑADO) ===== */
#endOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    color: #fff;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#endOverlay.anim-active {
    opacity: 1;
}

#endOverlay>div {
    background: linear-gradient(135deg, #1e1e2e 0%, #0f0f1a 100%);
    padding: 50px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1), 0 0 20px rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 500px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#endOverlay.anim-active>div {
    transform: scale(1);
}

.victory-banner {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.defeat-banner {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ff4c4c;
    text-shadow: 0 0 20px rgba(255, 76, 76, 0.5), 0 4px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.end-prize-container,
.end-defeat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.chest-box {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 10px 0;
}

.won-chest-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    animation: chestBounce 2s infinite ease-in-out;
    z-index: 2;
    position: relative;
}

@keyframes chestBounce {

    0%,
    100% {
        transform: translateY(0) scale(1.05);
    }

    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

.chest-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.6;
    }
}

.trophy-gain {
    font-size: 1.5rem;
    color: #4caf50;
    font-weight: 800;
}

.trophy-loss {
    font-size: 1.5rem;
    color: #ff4c4c;
    font-weight: 800;
}

.defeat-icon {
    font-size: 4rem;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
    animation: floatDefeat 4s infinite ease-in-out;
}

@keyframes floatDefeat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Rediseño de botones en el fin del juego */
#btnBackMain {
    margin-top: 30px;
    padding: 14px 40px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #6c5ce7 0%, #4834d4 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* =====================================================
   BOTONES DE ACCIÓN (3D)
   ===================================================== */
.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px auto;
    flex-wrap: wrap;
    z-index: 100;
    position: relative;
}

.actions button {
    position: relative;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#btnAttack {
    background: linear-gradient(180deg, #ffd700 0%, #ff8c00 100%);
    box-shadow: 0 8px 0 #b36200, 0 15px 25px rgba(255, 140, 0, 0.3);
}

#btnAttack:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #b36200, 0 20px 30px rgba(255, 140, 0, 0.4);
}

#btnAttack:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #b36200;
}

#btnAttack::before {
    content: '⚔️';
    font-size: 1.4rem;
}

#btnDice {
    background: linear-gradient(180deg, #00d2ff 0%, #3a7bd5 100%);
    box-shadow: 0 8px 0 #204e8f, 0 15px 25px rgba(58, 123, 213, 0.3);
}

#btnDice:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #204e8f, 0 20px 30px rgba(58, 123, 213, 0.4);
}

#btnDice:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #204e8f;
}

#btnDice::before {
    content: '🎲';
    font-size: 1.4rem;
}

#btnFlee {
    background: linear-gradient(180deg, #ff4c4c 0%, #b32a2a 100%);
    box-shadow: 0 8px 0 #7a1a1a, 0 15px 25px rgba(179, 42, 42, 0.3);
}

#btnFlee:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 0 #7a1a1a, 0 20px 30px rgba(179, 42, 42, 0.4);
}

#btnFlee:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #7a1a1a;
}

#btnFlee::before {
    content: '🏁';
    font-size: 1.4rem;
}

.actions button:disabled {
    filter: grayscale(1) brightness(0.6);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== DICE RESULT SMALL FIXES ===== */
#diceResult {
    font-size: 13px;
    color: #fff;
    display: inline-block;
    padding-left: 6px
}

#diceResult .dice-num {
    display: inline-block;
    font-weight: 700;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: #fff
}

/* ===== RESPONSIVE ===== */
@media(max-width:1200px) {
    :root {
        --side-width: 300px
    }

    .combat-chat {
        width: min(360px, 40vw);
        height: calc(34vh)
    }

    .combat-timeline {
        width: var(--side-width);
        top: 100px;
        height: calc(44vh)
    }

    .arena {
        margin-left: calc(var(--side-width) + var(--side-gap));
        margin-right: calc(var(--side-width) + var(--side-gap))
    }
}

@media(max-width:880px) {
    .arena {
        flex-direction: column;
        gap: 18px;
        padding: 20px;
        margin-left: 20px;
        margin-right: 20px
    }

    #vsBadge {
        width: 64px;
        height: 64px
    }

    .you-badge {
        left: 12px;
        top: -10px;
        font-size: .85rem;
        padding: 5px 8px
    }

    .combat-timeline {
        left: 12px;
        top: 90px;
        width: 300px;
        height: calc(42vh)
    }

    .combat-chat {
        right: 12px;
        width: 320px;
        height: 260px;
        bottom: 18px
    }
}

@media(max-width:480px) {

    .particle,
    .impact-particle {
        display: none
    }

    .dice {
        width: 58px;
        height: 58px;
        font-size: 22px
    }

    .dice-result {
        display: none
    }
}

/* ===== MISC PERFORMANCE / WILL-CHANGE HINTS ===== */
.fighter-particles,
.particle {
    will-change: transform, opacity
}

/* ===== FIX: hacer legible y encima el resultado del dado (dice result) ===== */
:root {
    --dice-z: 1205;
    /* prioridad, ajustar si hace falta */
}

/* Forzar que el contenedor del resultado del dado sea visible y contrastado */
#diceResult,
.dice-result {
    position: fixed;
    /* lo posicionamos respecto a la ventana para que no quede detrás */
    left: calc(var(--side-gap) + 12px);
    /* pegado a la columna timeline */
    top: calc(110px + 38px);
    /* justo debajo del encabezado/turno (ajusta si tu timeline cambia) */
    z-index: var(--dice-z) !important;
    background: rgba(6, 6, 10, 0.78);
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--accent-gold, #ffd86b) !important;
    font-weight: 800;
    font-size: 13px !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
    max-width: calc(var(--side-width) - 28px);
    white-space: normal;
    word-break: break-word;
    pointer-events: none;
    /* no interfiere con clicks */
    backdrop-filter: blur(4px);
}

/* si usas un span dentro (#diceResult .dice-num o .dice-num) lo resaltamos */
#diceResult .dice-num,
.dice-result .num {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 14px !important;
    margin-left: 8px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

/* Responsive: en pantallas pequeñas movemos el resultado más centrado para que no se salga */
@media (max-width: 880px) {

    #diceResult,
    .dice-result {
        left: 18px;
        top: calc(90px + 32px);
        max-width: calc(100vw - 36px);
        font-size: 12px !important;
    }
}







/* =====================================================
   PANEL UNIFICADO DE COMBATE (reemplaza timeline + chat)
   Panel lateral derecho con log de eventos + chat
   ===================================================== */

/* Ocultar los paneles originales si quedaran */
.combat-timeline,
.combat-chat {
    display: none !important;
}

/* ===== Panel unificado ===== */
.combat-unified {
    position: fixed;
    right: 20px;
    top: 90px;
    width: 380px;
    max-width: 40vw;
    height: calc(100vh - 130px);
    background: linear-gradient(180deg, rgba(15, 12, 41, 0.92), rgba(10, 8, 25, 0.95));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(100% + 32px));
    transition: transform 0.28s ease, opacity 0.22s ease;
}

body.chat-panel-open .combat-unified {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

body.combat-page:not(.chat-panel-open) .arena {
    margin-left: 40px !important;
    margin-right: 40px !important;
}

body.chat-panel-open .arena {
    margin-left: 40px !important;
    margin-right: 440px !important;
}

body.combat-page:not(.chat-panel-open) div.actions {
    margin-left: 40px !important;
    margin-right: 40px !important;
}

body.chat-panel-open div.actions {
    margin-left: 40px !important;
    margin-right: 440px !important;
}

.combat-chat-toggle {
    position: fixed;
    right: 18px;
    top: 50%;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.55);
    background: linear-gradient(145deg, rgba(20, 20, 40, 0.95), rgba(52, 36, 8, 0.94));
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1095;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 190, 45, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.combat-chat-toggle:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: #ffd700;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.62), 0 0 26px rgba(255, 190, 45, 0.36);
}

.combat-chat-toggle i {
    font-size: 1.25rem;
}

body.chat-panel-open .combat-chat-toggle {
    opacity: 0;
    pointer-events: none;
}

.chat-toggle-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff4040;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid rgba(20, 20, 35, 0.95);
    box-shadow: 0 0 12px rgba(255, 64, 64, 0.65);
}

.chat-toggle-badge.show {
    display: flex;
}

.unified-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-persist-toggle {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.chat-persist-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chat-persist-toggle .checkmark {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-persist-toggle .checkmark::after {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
    color: #1a1200;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-persist-toggle input:checked + .checkmark {
    background: #ffd700;
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.38);
}

.chat-persist-toggle input:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.chat-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.chat-panel-close:hover {
    background: rgba(255, 70, 70, 0.18);
    border-color: rgba(255, 90, 90, 0.45);
}

.unified-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffd86b;
    font-weight: 700;
}

.unified-feed {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 200, 50, 0.5) rgba(0, 0, 0, 0.2);
}

/* Scrollbar personalizada estilo elemental (Chromium / Edge / Safari) */
.unified-feed::-webkit-scrollbar {
    width: 6px;
}

.unified-feed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
}

.unified-feed::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffc832 0%, #ff8c00 100%);
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(255, 180, 0, 0.6);
    transition: background 0.3s ease;
}

.unified-feed::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffe066 0%, #ffaa00 100%);
    box-shadow: 0 0 14px rgba(255, 200, 0, 0.9);
}

/* Fix crítico para evitar el texto vertical */
.unified-feed .log-entry {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    word-break: break-word !important;
    margin-bottom: 4px;
}

.unified-feed .log-entry .ts {
    display: none;
}

.unified-feed .log-entry.chat-me .ts,
.unified-feed .log-entry.chat-enemy .ts {
    display: block !important;
    font-size: 10px;
    opacity: 0.5;
    margin-top: 4px;
}

.unified-feed .log-entry .icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.unified-feed .log-entry .content {
    flex: 1;
    min-width: 0;
    /* Permite que el flex-child colapse si es necesario sin romper el layout */
    text-align: left;
}

.unified-feed .log-entry .content span {
    display: inline !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
}

.unified-feed .log-entry .main-text {
    font-size: 13px !important;
    line-height: 1.3 !important;
}

.unified-feed .log-entry.chat-me {
    border-left: 3px solid #4caf50;
    background: rgba(76, 175, 80, 0.08);
}

.unified-feed .log-entry.chat-enemy {
    border-left: 3px solid #ff9800;
    background: rgba(255, 152, 0, 0.08);
}

.unified-feed .log-entry.dice {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: 14px 16px;
    height: auto;
    min-height: unset;
    overflow: visible;
}

.unified-feed .log-entry.dice .main-text {
    font-size: 13px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
}

.unified-feed .log-entry.dice .content div {
    font-size: 12px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    margin-top: 4px;
}

.unified-chat-form {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
}

.unified-chat-form input {
    flex: 1;
    background: rgba(13, 17, 33, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
}

/* ─── BOTÓN ENVIAR ÉPICO ELEMENTAL ──────────────────────────── */
/* ─── BOTÓN ENVIAR ÉPICO ELEMENTAL (REDiseño) ──────────── */
.chat-send-epic {
    flex-shrink: 0;
    padding: 0 20px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 200, 0, 0.2), rgba(255, 100, 0, 0.3));
    color: #ffd700;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chat-send-epic::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.chat-send-epic:hover::before {
    left: 100%;
}

.chat-send-epic:hover {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.4));
    box-shadow: 0 0 20px rgba(255, 180, 0, 0.4);
    transform: translateY(-2px);
}

.chat-send-epic i {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-send-epic:hover i {
    transform: translateX(5px) rotate(-10deg);
    color: #fff;
}

.chat-send-epic .btn-text {
    font-size: 11px;
}

.chat-send-epic:active {
    transform: translateY(1px) scale(0.98);
}

/* ─── MODAL 3D DADO ELEMENTAL ────────────────────────────────── */
.dice-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.dice-modal-box {
    background: linear-gradient(160deg, rgba(20,20,40,0.95), rgba(10,10,25,0.98));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 180, 0, 0.3), 0 25px 50px rgba(0,0,0,0.8);
    min-width: 300px;
}

.dice-modal-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* 3D Scene */
.dice-scene {
    width: 120px;
    height: 120px;
    perspective: 500px;
    margin: 0 auto 30px;
}

.dice-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(20deg) rotateY(20deg);
    animation: diceRoll 1.2s linear infinite;
}

.dice-3d.dice-stop {
    animation: diceStop 0.6s ease forwards;
}

@keyframes diceRoll {
    0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(180deg); }
}

/* Face rotation rotations are set dynamically via JS based on result */
.dice-face {
    position: absolute;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(30,20,0,0.9));
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.8);
    box-shadow: inset 0 0 20px rgba(255,215,0,0.1);
    backface-visibility: visible;
}

.dice-face.face-1 { transform: translateZ(60px); }
.dice-face.face-2 { transform: rotateY(180deg) translateZ(60px); }
.dice-face.face-3 { transform: rotateY(90deg) translateZ(60px); }
.dice-face.face-4 { transform: rotateY(-90deg) translateZ(60px); }
.dice-face.face-5 { transform: rotateX(90deg) translateZ(60px); }
.dice-face.face-6 { transform: rotateX(-90deg) translateZ(60px); }

/* Result label that appears after rolling */
.dice-result-label {
    font-size: 2rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 25px rgba(255,215,0,1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 10px;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

/* ─── CENTRADO BOTONES ACCIÓN ──────────────────────────────── */
.combat-page .actions,
body.combat-page div.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-left: 40px !important;
    margin-right: 440px !important;
    margin-top: 20px;
    gap: 20px;
}

/* ──────────────────────────────────
   PERFIL EN COMBATE (AVATAR + NAME)
────────────────────────────────── */
.player-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    width: 100%;
}

.avatar-frame-wrap-mini {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

.avatar-frame-wrap-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

@media (max-width: 600px) {
    .player-header {
        justify-content: center !important;
    }
}

@media (max-width: 1100px) {
    .combat-unified {
        width: 300px;
    }

    .arena {
        margin-right: 340px !important;
    }
}

@media (max-width: 850px) {
    .combat-unified {
        position: relative;
        width: 100%;
        height: 350px;
        right: 0;
        top: 0;
        margin-top: 20px;
    }

    .arena {
        margin-right: 0 !important;
        flex-direction: column;
        gap: 30px;
    }

    .fighter-pedestal {
        width: 100%;
        max-width: 380px;
    }

    .vs-jewel-container {
        padding: 10px 0;
    }

    #vsBadge {
        width: 70px;
        height: 70px;
        font-size: 1.4rem;
        transform: translateY(0);
        animation: vsPulseJewelMobile 2s infinite ease-in-out;
    }

    @keyframes vsPulseJewelMobile {

        0%,
        100% {
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8), inset 0 -3px 10px rgba(0, 0, 0, 0.4), inset 0 3px 10px rgba(255, 255, 255, 0.8);
            transform: scale(0.98);
        }

        50% {
            box-shadow: 0 10px 25px rgba(255, 160, 40, 0.6), inset 0 -3px 10px rgba(0, 0, 0, 0.4), inset 0 3px 10px rgba(255, 255, 255, 0.8);
            transform: scale(1.02);
        }
    }
}

/* ──────────────────────────────────
   PREMIUM CARD SELECTION UI
────────────────────────────────── */
.premium-card-select {
    width: 140px;
    background: rgba(20, 20, 35, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.premium-card-select:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0, 207, 255, 0.3);
    border-color: rgba(0, 207, 255, 0.5);
    z-index: 10;
}

.premium-card-select.selected-card {
    border: 3px solid #00ff88;
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.6), inset 0 0 15px rgba(0, 255, 136, 0.2);
    transform: translateY(-5px) scale(1.08);
    z-index: 20;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.card-image-wrapper img {
    width: 100%;
    border-radius: 8px;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.card-level-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    border: 1px solid #fff;
    text-transform: uppercase;
}

.card-info-box {
    width: 100%;
    text-align: center;
}

.card-name {
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

.premium-card-select.selected-card .card-name {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
}

.card-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.stat-badge {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.stat-badge.atk {
    color: #ff4c4c;
}

.stat-badge.hp {
    color: #00cfff;
}

.stat-badge i {
    font-size: 0.7rem;
}

/* ──────────────────────────────────
   VS ANIMATION OVERLAY (RPG STYLE)
────────────────────────────────── */
.vs-anim-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    /* Oculto por defecto */
    transition: opacity 0.3s ease;
}

.vs-anim-overlay.active {
    opacity: 1;
}

/* Fondos divididos rasgados */
.vs-anim-bg {
    position: absolute;
    top: 0;
    width: 55vw;
    height: 100vh;
    background: #111;
    z-index: 1;
}

.vs-anim-bg.left-bg {
    left: 0;
    background: linear-gradient(135deg, rgba(20, 40, 80, 0.95) 0%, rgba(10, 15, 30, 0.95) 100%);
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
    transform: translateX(-100%);
}

.vs-anim-bg.right-bg {
    right: 0;
    background: linear-gradient(-135deg, rgba(80, 20, 20, 0.95) 0%, rgba(30, 10, 10, 0.95) 100%);
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(100%);
}

.vs-anim-overlay.active .left-bg {
    animation: slideInLeft 0.5s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

.vs-anim-overlay.active .right-bg {
    animation: slideInRight 0.5s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
    }
}

/* Luchadores */
.vs-fighter {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
}

.vs-fighter.me {
    left: 15%;
    transform: translateX(-100px);
}

.vs-fighter.enemy {
    right: 15%;
    transform: translateX(100px);
}

.vs-anim-overlay.active .vs-fighter.me {
    animation: fighterInLeft 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) 0.3s forwards;
}

.vs-anim-overlay.active .vs-fighter.enemy {
    animation: fighterInRight 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) 0.3s forwards;
}

@keyframes fighterInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fighterInRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.vs-avatar-wrap {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #fff;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    background: #000;
}

.vs-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-fighter.me .vs-avatar-wrap {
    border-color: #00cfff;
    box-shadow: 0 0 40px rgba(0, 207, 255, 0.5);
}

.vs-fighter.enemy .vs-avatar-wrap {
    border-color: #ff4c4c;
    box-shadow: 0 0 40px rgba(255, 76, 76, 0.5);
}

.vs-name {
    margin-top: 15px;
    font-size: 2.5rem;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.8);
    font-weight: 900;
    letter-spacing: 2px;
}

/* Texto VS Central */
.vs-center-logo {
    position: absolute;
    z-index: 3;
    font-size: 8rem;
    font-weight: 900;
    font-style: italic;
    color: #ffd700;
    text-shadow: 0 0 30px #ff8c00, 4px 4px 0 #000;
    opacity: 0;
    transform: scale(5);
}

.vs-anim-overlay.active .vs-center-logo {
    animation: stampVS 0.5s cubic-bezier(0.1, 0.9, 0.2, 1) 0.6s forwards, pulseVS 2s infinite 1.1s;
}

@keyframes stampVS {
    0% {
        transform: scale(5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(-10deg);
        opacity: 1;
        filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.8));
    }
}

@keyframes pulseVS {

    0%,
    100% {
        transform: scale(1) rotate(-10deg);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }

    50% {
        transform: scale(1.1) rotate(-10deg);
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
}

/* Countdown Number */
.vs-countdown {
    position: absolute;
    bottom: 20%;
    width: 100%;
    text-align: center;
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #000, 0 0 40px rgba(255, 255, 255, 0.5);
    z-index: 4;
    transition: opacity 0.2s, transform 0.2s;
}

.vs-countdown.pop {
    transform: scale(1.3);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .vs-fighter.me {
        left: 5%;
    }

    .vs-fighter.enemy {
        right: 5%;
    }

    .vs-avatar-wrap {
        width: 100px;
        height: 100px;
    }

    .vs-name {
        font-size: 1.5rem;
    }

    .vs-center-logo {
        font-size: 5rem;
    }

    .vs-countdown {
        font-size: 3rem;
    }
}

/* MODAL CONFIRMACION PREMIUM */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.confirm-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.confirm-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-modal-overlay.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-content strong {
    color: #ffd700;
}

.upgrade-stats-preview {
    display: grid;
    gap: 10px;
    margin: 16px auto 0;
    max-width: 310px;
    text-align: left;
}

.upgrade-stat-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(77, 163, 255, 0.08));
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.04);
}

.upgrade-stat-label {
    color: #dbe8ff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.upgrade-stat-values {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8da3c0;
    font-size: 1rem;
}

.upgrade-stat-values strong:last-child {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.55);
}

.upgrade-stat-values i {
    color: #ffd700;
    font-size: 0.8rem;
}

.upgrade-stat-gain {
    min-width: 42px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(46, 213, 115, 0.16);
    color: #7dffad;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.upgrade-prestige-note {
    margin: 2px 4px 0;
    color: #b8c7e6;
    font-size: 0.84rem;
    line-height: 1.35;
    text-align: center;
}

/* ===== OVERRIDE FINAL: ALBUM PREMIUM 3D FLIPBOOK ===== */
.book-container {
    position: relative;
    width: 1400px;
    height: 950px;
    margin: 20px auto 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Glow elemental y animación de levitación global */
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 69, 0, 0.1), 0 0 30px rgba(0, 191, 255, 0.1) !important;
    animation: floatBook 6s ease-in-out infinite, pulseGlow 4s alternate infinite;
    transform-origin: center top;
}

/* El libro 3D per se */
.flipbook {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    perspective: 3000px; /* Profundidad 3D */
    background: url('../images/ui/book_bg.webp') no-repeat center center !important;
    background-size: 100% 100% !important;
}

/* Portadas estáticas simuladas sobre la imagen de fondo */
.hardcover {
    width: 50%;
    height: 100%;
    position: absolute;
    top: 0;
    z-index: 1;
}
.hardcover.front {
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 70px 60px 95px 95px; /* Ajuste para encajar en el arte izquierdo */
}
.hardcover.back {
    right: 0;
    /* La contraportada visualmente es la parte derecha del arte de fondo cuando no hay hojas */
}

/* Contenedor dinámico de hojas */
.pages-container {
    position: absolute;
    width: 42%; 
    height: 75%; 
    top: 13%; 
    right: 5%; 
    perspective: 2500px;
    transform-style: preserve-3d;
    z-index: 5;
}

/* Base de una hoja de papel (gira desde la izquierda/lomo) */
.paper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 1;
}

/* Caras de la hoja */
.face {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url('../images/ui/book_bg.webp') no-repeat right center;
    background-size: cover; /* Corregimos aspecto visual de libro doble */
    background-color: rgba(230, 215, 185, 0.95); 
    background-blend-mode: multiply;
    backface-visibility: hidden;
    padding: 20px;
    box-sizing: border-box; /* Previene overflow del grid */
    box-shadow: inset 0 0 30px rgba(0,0,0,0.1), -5px 0 10px rgba(0,0,0,0.2);
    border-radius: 2px 15px 15px 2px;
}

.face.front {
    transform: rotateY(0deg);
}

.face.back {
    transform: rotateY(180deg);
    border-radius: 15px 2px 2px 15px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.1), 5px 0 10px rgba(0,0,0,0.2);
}

/* Estados de paso de página (clases JS dinámicas) */
.paper.flipped {
    transform: rotateY(-180deg);
}

/* Grid dentro de cada cara de la hoja */
.page-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 15px !important;
    height: 100%;
    width: 100%;
    align-content: center !important;
    justify-items: center; /* Centrar cartas en sus celdas */
}

@keyframes floatBook {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.01); }
    100% { transform: translateY(0px) scale(1); }
}

/* Viejo css oculto */

/* Retiramos propiedades inutilizadas */

/* Retiramos left-page y right-page obsoletos */

/* Retiramos title-section rules obsoletos */

/* Controles de navegación asimétricos */
.book-nav-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: -50px;
    z-index: 10;
}

.book-nav-container-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -50px;
    z-index: 10;
}

.book-nav {
    background: transparent !important;
    border: none !important;
    color: #ffd700;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem; /* Flechas grandes */
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.9));
    box-shadow: none !important;
}

.book-nav:hover {
    transform: scale(1.2);
    color: #fff;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    background: transparent !important;
    box-shadow: none !important;
}

.book-nav:disabled {
    filter: grayscale(1) opacity(0.1);
    cursor: not-allowed;
    transform: none;
}

/* Texto inferior de páginas */
.page-numbers {
    position: absolute;
    bottom: 45px;     /* Alineado con la base del texto izquierdo */
    right: 320px;    /* A la derecha del lomo */
    font-family: 'Georgia', serif;
    color: #4a2e15;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 20;
    font-style: italic;
}

/* CAMBIOS DE ESCALADO DE CARTAS (Proporcional a 1400px) */
.collection-grid .carta,
.book-page .carta {
    width: 145px !important;
    height: 220px !important;
    background: white !important; /* Tarjeta base blanca */
    border: 3px solid #b8860b !important;
    border-radius: 8px !important;
    padding: 6px !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative;
    cursor: pointer;
}

.book-page .carta:hover {
    transform: scale(1.1) translateY(-5px) rotate(0deg) !important;
    border-color: #ffd700 !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 215, 0, 0.3) !important;
}

.carta-img {
    height: 110px !important;
    background: #4a2511 !important;
    border: 1px solid #b8860b !important;
    border-radius: 4px !important;
    margin-bottom: 5px !important;
    object-fit: cover !important;
}

.carta-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.carta-info h3 {
    margin: 2px 0 5px 0 !important;
    color: #3e2a15 !important;
    font-size: 0.95rem !important;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-shadow: none !important;
    white-space: nowrap;
}

.card-badges {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 5px;
}

.card-badges span {
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 4px;
    background: #1c110a;
    color: #ffd700;
    font-weight: bold;
    border: 1px solid #5a402a;
}

.card-stats-row {
    font-size: 0.8rem;
    color: #5a402a;
    font-weight: bold;
    border-top: 1px dashed #ccc;
    padding-top: 5px;
    width: 100%;
}

.upgrade-btn {
    background: linear-gradient(to bottom, #4CAF50, #2E7D32) !important;
    color: white !important;
    border: 2px solid #1B5E20 !important;
    border-radius: 5px !important;
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    margin-top: 4px !important;
    width: 100% !important;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    animation: pulseUpgrade 1.5s infinite alternate;
}

@keyframes pulseUpgrade {
    from { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); transform: scale(1); }
    to { box-shadow: 0 0 15px rgba(76, 175, 80, 1); transform: scale(1.05); }
}

.upgrade-btn:hover {
    background: linear-gradient(to bottom, #66BB6A, #388E3C) !important;
}

.info-btn-mini {
    position: absolute !important;
    bottom: 5px !important;
    right: 5px !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 13px !important;
    background: #ffd700 !important;
    color: #1c110a !important;
    border: 2px solid #5a402a !important;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.carta.not-owned {
    filter: brightness(0.6) sepia(1) hue-rotate(-30deg) saturate(0) opacity(0.5) !important;
    border-color: #5a402a !important;
    box-shadow: none !important;
    background: transparent !important;
}

.carta.not-owned:hover {
    transform: none !important;
    border-color: #5a402a !important;
}

.carta.not-owned .carta-info,
.carta.not-owned .upgrade-btn,
.carta.not-owned .info-btn-mini {
    display: none !important;
}

/* REDISEÑO MODAL ENCICLOPEDIA MÁS PREMIUM */
.enciclopedia-card {
    background: linear-gradient(135deg, #1f1f33 0%, #121220 100%) !important;
    border: 4px solid #ffd700 !important;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
}

.enciclopedia-img {
    background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%);
    border-radius: 50%;
    padding: 10px;
}

.stat-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(0,0,0,0.3)) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

/* =========================================================================
   BÚSQUEDA ÉPICA (RADAR MATCHMAKING)
========================================================================= */
.matchmaking-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(30, 15, 45, 0.95), rgba(10, 5, 20, 1));
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: none; /* Se activa con flex */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

.btn-cancel-radar {
    position: absolute;
    bottom: 50px;
    background: rgba(255, 60, 60, 0.15);
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.2);
}

.btn-cancel-radar:hover {
    background: #ff4d4d;
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 77, 77, 0.6);
}

.btn-cancel-radar i {
    margin-right: 8px;
}

.radar-container {
    position: relative;
    width: 800px;
    height: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Cartas a los lados */
.radar-player-card, .radar-opponent-card {
    width: 200px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: floatMatch 3s ease-in-out infinite;
    z-index: 10;
}

.radar-opponent-card {
    animation-delay: 1.5s;
}

.radar-player-card img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.5);
}

.unknown-opponent {
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    background: radial-gradient(circle, rgba(255, 0, 0, 0.1), transparent);
    width: 180px; height: 260px;
    border-radius: 12px;
    border: 3px dashed rgba(255, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Radar central */
.radar-rings {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 300px; height: 300px;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-rings .ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.3), inset 0 0 15px rgba(255, 140, 0, 0.3);
    animation: pulseRing 2.5s infinite linear;
}

.ring-1 { width: 100px; height: 100px; animation-delay: 0s !important; }
.ring-2 { width: 200px; height: 200px; animation-delay: 0.8s !important; }
.ring-3 { width: 300px; height: 300px; animation-delay: 1.6s !important; }

@keyframes pulseRing {
    0% { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Scanner rotatorio */
.radar-scanner {
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 70%, rgba(255, 215, 0, 0.4) 100%);
    animation: spinRadar 2s linear infinite;
    z-index: 6;
}

@keyframes spinRadar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-text {
    position: absolute;
    bottom: -60px;
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px #ff8c00;
    animation: pulseText 1s infinite alternate;
}

@keyframes pulseText {
    from { opacity: 0.6; }
    to { opacity: 1; text-shadow: 0 0 25px #ff8c00; }
}

@keyframes floatMatch {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Efecto Clash cuando encuentra rival */
.clash-vs {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(5);
    font-size: 8rem;
    font-weight: 900;
    color: #ff3300;
    text-shadow: 0 0 50px #ff0000, 3px 3px 0px #000;
    opacity: 0;
    z-index: 20;
}

.clash-active {
    animation: vsSlam 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes vsSlam {
    0% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; text-shadow: 0 0 80px #ff0000, 5px 5px 0px #000; }
}

.screen-shake {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-1deg); }
    20%, 80% { transform: translate3d(2px, 0, 0) rotate(1deg); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0) rotate(-2deg); }
    40%, 60% { transform: translate3d(4px, 0, 0) rotate(2deg); }
}

/* =========================================================================
   REFINAMIENTO DE COFRES (ETIQUETAS Y MODALES)
========================================================================= */

/* Etiquetas bajo los cofres en Main Menu */
.box-rarity-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
    padding: 6px 4px;
    width: 100%;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.premium-text {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.basic-text {
    color: #a0a0b0;
    text-shadow: 0 0 10px rgba(200, 200, 255, 0.4);
    border: 1px solid rgba(200, 200, 255, 0.2);
}

.card:hover .box-rarity-label {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.7);
}

/* Animaciones del Cofre en el Modal de Confirmación */
.modal-chest-icon {
    width: 120px;
    height: 120px;
    margin: -40px auto 15px auto; /* Sube un poco para sobresalir */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    position: relative;
    z-index: 10;
}

.premium-aura {
    background: radial-gradient(circle, rgba(255, 140, 0, 0.4) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.5);
    animation: pulseAuraPremium 2s infinite alternate;
}

.basic-aura {
    background: radial-gradient(circle, rgba(100, 150, 255, 0.3) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(100, 150, 255, 0.3);
    animation: pulseAuraBasic 2.5s infinite alternate;
}

.modal-floating-chest {
    max-width: 90%;
    max-height: 90%;
    filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.6));
    animation: floatChest 3s ease-in-out infinite;
    position: relative;
    z-index: 11;
}

@keyframes floatChest {
    0%, 100% { transform: translateY(0) scale(1.05); }
    50% { transform: translateY(-12px) scale(1); filter: drop-shadow(0 25px 15px rgba(0, 0, 0, 0.4)); }
}

@keyframes pulseAuraPremium {
    from { opacity: 0.6; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

@keyframes pulseAuraBasic {
    from { opacity: 0.5; transform: scale(0.95); }
    to { opacity: 0.8; transform: scale(1.05); }
}

.stat-value.hp {
    color: #00ff88 !important;
    text-shadow: 0 0 10px rgba(0,255,136, 0.5);
}

.stat-value.atk {
    color: #ff5555 !important;
    text-shadow: 0 0 10px rgba(255,85,85, 0.5);
}

/* =========================================================================
   EFECTOS 3D Y HOLOGRÁFICOS (COLECCIÓN)
========================================================================= */

/* Habilitar 3D dinámico en la carta */
.carta {
    transform-style: preserve-3d;
    will-change: transform;
    position: relative;
    overflow: hidden; /* Para que la luz y el foil no se salgan de los bordes redondeados */
    /* La transición de transform se maneja suavemente con CSS, JS solo fija el grado */
    transition: transform 0.1s ease-out, box-shadow 0.2s;
}

/* Capa de luz dinámica (reflejo glossy controlado por JS) */
.holo-light {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; /* No bloquear clics en la carta */
    z-index: 10;
    mix-blend-mode: overlay; /* Permite combinar luces blancas sobre el arte */
    border-radius: inherit;
    transition: background 0.1s ease-out;
}

/* Capa Foil holográfica permanente (Nivel 5+ o Legendarias/Épicas) */
.holo-foil {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9;
    /* Gradiente arcoíris pastel para simular prisma */
    background: linear-gradient(
        135deg, 
        rgba(255, 100, 100, 0.3) 0%, 
        rgba(255, 255, 100, 0.4) 20%, 
        rgba(100, 255, 100, 0.3) 40%, 
        rgba(100, 255, 255, 0.4) 60%, 
        rgba(100, 100, 255, 0.3) 80%, 
        rgba(255, 100, 255, 0.4) 100%
    );
    background-size: 200% 200%;
    mix-blend-mode: color-dodge; /* Clave para el efecto foil brillante sobre el arte */
    opacity: 0.65;
    animation: holoShimmer 4s linear infinite;
    border-radius: inherit;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
}

@keyframes holoShimmer {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
/* --- Floating Text Effects (Combat) --- */
.floating-text {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 1000;
    animation: floatUpFade 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.floating-text.super-effective {
    font-size: 2.2rem;
    color: #ffd700;
    text-shadow: 0 0 10px #ff8c00, 0 0 20px #ff4500, 2px 2px 5px #000;
    text-transform: uppercase;
    font-style: italic;
    animation: floatUpEpic 1.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes floatUpFade {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -70%) scale(1.1); opacity: 1; }
    80% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -120%) scale(0.9); opacity: 0; }
}

@keyframes floatUpEpic {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; filter: brightness(2); }
    15% { transform: translate(-50%, -60%) scale(1.4); opacity: 1; filter: brightness(1.5); }
    30% { transform: translate(-50%, -65%) scale(1.1); opacity: 1; filter: brightness(1); }
    70% { transform: translate(-50%, -85%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1.4); opacity: 0; filter: blur(2px); }
}

.floating-text.not-effective {
    font-size: 1.6rem;
    color: #a0c4ff;
    text-shadow: 0 0 5px #0033aa, 2px 2px 4px #000;
    text-transform: uppercase;
    font-style: italic;
    opacity: 0.8;
    animation: floatDownDull 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatDownDull {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; filter: grayscale(1); }
    15% { transform: translate(-50%, -40%) scale(1.1); opacity: 0.9; filter: grayscale(0.5); }
    30% { transform: translate(-50%, -35%) scale(1.0); opacity: 0.8; }
    80% { transform: translate(-50%, -10%) scale(1.0); opacity: 0.6; }
    100% { transform: translate(-50%, 10%) scale(0.9); opacity: 0; filter: blur(2px); }
}

/* =================================================================
   SISTEMA DE BUFF / DEBUFF BADGES (en arena de combate)
================================================================= */

/* Contenedor de badges debajo de la barra HP */
.buff-badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 4px 8px 8px 8px;
    width: 90%;
}

/* Badge base */
.buff-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    position: relative;
    cursor: default;
    white-space: nowrap;
    animation: badgePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: opacity 0.3s, transform 0.3s;
}

/* Pop-in al aparecer */
@keyframes badgePopIn {
    0%   { transform: scale(0); opacity: 0; }
    70%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Desvanecimiento al expirar */
.buff-badge.expiring {
    animation: badgeExpire 0.4s ease-in forwards;
}

@keyframes badgeExpire {
    0%   { transform: scale(1); opacity: 1; filter: saturate(1); }
    50%  { transform: scale(1.05); filter: grayscale(0.5); }
    100% { transform: scale(0); opacity: 0; filter: grayscale(1); }
}

/* ---- Colores por tipo ---- */

/* ATK positivo (verde) */
.buff-badge.atk-up {
    background: linear-gradient(135deg, #1a472a, #2d7a3a);
    color: #6fff8a;
    border: 1px solid #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5), inset 0 1px rgba(255,255,255,0.1);
}

/* ATK negativo (rojo) */
.buff-badge.atk-down {
    background: linear-gradient(135deg, #4a1010, #7a2020);
    color: #ff8f8f;
    border: 1px solid #e53935;
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.5), inset 0 1px rgba(255,255,255,0.1);
}

/* DEF positivo (azul) */
.buff-badge.def-up {
    background: linear-gradient(135deg, #0d2a4a, #1a4a7a);
    color: #7fcfff;
    border: 1px solid #1e88e5;
    box-shadow: 0 0 8px rgba(30, 136, 229, 0.5), inset 0 1px rgba(255,255,255,0.1);
}

/* DEF negativo (naranja) */
.buff-badge.def-down {
    background: linear-gradient(135deg, #4a2a00, #7a4400);
    color: #ffa040;
    border: 1px solid #f57c00;
    box-shadow: 0 0 8px rgba(245, 124, 0, 0.5), inset 0 1px rgba(255,255,255,0.1);
}

/* SKIP turno (gris) */
.buff-badge.skip {
    background: linear-gradient(135deg, #222230, #333348);
    color: #aaa;
    border: 1px solid #555;
    box-shadow: 0 0 6px rgba(100,100,100,0.3);
}

/* PRESTIGIO (dorado permanente) */
.buff-badge.prestige-perm {
    background: linear-gradient(135deg, #4a2e00, #7a4e00);
    color: #ffd700;
    border: 1.5px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), inset 0 1px rgba(255,255,255,0.15);
    animation: badgePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               prestigeBadgePulse 2.5s 0.35s ease-in-out infinite;
}

@keyframes prestigeBadgePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,215,0,0.5); }
    50%       { box-shadow: 0 0 20px rgba(255,215,0,0.9); }
}

/* Indicador de turnos restantes (número esquina superior derecha) */
.buff-badge .badge-turns {
    position: absolute;
    top: -7px;
    right: -5px;
    background: #fff;
    color: #111;
    font-size: 0.6rem;
    font-weight: 900;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.3);
    animation: turnsCounterPop 0.3s ease-out;
}

/* Bordes SÓLIDOS = permanentes, PUNTEADOS = temporales (1 turno) */
.buff-badge.temp {
    border-style: dashed;
    animation: badgePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               tempBadgeRotate 3s linear infinite;
}

/* Rotación del borde punteado para indicar "tiempo corriendo" */
@keyframes tempBadgeRotate {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

@keyframes turnsCounterPop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Icono dentro del badge */
.buff-badge .badge-icon {
    font-size: 0.85rem;
}

/* =================================================================
   PRESTIGE GLORY OVERLAY — Carta en Arena (cuando se activa)
================================================================= */

/* Wrapper necesario para la carta en la card-zone */
.card-zone {
    position: relative; /* ya tiene, reforzamos */
}

/* La imagen de carta cuando tiene prestigio activo */
.floating-card.prestige-active {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.8))
            drop-shadow(0 15px 15px rgba(0, 0, 0, 0.5));
}

/* Capa iridiscente sobre la carta en arena */
.card-prestige-overlay {
    position: absolute;
    top: 10px; /* alineada con la carta flotante */
    width: 175px;
    height: 220px; /* alto aproximado de la carta */
    border-radius: 12px;
    pointer-events: none;
    z-index: 4; /* encima de la carta (z3) */
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 215, 0, 0.22) 20%,
        rgba(255, 100, 200, 0.20) 45%,
        rgba(80, 200, 255, 0.20) 70%,
        transparent 100%
    );
    background-size: 300% 300%;
    animation: arenaPrestigeShimmer 2.5s ease-in-out infinite;
    mix-blend-mode: screen;
    border: 1.5px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25), inset 0 0 30px rgba(255, 215, 0, 0.05);
}

@keyframes arenaPrestigeShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Fade-in del overlay al activarse */
@keyframes arenaPrestigeFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.card-prestige-overlay.just-activated {
    animation: arenaPrestigeFadeIn 0.5s ease-out forwards,
               arenaPrestigeShimmer 2.5s 0.5s ease-in-out infinite;
}

/* =================================================================
   INDICADOR DE TURNO MEJORADO (ARRIBA CENTRO)
================================================================= */
#statusText {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 30px;
    border-radius: 50px;
    font-size: 1.25rem !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 auto 25px auto;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    background: rgba(15, 15, 25, 0.8) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(5px);
    width: fit-content;
    position: relative;
    z-index: 10;
}

#statusText i {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 5px currentColor);
}

#statusText.turn-p1 {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 200, 100, 0.15)) !important;
    color: #4affb0 !important;
    border-color: rgba(0, 255, 136, 0.6) !important;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4), inset 0 0 15px rgba(0, 255, 136, 0.2) !important;
    animation: pulseTurnP1 2.5s infinite;
}

#statusText.turn-p2 {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.2), rgba(200, 40, 40, 0.15)) !important;
    color: #ff6b6b !important;
    border-color: rgba(255, 68, 68, 0.6) !important;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.4), inset 0 0 15px rgba(255, 68, 68, 0.2) !important;
    animation: pulseTurnP2 2.5s infinite;
    transform: scale(0.95);
}

@keyframes pulseTurnP1 {
    0%, 100% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.3), inset 0 0 15px rgba(0, 255, 136, 0.15); }
    50% { box-shadow: 0 0 45px rgba(0, 255, 136, 0.6), inset 0 0 25px rgba(0, 255, 136, 0.4); }
}

@keyframes pulseTurnP2 {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 68, 68, 0.3), inset 0 0 10px rgba(255, 68, 68, 0.15); }
    50% { box-shadow: 0 0 35px rgba(255, 68, 68, 0.6), inset 0 0 20px rgba(255, 68, 68, 0.3); }
}


/* =================================================================
   NUEVO DISEÑO DASHBOARD (3 COLUMNAS)
================================================================= */

.dashboard-main-area {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 35px; /* Separación simétrica desde el centro */
    margin: 30px auto;
    max-width: 1550px; /* Más ancho para que quepa todo sin apretar */
    padding: 0 20px;
}

.col-far {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.col-thin {
    flex: 0 0 125px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-mid-column {
    flex: 0 0 720px; /* Ancho fijo garantizado para que no se solape con Misiones */
    max-width: 750px;
}

/* Panel de acceso lateral (Estilo Cristal para la Jungla) */
.side-access-panel {
    background: rgba(13, 17, 33, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.side-access-panel:hover {
    transform: translateY(-5px);
    background: #191f3d;
}

.side-access-panel.battle-pass { border-color: rgba(246, 200, 95, 0.5); box-shadow: 0 0 20px rgba(246, 200, 95, 0.15), inset 0 0 15px rgba(246, 200, 95, 0.1); min-height: 100%; flex: 1; }
.side-access-panel.guilds { border-color: rgba(0, 207, 255, 0.5); box-shadow: 0 0 20px rgba(0, 207, 255, 0.15), inset 0 0 15px rgba(0, 207, 255, 0.1); min-height: 100%; flex: 1; }
.side-access-panel.ranking { border-color: rgba(255, 215, 0, 0.5); box-shadow: 0 0 20px rgba(255, 215, 0, 0.15), inset 0 0 15px rgba(255, 215, 0, 0.1); flex: 1; }
.side-access-panel.collection { border-color: rgba(255, 68, 68, 0.5); box-shadow: 0 0 20px rgba(255, 68, 68, 0.15), inset 0 0 15px rgba(255, 68, 68, 0.1); flex: 1; }
.side-access-panel.daily-login { border-color: rgba(165, 94, 234, 0.5); box-shadow: 0 0 20px rgba(165, 94, 234, 0.15), inset 0 0 15px rgba(165, 94, 234, 0.1); flex: 1; }
.side-access-panel.social { border-color: rgba(250, 130, 49, 0.5); box-shadow: 0 0 20px rgba(250, 130, 49, 0.15), inset 0 0 15px rgba(250, 130, 49, 0.1); flex: 1; }
.side-access-panel.shop { border-color: rgba(32, 191, 107, 0.5); box-shadow: 0 0 20px rgba(32, 191, 107, 0.15), inset 0 0 15px rgba(32, 191, 107, 0.1); flex: 1; }

.side-access-panel.battle-pass:hover { border-color: #f6c85f; box-shadow: 0 10px 30px rgba(246, 200, 95, 0.4); }
.side-access-panel.guilds:hover { border-color: #00cfff; box-shadow: 0 10px 30px rgba(0, 207, 255, 0.4); }
.side-access-panel.ranking:hover { box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4); border-color: #ffd700; }
.side-access-panel.collection:hover { box-shadow: 0 10px 30px rgba(255, 68, 68, 0.4); border-color: #ff4444; }

/* Notificación de mejoras (Punto Rojo) */
.notification-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
    animation: pulseDot 2s infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes pulseDot {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 68, 68, 0.5); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(255, 68, 68, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 68, 68, 0.5); }
}
.side-access-panel.daily-login:hover { box-shadow: 0 10px 30px rgba(165, 94, 234, 0.4); border-color: #a55eea; }
.side-access-panel.social:hover { box-shadow: 0 10px 30px rgba(250, 130, 49, 0.4); border-color: #fa8231; }
.side-access-panel.shop:hover { box-shadow: 0 10px 30px rgba(32, 191, 107, 0.4); border-color: #20bf6b; }

.side-icon-wrap {
    font-size: 2.8rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px currentColor);
}

.battle-pass .side-icon-wrap { color: #f6c85f; }
.guilds .side-icon-wrap { color: #00cfff; }
.ranking .side-icon-wrap { color: #ffd700; font-size: 2.2rem; }
.collection .side-icon-wrap { color: #ff4444; font-size: 2.2rem; }
.daily-login .side-icon-wrap { color: #a55eea; font-size: 2.2rem; }
.social .side-icon-wrap { color: #fa8231; font-size: 2.2rem; }
.shop .side-icon-wrap { color: #20bf6b; font-size: 2.2rem; }

.side-title {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    line-height: 1.2;
    margin-bottom: 10px;
    color: #fff;
}

.side-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Badge Cerrado */
.badge-closed {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    font-weight: 800;
    margin-top: 10px;
}

/* Refinamiento HUD (Botones Cuadrados) */
.hud-actions-wrap {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.btn-hud-square {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f6c85f 0%, #eaa31e 100%);
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-hud-square:hover {
    transform: scale(1.1) translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 15px rgba(246, 200, 95, 0.4);
}

.profile-card {
    flex: 1;
    margin: 0 !important;
}

#trophies-display {
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* TOP HUD Y LOGIN DIARIO */
.top-hud-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    margin: 0 auto 30px auto;
    width: 720px; /* Ancho idéntico al bloque de modos central para alineación simétrica */
    max-width: 100%;
}

.daily-login-hud {
    flex: 0 0 120px;
    margin: 0;
    min-height: auto;
}

.daily-login-hud .side-icon-wrap {
    font-size: 2rem;
    margin-bottom: 5px;
    color: #a55eea;
}

/* BASE 3D DE COFRES (Más cristalina) */
.chests-pedestal {
    width: 720px;
    max-width: 95vw;
    height: 50px; 
    background: linear-gradient(180deg, rgba(29, 33, 56, 0.6) 0%, rgba(12, 14, 26, 0.4) 100%);
    border-top: 2px solid rgba(135, 168, 235, 0.3); 
    border-radius: 12px;
    margin: 0 auto;
    transform: perspective(600px) rotateX(40deg); 
    box-shadow: 0 15px 25px rgba(0,0,0,0.5);
    position: relative;
    top: -5px; /* Apenas toca la base para evitar que las rallas traseras se superpongan */
    margin-bottom: 20px; 
    z-index: -1; 
}

/* ──────────────────────────────────
   SPEED CLASH ANIMATION
────────────────────────────────── */
.speed-clash-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10000; background: rgba(0,0,0,0.85); display: flex;
    justify-content: center; align-items: center; pointer-events: none;
    opacity: 0; transition: opacity 0.3s;
}
.speed-clash-overlay.active { opacity: 1; }

.speed-clash-bg {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.05) 10px, rgba(255,255,255,0.05) 20px);
    animation: speedStripes 0.5s linear infinite;
    z-index: 1;
}
@keyframes speedStripes {
    0% { background-position: 0 0; }
    100% { background-position: -50px -50px; }
}

.speed-fighter {
    position: absolute; z-index: 3; display: flex; flex-direction: column; align-items: center;
}
.speed-fighter img {
    height: 350px; filter: drop-shadow(0 0 20px rgba(255,255,255,0.5));
}
.speed-fighter h2 { color:#fff; text-transform: uppercase; font-size: 2rem; margin-top:10px; font-style: italic; text-shadow: 0 0 10px #000; }

.speed-fighter.me { left: -50%; transform: skewX(-15deg); }
.speed-fighter.enemy { right: -50%; transform: skewX(15deg); }

.clash-fly.me { animation: flyInLeft 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; }
.clash-fly.enemy { animation: flyInRight 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; }

@keyframes flyInLeft { to { left: 25%; transform: skewX(0); } }
@keyframes flyInRight { to { right: 25%; transform: skewX(0); } }

.clash-win.me { animation: pushRight 1s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards; }
.screen-shake { 
    animation: shakeEffect 0.5s cubic-bezier(.36,.07,.19,.97) both; 
}
@keyframes shakeEffect {
  10%, 90% { transform: translate3d(-4px, 0, 0); }
  20%, 80% { transform: translate3d(8px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-12px, 0, 0); }
  40%, 60% { transform: translate3d(12px, 0, 0); }
}
.clash-win.enemy { animation: pushLeft 1s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards; }
.clash-lose { animation: spinOut 0.8s ease-out forwards; filter: grayscale(1) brightness(0.5) !important; }
/* Rebote de Impacto para Doble Choque */
.clash-rebound.me { animation: reboundLeft 0.5s ease-out forwards; }
.clash-rebound.enemy { animation: reboundRight 0.5s ease-out forwards; }
@keyframes reboundLeft { 
    0% { left: 25%; } 
    30% { left: 15%; } 
    100% { left: 25%; } 
}
@keyframes reboundRight { 
    0% { right: 25%; } 
    30% { right: 15%; } 
    100% { right: 25%; } 
}

@keyframes pushRight { 
    0% { left: 25%; z-index: 10; transform: scale(1); } 
    20% { left: 20%; transform: scale(1.1); }
    100% { left: 150%; transform: scale(2) rotate(15deg); opacity: 0; } 
}
@keyframes pushLeft { 
    0% { right: 25%; z-index: 10; transform: scale(1); } 
    20% { right: 20%; transform: scale(1.1); }
    100% { right: 150%; transform: scale(2) rotate(-15deg); opacity: 0; } 
}
@keyframes spinOut { 
    0% { transform: scale(1) rotate(0deg); opacity: 1; } 
    100% { transform: scale(0.1) rotate(1080deg); opacity: 0; } 
}

.speed-flash {
    position: absolute; top:50%; left:50%; width: 10px; height: 10px; border-radius: 50%;
    transform: translate(-50%, -50%); background: #fff; box-shadow: 0 0 100px 50px #fff;
    opacity: 0; z-index: 5;
}
.speed-flash.active { animation: flashBang 0.5s ease-out forwards; }
@keyframes flashBang { 0% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(50); opacity: 0; } }

.speed-result-text {
    position: absolute; z-index: 6; top: 20%; width: 100%; text-align: center;
    font-size: 3.5rem; color: #ffd700; text-shadow: 0 4px 0 #b30000, 0 0 20px #ff0000;
    font-weight: 900; font-style: italic; opacity: 0; transform: scale(0.5); text-transform: uppercase;
}
.speed-result-text.pop { animation: textPop 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes textPop { 0% { opacity:0; transform: scale(0.5); } 20% { opacity:1; transform: scale(1.2); } 80% { opacity:1; transform: scale(1.1); } 100% { opacity:0; transform: scale(2); filter: blur(10px); } }


/* ──────────────────────────────────
   RPS MINIGAME OVERLAY
────────────────────────────────── */
.rps-minigame-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10005; background: rgba(10, 10, 25, 0.95); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
}
.rps-modal-box {
    background: linear-gradient(145deg, #1e2035 0%, #111322 100%);
    border: 2px solid #5a6699; border-radius: 20px;
    padding: 30px; text-align: center; max-width: 600px; width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(255,255,255,0.05);
}
.rps-title { color: #ffd700; font-size: 2.2rem; margin-bottom: 5px; font-weight: 900; text-shadow: 0 2px 10px rgba(255,215,0,0.5); }
.rps-subtitle { color: #a0a6cc; font-size: 1rem; margin-bottom: 25px; }

.rps-timer-circle {
    position: relative; width: 100px; height: 100px; margin: 0 auto 30px;
}
.rps-circular-chart { display: block; margin: 0 auto; max-width: 80%; max-height: 250px; }
.rps-circle-bg { fill: none; stroke: #303350; stroke-width: 3.8; }
.rps-circle { fill: none; stroke-width: 3.8; stroke-linecap: round; stroke: #00ff88; transition: stroke-dasharray 1s linear; }
.rps-timer-text {
    position: absolute; top:50%; left:50%; transform: translate(-50%, -50%);
    font-size: 2rem; font-weight: 900; color: #fff;
}

.rps-choices { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; }
.rps-btn {
    flex: 1; min-width: 120px; padding: 20px; border: none; border-radius: 12px;
    font-size: 1.2rem; font-weight: 700; color: #fff; cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.rps-btn i { font-size: 2.5rem; }
.rps-btn.btn-fuego { background: linear-gradient(135deg, #ff4e00, #ec9f05); box-shadow: 0 5px 15px rgba(255,78,0,0.4); }
.rps-btn.btn-agua { background: linear-gradient(135deg, #00cfff, #0066ff); box-shadow: 0 5px 15px rgba(0,207,255,0.4); }
.rps-btn.btn-planta { background: linear-gradient(135deg, #00ff88, #009933); box-shadow: 0 5px 15px rgba(0,255,136,0.4); }
.rps-btn:hover:not(:disabled) { transform: translateY(-5px); filter: brightness(1.2); }
.rps-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; filter: grayscale(1); }
.rps-btn.selected { transform: scale(1.1); box-shadow: 0 0 30px currentColor; z-index: 2; border: 3px solid #fff; filter: none !important; opacity: 1 !important; }

.rps-status-area {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.4); border-radius: 10px; padding: 15px; margin-bottom: 20px;
}
.rps-player-status { display: flex; flex-direction: column; align-items: center; flex: 1; }
.rps-label { font-size: 0.8rem; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.rps-value { font-size: 1.4rem; font-weight: 900; margin-top: 5px; color: #fff; }
.rps-vs { font-size: 2rem; font-weight: 900; color: #ffaa00; font-style: italic; }

.rps-result-message {
    font-size: 1.5rem; font-weight: bold; color: #fff; min-height: 40px; margin-top: 10px;
    animation: fadeIn 0.3s;
}

.elem-fuego { color: #ff4e00 !important; text-shadow: 0 0 10px rgba(255,78,0,0.5); }
.elem-agua { color: #00cfff !important; text-shadow: 0 0 10px rgba(0,207,255,0.5); }
.elem-planta { color: #00ff88 !important; text-shadow: 0 0 10px rgba(0,255,136,0.5); }













/* --- THEME: FROSTED JUNGLE GLASS (CONSOLIDATED) --- */
.profile-card.glass-hud {
    background: rgba(13, 17, 33, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 30px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 5px auto 15px;
    width: fit-content;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}
.mode-selection.glass-panel {
    background: rgba(18, 22, 43, 0.88) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-radius: 20px !important;
}
.boxes-container {
    width: 95vw;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 25px 0;
    background: rgba(13, 17, 33, 0.7) !important;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border-radius: 24px !important;
    margin-top: -5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}
.boxes-container h2 { color: #f1c40f !important; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 25px; text-shadow: 0 0 15px rgba(241, 196, 15, 0.3); }
.btn-battlepass-entry, .side-access-panel {
    background: rgba(13, 17, 33, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* EFECTO LLAMAS ÉPICO BOTÓN MATCHMAKING */
.btn-matchmaking.premium-hero {
    position: relative;
    overflow: hidden;
}
.btn-matchmaking.premium-hero::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 200%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.8), rgba(255, 140, 0, 0.9), rgba(255, 215, 0, 1), transparent);
    z-index: 0;
    transition: none;
    filter: blur(8px);
    opacity: 0;
    pointer-events: none;
}
.btn-matchmaking.premium-hero:hover::before {
    animation: epicFlameSweep 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
}
.btn-matchmaking.premium-hero * {
    position: relative;
    z-index: 10;
}
@keyframes epicFlameSweep {
    0% { left: -150%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}









/* EFECTO LLAMAS ÉPICO EN EL RECTÁNGULO TRASERO (Sincronizado con el botón) */
.matchmaking {
    position: relative;
    overflow: hidden !important;
}

.matchmaking::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -150%;
    width: 300%; 
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.25), rgba(255, 140, 0, 0.35), rgba(255, 215, 0, 0.45), transparent);
    z-index: 0;
    filter: blur(25px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Solo se activa cuando se hace hover en el botón de dentro */
}









/* EFECTO LLAMAS ÉPICO EN EL RECTÁNGULO TRASERO (Sincronizado con el botón) */
.matchmaking {
    position: relative;
    overflow: hidden !important;
}

.matchmaking::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -150%;
    width: 300%; 
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.25), rgba(255, 140, 0, 0.35), rgba(255, 215, 0, 0.45), transparent);
    z-index: 0;
    filter: blur(25px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Solo se activa cuando se hace hover en el botón de dentro */
.matchmaking:has(.btn-matchmaking:hover)::before {
    opacity: 1;
    animation: epicFlameSweepLarge 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
}

@keyframes epicFlameSweepLarge {
    0% { left: -180%; }
    100% { left: 100%; }
}

/* BOTÓN DE RETORNO ÉPICO Y ELEMENTAL (FLOTANTE FUERA DE CABECERA) */
.btn-back-epic {
    position: fixed;
    top: 95px; /* Bajado para que no esté en la cabecera */
    left: 25px;
    z-index: 1000;
    background: rgba(13, 17, 33, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 255, 0.5);
    color: #00f2ff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.btn-back-epic:hover {
    transform: scale(1.15) translateX(-5px);
    background: rgba(0, 242, 255, 0.15);
    border-color: #00f2ff;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.6), inset 0 0 20px rgba(0, 242, 255, 0.3);
    color: #fff;
    text-shadow: 0 0 10px #00f2ff;
}

.btn-back-epic::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, #00f2ff, transparent);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    animation: rotateMystic 3s linear infinite;
}

.btn-back-epic:hover::after {
    opacity: 0.5;
}

@keyframes rotateMystic {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* VÓRTICE MÍSTICO CENTRAL (PORTAL) */
.main-portal-vortex {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    pointer-events: none;
    z-index: 5; /* Subido para asegurar visibilidad */
    display: flex;
    align-items: center;
    justify-content: center;
    mix-blend-mode: add; /* Probamos add para mayor brillo */
}

.portal-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Capa 1: Resplandor de base (Pulso ambiental) */
.portal-layer.base {
    background: radial-gradient(circle, rgba(0, 242, 255, 0.2), transparent 70%);
    filter: blur(50px);
    animation: portalPulse 10s ease-in-out infinite alternate;
}

/* Capa 2: Remolino Interno (Dinamismo sutil) */
.portal-layer.swirl {
    background: conic-gradient(from 0deg, 
        transparent, 
        rgba(0, 242, 255, 0.2), 
        rgba(138, 43, 226, 0.3), 
        transparent 50%, 
        rgba(0, 242, 255, 0.2), 
        transparent);
    filter: blur(15px);
    animation: portalRotate 25s linear infinite;
    -webkit-mask-image: radial-gradient(circle, black 20%, transparent 65%);
    mask-image: radial-gradient(circle, black 20%, transparent 65%);
}

/* Capa 3: Energía Fluida (Sentido horario) */
.portal-layer.energy {
    width: 85%;
    height: 85%;
    background: conic-gradient(from 120deg, 
        transparent, 
        rgba(0, 242, 255, 0.3), 
        transparent 30%, 
        rgba(255, 255, 255, 0.2), 
        transparent 60%, 
        rgba(0, 242, 255, 0.3), 
        transparent);
    filter: blur(10px);
    animation: portalRotate 15s linear infinite;
    opacity: 0.6;
}

@keyframes portalRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes portalPulse {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.15); opacity: 0.5; }
}

/* BOTONES MODAL PERDIDA RACHA DIARIA */
.btn-dl-recover {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    font-weight: 800;
    border: 2px solid #fff;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.btn-dl-recover:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}
.btn-dl-reset {
    background: linear-gradient(135deg, #e63946, #d90429);
    color: #fff;
    font-weight: 800;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}
.btn-dl-reset:hover {
    background: linear-gradient(135deg, #ef233c, #d90429);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

/* 🖼️ ICONOS PREMIUM DASHBOARD */
.side-panel-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.side-access-panel:hover .side-panel-img {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}


/* RULETA ÉPICA: DISEÑO DE TRAGAPERRAS PREMIUM */
#chestAnimationModal.roulette-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20000;
    background: radial-gradient(circle at center, rgba(13, 17, 33, 0.98) 0%, rgba(0, 0, 0, 1) 100%);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

#chestAnimationModal.active {
    display: flex;
}

.roulette-header {
    text-align: center;
    margin-bottom: 40px;
    z-index: 100;
}

#rouletteTitle {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin: 0;
    text-shadow: 0 0 30px rgba(255,255,255,0.3), 0 5px 15px rgba(0,0,0,0.5);
    background: linear-gradient(to bottom, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.roulette-divider {
    height: 4px;
    width: 120px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    margin: 20px auto;
}

.slots-wrapper {
    display: flex;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    border-radius: 35px;
    border: 8px solid #1e293b;
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.9),
        inset 0 0 40px rgba(0,0,0,0.5),
        0 0 0 2px rgba(255,255,255,0.05);
    position: relative;
}

/* Luces de la máquina */
.slots-wrapper::before, .slots-wrapper::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 20px #fbbf24, 0 0 40px rgba(251, 191, 36, 0.5);
    top: 50%;
    transform: translateY(-50%);
    animation: blinkLight 0.8s infinite alternate;
}
.slots-wrapper::before { left: -30px; }
.slots-wrapper::after { right: -30px; }

@keyframes blinkLight {
    from { opacity: 0.4; filter: brightness(0.5); }
    to { opacity: 1; filter: brightness(1.5); }
}

.slot-column {
    width: 220px;
    height: 300px;
    border-radius: 20px;
    background: #020617;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.9);
}

/* Sombreado interno para profundidad 3D real */
.slot-column::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,0,0,0.4) 15%, 
        transparent 35%, 
        transparent 65%, 
        rgba(0,0,0,0.4) 85%, 
        rgba(0,0,0,0.95) 100%);
    z-index: 10;
    pointer-events: none;
}

.slot-strip {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 20px; /* Offset para centrado inicial */
    left: 0;
    width: 100%;
    will-change: transform;
}

.slot-strip.spinning {
    filter: blur(4px);
}

.slot-card-item {
    height: 260px; /* ITEM_HEIGHT */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-sizing: border-box;
}

.slot-card-item img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
    transition: transform 0.3s ease;
}

.slot-card-item.winning-item {
    position: relative;
}

.slot-card-item.final-lock-item {
    height: 260px;
    padding: 10px;
}

.slot-card-item.final-lock-item img {
    max-width: 94%;
    max-height: 94%;
    transform: none;
    filter: drop-shadow(0 16px 28px rgba(0,0,0,0.82));
}

.slot-card-item.winning-item::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.35);
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 62%);
    box-shadow: 0 0 26px rgba(255,255,255,0.22);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.slot-column.locked .slot-card-item.winning-item::before {
    opacity: 1;
    transform: scale(1);
}

.rarity-advanced .slot-card-item.winning-item::before {
    border-color: rgba(251,191,36,0.65);
    box-shadow: 0 0 34px rgba(251,191,36,0.45);
}

.rarity-premium .slot-card-item.winning-item::before {
    border-color: rgba(216,180,254,0.8);
    box-shadow: 0 0 40px rgba(192,132,252,0.65), 0 0 70px rgba(34,211,238,0.25);
}

/* Línea de selección / Punto de mira */
.slot-pointer {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 260px;
    transform: translateY(-50%);
    background: linear-gradient(to bottom, 
        rgba(255, 215, 0, 0.08) 0%, 
        transparent 50%, 
        rgba(255, 215, 0, 0.08) 100%);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 20;
    pointer-events: none;
}

/* Variaciones por Rareza */
.rarity-basic #rouletteTitle { background: linear-gradient(to bottom, #fff, #94a3b8); -webkit-background-clip: text; }
.rarity-advanced #rouletteTitle { background: linear-gradient(to bottom, #fbbf24, #d97706); -webkit-background-clip: text; }
.rarity-premium #rouletteTitle { background: linear-gradient(to bottom, #c084fc, #7c3aed); -webkit-background-clip: text; }

.rarity-advanced .slots-wrapper { border-color: #d97706; box-shadow: 0 40px 100px rgba(217, 119, 6, 0.3); }
.rarity-premium .slots-wrapper { border-color: #7c3aed; box-shadow: 0 40px 100px rgba(124, 58, 237, 0.4); }

/* Botón Saltar */
.btn-skip-animation {
    position: fixed;
    bottom: 50px;
    right: 50px;
    z-index: 25000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-skip-animation:hover {
    background: #fff;
    color: #000;
    transform: translateY(-5px);
}

/* Aura y efectos de fondo */
.rarity-aura {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.4;
    pointer-events: none;
}
.aura-basic { background: radial-gradient(circle, rgba(74, 85, 104, 0.2) 0%, transparent 70%); }
.aura-advanced { background: radial-gradient(circle, rgba(180, 83, 9, 0.2) 0%, transparent 70%); animation: pulseAura 4s infinite alternate; }
.aura-premium { background: radial-gradient(circle, rgba(109, 40, 217, 0.3) 0%, transparent 70%); animation: pulseAura 3s infinite alternate; }

@keyframes pulseAura {
    from { opacity: 0.3; transform: scale(1); }
    to { opacity: 0.6; transform: scale(1.1); }
}

/* Botón Saltar */
.btn-skip-animation {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 25000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 25px;
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-skip-animation:hover {
    background: #fff;
    color: #000;
    transform: scale(1.05);
}

/* Resultado Final Premium */
.final-result-card {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 21000;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
}

.final-result-card.show {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
}

.final-card-inner {
    position: relative;
    width: 400px;
    padding: 50px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 40px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.2);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.final-result-card.show .final-card-inner {
    transform: scale(1);
    opacity: 1;
}

.final-card-inner img {
    width: 240px;
    height: auto;
    border-radius: 20px;
    margin-bottom: 30px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8));
    animation: floatReward 4s ease-in-out infinite;
}

#chestAnimationModal::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.09), transparent 22%),
        repeating-conic-gradient(from 0deg, rgba(255,255,255,0.055) 0deg 4deg, transparent 4deg 11deg);
    animation: rouletteHaloDrift 18s linear infinite;
}

#chestAnimationModal.rarity-basic::before { opacity: 0.18; }
#chestAnimationModal.rarity-advanced::before { opacity: 0.3; filter: sepia(0.6) saturate(1.4); }
#chestAnimationModal.rarity-premium::before { opacity: 0.48; filter: hue-rotate(35deg) saturate(1.8); }

@keyframes rouletteHaloDrift {
    to { transform: rotate(360deg); }
}

.roulette-bg-effects.advanced-sparks::after,
.roulette-bg-effects.premium-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255,215,0,0.8) 0 1px, transparent 2px);
    background-size: 90px 90px, 140px 140px;
    animation: starfieldFall 3.5s linear infinite;
    opacity: 0.35;
}

.roulette-bg-effects.premium-shimmer::after {
    background-image:
        radial-gradient(circle, rgba(255,255,255,1) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(192,132,252,0.95) 0 1px, transparent 3px),
        radial-gradient(circle, rgba(34,211,238,0.8) 0 1px, transparent 2px);
    background-size: 70px 70px, 110px 110px, 160px 160px;
    animation-duration: 2.4s;
    opacity: 0.55;
}

@keyframes starfieldFall {
    from { background-position: 0 -120px, 30px -80px, -20px -160px; }
    to { background-position: 0 120px, 30px 180px, -20px 160px; }
}

.slot-column.locked {
    animation: slotLockPunch 0.35s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.slot-column.lock-pulse::before {
    content: "";
    position: absolute;
    inset: -3px;
    z-index: 25;
    pointer-events: none;
    border-radius: 22px;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 0 26px rgba(255,255,255,0.55), inset 0 0 22px rgba(255,255,255,0.18);
    animation: slotLockPulse 0.55s ease-out forwards;
}

.rarity-advanced .slot-column.lock-pulse::before {
    border-color: rgba(251,191,36,0.95);
    box-shadow: 0 0 36px rgba(251,191,36,0.8), inset 0 0 26px rgba(251,191,36,0.22);
}

.rarity-premium .slot-column.lock-pulse::before {
    border-color: rgba(216,180,254,1);
    box-shadow: 0 0 42px rgba(192,132,252,0.95), 0 0 72px rgba(34,211,238,0.35), inset 0 0 30px rgba(216,180,254,0.28);
}

@keyframes slotLockPulse {
    0% { opacity: 0; transform: scale(0.92); }
    28% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1.12); }
}

.slot-column.locked .winning-item img {
    transform: scale(1.08);
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.5)) drop-shadow(0 18px 32px rgba(0,0,0,0.85));
}

.rarity-advanced .slot-column.locked .winning-item img {
    filter: drop-shadow(0 0 22px rgba(251,191,36,0.8)) drop-shadow(0 18px 32px rgba(0,0,0,0.85));
}

.rarity-premium .slot-column.locked .winning-item img {
    filter: drop-shadow(0 0 30px rgba(192,132,252,0.95)) drop-shadow(0 0 46px rgba(34,211,238,0.45)) drop-shadow(0 18px 32px rgba(0,0,0,0.85));
}

@keyframes slotLockPunch {
    0% { transform: scale(1); }
    45% { transform: scale(1.045); }
    100% { transform: scale(1); }
}

.slots-wrapper.fusion-ready {
    animation: fusionMachineCharge 1.1s ease forwards;
}

.slots-wrapper.fusion-ready .slot-column {
    transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.75s ease, filter 0.75s ease;
}

.slots-wrapper.fusion-ready .fusion-slot-1 { transform: translateX(138px) scale(0.9) rotate(-4deg); }
.slots-wrapper.fusion-ready .fusion-slot-2 { transform: scale(0.92); z-index: 5; }
.slots-wrapper.fusion-ready .fusion-slot-3 { transform: translateX(-138px) scale(0.9) rotate(4deg); }

.fusion-phase .slots-wrapper.fusion-ready .slot-column {
    filter: brightness(1.35) saturate(1.25);
}

@keyframes fusionMachineCharge {
    0% { transform: scale(1); filter: brightness(1); }
    60% { transform: scale(1.04); filter: brightness(1.35); }
    100% { transform: scale(0.96); filter: brightness(1.8); }
}

.fusion-burst {
    position: fixed;
    left: 50%;
    top: 52%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    z-index: 23000;
    pointer-events: none;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.78) 18%, transparent 62%);
    animation: fusionBurstPop 1.25s ease-out forwards;
}

.fusion-burst-basic {
    box-shadow: 0 0 70px rgba(203,213,225,0.45);
}

.fusion-burst-advanced {
    background: radial-gradient(circle, #fff 0%, rgba(251,191,36,0.95) 22%, rgba(217,119,6,0.22) 46%, transparent 70%);
    box-shadow: 0 0 95px rgba(251,191,36,0.75), 0 0 150px rgba(217,119,6,0.35);
}

.fusion-burst-premium {
    background:
        radial-gradient(circle, #fff 0%, rgba(216,180,254,0.95) 20%, rgba(34,211,238,0.42) 45%, transparent 72%),
        conic-gradient(from 0deg, transparent, rgba(255,255,255,0.9), transparent, rgba(192,132,252,0.95), transparent);
    box-shadow: 0 0 130px rgba(192,132,252,0.95), 0 0 220px rgba(34,211,238,0.45);
}

@keyframes fusionBurstPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15) rotate(0deg); }
    35% { opacity: 1; transform: translate(-50%, -50%) scale(2.1) rotate(70deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(3.7) rotate(160deg); }
}

.btn-skip-animation.used,
.btn-skip-animation:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
    transform: none;
}

.final-result-card.result-basic .final-card-inner {
    border-color: rgba(203,213,225,0.35);
    box-shadow: 0 0 70px rgba(148,163,184,0.18), inset 0 0 24px rgba(255,255,255,0.04);
}

.final-result-card.result-advanced .final-card-inner {
    border-color: rgba(251,191,36,0.7);
    box-shadow: 0 0 100px rgba(251,191,36,0.32), 0 0 180px rgba(217,119,6,0.16), inset 0 0 28px rgba(251,191,36,0.08);
}

.final-result-card.result-premium .final-card-inner {
    border-color: rgba(216,180,254,0.9);
    box-shadow: 0 0 130px rgba(192,132,252,0.46), 0 0 220px rgba(34,211,238,0.18), inset 0 0 42px rgba(216,180,254,0.14);
}

.final-result-card.result-advanced .final-card-inner img {
    animation: floatReward 3.2s ease-in-out infinite, rewardAdvancedGlow 1.8s ease-in-out infinite alternate;
}

.final-result-card.result-premium .final-card-inner img {
    animation: floatReward 2.8s ease-in-out infinite, rewardPremiumGlow 1.25s ease-in-out infinite alternate;
}

@keyframes rewardAdvancedGlow {
    from { filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8)) drop-shadow(0 0 16px rgba(251,191,36,0.45)); }
    to { filter: drop-shadow(0 24px 46px rgba(0,0,0,0.9)) drop-shadow(0 0 34px rgba(251,191,36,0.95)); }
}

@keyframes rewardPremiumGlow {
    from { filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8)) drop-shadow(0 0 22px rgba(192,132,252,0.7)); }
    to { filter: drop-shadow(0 28px 54px rgba(0,0,0,0.95)) drop-shadow(0 0 48px rgba(192,132,252,1)) drop-shadow(0 0 70px rgba(34,211,238,0.45)); }
}

.reward-kicker {
    color: #cbd5e1;
    font-size: 0.82rem;
    letter-spacing: 3px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.result-advanced .reward-kicker { color: #fde68a; }
.result-premium .reward-kicker { color: #e9d5ff; text-shadow: 0 0 16px rgba(216,180,254,0.7); }

@keyframes floatReward {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.final-card-name {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(255,255,255,0.4);
}

.final-card-qty {
    font-size: 1.8rem;
    color: #ffd700;
    font-weight: 800;
    margin-bottom: 20px;
}

.reward-gold-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: 700;
    margin-top: 15px;
}

.coin-icon-small {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    animation: none !important;
}

/* Impacto visual */
.impact-shake { animation: shakeScreen 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shakeScreen {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

.premium-shimmer {
    background: linear-gradient(45deg, transparent, rgba(124, 58, 237, 0.1), transparent);
    background-size: 200% 200%;
    animation: shimmerBg 4s infinite linear;
}
@keyframes shimmerBg {
    0% { background-position: -200% -200%; }
    100% { background-position: 200% 200%; }
}


/* ===================================================
   MODERN FULLSCREEN TOGGLE SWITCH (PREMIUM)
   =================================================== */
.settings-toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
}

.premium-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: .4s cubic-bezier(0.18, 0.89, 0.35, 1.15);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 3px;
    background: linear-gradient(135deg, #eee, #999);
    transition: .4s cubic-bezier(0.18, 0.89, 0.35, 1.15);
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 2;
}

input:checked + .switch-slider {
    background-color: rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
}

input:checked + .switch-slider:before {
    transform: translateX(32px);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

.switch-label-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* Combat chat drawer final overrides */
body.combat-page:not(.chat-panel-open) .arena,
body.combat-page:not(.chat-panel-open) div.actions {
    margin-right: 40px !important;
}

body.chat-panel-open .arena,
body.chat-panel-open div.actions {
    margin-right: 440px !important;
}

@media (max-width: 1100px) {
    body.chat-panel-open .arena,
    body.chat-panel-open div.actions {
        margin-right: 340px !important;
    }
}

@media (max-width: 850px) {
    .combat-chat-toggle {
        right: 14px;
        top: auto;
        bottom: 88px;
    }

    body.combat-page:not(.chat-panel-open) .combat-unified {
        position: fixed;
        right: 14px;
        top: 90px;
        width: min(360px, calc(100vw - 28px));
        height: min(520px, calc(100vh - 120px));
        margin-top: 0;
        transform: translateX(calc(100% + 28px));
    }

    body.chat-panel-open .combat-unified {
        position: fixed;
        right: 14px;
        top: 90px;
        width: min(360px, calc(100vw - 28px));
        height: min(520px, calc(100vh - 120px));
        margin-top: 0;
        transform: translateX(0);
    }

    body.combat-page:not(.chat-panel-open) .arena,
    body.combat-page:not(.chat-panel-open) div.actions,
    body.chat-panel-open .arena,
    body.chat-panel-open div.actions {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
