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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 90%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-title {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    margin-bottom: 15px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
    }
    to {
        text-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
    }
}

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

.score-panel, .high-score-panel, .level-panel {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-panel .label, .high-score-panel .label, .level-panel .label {
    color: #aaa;
    font-size: 0.9rem;
}

.score-panel .value, .high-score-panel .value, .level-panel .value {
    color: #4CAF50;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

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

.game-area {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    border-radius: 15px;
    background: #1a1a2e;
}

.game-over-overlay, .pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

.game-over-overlay.active, .pause-overlay.active {
    display: flex;
}

.game-over-content, .pause-content {
    text-align: center;
    color: #fff;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-over-content h2, .pause-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #f44336;
}

.pause-content h2 {
    color: #ff9800;
}

.final-score {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.final-score span {
    color: #4CAF50;
    font-weight: bold;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.5);
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 280px;
}

.control-panel, .settings-panel, .leaderboard-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    color: #fff;
}

.control-panel h3, .settings-panel h3, .leaderboard-panel h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #4CAF50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.direction-controls {
    display: flex;
    gap: 5px;
}

.dir-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dir-btn:hover {
    background: rgba(76, 175, 80, 0.5);
    border-color: #4CAF50;
}

.dir-btn:active {
    transform: scale(0.95);
}

.action-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-start {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-start:hover {
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.5);
}

.btn-pause {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.btn-pause:hover {
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.5);
}

.btn-reset {
    background: linear-gradient(135deg, #f44336, #da190b);
    color: white;
}

.btn-reset:hover {
    box-shadow: 0 5px 20px rgba(244, 67, 54, 0.5);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    font-size: 0.9rem;
    color: #ccc;
}

.setting-item select {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
}

.setting-item select option {
    background: #1a1a2e;
    color: #fff;
}

.setting-item input[type="color"] {
    width: 40px;
    height: 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.setting-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.setting-item input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.leaderboard-panel ol {
    list-style: none;
    padding: 0;
}

.leaderboard-panel li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.leaderboard-panel li:first-child {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.leaderboard-panel li:nth-child(2) {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
}

.leaderboard-panel li:nth-child(3) {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
}

.game-footer {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 0.85rem;
}

.game-footer p {
    margin: 5px 0;
}

@media (max-width: 900px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }
    
    .game-sidebar {
        width: 100%;
        max-width: 600px;
    }
    
    .game-info {
        gap: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}

@media (max-width: 500px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .score-panel, .high-score-panel, .level-panel {
        padding: 8px 15px;
    }
    
    .score-panel .value, .high-score-panel .value, .level-panel .value {
        font-size: 1.2rem;
    }
}

.achievement-notification {
    position: fixed;
    top: 20px;
    right: -300px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4);
    z-index: 1000;
    transition: right 0.5s ease;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-icon {
    font-size: 36px;
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-5px);
    }
}

.achievement-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.achievement-content h4 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.achievement-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

.combo-display {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 0.5s ease infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

.timer-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
}

.timer-panel .label {
    color: #aaa;
    font-size: 0.9rem;
}

.timer-panel .value {
    color: #ff9800;
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.audio-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.audio-toggle:hover {
    background: rgba(76, 175, 80, 0.5);
    border-color: #4CAF50;
}

.ai-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 15px;
    background: rgba(0, 150, 255, 0.8);
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    display: none;
}

.ai-indicator.active {
    display: block;
    animation: blink 1s ease infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}