/* =============================================
   SCHOOL NIGHT SHIFT — style.css
   Aesthetic: Retro-horror CRT terminal
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Creepster&display=swap');

:root {
  --green: #39ff14;
  --green-dim: #1a7a08;
  --red: #ff2222;
  --amber: #ffb700;
  --dark: #050a05;
  --panel: #0b150b;
  --border: #1a3a1a;
  --text: #b8ffb8;
  --font-mono: 'Share Tech Mono', monospace;
  --font-horror: 'Creepster', cursive;
  --monitor-w: 960px;
  --monitor-h: 600px;
}

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

html, body {
  width: 100%; height: 100%;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--text);
}

/* ===== MONITOR ===== */
#monitor {
  position: relative;
  width: var(--monitor-w);
  height: var(--monitor-h);
  background: var(--dark);
  border: 3px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 60px #00ff0033, inset 0 0 30px #000;
  transform-origin: center center;
  transition: transform 0.2s ease;
}
/* Fullscreen: scale monitor to fill the screen without changing any layout */
:fullscreen #monitor,
:-webkit-full-screen #monitor,
:-moz-full-screen #monitor {
  border-radius: 0;
  box-shadow: none;
}
/* Body when fullscreen — centers the fixed-size monitor */
:fullscreen body,
:-webkit-full-screen body,
:-moz-full-screen body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
/* CRT scanline effect over everything */
#monitor::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* Scanlines/flicker toggle classes */
#monitor.no-scanlines::after { display: none; }
#monitor.no-flicker { animation: none !important; }
#monitor.no-flicker * { animation-name: none !important; }

/* ===== SCREENS ===== */
.screen {
  position: absolute; inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: flex; flex-direction: column; }

/* ===== LOADING SCREEN ===== */
#screen-loading {
  background: #000;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
#loading-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  width: 340px;
}
#loading-title {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 8px;
  color: #3a6a3a; margin-bottom: 8px;
}
#loading-bar-outer {
  width: 100%; height: 3px;
  background: #0e1e0e;
  border: 1px solid #1a3a1a;
}
#loading-bar-inner {
  height: 100%; width: 0%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  transition: width 0.15s ease;
}
#loading-status {
  font-family: var(--font-mono); font-size: 10px;
  color: #2a4a2a; letter-spacing: 2px;
}

/* ===== MAIN MENU ===== */
#screen-menu {
  background: #000;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: row;
}

/* Vertical scanline grain over whole menu */
.menu-scanlines {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.25) 3px, rgba(0,0,0,0.25) 4px
  );
}

/* ── Characters: all stacked on the RIGHT side, bottom-anchored, FNAF2 style ── */
.menu-characters {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 65%;
  overflow: hidden;
  z-index: 1;
}
.menu-char {
  position: absolute;
  bottom: 0;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
}
/* Each char stacked in depth — closest (brightest + largest) on far right,
   furthest (darkest + smallest) behind. All anchored to right edge. */
#mchar-hugo     {
  right: -2%; height: 108%;
  filter: brightness(0.7) contrast(1.1);
  z-index: 4;
}
#mchar-ezekiel  {
  right: 16%; height: 100%;
  filter: brightness(0.5) contrast(1.1);
  z-index: 3;
}
#mchar-merriman {
  right: 32%; height: 90%;
  filter: brightness(0.35) contrast(1.2);
  z-index: 2;
}
#mchar-kirk     {
  right: 46%; height: 80%;
  filter: brightness(0.22) contrast(1.1);
  z-index: 1;
}

/* Canvas fallback (painted silhouettes if images missing) */
#menu-chars-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ── Fade: left edge of characters bleeds to black ── */
.menu-fade {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 55%;
  background: linear-gradient(to right,
    #000 0%,
    #000 30%,
    rgba(0,0,0,0.85) 55%,
    transparent 100%
  );
  z-index: 2; pointer-events: none;
}

/* ── Left content panel ── */
.menu-content {
  position: relative;
  z-index: 3;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: 40px 36px;
  width: 42%;
  animation: fadeIn 1s ease;
}

/* Title block */
.menu-title {
  display: flex; flex-direction: column; gap: 0;
}
.title-top {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 6px;
  color: #3a6a3a; text-transform: uppercase; margin-bottom: 4px;
}
.title-main {
  font-family: var(--font-mono); font-size: 52px; line-height: 1.05;
  color: #e8e8e8;
  text-shadow: 2px 2px 0 #000, 0 0 30px rgba(57,255,20,0.15);
  font-weight: bold;
  letter-spacing: 2px;
}
.title-star {
  font-size: 36px; color: var(--amber);
  text-shadow: 0 0 16px var(--amber);
  margin-top: 6px;
  display: block;
  animation: flicker 5s infinite;
}

/* Buttons: FNAF-style plain text with >> prefix */
.menu-buttons {
  display: flex; flex-direction: column; gap: 4px;
}
.menu-btn {
  font-family: var(--font-mono); font-size: 18px; letter-spacing: 1px;
  padding: 6px 0;
  border: none; background: transparent;
  color: #c8c8c8; cursor: pointer;
  text-align: left;
  transition: color 0.15s, text-shadow 0.15s;
}
.menu-btn:hover {
  color: #fff;
  text-shadow: 0 0 12px #fff;
}
.menu-btn.primary { color: #e8e8e8; }
.menu-btn.danger  { color: #884444; font-size: 14px; margin-top: 8px; }
.menu-btn.danger:hover { color: var(--red); text-shadow: 0 0 12px var(--red); }

.save-info {
  font-size: 12px; color: var(--amber); letter-spacing: 1px; margin-top: 4px;
}
.menu-footer {
  position: absolute; bottom: 10px; left: 0; right: 0;
  font-size: 10px; color: #2a3a2a; letter-spacing: 1px;
  padding: 0 36px;
}

/* ===== OFFICE VIEW ===== */
#screen-office { background: #111; }
.office-layer.hidden { display: none !important; }

/* ── Office pan container ── */
#office-pan {
  position: absolute; inset: 0;
  overflow: hidden;
  cursor: none;
}
/* Inner tray is wider than the screen — pans left/right with mouse */
#office-tray {
  position: absolute;
  top: 0; left: -25%; bottom: 0;
  width: 150%;
  height: 100%;          /* explicit height so canvas gets real offsetHeight */
  transition: left 0.08s linear;
  will-change: left;
}
/* All office image layers live inside the tray */
.office-layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Layer order inside the tray */
#office-bg        { z-index: 1; display: none; } /* not used — canvas draws base */
#office-canvas    { z-index: 2; background: transparent; pointer-events: none; display: block; }
#office-door-open,
#office-door-closed { z-index: 3; }          /* door overlays above canvas */
#office-lurking     { z-index: 4; }          /* animatronic lurking image above door */
#office-lights-off  { z-index: 5; }          /* lights-off always topmost */
#office-aiden       { z-index: 6; object-fit: contain; object-position: center bottom; background: transparent; } /* Aiden above everything */

/* Cam canvas fallback — hidden until needed */
#cam-canvas { z-index: 2; background: transparent; pointer-events: none; display: none; }

/* HUD */
#office-hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  z-index: 10;
}
.hud-left, .hud-center, .hud-right { display: flex; flex-direction: column; align-items: center; }
.hud-label { font-size: 9px; letter-spacing: 3px; color: var(--green-dim); }
.hud-value { font-size: 20px; color: var(--green); text-shadow: 0 0 8px var(--green); }
#power-bar-outer {
  width: 80px; height: 6px; background: #1a1a1a; border: 1px solid var(--green-dim);
  margin-top: 3px;
}
#power-bar-inner {
  height: 100%; width: 100%; background: var(--green);
  transition: width 0.5s, background 0.5s;
}

/* Office status */
#office-status {
  position: absolute; bottom: 52px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--amber); letter-spacing: 2px; z-index: 15;
  text-align: center; pointer-events: none;
}
#knock-warning {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 22px; color: var(--red); background: rgba(0,0,0,0.85);
  padding: 14px 28px; border: 2px solid var(--red);
  z-index: 20; text-align: center; letter-spacing: 2px;
  animation: pulse-red 0.4s infinite;
}

/* ── Door hotspot — inside #office-tray, pans with the room ── */
/* Photo: door occupies ~8%–42% left, ~5%–95% top of the image */
#door-hotspot {
  position: absolute;
  left: 8%; top: 5%;
  width: 34%; height: 90%;
  z-index: 15;
  cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 16px;
}
#door-hint {
  opacity: 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  color: #fff; background: rgba(0,0,0,0.6);
  padding: 4px 12px;
  pointer-events: none;
  transition: opacity 0.15s;
  border: 1px solid rgba(255,255,255,0.35);
}
#door-hotspot:hover #door-hint { opacity: 1; }
#door-hotspot:hover {
  background: rgba(255,200,150,0.06);
  outline: 2px solid rgba(255,255,255,0.18);
}

/* ── Key hints — bottom left corner ── */
#office-key-hints {
  position: absolute; bottom: 56px; left: 14px; z-index: 15;
  font-family: var(--font-mono); font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-shadow: 1px 1px 3px #000;
  pointer-events: none;
}
#hint-lights-state { color: var(--green); }
#hint-lights-state.off { color: #555; }


.ctrl-btn {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px;
  padding: 8px 18px; border: 1px solid var(--green-dim);
  background: rgba(5,10,5,0.8); color: var(--green); cursor: pointer;
  text-transform: uppercase; transition: all 0.15s;
}
.ctrl-btn:hover { background: var(--green); color: var(--dark); }
.ctrl-btn.highlight { border-color: var(--amber); color: var(--amber); }
.ctrl-btn.highlight:hover { background: var(--amber); color: var(--dark); }
.ctrl-btn.small { font-size: 10px; padding: 4px 10px; }
.ctrl-btn.door-closed { border-color: var(--red); color: var(--red); }
.ctrl-btn.lights-off { border-color: #555; color: #555; }
/* Office control bar — cams button only */
#office-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; gap: 12px; padding: 14px 0 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 15;
}
#office-controls #btn-cameras {
  padding: 12px 80px;
  font-size: 14px;
  letter-spacing: 4px;
}

/* ===== CAMERA VIEW — full-screen feed with overlaid UI ===== */
#screen-cameras {
  /* Uses flex column from .screen.active — wrapper fills it */
  background: #000;
}

/* Wrapper fills the whole screen and is the positioning context */
#cam-feed-wrapper {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  flex: 1;
}

/* Feed image fills wrapper */
#cam-feed-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) brightness(0.88) saturate(0.9);
  z-index: 1;
}

/* Canvas: z-index 2 so characters drawn on it appear above the feed image */
#cam-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  display: none;
}

/* ── CCTV Effects ── */
#cam-static-overlay {
  position: absolute; inset: 0; z-index: 4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  animation: staticAnim 0.06s infinite;
  opacity: 0.3;
  mix-blend-mode: overlay;
}
/* Horizontal scan-roll line */
#cam-static-overlay::after {
  content: '';
  position: absolute; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.04);
  animation: scanRoll 4s linear infinite;
}
@keyframes scanRoll {
  0%   { top: -2%; }
  100% { top: 102%; }
}

#cam-signal-lost {
  position: absolute; inset: 0; z-index: 10;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--red); letter-spacing: 4px;
}
#cam-signal-lost.hidden { display: none; }

/* Character overlay */
#cam-character-overlay {
  display: none !important; /* Characters drawn on canvas instead */
}

/* ── FNAF-style HUD overlays (all inside #cam-feed-wrapper) ── */

/* Top-left: REC dot + cam name */
#cam-hud-tl {
  position: absolute; top: 10px; left: 14px; z-index: 9;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; color: #fff;
  text-shadow: 1px 1px 3px #000;
  pointer-events: none;
}
#cam-rec-dot {
  color: #ff2222; font-size: 16px;
  animation: recBlink 1.2s step-start infinite;
}
@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
#cam-label { font-size: 13px; color: #ddd; letter-spacing: 1px; }

/* Top-right: time + night */
#cam-hud-tr {
  position: absolute; top: 10px; right: 14px; z-index: 9;
  font-family: var(--font-mono); color: #fff;
  text-align: right; text-shadow: 1px 1px 3px #000;
  line-height: 1.3;
  pointer-events: none;
}
#cam-time-display  { font-size: 20px; font-weight: bold; }
#cam-night-display { font-size: 13px; color: #bbb; }

/* Bottom-left: power + usage */
#cam-hud-bl {
  position: absolute; bottom: 14px; left: 14px; z-index: 9;
  font-family: var(--font-mono); color: #fff;
  text-shadow: 1px 1px 3px #000; line-height: 1.6;
  pointer-events: none;
}
#cam-power-text { font-size: 13px; }
.usage-label { font-size: 11px; color: #aaa; margin-right: 4px; }
.usage-bar-pip {
  display: inline-block;
  width: 14px; height: 12px;
  background: var(--green);
  margin-right: 2px;
  vertical-align: middle;
}

/* ── Music box — bottom-center ── */
#musicbox-ui {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 9;
  background: rgba(0,0,0,0.78);
  border: 1px solid var(--amber);
  padding: 7px 12px;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  min-width: 120px;
}
.mb-label { font-size: 9px; color: var(--amber); letter-spacing: 2px; }
#mb-bar-outer {
  width: 100px; height: 8px;
  background: #1a1a1a; border: 1px solid var(--amber);
}
#mb-bar-inner {
  height: 100%; width: 100%; background: var(--amber);
  transition: width 0.3s, background 0.3s;
}
#mb-warning { font-size: 10px; color: var(--red); animation: pulse-red 0.5s infinite; }

/* ── Map overlay — bottom-right, FNAF-style ── */
#cam-map {
  position: absolute;
  bottom: 14px; right: 14px;
  width: 220px; height: 190px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.3);
  z-index: 9;
  overflow: hidden;
}

#map-lines {
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none;
}
#map-nodes { position: absolute; inset: 0; z-index: 2; }

/* ── Camera map nodes ── */
.map-node {
  position: absolute;
  width: 34px; height: 28px;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 6px; letter-spacing: 0.3px;
  color: rgba(255,255,255,0.6);
  text-align: center; line-height: 1.2;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  user-select: none;
  white-space: nowrap;
}
.map-node:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(0,0,0,0.95);
}
.map-node.active {
  border-color: #fff;
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.4);
}
.map-node.has-character {
  border-color: var(--amber);
  color: var(--amber);
  animation: pulse-amber 0.8s infinite;
}
.map-node-id  { font-size: 7px; font-weight: bold; color: inherit; }
.map-node-sub { font-size: 5px; color: inherit; opacity: 0.8; }

/* "You" node */
.map-you {
  width: 36px; height: 30px;
  border-color: rgba(255,255,255,0.9);
  color: #fff; cursor: default;
}
.map-you:hover { border-color: rgba(255,255,255,0.9); background: rgba(0,0,0,0.85); box-shadow: none; }
.map-you .map-node-id { font-size: 7px; color: #fff; }
.map-you .map-node-sub { font-size: 7px; color: #fff; opacity: 1; }

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 5px var(--amber); }
  50%       { box-shadow: 0 0 12px var(--amber); }
}

/* Back button — floats over camera feed bottom-left */
.back-btn {
  position: absolute;
  bottom: 10px; left: 10px;
  z-index: 20;
  border-color: rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.7);
  font-size: 11px; padding: 6px 14px;
}
.back-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff; color: #fff;
}

/* ===== JUMPSCARE ===== */
#screen-jumpscare {
  background: #000;
  align-items: center; justify-content: center;
  z-index: 100;
}
#jumpscare-img {
  width: 100%; height: 100%; object-fit: cover;
  animation: jumpscareAnim 0.1s steps(1) infinite;
}
#jumpscare-text {
  position: absolute; bottom: 40px;
  font-family: var(--font-horror); font-size: 56px;
  color: var(--red); text-shadow: 0 0 30px var(--red);
  animation: flicker 0.2s infinite;
  letter-spacing: 8px;
}

/* ===== CUSTOM NIGHT SCREEN ===== */
#screen-custom-night {
  background: #000;
  align-items: center;
  justify-content: center;
}
#custom-night-panel {
  width: 460px;
  display: flex; flex-direction: column; gap: 0;
  padding: 36px 40px;
  border: 1px solid #1a0a2a;
  background: #05030a;
  box-shadow: 0 0 40px rgba(170,0,255,0.08);
}
#custom-night-title {
  font-family: var(--font-mono);
  font-size: 22px; letter-spacing: 8px;
  color: #e8e8e8; margin-bottom: 6px;
  border-bottom: 1px solid #1a0a2a;
  padding-bottom: 14px;
}
#custom-night-sub {
  font-size: 10px; color: #555; letter-spacing: 1px;
  margin-bottom: 22px; margin-top: 8px;
}
.cn-row {
  display: flex; align-items: center;
  gap: 12px; padding: 9px 0;
  border-bottom: 1px solid #0e0818;
}
.cn-label {
  font-family: var(--font-mono); font-size: 12px;
  width: 110px; flex-shrink: 0;
}
.cn-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 3px;
  background: #1a0a2a; outline: none; cursor: pointer;
  border-radius: 2px;
}
.cn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #aa00ff; cursor: pointer;
  box-shadow: 0 0 8px #aa00ff88;
}
.cn-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #aa00ff; cursor: pointer; border: none;
}
.cn-val {
  font-family: var(--font-mono); font-size: 13px;
  color: #aa00ff; width: 28px; text-align: right;
}
#cn-presets {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 18px; margin-bottom: 6px;
}
.cn-preset-label {
  font-size: 9px; color: #444; letter-spacing: 3px;
}
.cn-preset-btn {
  font-family: var(--font-mono); font-size: 10px;
  padding: 4px 10px; cursor: pointer; letter-spacing: 1px;
  border: 1px solid #2a1a3a; background: #0a050f; color: #888;
  transition: all 0.15s;
}
.cn-preset-btn:hover { border-color: #aa00ff; color: #cc44ff; }
#cn-buttons {
  display: flex; flex-direction: column; gap: 4px; margin-top: 22px;
}

/* ===== SETTINGS SCREEN ===== */
#screen-settings {
  background: #000;
  align-items: center;
  justify-content: center;
}
#settings-panel {
  width: 420px;
  display: flex; flex-direction: column; gap: 0;
  padding: 36px 40px;
  border: 1px solid #1a3a1a;
  background: #060e06;
  box-shadow: 0 0 40px rgba(0,255,0,0.06);
}
#settings-title {
  font-family: var(--font-mono);
  font-size: 22px; letter-spacing: 8px;
  color: #e8e8e8; margin-bottom: 28px;
  border-bottom: 1px solid #1a3a1a;
  padding-bottom: 14px;
}
.settings-section { margin-bottom: 22px; }
.settings-section-label {
  font-size: 9px; letter-spacing: 4px;
  color: var(--green-dim); margin-bottom: 10px;
  text-transform: uppercase;
}
.settings-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #0e1e0e;
}
.settings-label {
  font-size: 12px; color: #aaa; letter-spacing: 1px;
}
.settings-btn {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  padding: 4px 14px; cursor: pointer;
  border: 1px solid #333; background: #0a0a0a; color: #555;
  transition: all 0.15s; min-width: 72px; text-align: center;
}
.settings-btn.active {
  border-color: var(--green-dim); color: var(--green);
  background: #071407;
}
.settings-btn:hover { border-color: #555; color: #aaa; }
.settings-btn.active:hover { border-color: var(--green); }
.settings-slider-wrap {
  display: flex; align-items: center; gap: 10px;
}
.settings-slider {
  -webkit-appearance: none; appearance: none;
  width: 110px; height: 3px;
  background: #1a3a1a; outline: none; cursor: pointer;
  border-radius: 2px;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); cursor: pointer;
  box-shadow: 0 0 6px var(--green);
}
.settings-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); cursor: pointer; border: none;
}
#setting-volume-val,
#setting-music-vol-val,
#setting-sfx-vol-val {
  font-size: 10px; color: var(--green-dim); width: 34px; text-align: right;
}

/* ===== NIGHT INTRO SCREEN ===== */
#screen-night-intro {
  background: #000;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#night-intro-content {
  text-align: center;
  animation: nightIntroFade 3.5s ease forwards;
}
@keyframes nightIntroFade {
  0%   { opacity: 0; transform: scale(0.92); }
  18%  { opacity: 1; transform: scale(1); }
  75%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}
#night-intro-label {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 12px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#night-intro-number {
  font-family: var(--font-horror);
  font-size: 130px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 60px rgba(255,255,255,0.15);
}
#night-intro-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #444;
  letter-spacing: 4px;
  margin-top: 16px;
}

/* ===== WIN SCREEN ===== */
#screen-win {
  background: radial-gradient(ellipse at center, #0a1a08 0%, #020802 100%);
  align-items: center; justify-content: center;
}
.win-content {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  animation: fadeIn 0.8s ease;
}
.win-title {
  font-family: var(--font-horror); font-size: 80px; color: var(--green);
  text-shadow: 0 0 30px var(--green);
  animation: flicker 3s infinite;
}
#win-msg { font-size: 16px; color: var(--text); letter-spacing: 2px; }

/* ===== POWER OUT ===== */
#power-out-overlay {
  position: absolute; inset: 0; background: #000; z-index: 50;
  display: flex; align-items: center; justify-content: center;
}
#power-out-overlay.hidden { display: none; }
.po-text {
  font-family: var(--font-horror); font-size: 60px; color: var(--red);
  text-shadow: 0 0 20px var(--red);
  animation: flicker 0.3s infinite;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

/* ===== ANIMATIONS ===== */
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.4; }
  97%            { opacity: 1; }
  98%            { opacity: 0.2; }
  99%            { opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes staticAnim {
  0%   { background-position: 0 0; }
  25%  { background-position: -50px 20px; }
  50%  { background-position: 30px -15px; }
  75%  { background-position: -10px 40px; }
  100% { background-position: 0 0; }
}
@keyframes pulse-red {
  0%, 100% { color: var(--red); opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes jumpscareAnim {
  0%   { filter: brightness(1) saturate(1); }
  33%  { filter: brightness(2) saturate(2) hue-rotate(10deg); }
  66%  { filter: brightness(0.8) saturate(3) hue-rotate(-10deg); }
  100% { filter: brightness(1.5) saturate(1.5); }
}

/* ===== RESPONSIVE SCALING ===== */
@media (max-width: 980px) {
  #monitor {
    width: 100vw;
    height: calc(100vw * 0.625);
    border-radius: 0;
  }
}
@media (max-height: 620px) {
  #monitor {
    height: 100vh;
    width: calc(100vh * 1.6);
  }
}