:root {
    /* Paleta Dark Mode Elegante */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    
    /* Estilo de Carta TCG */
    --card-width: 280px;
    --card-height: 400px;
    --art-height: 320px;
    --card-radius: 18px;
    --shadow-tcg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

/* Reset y Base */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at top right, #1e1b4b, transparent);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Estilo Moderno */
.header {
    padding: 40px 20px 20px;
    text-align: center;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin: 0;
}

.header-accent { color: var(--primary); }

.header-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Navegación por Pestañas (Glassmorphism) */
.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.tabs {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 5px;
}

.tab-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-item:hover { color: white; }

.tab-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Layout Principal */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 90%;
    padding-bottom: 50px;
}

/* --- ESTILOS PARA EL CROPPER "ESTILO INSTAGRAM" --- */

/* 1. Oscurecer el fondo que rodea la imagen para dar enfoque */
.modal-body-cropper {
    background-color: #000; /* Negro puro detrás de la foto */
    overflow: hidden; /* Evitar que la imagen grande se salga del modal */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 2. El recuadro de recorte nativo lo hacemos invisible pero mantenemos los manejadores */
.cropper-view-box,
.cropper-face {
    border: none !important; /* Quitamos el borde cuadrado por defecto */
    outline: none !important;
}

/* 3. Recreamos el círculo gris claro (como en tu ejemplo) */
.cropper-face {
    background-color: transparent !important; /* Limpio por dentro */
    
    /* El borde gris claro del círculo */
    border: 3px solid rgba(226, 232, 240, 0.7) !important; 
    border-radius: 50%; /* ¡ESTO HACE EL CÍRCULO! */
    
    /* Sombra externa muy difuminada para que parezca que está "encima" */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4); 
}

/* 4. Creamos los costados oscuros (overlay) */
/* Usamos el contenedor de la foto de Cropper para proyectar el oscurecimiento */
.cropper-container {
    position: relative;
}

/* Sombra que viene desde la izquierda y derecha de la foto */
.cropper-container::before,
.cropper-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 25%; /* Ajusta esto según cuánto quieras que se oscurezca a los lados */
    height: 100%;
    /* Degradado oscuro para que se sienta integrado con el fondo negro */
    background: linear-gradient(to right, rgba(0,0,0,0.9), rgba(0,0,0,0.5) 70%, transparent);
    pointer-events: none; /* Crucial: Para que el usuario pueda hacer zoom a la foto de abajo */
    z-index: 10; /* Por encima de la foto, por debajo del círculo */
}

/* Espejamos la sombra para el lado derecho */
.cropper-container::after {
    left: auto;
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.9), rgba(0,0,0,0.5) 70%, transparent);
}


.creator-container {
    display: grid;
    grid-template-columns: 1fr 350px; /* Split screen */
    gap: 40px;
    align-items: start;
}

/* Secciones de Contenido */
.section-container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
}

.full-width { grid-column: 1 / -1; }

.section-header { margin-bottom: 25px; }
.section-header h2 { margin: 0; font-size: 1.5rem; }
.section-header p { color: var(--text-muted); font-size: 0.9rem; margin: 5px 0 0; }

/* Formulario */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- BOTÓN DE INVOCACIÓN DE ARTE (File Upload) --- */
.custom-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 27, 75, 0.8));
    border: 2px solid var(--primary);
    color: #f8fafc;
    padding: 16px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Efecto de luz mística y sombreado profundo */
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.5), /* Sombra física */
        0 0 15px rgba(139, 92, 246, 0.4), /* Resplandor violeta externo */
        inset 0 0 10px rgba(139, 92, 246, 0.2); /* Brillo interno */
}

/* Efecto al pasar el ratón: La energía cambia a Dorado */
.custom-file-btn:hover {
    background: linear-gradient(145deg, rgba(30, 27, 75, 1), rgba(15, 23, 42, 1));
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-4px); /* Se levanta de la mesa */
    
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.7), /* Sombra más alargada */
        0 0 20px rgba(251, 191, 36, 0.5), /* Resplandor dorado externo */
        inset 0 0 15px rgba(251, 191, 36, 0.3); /* Brillo dorado interno */
}

.custom-file-btn:active {
    transform: translateY(2px); /* Efecto de pulsación dura */
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.6);
}

.custom-file-btn .icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4)); /* Pequeño halo al icono */
    transition: transform 0.3s ease;
}

.custom-file-btn:hover .icon {
    transform: scale(1.2) rotate(5deg); /* El icono reacciona al hover */
}



.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Workshop de Stats (Sliders) */
.stats-workshop {
    background: rgba(15, 23, 42, 0.5);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.stat-control { margin-bottom: 15px; }

.stat-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.stat-number { color: var(--primary); font-weight: 800; }

.range-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Badge de Puntos */
.budget-card {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
}

.remaining-points {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

/* --- ESTILOS PARA LAS FAMILIAS DE PASIVAS --- */
#cardPassive optgroup {
    font-size: 1.1rem;      /* Aumenta ligeramente la letra */
    font-weight: 800;       /* Le da más grosor para que destaque */
    font-style: normal;     /* Quita la cursiva que traen los navegadores por defecto */
    color: var(--gold);     /* Le damos ese toque dorado de la forja */
    background-color: var(--bg-card); /* Fondo oscuro para que no desentone */
}

/* Opcional: Aumentar un pelín también las opciones normales para que haya armonía */
#cardPassive option {
    font-size: 0.95rem;
    color: var(--text-main);
}



/* Botón de Forja */
.btn-forge {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-forge:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-forge:disabled {
    filter: grayscale(1);
    opacity: 0.3;
    cursor: not-allowed;
}





/* --- LA CARTA (TCG Visual Refinado) --- */
.preview-container {
    display: flex;
    justify-content: center;
    perspective: 1000px; /* Efecto 3D para la carta */
}

.sticky-preview {
    position: sticky;
    top: 40px;
}

.card-preview {
    /* CAMBIO CLAVE: Cambiamos width por max-width y usamos 100% */
    width: 100%; 
    max-width: var(--card-width); 
    min-height: var(--card-height);
    
    /* Mantenemos tu estética intacta */
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    
    /* El marco que tanto te gusta */
    border: 6px solid #2d2d2d; 
    outline: 2px solid var(--gold);
    outline-offset: -4px;
    
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.8),
        0 0 20px rgba(139, 92, 246, 0.2);
    
    /* Animación fluida */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Evita que la carta se colapse si no hay contenido */
    aspect-ratio: 280 / 400; 
}

/* Ajuste sutil para móviles muy pequeños */
@media (max-width: 480px) {
    .card-preview {
        outline-width: 1px; /* Un poco más fino para que no sature */
        border-width: 4px;
    }
}

.card-preview:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 30px 60px rgba(0,0,0,0.9);
}

.card-art {
    height: var(--art-height);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    
    /* Efecto de cristalización sobre el arte */
    border-bottom: 3px solid var(--gold);
    position: relative;
    z-index: 1;
    image-rendering: -webkit-optimize-contrast;
}

/* Brillo Holográfico sutil en el arte */
.card-art::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    z-index: 2;
}

/* Sombra inferior para legibilidad del nombre */
.card-art::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 3;
}

.card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a; /* Fondo de piedra oscura */
    background-image: url('https://www.transparenttextures.com/patterns/dark-leather.png');
    border: 2px solid #333;
    margin: 6px;
    border-radius: 4px;
    color: #e2e8f0;
}

.card-header-inner h3 {
    margin: 0;
    font-size: 1.2rem;
    font-family: 'Serif', Georgia, serif; /* Fuente RPG */
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.meta-info {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
}

.preview-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

.stat-box {
    background: linear-gradient(145deg, #262626, #171717);
    border: 1px solid #444;
    padding: 8px 4px; /* Un poco más de aire interior */
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    
    /* MAGIA PARA CENTRAR */
    display: flex;
    flex-direction: column;
    align-items: center;    /* Centra horizontalmente */
    justify-content: center; /* Centra verticalmente */
    text-align: center;
}

.stat-box b {
    color: #fff;
    display: block;
    font-size: 1.1rem; /* Un pelín más grandes para que destaquen */
    margin-top: 4px;   /* Separación entre el icono y el número */
}

.passive-desc {
    margin-top: auto;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    color: #cbd5e1;
    line-height: 1.4;
}

/* Biblioteca (Grid pulido) */
.cards-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    padding: 20px;
}



/* --- CARTAS EN LA BIBLIOTECA (.card-item) --- */
.card-item {
    background: var(--bg-card);
    border: 2px solid; /* El color se inyecta por JS según el elemento */
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.5);
}

.card-item-art {
    width: 100%;
    height: 180px; /* Crucial para que la imagen tenga espacio */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000; /* Fondo por si no hay imagen */
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.card-item-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
}

.card-item-info strong {
    font-size: 1.1rem;
    color: white;
}

.card-item-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-delete-card {
    margin-top: 10px;
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-delete-card:hover {
    background: #dc2626;
}



/* --- LIBRARY SHOWCASE MODE (Escaparate Bonito) --- */

/* 1. Contenedor Principal: Limpia Flexbox y centra */
.library-detail-view.showcase-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* Efecto 3D sutil */
    padding: 0;
    overflow: hidden; /* Evita scrolls raros */
}

/* 2. La Carta en el Escaparate: Forzamos proporciones TCG */
.library-detail-view.showcase-mode .card-visual {
    width: 320px; /* Un poco más grande para el mostrador */
    height: 480px; /* Proporción TCG estricta */
    margin: 0;
    transform: rotateY(-5deg) scale(1); /* Efecto mostrador */
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 0 30px 5px rgba(99, 102, 241, 0.2); /* Brillo sutil */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000; /* Fondo negro puro detrás del arte */
}

/* Efecto hover en el mostrador */
.library-detail-view.showcase-mode .card-visual:hover {
    transform: rotateY(0deg) scale(1.02);
    box-shadow: 
        0 35px 60px -15px rgba(0, 0, 0, 0.8),
        0 0 40px 10px rgba(99, 102, 241, 0.3);
}

/* 3. Estructura Interna (Modo Mostrador) */

/* Nombre arriba, dentro de la carta */
.library-detail-view.showcase-mode .card-visual .card-name-text {
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Contenedor del Arte: Ocupa la mayor parte */
.library-detail-view.showcase-mode .card-visual .card-art-container {
    height: 380px; /* Espacio para stats abajo */
    border-radius: 0; /* Imagen cuadrada TCG */
}

/* Stats Grid: Superpuesta abajo con Glassmorphism */
.library-detail-view.showcase-mode .card-visual .card-stats-grid {
    position: absolute;
    bottom: 60px; /* Espacio para la pasiva */
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.8); /* var(--bg-main) con opacidad */
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0;
    padding: 8px 15px;
}

/* Pasiva: Abajo del todo, texto pequeño elegante */
.library-detail-view.showcase-mode .card-visual .card-passive-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Botón Eliminar: Fuera de la carta, abajo del mostrador */
.btn-delete-showcase {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-delete-showcase:hover {
    background: #dc2626;
}


/* --- ESTILO ROSTER AGRUPADO --- */
.roster-group {
    margin-bottom: 20px;
}

.roster-category-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 2px;
    border-left: 3px solid var(--gold);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.roster-category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-list-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.card-list-item:hover {
    background: rgba(99, 102, 241, 0.1);
    padding-left: 20px; /* Efecto de desplazamiento */
}

.card-list-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: white;
}

/* Punto de color del elemento */
.item-element-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 5px currentColor;
}

.item-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
}

.item-stats-brief {
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--text-muted);
    opacity: 0.7;
}







/* --- COLISEO --- */



.vs-badge {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Serif', Georgia, serif;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.arena-actions {
    margin-bottom: 20px;
}

/* Consola de Combate */
/* --- CONSOLA DE COMBATE PROFESIONAL --- */
.combat-console {
    background: #020617 !important;
    border: 2px solid #1e293b;
    border-radius: 8px;
    
    /* 1. Altura estática: Suficiente para unas 2-3 rondas (aprox 400px) */
    height: 400px; 
    max-height: 400px;
    
    /* 2. Habilitar el slider (scroll) */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita que el borde se rompa */
    position: relative;
}

#logContent {
    flex: 1;
    overflow-y: auto; /* Aquí aparece el slider si el contenido supera los 400px */
    padding: 15px;
    display: flex;
    flex-direction: column; /* Cambiamos a column para control total */
    gap: 4px;
    
    /* Personalización del slider (Scrollbar) para que se vea Pro */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #0f172a;
}

/* Estilo del scrollbar para Chrome/Safari/Edge */
#logContent::-webkit-scrollbar {
    width: 6px;
}
#logContent::-webkit-scrollbar-track {
    background: #0f172a;
}
#logContent::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.log-entry {
    
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.4;
    border-left: 4px solid transparent;
    animation: fadeInLog 0.3s ease-out;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 8px 0;
    word-wrap: break-word; /* Blindaje para que el texto no se salga en móviles */
}

@keyframes fadeInLog {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Tipos de Log con colores distinguidos */
.log-entry.system { 
    color: #94a3b8; 
    border-left-color: #475569; 
    background: rgba(71, 85, 105, 0.1);
}

.log-entry.round-header { 
    color: var(--gold); 
    font-weight: 800; 
    text-transform: uppercase;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.3);
    margin: 15px 0 10px 0;
    background: rgba(251, 191, 36, 0.05);
    letter-spacing: 2px;
}

.log-entry.attack { 
    color: #f8fafc; 
    border-left-color: #ef4444; /* Rojo ataque */
    background: rgba(239, 68, 68, 0.05);
}

.log-entry.damage { 
    color: #fca5a5; 
    font-style: italic;
}

.log-entry.victory { 
    color: #4ade80; 
    border-left-color: #22c55e; 
    font-weight: bold;
    background: rgba(34, 197, 94, 0.1);
    font-size: 1rem;
}

.log-entry.passive { 
    color: #a78bfa; 
    border-left-color: #8b5cf6; 
    background: rgba(139, 92, 246, 0.05);
}

.log-round-tag {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: bold;
    display: inline-block;
    vertical-align: middle;
}

/* Badge de Ronda dentro del log */
.log-round-tag {
    font-size: 0.7rem;
    background: #334155;
    color: #f8fafc;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}


/* --- COLOSSEUM ARENA V1.2 --- */
.arena-setup {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    background: rgba(15, 23, 42, 0.4);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.fighter-select {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-mini {
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
    padding: 8px;
}

.vs-badge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}

.vs-badge {
    font-size: 2.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.mini-card-slot {
    height: 60px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    background: rgba(0,0,0,0.2);
}

/* Consola con Scroll Interno */
.combat-console {
    background: #020617;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.console-header {
    background: #1e293b;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border-color);
}

.log-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-family: 'JetBrains Mono', monospace;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}







/* --- MEDIA QUERIES (Ajustes para móviles) --- */
@media (max-width: 768px) {
    .arena-setup {
        flex-direction: column;
        align-items: center;
    }

    .vs-badge-container {
        padding: 10px 0;
        transform: rotate(90deg); /* El VS gira para flujo vertical */
    }

    .fighter-select {
        width: 100%;
    }

    .arena-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn-forge {
        width: 100%;
    }
    .header-title { font-size: 1.5rem; }
    
    /* Tabs más fáciles de tocar con el pulgar */
    .tabs {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 5px;
    }
    
    .tab-item {
        padding: 12px 5px;
        font-size: 0.8rem;
        flex-direction: column;
    }

    /* Biblioteca: De Lista/Detalle a Vertical */
    .library-sidebar {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-y: auto;
    padding: 10px;
    }

    .library-sidebar {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .library-list-container .card-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    }

    .library-detail-view.showcase-mode .card-visual {
        transform: scale(0.85); /* Reducimos la carta para que quepa */
        margin: -40px 0;
    }

    /* Coliseo: Ajuste de la Arena */


    .vs-badge {
        margin: 10px 0;
        font-size: 1.8rem;
    }
}

.library-list-container .card-list-item:hover {
    background: var(--primary);
    transform: translateX(5px);
}

.library-list-container .card-list-item.active {
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

/* Panel de Detalle */
.library-detail-view {
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.detail-art-container {
    width: 300px;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5), 0 0 10px var(--primary);
}

.detail-stats {
    flex: 1;
    max-width: 400px;
}

.btn-delete-card {
    margin-top: 20px;
    background: #450a0a;
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.btn-delete-card:hover {
    background: #ef4444;
    color: white;
}

.mini-card-slot {
    position: relative;
    height: 200px; /* Altura para que se vea bien la imagen */
    border: 2px solid #1e293b;
    border-radius: 12px;
    background: radial-gradient(circle, #1e293b 0%, #020617 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.arena-fighter-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Se activa por JS */
}

.slot-placeholder {
    color: #475569;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 2px;
}

/* Barras de Vida Estilo RPG */
.hp-bar-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 8px;
    background: #450a0a;
    border-radius: 4px;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.1);
}

.hp-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border-radius: 4px;
    transition: width 0.4s ease-out;
}

/* Contenedor de grupos */
.roster-group { margin-bottom: 20px; }

.roster-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.category-count {
    margin-left: auto;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.6rem;
}

/* Efectos de Rareza */
.card-list-item.rarity-legendary {
    border-left: 3px solid #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
}

.card-list-item.rarity-epic {
    border-left: 3px solid #a78bfa;
}

.item-stats-brief {
    display: flex;
    gap: 8px;
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

.item-element-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}