body {
    background: linear-gradient(135deg, #112D4E, #1A1A1A);
    color: #e0e0e0;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

h1 {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 8px DBE2EF;
    font-weight: 700;
    letter-spacing: 1px;
}

#nextBlocks {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.next-canvas {
    border: 1px solid #333;
    background: #111;
    border-radius: 5px;
}

.game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- NEON UI STYLES START --- */

.info-panel2 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    background: rgba(17, 17, 17, 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #00BFFF;
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.5), inset 0 0 10px rgba(0, 191, 255, 0.3);
    backdrop-filter: blur(5px);
    min-width: 160px;
}

/* --- Responsive Layout for Mobile & Tablet --- */
@media (max-width: 1100px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .side-panel, .info-panel2 {
        width: 90%;
        max-width: 500px; /* Adjust max-width as needed */
    }

    #nextBlocks {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.score-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(0, 191, 255, 0.2); /* Blue Neon */
    padding-bottom: 10px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00BFFF; /* Blue Neon */
    text-transform: uppercase;
}

.info-item span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #00BFFF; /* Blue Neon */
}

.score-main span {
    font-size: 2.5rem;
    color: #00BFFF; /* Blue Neon */
    text-shadow: 0 0 8px #fff, 0 0 15px #00BFFF; /* Blue Neon */
}

.combo-display {
    color: #FF4136; /* Blue Neon */
    animation: pulse 0.5s ease-in-out infinite;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 10px #FF4136; /* Blue Neon */
    text-align: center;
    margin-top: 10px;
}

.controls {
    margin-top: 0;
    text-align: left;
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.6;
}

.controls p {
    margin: 8px 0;
    padding-left: 10px;
    border-left: 2px solid #00BFFF; /* Blue Neon */
}

.controls .highlight {
    color: #FFD700; /* Gold */
    font-weight: bold;
    text-shadow: 0 0 6px #FFD700;
}

.timer-container {
    margin-top: 20px;
    text-align: center;
    width: 100%;
}

.timer-container h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00BFFF;
    text-transform: uppercase;
    margin-bottom: 10px;
}

#timer-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 5px;
    text-shadow: 0 0 5px #fff, 0 0 10px #00BFFF;
    transition: color 0.3s, text-shadow 0.3s;
}

#timer-display.warning {
    color: #FF4136;
    text-shadow: 0 0 5px #fff, 0 0 10px #FF4136;
}

/* --- NEON UI STYLES END --- */

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

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

canvas {
    border: 3px solid #222;
    background: #111;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.2);
}

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.game-over-content {
    background: rgba(17, 17, 17, 0.7);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    color: #eee;
    border: 2px solid #FF4136; /* Red Neon Border */
    box-shadow: 0 0 25px rgba(255, 65, 54, 0.6), inset 0 0 15px rgba(255, 65, 54, 0.4); /* Red Neon Shadow */
    backdrop-filter: blur(5px);
    width: 350px;
}

.game-over-content h2 {
    font-size: 3rem;
    color: #FF4136; /* Red Neon */
    text-shadow: 0 0 8px #fff, 0 0 15px #FF4136;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.game-over-content p {
    font-size: 1.2rem;
    color: #FF4136; /* Red Neon */
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 65, 54, 0.3);
    padding-bottom: 10px;
    margin: 20px 0;
}

.game-over-content p span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #FF4136;
}

.restart-btn {
    background: rgba(255, 65, 54, 0.1);
    color: #FF4136;
    border: 2px solid #FF4136;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 65, 54, 0.7);
    box-shadow: 0 0 10px rgba(255, 65, 54, 0.5), inset 0 0 5px rgba(255, 65, 54, 0.3);
}

.restart-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 65, 54, 0.2);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 65, 54, 0.8), inset 0 0 8px rgba(255, 65, 54, 0.5);
}

.level-indicator {
    color: #00f0ff;
    font-size: 1.1rem;
    margin: 10px 0;
}

.particles {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

@keyframes shake {
    0% {
        transform: translate(0px, 0px);
    }

    20% {
        transform: translate(-5px, 0px);
    }

    40% {
        transform: translate(5px, 0px);
    }

    60% {
        transform: translate(-5px, 0px);
    }

    80% {
        transform: translate(5px, 0px);
    }

    100% {
        transform: translate(0px, 0px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out;
}