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

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', monospace;
    color: #fff;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 200, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.game-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(180deg, #00f5ff 0%, #7b2fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
    letter-spacing: 8px;
}

#gameCanvas {
    border: 3px solid #00f5ff;
    border-radius: 5px;
    box-shadow: 
        0 0 20px rgba(0, 245, 255, 0.4),
        inset 0 0 20px rgba(0, 245, 255, 0.1);
    background: rgba(0, 0, 0, 0.8);
}

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

.panel-box {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 245, 255, 0.4);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 
        0 0 15px rgba(0, 245, 255, 0.2),
        inset 0 0 10px rgba(0, 245, 255, 0.05);
}

.panel-box h3 {
    font-size: 0.75rem;
    color: #00f5ff;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.panel-box canvas {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.panel-box div {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.score-box div {
    font-size: 1.2rem;
}

.controls-hint {
    display: flex;
    gap: 15px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

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

.overlay-content h2 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(180deg, #00f5ff 0%, #7b2fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: 10px;
}

.overlay-content p {
    font-size: 1rem;
    color: #00f5ff;
    letter-spacing: 3px;
    animation: blink 1s ease-in-out infinite;
}

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

.final-score {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #fff;
}

/* Piece colors glow effect */
.piece-glow {
    filter: drop-shadow(0 0 10px currentColor);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 10px;
    }
    
    .side-panel {
        flex-direction: row;
        gap: 10px;
    }
    
    .side-panel.left {
        order: 2;
    }
    
    .side-panel.right {
        order: 3;
    }
    
    .main-game {
        order: 1;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    #gameCanvas {
        width: 250px;
        height: 500px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .panel-box {
        padding: 10px;
    }
    
    .panel-box canvas {
        width: 60px;
        height: 60px;
    }
    
    .panel-box div {
        font-size: 1rem;
    }
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
    max-width: 300px;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.control-btn {
    width: 70px;
    height: 60px;
    border: 2px solid #00f5ff;
    background: rgba(0, 245, 255, 0.1);
    color: #00f5ff;
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.control-btn:active {
    background: rgba(0, 245, 255, 0.4);
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.6);
}

.control-btn.wide {
    width: 150px;
    font-size: 1rem;
}
