:root {
    --bg-color: #050505;
    --acc-color: #a00;
    --text-color: #ddd;
    --ui-bg: rgba(20, 20, 20, 0.85);
    --font-main: 'Courier New', Courier, monospace;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1280px;
    max-height: 720px;
    background: #000;
    box-shadow: 0 0 50px rgba(100, 0, 0, 0.2);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

#stats-panel {
    width: 250px;
    background: var(--ui-bg);
    padding: 10px;
    border: 1px solid #333;
    border-left: 5px solid var(--acc-color);
}

.stat-row {
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
}

.bar-container {
    width: 100%;
    height: 6px;
    background: #333;
    margin-top: 2px;
}

.bar {
    height: 100%;
    background: var(--acc-color);
    width: 100%;
    transition: width 0.2s;
}

#sanity-bar {
    background: #409;
}

#message-log {
    width: 400px;
    height: 150px;
    background: var(--ui-bg);
    border: 1px solid #333;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    font-size: 12px;
}

.log-entry {
    margin-bottom: 4px;
    text-shadow: 1px 1px 0 #000;
    opacity: 0.8;
}

#screens {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

#start-screen,
#game-over-screen {
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    text-align: center;
    border: 1px solid var(--acc-color);
    box-shadow: 0 0 30px var(--acc-color);
    max-width: 600px;
}

h1 {
    font-size: 48px;
    color: var(--acc-color);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0 0 10px red;
}

button {
    background: #200;
    color: #fff;
    border: 1px solid #f00;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

button:hover {
    background: #f00;
    color: #000;
    box-shadow: 0 0 20px #f00;
}

#vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.8) 90%);
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
}