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

body {
    background: #1a1a2e;
    color: #eee;
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}

#gameCanvas {
    background: #0f0f1a;
    border: 3px solid #4a4a6a;
    border-radius: 4px;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-box {
    background: #0f0f1a;
    border: 2px solid #4a4a6a;
    border-radius: 4px;
    padding: 10px 15px;
    min-width: 100px;
    text-align: center;
}

.label {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #4ecdc4;
}

.next-piece {
    background: #0f0f1a;
    border: 2px solid #4a4a6a;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
}

.next-piece .label {
    margin-bottom: 10px;
}

#nextCanvas {
    background: #0f0f1a;
}

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

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

.control-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: #2a2a4a;
    border: 2px solid #4a4a6a;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.control-btn:active {
    background: #4a4a6a;
}

.control-btn.wide {
    width: 130px;
    font-size: 16px;
}

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

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: #1a1a2e;
    border: 3px solid #4a4a6a;
    border-radius: 8px;
    padding: 30px 50px;
    text-align: center;
}

.overlay-content h2 {
    font-size: 36px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.overlay-content p {
    font-size: 24px;
    margin-bottom: 20px;
}

.overlay-content .control-btn {
    margin-top: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .game-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .controls {
        display: flex;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (min-width: 769px) {
    .controls {
        display: none;
    }
}
