:root {
    --primary-blue: #1f4172;
    --secondary-light: #218589;
    --text-dark: #333;
    --board-background: #222;
    --game-font: 'Arial', sans-serif;
    --block-size: 20px;
}

body {
    font-family: var(--game-font);
    background-color: var(--primary-blue);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.tetris-container {
    background-color: #218589;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    text-align: center;
}

.game-area {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    position: relative; /* ensure floating next positions against this */
}

#tetris-canvas {
    border: 5px solid var(--primary-blue);
    background-color: var(--board-background);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
}

.game-info {
    text-align: left;
    padding: 10px;
    min-width: 150px;
}

/* Floating Next Preview */
#floating-next {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.45);
    padding: 4px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
    z-index: 10;
}

#floating-next canvas {
    width: 60px;
    height: 60px;
    image-rendering: pixelated;
}

/* Fade states */
#floating-next.fade-active { opacity: 0.5; transition: opacity 0.4s ease; }
#floating-next.fade-inactive { opacity: 1; transition: opacity 0.4s ease; }
/* Extra dim when paused */
#floating-next.fade-paused { opacity: 0.35; transition: opacity 0.3s ease; }

/* Pause dim overlay */
#pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.35);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 9998;
}
#pause-overlay.show { opacity: 1; }

/* Mobile fit */
@media (max-width: 700px) {
    body { overflow: hidden; }
    .tetris-container {
        width: 100vw;
        height: 100vh;
        padding: 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .title-presenter img { display: none; }
    .arcade-title { transform: scale(0.55); margin: 0; padding: 0; }
    .game-area {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 0;
    }
    #tetris-canvas {
        height: 68vh;
        width: auto;
    }
    .game-info {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 4px;
        font-size: 0.78em;
    }
    #start-button {
        width: 92%;
        margin-top: 4px;
        font-size: 1em;
    }
    #controls-info {
        font-size: 0.75em;
        margin-top: 4px;
    }
}
