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

:root {
    --bg-color: #050505;
    --text-color: #00ff41;
    --text-color-dim: #008f11;
    --alert-color: #ff003c;
    --font-main: 'VT323', monospace;
}

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

body {
    background-color: #000;
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111;
}

#game-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Force pixelated scaling */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* Basic scanlines effect overlay implicitly */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* HUD Styling */
#hud {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    position: relative;
}

.hud-top, .hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hud-top {
    align-items: flex-start;
}

.stat-box {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid var(--text-color-dim);
    padding: 5px 15px;
    font-size: 1.5rem;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.log-box {
    background: rgba(0, 20, 0, 0.7);
    border: 1px solid var(--text-color-dim);
    padding: 10px;
    width: 300px;
    height: 100px;
    font-size: 1.2rem;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.log-entry {
    margin-bottom: 2px;
    animation: fadeOut 5s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.minimap-container {
    border: 2px solid var(--text-color-dim);
    background: rgba(0, 0, 0, 0.8);
    padding: 2px;
}

#minimap-canvas {
    image-rendering: pixelated;
    width: 128px;
    height: 128px;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: rgba(0, 255, 65, 0.5);
}

#damage-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10;
}

/* Menus */
.menu-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 100;
}

.menu-screen h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px var(--text-color-dim);
}

.menu-screen .fatal-error {
    color: var(--alert-color);
    text-shadow: 2px 2px 0px #800000;
}

.menu-options {
    list-style: none;
    margin-top: 30px;
}

.menu-options li {
    font-size: 2rem;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-options li:hover:not(.disabled) {
    color: #fff;
    text-shadow: 0 0 10px var(--text-color);
}

.menu-options li.disabled {
    color: #333;
    cursor: not-allowed;
}

/* Scanlines effect via CSS */
#game-container::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 50;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}