/* ==========================================================================
   GAME 06: MEMORY CARDS STYLES (OBSIDIAN REDESIGN - GOLD #F4B860)
   ========================================================================== */

.memory-cards-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* HUD Panel */
.mc-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface, #10131B);
    border: 1px solid rgba(244, 184, 96, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(244, 184, 96, 0.08);
    border-radius: 14px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.mc-hud-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main, #F5F3EE);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-hud-item i {
    color: var(--accent-game-006, #F4B860);
}

.mc-target-wrapper {
    background: linear-gradient(135deg, rgba(244, 184, 96, 0.12), rgba(16, 19, 27, 0.8));
    border: 1.5px dashed rgba(244, 184, 96, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1.05rem;
    color: var(--text-muted, #9B9EAA);
}

.mc-target-val {
    color: var(--accent-game-006, #F4B860);
    font-weight: 800;
    font-size: 1.3rem;
    font-family: 'Space Grotesk', sans-serif;
}

/* 4x3 Cards Board Grid */
.mc-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 110px);
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin: 10px auto;
}

/* 3D Flip Card Wrapper */
.mc-card-wrapper {
    perspective: 1000px;
    cursor: pointer;
    touch-action: manipulation;
}

.mc-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
    border-radius: 12px;
}

/* Face down transition */
.mc-card.face-down {
    transform: rotateY(180deg);
}

.mc-card-front, .mc-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #181C27);
    border: 1.5px solid rgba(244, 184, 96, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, transform 0.2s;
}

/* Back face (shown when rotated/face-down) */
.mc-card-back {
    transform: rotateY(180deg);
    font-size: 2.2rem;
    font-weight: 800;
    color: rgba(244, 184, 96, 0.4);
    background: linear-gradient(145deg, #181C27, #10131B);
}

/* Front face (shown face-up) */
.mc-card-front {
    font-size: 2.5rem;
    color: var(--text-main, #F5F3EE);
    background: var(--bg-surface, #10131B);
}

/* Hover Glow */
.mc-card-wrapper:hover .mc-card-front,
.mc-card-wrapper:hover .mc-card-back {
    border-color: var(--accent-game-006, #F4B860);
    box-shadow: 0 6px 20px rgba(244, 184, 96, 0.25);
}

/* Card Selection Indicators */
.mc-card-wrapper.selected .mc-card-back,
.mc-card-wrapper.selected .mc-card-front {
    border-color: #F4B860 !important;
    box-shadow: 0 0 16px rgba(244, 184, 96, 0.4) !important;
    background-color: rgba(244, 184, 96, 0.1) !important;
}

/* Correct feedback state */
.mc-card-wrapper.correct .mc-card-front,
.mc-card-wrapper.correct .mc-card-back {
    border-color: #47D18C !important;
    background-color: rgba(71, 209, 140, 0.12) !important;
    box-shadow: 0 0 18px rgba(71, 209, 140, 0.35) !important;
}

/* Incorrect shake state */
.mc-card-wrapper.incorrect .mc-card-back,
.mc-card-wrapper.incorrect .mc-card-front {
    border-color: #FF647C !important;
    background-color: rgba(255, 100, 124, 0.12) !important;
    box-shadow: 0 0 18px rgba(255, 100, 124, 0.35) !important;
    animation: mcShake 0.4s ease-in-out;
}

@keyframes mcShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Overlay & Results Wrap */
.mc-results-wrapper {
    background: var(--bg-surface, #10131B);
    border: 1px solid rgba(244, 184, 96, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin: 20px auto;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.mc-results-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main, #F5F3EE);
    text-align: center;
    margin-bottom: 20px;
}

.mc-results-target {
    font-size: 1.1rem;
    color: var(--text-muted, #9B9EAA);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.mc-results-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--bg-card, #181C27);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mc-results-row.completed {
    border-left: 4px solid #47D18C;
}

.mc-results-row.failed {
    border-left: 4px solid #FF647C;
    opacity: 0.8;
}

.mc-row-name {
    font-weight: 700;
    color: var(--text-main, #F5F3EE);
}

.mc-row-time {
    font-size: 0.95rem;
    color: var(--text-muted, #9B9EAA);
}

.mc-row-points {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    color: var(--accent-game-006, #F4B860);
}

/* Scoreboard Panel at bottom of game screen */
.mc-scores-panel {
    background: var(--bg-surface, #10131B);
    border: 1px solid rgba(244, 184, 96, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-top: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mc-scores-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-muted, #9B9EAA);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
}

.mc-player-scores {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.mc-score-card {
    background: var(--bg-card, #181C27);
    border: 1px solid rgba(244, 184, 96, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.mc-score-card.self {
    border-color: var(--accent-game-006, #F4B860);
    background: rgba(244, 184, 96, 0.1);
}

.mc-score-name {
    color: var(--text-main, #F5F3EE);
}

.mc-score-val {
    color: var(--accent-game-006, #F4B860);
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
}

/* Custom Final Rankings/Podium Screen */
.mc-final-wrapper {
    background: var(--bg-surface, #10131B);
    border: 1px solid rgba(244, 184, 96, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 550px;
    margin: 20px auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.mc-podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin: 25px 0;
    min-height: 180px;
}

.mc-podium-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px 12px 4px 4px;
    background: var(--bg-card, #181C27);
    border: 1.5px solid rgba(244, 184, 96, 0.2);
    padding: 12px 6px;
    position: relative;
}

.mc-podium-slot.rank-1 {
    height: 180px;
    border-color: #F4B860;
    background: linear-gradient(180deg, rgba(244, 184, 96, 0.2), rgba(244, 184, 96, 0.04));
    box-shadow: 0 0 20px rgba(244, 184, 96, 0.2);
}

.mc-podium-slot.rank-2 {
    height: 150px;
    border-color: #C0C0C0;
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.03));
}

.mc-podium-slot.rank-3 {
    height: 120px;
    border-color: #CD7F32;
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.03));
}

.mc-podium-badge {
    position: absolute;
    top: -15px;
    font-size: 1.4rem;
}

.mc-podium-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--text-main, #F5F3EE);
    margin-top: 15px;
    font-size: 0.95rem;
    word-break: break-all;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-podium-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    color: var(--accent-game-006, #F4B860);
    font-size: 0.9rem;
    margin-top: 4px;
}

.mc-final-list {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.mc-final-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--bg-card, #181C27);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .memory-cards-container,
    .mc-hud,
    .mc-target-wrapper,
    .mc-board,
    .mc-final-list {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .mc-hud {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mc-hud-item {
        min-width: 0;
        max-width: 100%;
    }

    /* Translate 4x3 desktop into 3x4 mobile */
    .mc-board {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, clamp(65px, 18vw, 85px));
        gap: 10px;
        width: 100%;
        max-width: 100%;
        margin: 10px auto;
    }
    
    .mc-card-front {
        font-size: 1.9rem;
    }
    
    .mc-card-back {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .mc-board {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, clamp(58px, 16vw, 72px));
        gap: 8px;
    }
    
    .mc-card-front {
        font-size: 1.7rem;
    }
    
    .mc-card-back {
        font-size: 1.5rem;
    }
    
    .mc-hud {
        padding: 8px 12px;
    }
    
    .mc-hud-item {
        font-size: 0.9rem;
    }
    
    .mc-target-wrapper {
        padding: 4px 10px;
        font-size: 0.95rem;
    }
    
    .mc-target-val {
        font-size: 1.1rem;
    }
}

@media (max-width: 400px) {
    .mc-hud {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 6px 10px;
    }
    
    .mc-hud-item {
        font-size: 0.85rem;
    }
    
    .mc-board {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, clamp(52px, 15vw, 68px));
        gap: 6px;
    }
    
    .mc-card-front {
        font-size: 1.5rem;
    }
    
    .mc-card-back {
        font-size: 1.3rem;
    }
}


