html {
    text-align: center;
}

/* Memory Card Game Styles */

/* Reset and base styles for consistent appearance across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #333;
}

/* Main game container to center everything nicely */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 800px;
    width: 100%;
}

/* Game title styling */
h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Score and status display area */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(45deg, #f7fafc, #edf2f7);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

/* Individual score styling */
.score {
    font-size: 1.3em;
    font-weight: bold;
    color: #2d3748;
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Player 1 score gets a blue accent */
#score1 {
    border-left: 4px solid #3182ce;
}

/* Player 2 score gets a purple accent */
#score2 {
    border-left: 4px solid #805ad5;
}

/* Game status (whose turn, game over messages) */
#gameStatus {
    font-size: 1.4em;
    font-weight: bold;
    color: #4a5568;
    text-align: center;
    padding: 10px 20px;
    background: linear-gradient(45deg, #bee3f8, #d6f5d6);
    border-radius: 25px;
    border: 2px solid #90cdf4;
    min-width: 200px;
}

/* Main cards container - this holds our 4x4 grid */
#cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

/* Each row of cards */
#cards > div {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Card button styling - these are the clickable card elements */
#cards button {
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Hover effect for interactive feedback */
#cards button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Active/pressed state for tactile feedback */
#cards button:active {
    transform: translateY(-2px);
}

/* Card image styling */
#cards img {
    display: block;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    transition: all 0.3s ease;
    background: white;
}

/* Hover effect on card images */
#cards button:hover img {
    border-color: #4299e1;
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.3);
}

/* Hide the default <br> tags since we're using flexbox */
#cards br {
    display: none;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .score {
        font-size: 1.1em;
    }
    
    #gameStatus {
        font-size: 1.2em;
        min-width: auto;
    }
    
    /* Make cards smaller on mobile */
    #cards img {
        width: 100px !important;
        height: 95px !important;
    }
    
    #cards > div {
        gap: 10px;
    }
    
    #cards {
        gap: 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #cards img {
        width: 70px !important;
        height: 67px !important;
    }
    
    #cards > div {
        gap: 8px;
    }
}

/* Animation for matched cards */
@keyframes matchAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* You can add this class via JavaScript when cards match */
.matched {
    animation: matchAnimation 0.5s ease;
}

/* Flip animation for card reveals */
@keyframes flipCard {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* You can add this class when cards are flipped */
.flipping {
    animation: flipCard 0.6s ease;
}