/* ============================================
   GRID DE CARTAS
   ============================================ */

.cartas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .cartas-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CARTA CARD
   ============================================ */

.carta-card {
    transition: all 0.3s ease;
}

.carta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   MODAL DE INFORMACIÓN
   ============================================ */

.carta-info-modal .info-section {
    padding: 10px 0;
}

.carta-info-modal h4 {
    display: flex;
    align-items: center;
    gap: 8px;

    font-family: 'Alfa Slab One', cursive;}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carta-card {
    animation: fadeInUp 0.4s ease;
}

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

/* ============================================
   ESTADOS DE BOTONES - COLORES SUAVES
   ============================================ */

/* Botón Info/Tres - Azul/Morado Suave */
.button.tres {
    background: linear-gradient(135deg, #e8ebfa 0%, #f3e8f8 100%);
    color: #5a67d8;
    border: 1px solid #c3caf5;
}

.button.tres:hover {
    background: linear-gradient(135deg, #dce1f7 0%, #e8daf4 100%);
    border-color: #a8b4f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.button.tres:active {
    transform: translateY(0);
}

/* Botón Danger - Rojo Suave */
.button.danger {
    background: linear-gradient(135deg, #ffe5e5 0%, #fff0f0 100%);
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.button.danger:hover {
    background: linear-gradient(135deg, #ffd6d6 0%, #ffe0e0 100%);
    border-color: #fc8181;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.button.danger:active {
    transform: translateY(0);
}

/* Botón Success - Verde Suave (opcional) */
.button.success {
    background: linear-gradient(135deg, #e6f9f0 0%, #f0fdf4 100%);
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.button.success:hover {
    background: linear-gradient(135deg, #d1f4e0 0%, #e6f9f0 100%);
    border-color: #68d391;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.15);
}

/* Botón Warning - Amarillo/Naranja Suave (opcional) */
.button.warning {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%);
    color: #d69e2e;
    border: 1px solid #fbd38d;
}

.button.warning:hover {
    background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
    border-color: #f6ad55;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(214, 158, 46, 0.15);
}

/* Botón Primary - Azul Suave (opcional) */
.button.primary {
    background: linear-gradient(135deg, #e6f2ff 0%, #f0f7ff 100%);
    color: #3182ce;
    border: 1px solid #90cdf4;
}

.button.primary:hover {
    background: linear-gradient(135deg, #d1e7ff 0%, #e6f2ff 100%);
    border-color: #63b3ed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
}

/* Botón Secondary - Gris Suave */
.button.secondary {
    background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.button.secondary:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #f7fafc 100%);
    border-color: #a0aec0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.1);
}

/* ============================================
   VARIANTES DE BOTONES CON ICONOS
   ============================================ */

/* Botones pequeños con solo iconos */
.button.icon-only {
    padding: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

/* Mejora visual de emojis en botones */
.button {
    font-family: 'Source Code Pro', monospace;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Efecto de "glow" suave en hover */
.button.tres:hover,
.button.danger:hover,
.button.success:hover,
.button.warning:hover,
.button.primary:hover {
    position: relative;
}

.button.tres:hover::before,
.button.danger:hover::before,
.button.success:hover::before,
.button.warning:hover::before,
.button.primary:hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    opacity: 0.3;
    z-index: -1;
    filter: blur(8px);
}

.button.tres:hover::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.button.danger:hover::before {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.button.success:hover::before {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.button.warning:hover::before {
    background: linear-gradient(135deg, #ed8936 0%, #d69e2e 100%);
}

.button.primary:hover::before {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

/* ============================================
   ALERTAS MEJORADAS
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
    font-size: 17px;
    line-height: 1.5;
}

.alert-error {
    background-color: #fff5f5;
    border-left: 4px solid #fc8181;
    color: #742a2a;
}

.alert-error::before {
    content: '❌';
    font-size: 44px;
    flex-shrink: 0;
}

.alert-success {
    background-color: #f0fff4;
    border-left: 4px solid #68d391;
    color: #22543d;
}

.alert-success::before {
    content: '✅';
    font-size: 44px;
    flex-shrink: 0;
}

.alert-warning {
    background-color: #fffaf0;
    border-left: 4px solid #f6ad55;
    color: #744210;
}

.alert-warning::before {
    content: '⚠️';
    font-size: 44px;
    flex-shrink: 0;
}

.alert-info {
    background-color: #ebf8ff;
    border-left: 4px solid #63b3ed;
    color: #2c5282;
}

.alert-info::before {
    content: 'ℹ️';
    font-size: 44px;
    flex-shrink: 0;
}

/* Botón de cerrar en alertas */
.alert .alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 44px;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert .alert-close:hover {
    opacity: 1;
}

/* ============================================
   TRANSICIONES GLOBALES
   ============================================ */

.button,
.alert {
    transition: all 0.2s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .button {
        padding: 10px 16px;
        font-size: 17px;
    }
    
    .button.icon-only {
        width: 36px;
        height: 36px;
        font-size: 19px;
    }
    
    .alert {
        padding: 12px 15px;
        font-size: 19px;
    }
}

/* ============================================
   ESTADOS DISABLED
   ============================================ */

.button:disabled,
.button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.button:disabled:hover,
.button[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   LOADING STATE EN BOTONES
   ============================================ */

.button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-color: currentColor transparent currentColor transparent;
    border-radius: 50%;
    animation: button-loading-spinner 1s linear infinite;
}

@keyframes button-loading-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   GRUPOS DE BOTONES
   ============================================ */

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group.compact {
    gap: 5px;
}

.button-group.vertical {
    flex-direction: column;
}

.button-group.stretch .button {
    flex: 1;
}

.dibujo-carta-astral {
    display: grid;
    grid-template-columns: 1fr 1fr;
}