

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

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050505;
    font-family: 'VT323', 'Courier New', monospace;
    color: #33ff00;
}

/* CRT Scanline Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
}

/* Subtle flicker */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(18, 16, 16, 0.02);
    opacity: 0;
    pointer-events: none;
    z-index: 998;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.02; }
    50%  { opacity: 0.05; }
    100% { opacity: 0.02; }
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
}

/* HUD - Top bar */
#hud {
    position: absolute;
    top: 0; left: 0; width: 100%;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    border-bottom: 1px solid rgba(51, 255, 0, 0.25);
    background: rgba(5, 5, 5, 0.85);
}

.hud-text {
    font-size: 20px;
    letter-spacing: 1px;
    color: #33ff00;
    text-shadow: 0 0 6px rgba(51, 255, 0, 0.6);
    background: transparent;
    padding: 4px 8px;
    border: none;
}

/* Stage progress bar */
#stage-bar-container {
    position: absolute;
    top: 46px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 6px;
    background: #111;
    border: 1px solid #33ff00;
    z-index: 10;
    pointer-events: none;
}

#stage-bar {
    width: 0%;
    height: 100%;
    background: #33ff00;
    box-shadow: 0 0 8px #33ff00;
    transition: width 0.2s linear;
}

/* Bottom HUD */
#hud-bottom {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    pointer-events: none;
    z-index: 10;
    border-top: 1px solid rgba(51, 255, 0, 0.2);
    background: rgba(5, 5, 5, 0.7);
}

/* Panels - Menu, Pause, Death, Victory, Settings */
.panel {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #080808;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.panel h1 {
    font-size: 64px;
    margin-bottom: 8px;
    color: #33ff00;
    text-shadow: 0 0 10px #33ff00, 0 0 20px rgba(51, 255, 0, 0.4);
    letter-spacing: 6px;
    text-transform: uppercase;
}

.panel h2 {
    font-size: 40px;
    margin-bottom: 16px;
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
    letter-spacing: 4px;
}

.panel h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #aaa;
    letter-spacing: 2px;
}

.panel p {
    font-size: 20px;
    margin-bottom: 6px;
    color: #ccc;
    letter-spacing: 1px;
}

/* Buttons - chunky retro style */
.panel button {
    background: #0a0a0a;
    color: #33ff00;
    border: 2px solid #33ff00;
    padding: 10px 36px;
    font-size: 20px;
    font-family: 'VT323', monospace;
    font-weight: normal;
    margin: 6px;
    cursor: pointer;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.08s ease;
    box-shadow: 0 0 0 transparent;
}

.panel button:hover {
    background: #33ff00;
    color: #000;
    box-shadow: 0 0 12px #33ff00;
}

.panel button:active {
    transform: translateY(2px);
    box-shadow: 0 0 4px #33ff00;
}

/* Settings rows */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 320px;
    margin: 8px 0;
    font-size: 20px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(51, 255, 0, 0.15);
    padding-bottom: 4px;
}

.setting-row button {
    padding: 4px 16px;
    margin: 0;
    font-size: 18px;
    min-width: 70px;
}

.setting-row input[type=range] {
    width: 120px;
    cursor: pointer;
    accent-color: #33ff00;
}

/* Modal */
.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-box {
    background: #0a0a0a;
    border: 2px solid #ff0055;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.3);
}

.modal-box p {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: 2px;
}

/* Controls info */
.controls-info {
    margin-top: 24px;
    font-size: 16px;
    color: #666;
    text-align: center;
    line-height: 1.6;
    letter-spacing: 1px;
}

.controls-info span {
    color: #33ff00;
    background: rgba(51, 255, 0, 0.1);
    padding: 1px 6px;
    border: 1px solid rgba(51, 255, 0, 0.3);
}

/* Dev mode hint */
.dev-hint {
    margin-top: 6px;
    font-size: 14px;
    color: #444;
    letter-spacing: 1px;
}