body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-container {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.stats {
    display: flex;
    gap: 20px;
}

.moves, .timer {
    font-size: 1.1rem;
    font-weight: 500;
}

.controls {
    display: flex;
    gap: 10px;
}

.control-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.control-button:hover {
    background-color: #0056b3;
}

#stop {
    background-color: #dc3545;
}

#stop:hover {
    background-color: #c82333;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.difficulty-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.difficulty-button:hover {
    background-color: #5a6268;
}

.difficulty-button.active {
    background-color: #28a745;
}

.difficulty-button.active:hover {
    background-color: #218838;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 auto;
    max-width: 600px;
}

.card {
    aspect-ratio: 3/4;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

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

.card-front, .card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-front {
    background-color: #007bff;
    background-image: linear-gradient(135deg, #0056b3 25%, transparent 25%),
                      linear-gradient(225deg, #0056b3 25%, transparent 25%),
                      linear-gradient(45deg, #0056b3 25%, transparent 25%),
                      linear-gradient(315deg, #0056b3 25%, #007bff 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px;
    background-repeat: repeat;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
    font-size: 2rem;
    color: #333;
}

.card.matched .card-back {
    background-color: #d4edda;
    color: #28a745;
}

.result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.result-container.show {
    visibility: visible;
    opacity: 1;
}

.result-content {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.result-content h2 {
    color: #007bff;
    margin-top: 0;
}

.score-details {
    margin: 20px 0;
    font-size: 1.2rem;
}

.score-details p {
    margin: 10px 0;
}

#play-again {
    background-color: #28a745;
    padding: 10px 20px;
    font-size: 1rem;
}

#play-again:hover {
    background-color: #218838;
}

.info-section {
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-section h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.info-section h3 {
    color: #444;
    margin-top: 20px;
}

.info-section ul, .info-section ol {
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
}

.note {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-top: 20px;
    border-radius: 0 4px 4px 0;
}

.note h4 {
    margin-top: 0;
    color: #007bff;
}

/* Ad Container Styling */
.ad-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    overflow: hidden;
    min-height: 100px;
}

.ad-bottom {
    margin-top: 30px;
    background-color: #f9f9f9;
    border-top: 3px solid #007bff;
}

footer {
    text-align: center;
    padding: 1rem 0;
    background-color: #333;
    color: #fff;
    margin-top: 30px;
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .difficulty-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-button {
        width: 100%;
        max-width: 200px;
    }
    
    #game-board {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}

/* Card flip animation */
@keyframes flipIn {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(180deg);
    }
}

@keyframes flipOut {
    from {
        transform: rotateY(180deg);
    }
    to {
        transform: rotateY(0deg);
    }
}

/* Match animation */
@keyframes matched {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
} 
