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

body {
    background: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
}

.hidden {
    display: none !important;
}

/* ── START SCREEN ─────────────────────────────────────── */

#start-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 200;
}

#start-screen h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.3em;
    color: #c8a44a;
    text-shadow: 0 0 30px rgba(200, 164, 74, 0.4);
    margin-bottom: 0.75rem;
}

#start-subtitle {
    font-size: 1.1rem;
    letter-spacing: 0.6em;
    color: #555;
    margin-bottom: 3rem;
}

#start-btn {
    padding: 0.9rem 3.5rem;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.25em;
    background: transparent;
    color: #c8a44a;
    border: 1px solid #c8a44a;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#start-btn:hover {
    background: #c8a44a;
    color: #000;
}

/* ── GAME LAYOUT ──────────────────────────────────────── */

#game {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
}

/* ── HUD ──────────────────────────────────────────────── */

#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 1.5rem;
    background: #080808;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
    z-index: 10;
}

#night-label {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: #c8a44a;
}

#time-label {
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: #ddd;
}

/* ── MAIN VIEW ────────────────────────────────────────── */

#main-view {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #050505;
    min-height: 0;
}

#view-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s;
}

/* camera mode: greenish surveillance tint */
#main-view.cam-mode #view-img {
    filter: sepia(0.4) hue-rotate(75deg) saturate(1.6) brightness(0.75);
}

/* scanlines overlay */
#scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.18) 3px,
        rgba(0, 0, 0, 0.18) 4px
    );
    pointer-events: none;
    animation: scanroll 8s linear infinite;
}

@keyframes scanroll {
    from { background-position: 0 0; }
    to   { background-position: 0 100px; }
}

/* camera label (top-left) */
#cam-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(120, 255, 120, 0.85);
    background: rgba(0,0,0,0.55);
    padding: 0.15rem 0.5rem;
    pointer-events: none;
}

/* entity detected (on camera feed) */
#creature-cam-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(1rem, 3vw, 1.6rem);
    letter-spacing: 0.15em;
    color: #ff3030;
    text-shadow: 0 0 18px rgba(255, 48, 48, 0.7);
    background: rgba(0,0,0,0.65);
    padding: 0.5rem 1.2rem;
    pointer-events: none;
    animation: blink 0.7s step-start infinite;
}

/* proximity warning (in office view) */
#proximity-warning {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #ff1111;
    text-shadow: 0 0 12px rgba(255, 17, 17, 0.8);
    background: rgba(0,0,0,0.6);
    padding: 0.2rem 0.7rem;
    pointer-events: none;
    animation: blink 0.45s step-start infinite;
}

/* no signal */
#no-signal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    letter-spacing: 0.4em;
    color: #333;
    background: #050505;
    pointer-events: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── MONITOR PANEL ────────────────────────────────────── */

#monitor-panel {
    background: #0a0a0a;
    border-top: 1px solid #1c1c1c;
    flex-shrink: 0;
}

#toggle-monitor {
    width: 100%;
    padding: 0.5rem;
    background: #111;
    color: #555;
    border: none;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    cursor: pointer;
    transition: color 0.15s;
}

#toggle-monitor:hover { color: #888; }
#toggle-monitor.cam-active { color: #4dff4d; }

/* ── CAM MAP OVERLAY ──────────────────────────────────── */

#cam-map {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 190px;
    height: 170px;
    background: rgba(0, 6, 0, 0.88);
    border: 1px solid rgba(77, 255, 77, 0.22);
    z-index: 5;
}

.map-edge {
    stroke: #1a3a1a;
    stroke-width: 2;
}

.door-edge {
    stroke: #1a5a1a;
    stroke-width: 2.5;
}

.door-edge.closed {
    stroke: #5a1a1a;
}

.map-circle {
    fill: #070e07;
    stroke: #1a4a1a;
    stroke-width: 1.5;
}

.office-node {
    fill: #0e0b03;
    stroke: #3e2e08;
    stroke-width: 1.5;
}

.map-label {
    font-size: 9px;
    fill: #2a7a2a;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    font-family: 'Courier New', monospace;
}

.office-label {
    font-size: 8px;
    fill: #6a4a14;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    font-family: 'Courier New', monospace;
}

.cam-node {
    cursor: pointer;
}

.cam-node:hover .map-circle {
    fill: #0d250d;
    stroke: #2a6a2a;
}

.cam-node.active .map-circle {
    fill: #091a09;
    stroke: #4dff4d;
    stroke-width: 2;
}

.cam-node.active .map-label {
    fill: #4dff4d;
}

/* ── DOOR CONTROLS ────────────────────────────────────── */

#door-controls {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #080808;
    border-top: 1px solid #1a1a1a;
    justify-content: center;
    flex-shrink: 0;
}

.door-btn {
    flex: 1;
    max-width: 180px;
    padding: 0.45rem 0.3rem;
    background: #0d1f0d;
    color: #4dff4d;
    border: 1px solid #1a4a1a;
    font-family: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.door-btn:hover {
    background: #122a12;
}

.door-btn small {
    display: block;
    font-size: 0.6rem;
    color: #2a6a2a;
    letter-spacing: 0.05em;
    margin-top: 0.1rem;
}

.door-btn.closed {
    background: #1f0d0d;
    color: #ff5555;
    border-color: #4a1a1a;
}

.door-btn.closed small {
    color: #6a2a2a;
}

.door-status {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    margin-top: 0.15rem;
}

/* ── JUMPSCARE ────────────────────────────────────────── */

#jumpscare {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#jumpscare-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── WIN / GAME OVER ──────────────────────────────────── */

#win-screen,
#gameover-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#win-screen h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.4em;
    color: #c8a44a;
    text-shadow: 0 0 30px rgba(200, 164, 74, 0.5);
}

#win-screen p {
    font-size: 0.9rem;
    letter-spacing: 0.4em;
    color: #666;
}

#gameover-screen h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.3em;
    color: #ff2222;
    text-shadow: 0 0 30px rgba(255, 34, 34, 0.5);
}

#gameover-screen p {
    font-size: 0.9rem;
    letter-spacing: 0.4em;
    color: #666;
}

#restart-btn,
#retry-btn {
    padding: 0.8rem 2.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.25em;
    background: transparent;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#restart-btn {
    color: #c8a44a;
    border-color: #c8a44a;
}

#restart-btn:hover {
    background: #c8a44a;
    color: #000;
}

#retry-btn {
    color: #ff4444;
    border-color: #ff4444;
}

#retry-btn:hover {
    background: #ff4444;
    color: #000;
}
