* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.5rem;
    text-align: center;
}

.game-info {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 15px;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
}

.game-info div {
    font-weight: bold;
    color: #444;
}

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

.btn {
    background-color: #4a6ee0;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #3a5ec0;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

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

.card {
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

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

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

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

.card-front {
    background-color: #4a6ee0;
    color: white;
    font-size: 2.5rem;
}

.card-back {
    background-color: #f0f0f0;
    transform: rotateY(180deg);
}

.card.matched .card-back {
    background-color: #8bc34a;
}

.card.hint {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 110, 224, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 110, 224, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 110, 224, 0); }
}

.game-status {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    min-height: 24px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.win-content {
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.tutorial-steps {
    margin: 20px 0;
}

.step {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.step h3 {
    color: #4a6ee0;
    margin-bottom: 5px;
}

.tips {
    margin-top: 20px;
}

.tips ul {
    padding-left: 20px;
    margin-top: 10px;
}

.win-stats {
    margin: 20px 0;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .card {
        height: 100px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

@media (max-width: 400px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        height: 80px;
    }
}