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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

.game-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.game-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.game-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#reset-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

#reset-btn:hover {
    background: #c0392b;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 20px;
    background: #34495e;
    justify-content: center;
}

.tile {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    user-select: none;
}

.tile.selected {
    transform: scale(0.9);
    box-shadow: 0 0 0 3px #f1c40f;
}

.tile.matched {
    animation: pulse 0.5s ease-in-out;
}

.tile.type-0 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.tile.type-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.tile.type-2 { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.tile.type-3 { background: linear-gradient(135deg, #f39c12, #d35400); }
.tile.type-4 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.tile.type-5 { background: linear-gradient(135deg, #1abc9c, #16a085); }

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

.game-controls {
    padding: 20px;
    background: #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.level-info {
    flex: 1;
    min-width: 200px;
}

.level-info h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

#hint-btn, #sound-toggle {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

#hint-btn:hover, #sound-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#sound-toggle.off {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Responsive design */
@media (max-width: 768px) {
    .tile {
        width: 45px;
        height: 45px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .game-controls {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tile {
        width: 35px;
        height: 35px;
    }
}