/* Memory Cards Game - Orange/Yellow Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --primary-light: #FCD34D;
    --secondary-color: #10B981;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
    --card-back: linear-gradient(135deg, #F59E0B 0%, #FB923C 100%);
    --card-front: #FFFFFF;
    --shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 25px rgba(245, 158, 11, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 728px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

header {
    margin-bottom: 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.difficulty-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.new-game-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.new-game-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-box {
    background: var(--surface);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    text-align: center;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-left: 5px;
}

.instructions {
    background: var(--surface);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.game-board {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
    perspective: 1000px;
    justify-content: center;
}

.game-board.easy {
    grid-template-columns: repeat(3, 120px);
}

.game-board.medium {
    grid-template-columns: repeat(4, 120px);
}

.game-board.hard {
    grid-template-columns: repeat(4, 120px);
}

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

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

.card.matched {
    animation: matchPulse 0.5s ease;
}

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 3rem;
}

.card-front {
    background: var(--card-front);
    border: 3px solid var(--border-color);
    transform: rotateY(180deg);
}

.card-back {
    background: var(--card-back);
    border: 3px solid var(--primary-dark);
}

.card-back::after {
    content: "?";
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.card.matched .card-front {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: var(--secondary-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    border: 3px solid var(--primary-color);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.stats {
    background: #FEF3C7;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.stats p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: var(--text-primary);
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.overlay-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.tips {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.tips h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
}

.tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .difficulty-selector {
        width: 100%;
    }
    
    .difficulty-btn {
        flex: 1;
    }
    
    .new-game-btn {
        width: 100%;
    }
    
    .card {
        width: 90px;
        height: 90px;
    }
    
    .game-board.easy {
        grid-template-columns: repeat(3, 90px);
    }
    
    .game-board.medium {
        grid-template-columns: repeat(4, 90px);
    }
    
    .game-board.hard {
        grid-template-columns: repeat(4, 90px);
    }
    
    .card-face {
        font-size: 2rem;
    }
}