:root {
    --bg-color: #1a1a2e;
    --game-bg: #0f0f1a;
    --text-color: #e94560;
    --accent-color: #16213e;
    --border-color: #e94560;
    --grid-line: rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(45deg, #1a1a2e 25%, #16213e 25%, #16213e 50%, #1a1a2e 50%, #1a1a2e 75%, #16213e 75%, #16213e 100%);
    background-size: 40px 40px;
    animation: bgScroll 20s linear infinite;
}

@keyframes bgScroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 80px 80px;
    }
}

#app {
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

#game-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--accent-color);
    border: 4px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    position: relative;
}

canvas#tetris-board {
    background-color: var(--game-bg);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 30px 30px;
    /* Match BLOCK_SIZE */
    border: 2px solid #fff;
    display: block;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

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

#score-box,
#next-piece-box,
#high-scores {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

h2,
h3 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(233, 69, 96, 0.5);
}

#score {
    font-size: 1.8rem;
    margin: 0;
    font-weight: bold;
}

button {
    background-color: var(--text-color);
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #b02a40;
}

button:hover {
    background-color: #ff5e78;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #b02a40;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #b02a40;
}

#high-score-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    font-size: 0.9rem;
}

#high-score-list li {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal */
.hidden {
    display: none !important;
}

#game-over-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 6px;
    /* Match container radius minus border */
}

.modal-content {
    background-color: var(--accent-color);
    padding: 40px;
    border: 2px solid var(--text-color);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.8);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#initials {
    background: transparent;
    border: none;
    border-bottom: 2px solid #fff;
    color: #fff;
    font-size: 2rem;
    text-align: center;
    width: 100px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-family: inherit;
}

#initials:focus {
    outline: none;
    border-bottom-color: var(--text-color);
}

/* Audio Control */
#audio-control {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: none;
    padding: 5px;
}

#audio-control:hover {
    transform: scale(1.1);
    background: none;
    box-shadow: none;
}