/* Page Reset & Base Settings */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  overflow: hidden; /* Prevents scrollbars & mobile pull-to-refresh */
  position: relative;
}

/* Background Image Layer */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('TracenBG.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: -1;
}

/* UI Header Wrapper (Stacked Title + Buttons) */
.ui-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 100; /* Keeps controls above the physics layer */
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none; /* Clicks pass through empty spaces to canvas */
}

/* Page Title Styling */
.page-title {
  margin: 0;
  font-size: 24px;
  color: #2c3e50;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

/* Button Container */
.button-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: auto; /* Restores clicks specifically for buttons */
}

/* Base Button Styling */
.btn {
  padding: 10px 18px;
  font-size: 14px;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  font-weight: bold;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation; /* Improves mobile tap responsiveness */
  transition: transform 0.1s ease, opacity 0.2s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.95);
}

/* Accent Colors */
.btn-red { background-color: #e74c3c; }
.btn-blue { background-color: #3498db; }
.btn-green { background-color: #2ecc71; }
.btn-purple { background-color: #9b59b6; }

/* Physics Canvas Container */
#physics-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  touch-action: none; /* Disables mobile page scrolling while dragging items */
}

#physics-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Fullscreen Jumpscare Overlay */
#jumpscare-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 9999;
}

#jumpscare-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

#jumpscare-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  }
