* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #000;
  overflow: hidden;
  font-family: 'Share Tech Mono', monospace;
  color: #ddd;
  width: 100vw;
  height: 100vh;
}

#game-container {
  position: relative;
  width: 100vw;
  height: calc(100vh - 24px);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ui-overlay > * {
  pointer-events: auto;
}

#game-footer {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

#game-footer a {
  color: #555;
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
}

#game-footer a:hover {
  color: #f0d000;
}

/* Menu Styles */
.menu-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.menu-title {
  font-family: 'Creepster', cursive;
  font-size: clamp(32px, 6vw, 72px);
  color: #f0d000;
  text-shadow: 0 0 20px #f0d00088, 0 0 40px #f0d00044, 3px 3px 0 #1a1200;
  text-align: center;
  line-height: 1.1;
  animation: titleFlicker 3s infinite;
  margin-bottom: 10px;
}

.menu-subtitle {
  font-family: 'Special Elite', cursive;
  font-size: clamp(12px, 2vw, 20px);
  color: #887700;
  margin-bottom: 40px;
}

@keyframes titleFlicker {
  0%, 93%, 95%, 97%, 100% { opacity: 1; }
  94% { opacity: 0.7; }
  96% { opacity: 0.85; }
}

.menu-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(16px, 2.5vw, 24px);
  padding: 12px 40px;
  margin: 8px;
  background: transparent;
  border: 2px solid #f0d000;
  color: #f0d000;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 220px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.menu-btn:hover {
  background: #f0d00022;
  box-shadow: 0 0 20px #f0d00044;
  transform: scale(1.05);
}

.menu-btn:disabled {
  border-color: #444;
  color: #444;
  cursor: default;
}

.menu-btn:disabled:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.night-info {
  font-size: clamp(11px, 1.5vw, 16px);
  color: #666;
  margin-top: 20px;
}

/* HUD Styles */
.hud-night {
  position: absolute;
  top: 12px;
  left: 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(14px, 2vw, 22px);
  color: #eee;
  text-shadow: 0 0 10px #000;
  z-index: 10;
}

.hud-clock {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(18px, 3vw, 32px);
  color: #eee;
  text-shadow: 0 0 10px #000;
  z-index: 10;
}

.hud-power {
  position: absolute;
  bottom: 70px;
  left: 16px;
  z-index: 10;
}

.power-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(12px, 1.5vw, 18px);
  color: #ccc;
  text-shadow: 0 0 8px #000;
}

.power-bar-bg {
  width: clamp(120px, 20vw, 250px);
  height: 14px;
  background: #222;
  border: 1px solid #555;
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.power-bar-fill {
  height: 100%;
  transition: width 0.5s, background 0.5s;
  border-radius: 2px;
}

.power-usage {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(10px, 1.2vw, 14px);
  color: #999;
  margin-top: 2px;
}

/* Door Buttons */
.door-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(50px, 7vw, 80px);
  height: clamp(100px, 18vh, 160px);
  border: 2px solid #555;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(9px, 1.2vw, 13px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 10;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.door-btn.left {
  left: 4px;
}

.door-btn.right {
  right: 4px;
}

.door-btn.open {
  background: #0a2a0a99;
  border-color: #2a5a2a;
  color: #4f4;
}

.door-btn.closed {
  background: #2a0a0a99;
  border-color: #5a2a2a;
  color: #f44;
}

.door-btn:hover {
  border-color: #aaa;
}

.door-btn .door-icon {
  font-size: clamp(20px, 3vw, 32px);
}

.door-btn.disabled {
  opacity: 0.3;
  cursor: default;
}

/* Light Buttons */
.light-btn {
  position: absolute;
  top: calc(50% + 100px);
  width: clamp(50px, 7vw, 80px);
  height: clamp(36px, 5vh, 50px);
  border: 1px solid #444;
  background: #111;
  color: #888;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(8px, 1vw, 11px);
  cursor: pointer;
  z-index: 10;
  text-transform: uppercase;
}

.light-btn.left { left: 4px; }
.light-btn.right { right: 4px; }

.light-btn:hover { border-color: #f0d000; color: #f0d000; }
.light-btn.active { background: #2a2a00; border-color: #f0d000; color: #f0d000; }

/* Camera Toggle Button */
.camera-toggle-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(14px, 2vw, 20px);
  padding: 10px 30px;
  background: #111;
  border: 2px solid #3a6a8a;
  color: #5af;
  cursor: pointer;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 3px;
  transition: all 0.15s;
}

.camera-toggle-btn:hover {
  background: #0a2a3a;
  box-shadow: 0 0 15px #3a6a8a55;
}

.camera-toggle-btn.active {
  background: #0a2a3a;
  border-color: #5af;
  box-shadow: 0 0 20px #5af44;
}

.camera-toggle-btn.disabled {
  opacity: 0.3;
  cursor: default;
}

/* Audio Lure Button */
.audio-lure-btn {
  position: absolute;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(11px, 1.5vw, 16px);
  padding: 8px 20px;
  background: #0a1a2a;
  border: 2px solid #0af;
  color: #0af;
  cursor: pointer;
  z-index: 25;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.15s;
}

.audio-lure-btn:hover {
  background: #0a2a4a;
  box-shadow: 0 0 15px #0af55;
}

.audio-lure-btn.active {
  background: #0a3a5a;
  border-color: #5cf;
  color: #5cf;
  animation: lurePulse 0.5s infinite;
}

.audio-lure-btn.cooldown {
  opacity: 0.4;
  cursor: default;
  border-color: #456;
  color: #456;
}

@keyframes lurePulse {
  0%, 100% { box-shadow: 0 0 10px #0af; }
  50% { box-shadow: 0 0 25px #0af; }
}

/* Crimson Chin Warning */
.crimson-warning {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Creepster', cursive;
  font-size: clamp(14px, 2.5vw, 24px);
  color: #f44;
  text-shadow: 0 0 15px #f00, 0 0 30px #800;
  z-index: 15;
  animation: warningFlash 0.6s infinite;
  white-space: nowrap;
}

.francis-scream-warning {
  display: none; /* Removed — Francis screams now instead of text */
}

.night-select-btn {
  border-color: #f44 !important;
  color: #f44 !important;
}

.night-select-btn:hover {
  background: #f4422222 !important;
  box-shadow: 0 0 20px #f4444444 !important;
}

.night-pick-btn {
  font-size: clamp(12px, 1.8vw, 18px) !important;
  border-color: #f80 !important;
  color: #f80 !important;
}

.night-pick-btn:hover {
  background: #f8022222 !important;
  box-shadow: 0 0 15px #f8044444 !important;
  transform: scale(1.08) !important;
}

#night-select-container {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Pause screen overlay */
.overlay-screen[style*="transparent"] .menu-btn {
  min-width: 200px;
}

/* Camera View */
.camera-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 20;
  pointer-events: auto;
}

.camera-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(14px, 2vw, 22px);
  color: #8f8;
  text-shadow: 0 0 10px #0f0;
  z-index: 22;
}

.camera-map {
  position: absolute;
  bottom: 60px;
  right: 12px;
  background: #0a0a0aCC;
  border: 1px solid #333;
  padding: 12px 16px;
  z-index: 22;
  border-radius: 4px;
  line-height: 0.8;
}

.cam-node {
  display: inline-block;
  width: clamp(26px, 3.5vw, 36px);
  height: clamp(22px, 3vw, 28px);
  margin: 2px 4px;
  background: #1a1a2a;
  border: 1px solid #445;
  color: #889;
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(8px, 1.1vw, 11px);
  cursor: pointer;
  text-align: center;
  line-height: clamp(24px, 3.5vw, 32px);
  transition: all 0.1s;
}

.cam-node:hover {
  border-color: #aaf;
  color: #aaf;
}

.cam-node.active {
  background: #2a2a00;
  border-color: #f0d000;
  color: #f0d000;
}

.cam-node.has-enemy {
  /* No longer shows red for Francis */
}

.cam-node.has-crimson {
  animation: crimsonPulse 0.8s infinite;
  border-color: #c00;
  color: #f44;
  background: #2a0a0a;
}

@keyframes crimsonPulse {
  0%, 100% { border-color: #c00; box-shadow: 0 0 6px #f00; }
  50% { border-color: #600; box-shadow: 0 0 2px #800; }
}

.cam-node.cam-spacer {
  width: clamp(20px, 3vw, 28px);
  height: clamp(12px, 1.5vw, 16px);
}

/* Game Over / Victory Screens */
.overlay-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background: #000000ee;
}

.gameover-text {
  font-family: 'Creepster', cursive;
  font-size: clamp(40px, 8vw, 80px);
  color: #d00;
  text-shadow: 0 0 30px #d00, 0 0 60px #800;
  animation: goFlicker 0.5s infinite;
}

@keyframes goFlicker {
  0%, 80%, 90%, 100% { opacity: 1; }
  85% { opacity: 0.6; }
  95% { opacity: 0.8; }
}

.victory-text {
  font-family: 'Creepster', cursive;
  font-size: clamp(48px, 10vw, 100px);
  color: #f0d000;
  text-shadow: 0 0 30px #f0d000, 0 0 60px #886600;
}

.overlay-sub {
  font-family: 'Special Elite', cursive;
  font-size: clamp(14px, 2vw, 22px);
  color: #888;
  margin: 10px 0 30px;
}

.newspaper {
  background: #d4c89e;
  color: #222;
  padding: 20px 30px;
  max-width: 400px;
  text-align: center;
  font-family: 'Special Elite', cursive;
  border: 2px solid #999;
  margin: 20px;
}

.newspaper h2 {
  font-size: clamp(16px, 2.5vw, 24px);
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.newspaper p {
  font-size: clamp(11px, 1.5vw, 15px);
  line-height: 1.4;
  color: #444;
}

/* Scanlines overlay for camera */
.scanlines {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 2px,
    rgba(0, 255, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 21;
}

.vignette {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 21;
}

/* Jumpscare */
.jumpscare-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Static transition */
.static-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 50;
  pointer-events: none;
}

@media (max-width: 600px) {
  .camera-map {
    bottom: 55px;
    right: 6px;
    padding: 6px;
  }
}