@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Montserrat:ital,wght@1,800;1,900&family=Orbitron:wght@700;900&family=Share+Tech+Mono&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #020307;
  font-family: 'Share Tech Mono', 'Orbitron', 'Montserrat', sans-serif;
  color: #ffffff;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* HORROR HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* TOP RIGHT HUD: CLOCK & SURVIVAL STATUS */
.hud-top-right {
  position: absolute;
  top: 25px;
  right: 35px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hud-money {
  font-size: 2.8rem;
  color: #ff1e1e;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 2px 2px 0px #000;
}

/* HEART RATE MONITOR */
.heartbeat-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 10, 15, 0.85);
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid #cc0000;
  box-shadow: 0 0 15px rgba(200, 0, 0, 0.4);
}

.heart-icon {
  font-size: 1.4rem;
  animation: pulseHeart 0.8s infinite;
}

@keyframes pulseHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.heart-val {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ff3333;
  letter-spacing: 1px;
}

/* RADAR / MINI-MAP (BOTTOM LEFT) */
.hud-radar-container {
  position: absolute;
  bottom: 30px;
  left: 35px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(5, 8, 12, 0.9);
  border: 3px solid #cc0000;
  box-shadow: 0 0 20px rgba(200, 0, 0, 0.5);
  overflow: hidden;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* BOTTOM CENTER: CCTV FLIP BUTTON */
#cctv-toggle-bar {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

.btn-cctv {
  background: rgba(10, 15, 25, 0.88);
  color: #00f0ff;
  border: 2px solid #00f0ff;
  border-radius: 30px;
  padding: 12px 32px;
  font-size: 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  transition: all 0.2s ease;
}

.btn-cctv:hover {
  background: #00f0ff;
  color: #000;
  box-shadow: 0 0 35px #00f0ff;
  transform: scale(1.05);
}

/* AUTHENTIC FNAF CCTV STYLE START SCREEN */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 65% 50%, rgba(5, 12, 22, 0.65) 0%, rgba(2, 4, 8, 0.96) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 35px 55px;
  z-index: 100;
  pointer-events: auto;
}

.menu-cctv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: #00f0ff;
  text-shadow: 0 0 10px #00f0ff;
  border-bottom: 2px solid rgba(0, 240, 255, 0.3);
  padding-bottom: 12px;
}

.cctv-rec {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ff1a1a;
  font-weight: bold;
}

.rec-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff0000;
  box-shadow: 0 0 12px #ff0000;
  animation: recBlink 1s infinite alternate;
}

@keyframes recBlink {
  0% { opacity: 1; }
  100% { opacity: 0.2; }
}

.menu-main-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

.menu-left-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 580px;
}

.fnaf-title {
  font-family: 'Creepster', 'Arial Black', Impact, sans-serif;
  font-size: 5rem;
  letter-spacing: 6px;
  color: #ff1a1a;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(180, 0, 0, 0.5), 4px 4px 0 #000;
  line-height: 1.0;
  margin-bottom: 4px;
  animation: textFlicker 3s infinite;
}

.fnaf-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 6px;
  color: #00f0ff;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.7);
  margin-bottom: 12px;
}

.fnaf-desc {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  letter-spacing: 3px;
  color: #d4a373;
  margin-bottom: 30px;
}

.menu-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.btn-fnaf-play {
  background: linear-gradient(45deg, #cc0000, #770000);
  color: #fff;
  border: 2px solid #ff3333;
  border-radius: 8px;
  padding: 16px 36px;
  font-size: 1.4rem;
  font-family: 'Share Tech Mono', monospace;
  font-weight: 900;
  letter-spacing: 3px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 25px rgba(200, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.btn-fnaf-play:hover {
  background: linear-gradient(45deg, #ff1a1a, #990000);
  transform: translateX(10px);
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.9);
}

.btn-fnaf-guide {
  background: rgba(10, 20, 35, 0.85);
  color: #00f0ff;
  border: 2px solid #00f0ff;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 2px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transition: all 0.2s ease;
}

.btn-fnaf-guide:hover {
  background: #00f0ff;
  color: #000;
  transform: translateX(10px);
}

.guide-modal {
  background: rgba(8, 14, 22, 0.95);
  border: 2px solid #00f0ff;
  border-radius: 8px;
  padding: 16px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.fnaf-version {
  margin-top: 30px;
  font-size: 0.85rem;
  color: #557799;
  letter-spacing: 2px;
}

/* RIGHT COLUMN: PREVIEW CCTV SCHEMATIC MAP */
.menu-right-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cctv-preview-card {
  position: relative;
  width: 360px;
  height: 310px;
  background: rgba(5, 10, 18, 0.9);
  border: 3px solid #00f0ff;
  border-radius: 12px;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.4);
  padding: 10px;
}

.preview-map-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: #00f0ff;
  letter-spacing: 2px;
  text-align: center;
}

.preview-node {
  position: absolute;
  background: rgba(10, 20, 30, 0.9);
  color: #00f0ff;
  border: 2px solid #00f0ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.preview-node.active {
  background: #00f0ff;
  color: #000;
  box-shadow: 0 0 20px #00f0ff;
  border-color: #fff;
  animation: nodePulse 1.5s infinite alternate;
}

@keyframes nodePulse {
  0% { box-shadow: 0 0 10px #00f0ff; }
  100% { box-shadow: 0 0 25px #00f0ff; }
}

/* CCTV TABLET MONITOR OVERLAY */
#cctv-monitor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 80;
  display: none;
  background: radial-gradient(circle, transparent 40%, rgba(0, 10, 15, 0.7) 100%);
  border: 14px solid #14171c;
  box-shadow: inset 0 0 100px rgba(0, 240, 255, 0.25);
}

.cctv-header {
  position: absolute;
  top: 30px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: #00f0ff;
  text-shadow: 0 0 10px #00f0ff;
}

.cctv-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 15px #00f0ff;
}

.cctv-grain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 255, 200, 0.03) 0px, rgba(0, 0, 0, 0.3) 2px, rgba(0, 0, 0, 0) 4px);
}

.cctv-map-wrap {
  position: absolute;
  bottom: 40px;
  right: 45px;
  width: 340px;
  height: 300px;
  background: rgba(5, 10, 18, 0.88);
  border: 3px solid #00f0ff;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
  padding: 10px;
}

.cctv-map-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: #00f0ff;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 5px;
}

.cctv-svg-lines {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  height: 260px;
  pointer-events: none;
}

.cam-btn {
  position: absolute;
  background: rgba(10, 20, 30, 0.9);
  color: #00f0ff;
  border: 2px solid #00f0ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  transition: all 0.15s ease;
  z-index: 10;
}

.cam-btn:hover {
  background: #00f0ff;
  color: #000;
  box-shadow: 0 0 20px #00f0ff;
  transform: scale(1.1);
}

.cam-btn.active {
  background: #00f0ff;
  color: #000;
  box-shadow: 0 0 25px #00f0ff;
  border-color: #fff;
}

.btn-close-monitor {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(200, 0, 0, 0.85);
  color: #fff;
  border: 2px solid #ff4d4d;
  border-radius: 30px;
  padding: 12px 36px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.btn-close-monitor:hover {
  background: #ff1a1a;
  transform: translateX(-50%) scale(1.08);
}

.key-badge {
  background: #cc0000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.7) 100%);
}

#panic-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  background: radial-gradient(circle, transparent 50%, rgba(180, 0, 0, 0.65) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-play {
  background: linear-gradient(45deg, #cc0000, #660000);
  color: #fff;
  border: 2px solid #ff3333;
  border-radius: 40px;
  padding: 16px 52px;
  font-size: 1.5rem;
  font-family: inherit;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 4px;
  cursor: pointer !important;
  box-shadow: 0 0 35px rgba(200, 0, 0, 0.7);
  transition: all 0.2s ease;
  pointer-events: auto !important;
}

.btn-play:hover {
  background: linear-gradient(45deg, #ff1a1a, #990000);
  transform: scale(1.06);
}

/* Modals & Overlays Cursor & Clickability Guarantee */
#start-screen,
#pause-menu,
#gameover-screen,
#win-screen,
#guide-modal,
#cctv-monitor-overlay {
  cursor: default !important;
  pointer-events: auto !important;
}

#start-screen *,
#pause-menu *,
#gameover-screen *,
#win-screen *,
#guide-modal *,
#cctv-monitor-overlay * {
  cursor: default !important;
  pointer-events: auto !important;
}

button,
.btn-play,
.btn-secondary,
.cam-btn,
.btn-close-monitor,
#pause-menu button,
#pause-menu .btn-play,
#pause-menu .btn-secondary,
#pause-menu canvas,
.hotbar-slot,
.bp-slot-btn {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* HOTBAR STYLES */
.hotbar-slot {
  width: 58px;
  height: 58px;
  background: rgba(10, 18, 30, 0.85);
  border: 2px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.hotbar-slot:hover {
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.18);
  transform: translateY(-3px);
}

.hotbar-slot.active {
  border-color: #00ff66;
  background: rgba(0, 255, 102, 0.22);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.6);
  transform: scale(1.08);
}

.slot-num {
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 0.65rem;
  color: #888;
  font-family: monospace;
  font-weight: bold;
}

.hotbar-slot.active .slot-num {
  color: #00ff66;
}

.slot-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.slot-name {
  font-size: 0.58rem;
  letter-spacing: 1px;
  color: #aaa;
  margin-top: 2px;
  font-weight: bold;
}

.hotbar-slot.active .slot-name {
  color: #fff;
}

/* BACKPACK SLOTS */
.backpack-item-card {
  background: rgba(15, 24, 40, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 95px;
  transition: all 0.15s ease;
  position: relative;
}

.backpack-item-card:hover {
  border-color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  background: rgba(20, 35, 60, 0.95);
}

.bp-empty-slot {
  background: rgba(8, 12, 20, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 0.8rem;
  min-height: 95px;
}

/* TEXT CHAT & VOICE CHAT STYLES */
#chat-panel {
  position: absolute;
  bottom: 210px;
  left: 35px;
  width: 320px;
  max-height: 180px;
  background: rgba(5, 10, 18, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 22;
  pointer-events: auto;
  font-family: 'Share Tech Mono', monospace;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  max-height: 120px;
}

.chat-msg {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 6px;
  border-radius: 4px;
  color: #ddd;
  word-break: break-word;
}

.chat-msg .sender {
  color: #00f0ff;
  font-weight: bold;
  margin-right: 4px;
}

.chat-msg.system {
  color: #ffea00;
  font-style: italic;
}

#chat-input-box {
  display: flex;
  gap: 4px;
}

#chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #00f0ff;
  border-radius: 4px;
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
}

/* VOICE CHAT WIDGET */
#voice-chat-widget {
  position: absolute;
  top: 75px;
  left: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 10, 18, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 20;
  pointer-events: auto;
  font-size: 0.72rem;
  font-family: monospace;
}

#voice-chat-widget.talking {
  border-color: #00ff66;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.8);
  color: #00ff66;
}


