:root {
    --bg-color: #0a0a12;
    --board-bg: #111;
    --text-color: #fff;
    --accent-color: #0ff;
    --accent-glow: 0 0 10px #0ff, 0 0 20px #0ff;
    --border-color: #333;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    gap: 2rem;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    /* Fixed minimum dimensions for stability */
    min-width: 800px;
    min-height: 700px;
    justify-content: center;
    align-items: flex-start;
}

.game-board-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

canvas#game-board {
    background-color: var(--board-bg);
    display: block;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Fixed width to prevent layout shifts */
    width: 300px;
    flex-shrink: 0;
}

.info-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.info-box h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

canvas#next-piece {
    margin: 0 auto;
    display: block;
}

.controls-info {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
    margin-top: auto;
}

button {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 0.8rem 1.5rem;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    width: 100%;
    /* Make button fill sidebar width */
}

button:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: var(--accent-glow);
}

#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none !important;
}

#game-over-overlay h2 {
    font-size: 2.5rem;
    color: #ff0055;
    text-shadow: 0 0 20px #ff0055;
    text-transform: uppercase;
}