/**
 * memory.css - Memory Match game styles
 */

body {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.6rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.back-btn:hover, .back-btn:active {
    color: #f5576c;
}

.stats {
    gap: 20px;
    margin-bottom: 15px;
}

.stat-box {
    padding: 10px 20px;
}

.stat-box .label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stat-box .value {
    font-size: 1.4rem;
}

.stat-box .value.time {
    color: #ffd700;
}

.game-container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 340px;
}

.card {
    aspect-ratio: 1;
    width: 75px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    transition: transform 0.3s, background 0.3s;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.card:active {
    transform: scale(0.95);
}

.card .front {
    display: none;
}

.card .back {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.card.flipped {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card.flipped .front {
    display: flex;
}

.card.flipped .back {
    display: none;
}

.card.matched {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    cursor: default;
    animation: matchPulse 0.5s ease;
}

@keyframes matchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.card.wrong {
    animation: memory-shake 0.5s ease;
}

@keyframes memory-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.overlay h2 {
    font-size: 2.2rem;
    text-align: center;
}

.overlay p {
    margin-bottom: 25px;
}

.result-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.result-stat {
    text-align: center;
    color: white;
}

.result-stat .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
}

.result-stat .label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.play-btn {
    font-size: 1.3rem;
    margin: 10px;
}

.play-btn.secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.difficulty-select {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.difficulty-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-btn:hover, .difficulty-btn:active {
    background: rgba(255,255,255,0.25);
    border-color: white;
}

.best-time {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 20px;
}

.stars {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Easter Egg: Standing Ovation for Perfect Game */
.standing-ovation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.ovation-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 0 0 30px #ffd700, 0 0 60px #ff006e;
    margin-bottom: 30px;
    animation: ovationPulse 0.5s ease infinite alternate;
}

@keyframes ovationPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.ovation-cards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 350px;
}

.ovation-card {
    font-size: 2.5rem;
    animation: cardBow 1s ease infinite;
}

@keyframes cardBow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-10deg); }
    50% { transform: translateY(5px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(10deg); }
}

.ovation-message {
    margin-top: 30px;
    font-size: 1.2rem;
    color: white;
    text-align: center;
}

.ovation-clap {
    position: fixed;
    font-size: 2rem;
    animation: clapFloat 1.5s ease forwards;
    pointer-events: none;
    z-index: 201;
}

@keyframes clapFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-100px) scale(1.5); }
}

.ovation-close-btn {
    margin-top: 25px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ffd700, #ff006e);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

/* === SPECIAL CARD GLOW EFFECTS (v0.11.0) === */
.card.special-freeze {
    box-shadow: 0 0 15px 5px #4fc3f7, 0 4px 15px rgba(0,0,0,0.2);
}

.card.special-peek {
    box-shadow: 0 0 15px 5px #ffd700, 0 4px 15px rgba(0,0,0,0.2);
}

.card.special-bonus {
    box-shadow: 0 0 15px 5px #ff006e, 0 4px 15px rgba(0,0,0,0.2);
    animation: rainbowGlow 2s ease infinite;
}

@keyframes rainbowGlow {
    0%, 100% { box-shadow: 0 0 15px 5px #ff006e, 0 4px 15px rgba(0,0,0,0.2); }
    33% { box-shadow: 0 0 15px 5px #ffd700, 0 4px 15px rgba(0,0,0,0.2); }
    66% { box-shadow: 0 0 15px 5px #38ef7d, 0 4px 15px rgba(0,0,0,0.2); }
}

/* === COMBO TEXT ANIMATION (v0.11.0) === */
.combo-text {
    position: fixed;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700, 2px 2px 4px rgba(0,0,0,0.5);
    animation: comboFloat 1s ease forwards;
    pointer-events: none;
    z-index: 150;
}

@keyframes comboFloat {
    0% { opacity: 1; transform: scale(1) translateY(0); }
    50% { transform: scale(1.3) translateY(-20px); }
    100% { opacity: 0; transform: scale(1) translateY(-50px); }
}

/* === SPECIAL CARD EFFECT FEEDBACK (v0.11.0) === */
.effect-text {
    position: fixed;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: effectFloat 1.5s ease forwards;
    pointer-events: none;
    z-index: 150;
}

@keyframes effectFloat {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-40px); }
}

/* === TIME CHALLENGE MODE (v0.11.0) === */
.time-challenge-option {
    margin: 15px 0;
    font-size: 1.1rem;
}

.time-challenge-option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}

.time-challenge-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.timer-warning {
    color: #ff4444 !important;
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === GAME OVER OVERLAY (v0.11.0) === */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.game-over-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #ff4444;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.3);
}

.game-over-content h2 {
    font-size: 2.5rem;
    color: #ff4444;
    margin-bottom: 20px;
}

.game-over-stats {
    font-size: 1.2rem;
    margin: 20px 0;
    color: #ccc;
}

/* === DIFFICULTY LOCK STYLES (v0.11.0) === */
.difficulty-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.difficulty-btn.locked::after {
    content: '\1F512';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.difficulty-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.unlock-hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* === EASTER EGG EFFECTS (v0.11.0) === */
.card.grumpy .front {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a) !important;
}

.egg-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    z-index: 200;
    animation: eggPop 0.5s ease;
}

@keyframes eggPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.lightning-flash {
    animation: lightningFlash 0.1s ease 3;
}

@keyframes lightningFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2); }
}

.crown-glow {
    animation: crownGlow 1s ease infinite;
}

@keyframes crownGlow {
    0%, 100% { box-shadow: 0 0 10px #ffd700; }
    50% { box-shadow: 0 0 30px #ffd700, 0 0 50px #ffa500; }
}

@media (max-width: 380px) {
    .card {
        width: 65px;
        font-size: 1.8rem;
    }

    .game-grid {
        gap: 8px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .stats {
        gap: 10px;
    }

    .stat-box {
        padding: 8px 15px;
    }

    .egg-celebration {
        font-size: 1.5rem;
        padding: 15px 25px;
        max-width: 90%;
    }
}
