:root {
    /* Paleta moderna y equilibrada */
    --primary: #6366f1;
    --primary-light: #8b5cf6;
    --secondary: #0ea5e9;
    --accent: #10b981;
    --accent-warm: #f59e0b;
    --surface: #ffffff;
    --surface-elevated: #f8fafc;
    --surface-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-accent: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Cargar fuente OpenDyslexic */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../../fonts/OpenDyslexic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('../../fonts/OpenDyslexic-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

body, button, input, select, textarea {
    font-family: 'OpenDyslexic', sans-serif;
}

body {
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Elementos flotantes sutiles */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    animation: float 20s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    width: 200px;
    height: 200px;
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: -3%;
    animation-delay: 10s;
}

.floating-shape:nth-child(3) {
    width: 300px;
    height: 300px;
    bottom: -10%;
    left: 40%;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(15px) rotate(240deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header moderno */
.header {
    text-align: center;
    margin-bottom: 4rem;
}

.back-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.back-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.main-title {
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: slideUp 0.8s ease 0.2s both;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    animation: slideUp 0.8s ease 0.4s both;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Controles de accesibilidad */
.accessibility-controls {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.control-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#colorblindMode {
    min-width: 140px;
    padding: 0.5rem 0.75rem;
}

#colorblindMode option {
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.5rem;
}

.control-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Estilos específicos del juego */
.game-controls {
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Botones modernos */
.btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Estilos para botón deshabilitado */
.btn:disabled {
    background: var(--surface-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-start {
    background: var(--gradient-accent);
}

.btn-start:disabled {
    background: var(--surface-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
    opacity: 0.6;
}

.btn-start:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-reset {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-change-mode {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.btn-change-mode:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.score-display {
    font-size: 1.25rem;
    margin: 1rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.score-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    background: var(--surface-elevated);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mode-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mode-card .checkmark {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    font-size: 1.1rem;
    animation: checkmarkPop 0.4s ease-out;
    border: 3px solid var(--surface);
}

.mode-card.active .checkmark {
    opacity: 1;
    transform: scale(1);
}

.mode-card.active {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
    position: relative;
}

.mode-card.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    z-index: -1;
    animation: activeGlow 2s ease-in-out infinite alternate;
}

@keyframes activeGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

.mode-card.active::after {
    transform: scaleX(1);
}

@keyframes checkmarkPop {
    0% { 
        opacity: 0; 
        transform: scale(0) rotate(-180deg); 
    }
    50% { 
        transform: scale(1.2) rotate(0deg); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotate(0deg); 
    }
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.mode-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.mode-desc {
    color: var(--text-secondary);
    opacity: 0.9;
    font-size: 0.9rem;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 2rem auto;
    max-width: 600px;
    background: var(--surface-elevated);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* Grid específico para 16 cartas (4x4) */
.game-board.sound-image {
    grid-template-columns: repeat(4, 1fr);
}

.game-board::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--gradient-primary);
    border-radius: calc(var(--radius-lg) + 10px);
    z-index: -1;
    opacity: 0.1;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.board-title {
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.game-board-container {
    margin: 2rem 0;
}

/* Layout del juego */
.game-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Panel lateral */
.game-sidebar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* Información de progreso */
.progress-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Timer */
.timer-display {
    text-align: center;
    padding: 1rem;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    color: white;
}

.timer-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'OpenDyslexic', sans-serif;
}

/* Botones del sidebar */
.game-controls-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-sidebar {
    background: var(--surface-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sidebar:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-sidebar.btn-start {
    background: var(--gradient-accent);
    border-color: var(--accent);
    color: white;
}

.btn-sidebar.btn-start:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.game-start-section {
    text-align: center;
}

.btn-sidebar i {
    font-size: 1rem;
}

/* Tablero principal */
.game-main {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.board-title {
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.mode-badge {
    background: var(--gradient-accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.card {
    aspect-ratio: 1;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-md);
    min-height: 80px;
    max-height: 100px;
}

.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    opacity: 1;
}

.card.flipped .card-front {
    display: none;
    opacity: 0;
}

.card.flipped .card-back {
    display: flex;
    opacity: 1;
}

.card-front {
    background: var(--gradient-primary);
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    z-index: 1;
}

.card-back {
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 0.5rem;
    text-align: center;
    border: 2px solid var(--border);
    z-index: 0;
}

.card.flipped .card-front {
    display: none;
}

.card.flipped .card-back {
    display: flex;
}

.card.matched {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s linear;
}

/* Indicadores de estado de las cartas */
.card.incorrect::after {
    content: '❌';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ef4444;
    z-index: 10;
    animation: incorrectPulse 0.5s ease-out;
}

.card.correct::after {
    content: '✅';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #10b981;
    z-index: 10;
    animation: correctPulse 0.5s ease-out;
}

@keyframes incorrectPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes correctPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Hover effects para las cartas */
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Efecto especial para cartas volteadas */
.card.flipped {
transform: scale(1.02);
box-shadow: var(--shadow-xl);
border: none !important;
}

/* Remove focus outline and selection border */
.card:focus, 
.card:focus-visible,
.card:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.card.flipped .card.correct {
border-color: #10b981;
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
animation: pulse 0.6s ease-in-out;
}

.card.incorrect {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
    animation: shake 0.5s ease-in-out;
}

.card.correct-temp {
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
    animation: pulse 0.6s ease-in-out;
}

.card.flipped .card-back {
    border: none;
    box-shadow: none;
}

/* Responsive para cartas más pequeñas */
@media (max-width: 1024px) {
.game-layout {
grid-template-columns: 1fr;
gap: 1.5rem;
}
    .game-sidebar {
        position: static;
        order: 2;
    }
    
    .game-main {
        order: 1;
    }
}

@media (max-width: 768px) {
    .board-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        max-width: 400px;
        padding: 1.5rem;
    }
    
    .card {
        min-height: 70px;
        max-height: 85px;
        font-size: 1.3rem;
    }
    
    .card-front {
        font-size: 1.5rem;
    }
    
    .card-back {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        max-width: 300px;
        padding: 1rem;
    }
    
    .card {
        min-height: 60px;
        max-height: 75px;
        font-size: 1.1rem;
    }
    
    .card-front {
        font-size: 1.3rem;
    }
    
    .card-back {
        font-size: 0.9rem;
    }
}

/* Modo oscuro */
body.dark-mode {
    --surface: #1e293b;
    --surface-elevated: #334155;
    --surface-secondary: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #475569;
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

/* Filtros para daltonismo */
body.protanopia {
    /* Daltonismo rojo-verde - usa azul y amarillo */
    --primary: #2563eb; /* Azul intenso */
    --primary-light: #3b82f6;
    --secondary: #0ea5e9; /* Azul cielo */
    --accent: #f59e0b; /* Amarillo/naranja */
    --accent-warm: #eab308; /* Amarillo más cálido */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #0ea5e9 100%);
}

body.tritanopia {
    /* Tritanopia - dificultad con azul/amarillo - usa rojo y verde */
    --primary: #dc2626; /* Rojo */
    --primary-light: #ef4444;
    --secondary: #16a34a; /* Verde */
    --accent: #16a34a; /* Verde para contraste */
    --accent-warm: #dc2626; /* Rojo */
    --gradient-primary: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-accent: linear-gradient(135deg, #16a34a 0%, #059669 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .back-btn,
    .accessibility-controls {
        position: static;
        margin-bottom: 1rem;
    }
    
    .header {
        margin-top: 1rem;
    }

    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-modes {
        grid-template-columns: 1fr;
    }
}

/* Iconos simples para modo oscuro/claro */
.theme-icon {
    font-size: 1.2rem;
    display: inline-block;
}

/* Modal personalizado para confirmar cambio de modo */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-warm);
}

.modal-title {
    font-family: 'OpenDyslexic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn-cancel {
    background: var(--surface-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.modal-btn-cancel:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.modal-btn-confirm {
    background: var(--gradient-accent);
    color: white;
}

.modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Modal de victoria especial */
.victory-modal .modal-icon {
    color: var(--accent-warm);
    animation: victoryBounce 1s ease-in-out infinite alternate;
    font-size: 4rem;
}

.victory-modal .modal-title {
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 2rem;
    font-family: 'OpenDyslexic', 'Nunito', sans-serif;
}

/* Estadísticas de victoria */
.victory-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive para el modal de victoria */
@media (max-width: 768px) {
    .victory-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .victory-modal .modal-icon {
        font-size: 3rem;
    }
    
    .victory-modal .modal-title {
        font-size: 1.5rem;
    }
}

@keyframes victoryBounce {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}
