@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

:root {
    --bg-color: #050505;
    --neon-blue: #00f3ff;
    --neon-pink: #ff00ff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a2e 0%, #050505 100%);
    touch-action: none;
}

.container {
    width: 100%;
    height: 100vh;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.game-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.side-panel {
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-box {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    text-align: center;
}

.panel-box h2 {
    font-size: 0.6rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    margin-bottom: 0.2rem;
    letter-spacing: 1px;
}

.panel-box div {
    font-size: 1.2rem;
    font-weight: 700;
}

.main-canvas {
    position: relative;
    padding: 5px;
    background: var(--glass-bg);
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

#tetris {
    display: block;
    background-color: rgba(0, 0, 0, 0.8);
    height: 60vh;
    width: auto;
}

#next {
    width: 60px;
    height: 60px;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s;
}

.win-title {
    color: #ffde00;
    font-size: 2.5rem;
    text-shadow: 0 0 20px #ffde00, 0 0 40px #ff8a00;
    margin-bottom: 15px;
    animation: pulse 1s infinite alternate;
}

.win-text {
    color: #00f3ff;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.win-msg {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.9;
}

@keyframes pulse {
    from {
        transform: scale(1);
        filter: brightness(1);
    }

    to {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

.overlay.hidden {
    display: none;
    opacity: 0;
}

.overlay-content {
    text-align: center;
}

.logo {
    font-size: 3.5rem;
    line-height: 0.85;
    color: var(--neon-blue);
    text-shadow: 0 0 20px var(--neon-blue);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 0.7rem;
    margin-bottom: 2.5rem;
    color: var(--neon-pink);
    letter-spacing: 4px;
    animation: blink 1.5s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

.primary-btn {
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 0.8rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.primary-btn:hover {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-pink);
}

/* Mobile Controls */
.mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
}

.control-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ctrl-btn {
    width: 55px;
    height: 55px;
    background: var(--glass-bg);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:active {
    background: var(--neon-blue);
    color: #000;
}

.ctrl-btn.long {
    width: 185px;
    height: 45px;
    border-radius: 25px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Responsive Overrides */
@media screen and (max-width: 600px) {
    .container {
        padding: 5px;
    }

    .game-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .side-panel {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }

    .side-panel.left {
        order: 1;
    }

    .main-canvas {
        order: 2;
    }

    .side-panel.right {
        order: 3;
    }

    .panel-box {
        padding: 0.4rem;
        flex: 1;
        min-width: 0;
        max-width: 100px;
    }

    #tetris {
        height: 40vh;
    }

    .logo {
        font-size: 2.5rem;
    }

    .mobile-controls {
        margin-top: 10px;
    }

    .ctrl-btn {
        width: 50px;
        height: 50px;
    }

    .ctrl-btn.long {
        width: 170px;
        height: 40px;
    }
}