* {
    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;
    color: #fff;
    overflow: hidden;
}

.game-container {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 100vw;
    max-height: 100vh;
}

.main-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-title {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #00d4ff, #7b2cbf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 5px #00d4ff);
    }
    to {
        filter: drop-shadow(0 0 20px #7b2cbf);
    }
}

.score-display {
    display: flex;
    gap: 40px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.canvas-wrapper {
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

.canvas-wrapper.game-over {
    animation: shake 0.5s ease-in-out;
    border-color: #ff4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#gameCanvas {
    display: block;
    background: #111;
    border-radius: 5px;
}

.controls-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
    color: #888;
}

.key {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    color: #00d4ff;
}

.game-buttons {
    display: flex;
    gap: 15px;
}

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

.game-btn:not(:disabled) {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.game-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

.game-btn:not(:disabled):active {
    transform: translateY(0);
}

.game-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    cursor: not-allowed;
}

#startBtn:not(:disabled) {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

#startBtn:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 150px;
}

.panel-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#nextCanvas {
    display: block;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.mobile-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.mobile-row {
    display: flex;
    gap: 8px;
}

.mobile-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-btn:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.2);
    transform: scale(1.1);
}

.mobile-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.mobile-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.drop-btn {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.drop-btn:hover:not(:disabled) {
    background: rgba(255, 68, 68, 0.2);
}

@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        overflow-y: auto;
    }

    .side-panel {
        flex-direction: row;
        min-width: auto;
        justify-content: center;
    }

    .left-panel {
        order: 2;
    }

    .right-panel {
        order: 1;
    }

    .game-title {
        font-size: 1.8rem;
    }

    .controls-info {
        font-size: 0.75rem;
        gap: 8px;
    }
}

@media (max-width: 500px) {
    #gameCanvas {
        width: 200px;
        height: 400px;
    }

    .canvas-wrapper {
        padding: 5px;
    }

    .game-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .mobile-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}
