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

body {
    background-color: #000022;
    color: #e0e0ff;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 20px;
}

.game-title {
    font-family: 'Courier New', monospace;
    font-size: 28px;
    color: #00ffff;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #0088ff,
        0 0 40px #0044ff;
    letter-spacing: 3px;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 20px;
}

#gameWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#scoreBoard {
    text-align: center;
    color: #00ffff;
    font-size: 16px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

#gameArea {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-start;
}

#gameContainer {
    border: 2px solid #00aaff;
    box-shadow:
        0 0 10px rgba(0, 170, 255, 0.4),
        0 0 20px rgba(0, 170, 255, 0.2),
        inset 0 0 10px rgba(0, 170, 255, 0.1);
    position: relative;
}

#gameCanvas {
    display: block;
}

#sidePanel {
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#nextCanvas {
    border: 1px solid #00aaff;
    background: #000011;
    box-shadow: 0 0 6px rgba(0, 170, 255, 0.3);
}

#nextPieceLabel, #highScoreLabel {
    color: #00ffff;
    font-size: 12px;
    letter-spacing: 2px;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
    margin-top: 8px;
}

#highScoreValue {
    color: #00ffff;
    font-size: 18px;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    font-weight: bold;
}

#message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 20, 0.85);
    color: #00ffff;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    text-align: center;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #0088ff;
    letter-spacing: 2px;
    pointer-events: none;
    z-index: 10;
}

#message .sub {
    font-size: 13px;
    color: #88bbdd;
    margin-top: 14px;
    text-shadow: none;
    letter-spacing: 1px;
}

footer {
    text-align: center;
    padding: 16px 20px;
    color: #445566;
    font-size: 12px;
    border-top: 1px solid rgba(0, 170, 255, 0.1);
    margin-top: 20px;
}

@media (max-width: 520px) {
    #gameArea {
        flex-direction: column;
        align-items: center;
    }

    #sidePanel {
        flex-direction: row;
        width: auto;
        gap: 20px;
    }

    .game-title {
        font-size: 20px;
    }
}
