.mcg-game-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #6b21a8 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.mcg-game-header {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.mcg-game-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    color: #333;
    text-align: center;
    font-weight: bold;
}

.mcg-game-controls {
    margin-bottom: 20px;
}

.mcg-level-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.mcg-level-selector label {
    font-weight: bold;
    color: #333;
}

.mcg-level-btn {
    padding: 10px 20px;
    border: 2px solid #3b82f6;
    background: white;
    color: #1e40af;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mcg-level-btn:hover {
    background: #eff6ff;
    transform: translateY(-2px);
}

.mcg-level-btn.active {
    background: #3b82f6;
    color: white;
}

.mcg-game-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mcg-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.mcg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mcg-btn-start {
    background: #1e40af;
}

.mcg-btn-start:hover:not(:disabled) {
    background: #1e3a8a;
    transform: translateY(-2px);
}

.mcg-btn-restart {
    background: #7c3aed;
}

.mcg-btn-restart:hover:not(:disabled) {
    background: #6d28d9;
    transform: translateY(-2px);
}

.mcg-btn-help {
    background: #4f46e5;
}

.mcg-btn-help:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-2px);
}

.mcg-btn-help.used {
    background: #9ca3af;
    cursor: not-allowed;
}

.mcg-game-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.mcg-stat {
    text-align: center;
}

.mcg-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.mcg-stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #3b82f6;
}

.mcg-game-message {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    display: none;
}

.mcg-game-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.mcg-game-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

.mcg-game-message.info {
    background: #dbeafe;
    color: #1e40af;
    display: block;
}

.mcg-game-board {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 10px;
    min-height: 400px;
}

.mcg-start-message {
    text-align: center;
    padding: 100px 20px;
    font-size: 18px;
    color: #666;
}

.mcg-cards-container {
    display: grid;
    gap: 15px;
    justify-content: center;
}

.mcg-cards-container.level-1 {
    grid-template-columns: repeat(3, 120px);
}

.mcg-cards-container.level-2 {
    grid-template-columns: repeat(4, 120px);
}

.mcg-cards-container.level-3 {
    grid-template-columns: repeat(6, 120px);
}

.mcg-card {
    width: 120px;
    height: 120px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.mcg-card.flipped {
    transform: rotateY(180deg);
}

.mcg-card.matched {
    opacity: 0.6;
    cursor: default;
}

.mcg-card.hint {
    animation: mcg-hint-pulse 1s ease-in-out;
}

.mcg-card-face {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mcg-card-front {
    background: linear-gradient(135deg, #1e3a8a 0%, #6b21a8 100%);
    transform: rotateY(180deg);
}

.mcg-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.mcg-card-back {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    font-size: 40px;
    color: white;
}

.mcg-card-back::before {
    content: "?";
    font-weight: bold;
}

/* Ranking Section */
.mcg-ranking-section {
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

.mcg-ranking-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #1e40af;
    text-align: center;
    font-weight: bold;
}

.mcg-ranking-list {
    max-width: 600px;
    margin: 0 auto;
}

.mcg-no-scores {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.mcg-ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.mcg-ranking-item:hover {
    background: #eff6ff;
    transform: translateX(5px);
}

.mcg-ranking-item.top-1 {
    border-left-color: #fbbf24;
    background: #fffbeb;
}

.mcg-ranking-item.top-2 {
    border-left-color: #94a3b8;
    background: #f8fafc;
}

.mcg-ranking-item.top-3 {
    border-left-color: #fb923c;
    background: #fff7ed;
}

.mcg-ranking-position {
    font-weight: bold;
    font-size: 18px;
    color: #1e40af;
    min-width: 30px;
}

.mcg-ranking-item.top-1 .mcg-ranking-position {
    color: #d97706;
}

.mcg-ranking-item.top-2 .mcg-ranking-position {
    color: #64748b;
}

.mcg-ranking-item.top-3 .mcg-ranking-position {
    color: #ea580c;
}

.mcg-ranking-name {
    flex: 1;
    font-weight: 600;
    color: #334155;
    margin: 0 15px;
}

.mcg-ranking-score {
    font-weight: bold;
    font-size: 18px;
    color: #3b82f6;
    margin-right: 10px;
}

.mcg-ranking-details {
    font-size: 12px;
    color: #64748b;
}

.mcg-save-score-form {
    background: #eff6ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #3b82f6;
}

.mcg-save-score-form h4 {
    margin: 0 0 15px 0;
    color: #1e40af;
    font-size: 18px;
}

.mcg-save-score-form input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.mcg-save-score-form input:focus {
    outline: none;
    border-color: #3b82f6;
}

.mcg-save-score-form button {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mcg-save-score-form button:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.mcg-save-score-form button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Animaciones */
@keyframes mcg-hint-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 16px rgba(251, 191, 36, 0.6);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .mcg-game-container {
        padding: 15px;
    }
    
    .mcg-cards-container.level-1 {
        grid-template-columns: repeat(3, 90px);
    }
    
    .mcg-cards-container.level-2 {
        grid-template-columns: repeat(4, 80px);
    }
    
    .mcg-cards-container.level-3 {
        grid-template-columns: repeat(6, 60px);
    }
    
    .mcg-card {
        width: 100%;
        height: 100%;
        aspect-ratio: 1;
    }
    
    .mcg-game-title {
        font-size: 22px;
    }
    
    .mcg-level-btn,
    .mcg-btn {
        font-size: 14px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .mcg-cards-container.level-3 {
        grid-template-columns: repeat(6, 50px);
    }
    
    .mcg-game-stats {
        flex-direction: column;
        gap: 10px;
    }
}
