/* =============================================
   BLOCKBLAST - NEON WIREFRAME AESTHETIC
   ============================================= */

:root {
    --bg-dark: #0a0a1a;
    --bg-mid: #0f0f2a;
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00ff;
    --neon-purple: #8a2be2;
    --grid-color: rgba(0, 240, 255, 0.08);
    --board-size: min(60vw, 55vh, 420px);
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    color: #fff;
}

/* === SVG POLYGON BACKGROUND === */
.geo-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    animation: geoFloat 8s ease-in-out infinite alternate;
}

@keyframes geoFloat {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.01);
    }
}

/* Neon glow accents - symmetric */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.1) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle vignette */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 0;
}

/* === GAME WRAPPER === */
.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    padding: 50px 20px 20px;
    position: relative;
    z-index: 1;
    gap: 8px;
}

/* === SCORE DISPLAY === */
#score-display {
    font-family: 'Orbitron', monospace;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px rgba(0, 240, 255, 0.5);
    letter-spacing: 4px;
    margin: 0;
}

/* === COMBO DISPLAY === */
#combo-display {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--neon-magenta);
    text-align: center;
    text-shadow: 0 0 15px var(--neon-magenta);
    min-height: 1.5em;
}

/* === GAME AREA === */
#game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* === GAME BOARD === */
#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: var(--board-size);
    height: var(--board-size);
    background: rgba(15, 15, 40, 0.8);
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.3),
        inset 0 0 30px rgba(0, 240, 255, 0.1);
    position: relative;
}

/* Cell styling */
.cell {
    border: 1px solid rgba(0, 240, 255, 0.15);
}

.cell.clearing {
    animation: flashClear 0.3s ease-out;
}

@keyframes flashClear {
    0% {
        background-color: rgba(255, 255, 255, 0.8);
    }

    100% {
        background-color: transparent;
    }
}

/* Filled cell styling */
.filled {
    border-radius: 4px;
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.3),
        inset -2px -2px 4px rgba(0, 0, 0, 0.4),
        0 0 8px currentColor;
}

/* Block colors with neon glow */
.block-red {
    background-color: #ff3366;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #ff3366;
}

.block-blue {
    background-color: #3366ff;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #3366ff;
}

.block-yellow {
    background-color: #ffcc00;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #ffcc00;
}

.block-purple {
    background-color: #9933ff;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #9933ff;
}

.block-green {
    background-color: #33ff66;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #33ff66;
}

.block-orange {
    background-color: #ff6633;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #ff6633;
}

.block-cyan {
    background-color: #00ccff;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #00ccff;
}

.block-lime {
    background-color: #ccff00;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #ccff00;
}

.block-magenta {
    background-color: #ff00cc;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #ff00cc;
}

.block-brown {
    background-color: #996633;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #996633;
}

.block-silver {
    background-color: #cccccc;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #cccccc;
}

.block-teal {
    background-color: #009999;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 0 0 10px #009999;
}

/* === BLOCK OPTIONS === */
#block-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.block-option {
    background: rgba(20, 20, 50, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    cursor: grab;
    padding: 10px;
    transition: all 0.2s ease;
}

.block-option:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

.block-preview .preview-cell {
    width: 22px;
    height: 22px;
    margin: 2px;
}

.block-preview .preview-cell.dragging {
    opacity: 0;
}

.draggable-block-preview-square {
    box-shadow:
        inset 2px 2px 3px rgba(255, 255, 255, 0.3),
        inset -2px -2px 3px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

/* === GAME OVER OVERLAY === */
.game-over-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over-box {
    background: linear-gradient(135deg, rgba(20, 20, 50, 0.95), rgba(10, 10, 30, 0.95));
    border: 2px solid var(--neon-magenta);
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.3);
}

.game-over-box h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5em;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--neon-magenta);
    text-shadow: 0 0 20px var(--neon-magenta);
}

.game-over-box p {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2em;
    margin-bottom: 24px;
    color: #ccc;
}

.game-over-box button {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, var(--neon-cyan), #0099cc);
    color: var(--bg-dark);
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-over-box button:hover {
    box-shadow: 0 0 25px var(--neon-cyan);
    transform: scale(1.05);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    :root {
        --board-size: min(85vw, 50vh, 350px);
    }

    .game-wrapper {
        padding: 70px 15px 15px;
        gap: 12px;
    }

    #score-display {
        font-size: 2rem;
    }

    .block-preview .preview-cell {
        width: 10px;
        height: 10px;
    }

    #block-options {
        gap: 12px;
    }

    .block-option {
        padding: 6px;
    }
}

@media (max-height: 600px) {
    :root {
        --board-size: min(50vw, 45vh, 300px);
    }

    .game-wrapper {
        gap: 8px;
    }
}