:root {
  --bg-color: #050505;
  --text-color: #eeeeee;
  --accent-primary: #ccff00; /* Neon Lime */
  --accent-secondary: #ff00ff; /* Neon Magenta */
  --accent-tertiary: #00ffff; /* Cyan */
  --font-main: "Inter", sans-serif;
  --font-mono: "Space Mono", monospace;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow: hidden; /* No scroll */
  width: 100vw;
  height: 100vh; /* Fallback */
  height: 100dvh; /* Mobile viewport fix */
  border: 10px solid var(--accent-primary); /* The only border */
}

/* ... unchanged ... */

.permission-text {
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  margin: 0;
  padding: 0 16px; /* Added padding */
}

canvas {
  margin: 0 auto;
}

/* --- LAYERS --- */

/* Layer 0: Video */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.6;
  filter: grayscale(100%) contrast(1.2) brightness(0.8);
}

/* Layer 1: Marquee (Top Fixed) */
.marquee-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--accent-primary);
  color: #000;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
  z-index: 100;
  font-family: var(--font-mono);
  font-weight: bold;
  text-transform: uppercase;
}

.marquee-content {
  display: inline-block;
  animation: marquee 20s linear infinite;
}

.marquee-item {
  margin-right: 2rem;
  font-size: 1.2rem;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Layer 2: Blob (Center Fixed) */
#blob-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10; /* Above video, below UI text */
  pointer-events: auto; /* Clickable via Raycasting */
}

/* Layer 3: UI Overlay */
#ui-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none; /* Let clicks pass to blob */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6rem 2rem 2rem 2rem; /* Top padding for marquee */
}

/* Title (Top Center) */
.title-container {
  text-align: center;
  pointer-events: none;
}

h1 {
  font-size: calc(50px + 6vw);
  text-transform: uppercase;
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -5px;
  color: transparent;
  -webkit-text-stroke: 2px #fff;
  opacity: 0.8;
  margin: 0;
}

/* Instruction (Center, below blob visually) */
#instruction-text {
  position: absolute;
  bottom: 132px; /* User Request: Moved down by 100px from 232px */
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 2px 10px #000;
  z-index: 30;
  pointer-events: none; /* Ensure clicks pass through to blob */
  text-align: center;
  user-select: none; /* Prevent text selection */
}

/* Privacy Link */
.privacy-link {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  pointer-events: auto;
}

.privacy-link a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  border-bottom: 1px dotted #666;
  transition: all 0.2s;
}

.privacy-link a:hover {
  color: var(--accent-primary);
  border-bottom: 1px solid var(--accent-primary);
}

/* Stages (Bottom / Full Overlay) */
.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* Hidden by default */
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4rem;
}

.stage.active {
  display: flex;
}

/* Stage 3 Result */
.result-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  z-index: 50; /* Top of everything */
}

.result-controls {
  position: absolute;
  /* Privacy Link is bottom: 2rem. 
     Text height ~20px. 
     Gap 50px. 
     Total ~100-110px. */
  bottom: 110px; 
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

@media (max-width: 600px) {
  .result-controls {
      bottom: 110px !important;
  }
}

.typewriter-container {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 80%);
  width: 100%;
  max-width: 800px; /* Readable width */
  max-height: 60vh;
  overflow-y: auto; /* Scroll if text is tall */
  text-align: center;
  padding: 2rem;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.typewriter-container::-webkit-scrollbar {
  display: none;
}

.typewriter-text {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  white-space: pre-wrap; /* Preserve newlines */
}

.story-location {
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-top: 2rem;
  letter-spacing: 2px;
  opacity: 0; /* Fade in later */
  font-weight: bold;
}

.restart-btn {
  background: var(--accent-primary);
  color: #000;
  border: none;
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.restart-btn:hover {
  transform: scale(1.05);
}

/* Utilities */
.hidden {
  display: none !important;
}
.fade-in {
  animation: fadeIn 0.5s forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.glitch-hover:hover {
  color: var(--accent-primary);
  -webkit-text-stroke: 0;
}

/* Review Stage */
#stage-review {
  background: rgba(0, 0, 0, 0.9);
  height: 100%;
  width: 100%;
}
.review-content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 450px;
  max-width: calc(100vw - 20px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  z-index: 60;
}

.review-title {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

.location-picker {
  width: 100%;
  max-width: 600px;
  z-index: 100; /* Ensure input is clickable */
}

.city-input {
  width: 100%;
  max-width: calc(100vw - 20px); /* Fit within page border */
  padding: 1rem;
  background: #111;
  border: 1px solid var(--accent-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  outline: none;
  text-align: center;
}

.city-input:focus {
  background: #222;
  box-shadow: 0 0 10px var(--accent-primary);
}

/* Google Places Autocomplete overrides */
.pac-container {
  background-color: #111;
  border: 1px solid var(--accent-primary);
  font-family: var(--font-mono);
  color: #fff;
  z-index: 9999 !important; /* Above everything */
  max-width: calc(100vw - 20px);
}

.pac-item {
  border-top: 1px solid #333;
  color: #fff;
  padding: 10px;
}

.pac-item:hover,
.pac-item-selected {
  background-color: #333;
}

.pac-item-query {
  color: var(--accent-primary);
}

.review-box {
  border: 1px solid #fff;
  padding: 1rem;
  width: 100%;
  max-width: calc(100vw - 20px); /* User Request: Browser width - border */
  margin-bottom: 1rem;
  background: #111;
  position: relative; /* For absolute icon */
}

.edit-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--accent-primary);
  opacity: 0.5;
  pointer-events: none; /* Icon itself isn't clickable, just a visual cue */
}

.review-textarea:focus + .edit-icon,
.review-box:hover .edit-icon {
  opacity: 1;
}

.review-textarea {
  width: 100%;
  height: 150px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  text-align: center;
  padding-top: 1.5rem; /* Space for icon? actually icon is top right, maybe not needed */
}

.review-options {
  width: 100%;
  max-width: calc(100vw - 20px);
  margin-bottom: 1rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: pointer;
  font-family: var(--font-mono);
  color: #888;
  transition: all 0.2s;
  width: 100%;
  max-width: calc(100vw - 20px);
  user-select: none;
  margin-bottom: 1rem;
}

.checkbox-container:hover {
  color: #fff;
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-primary);
  margin-right: 15px; /* Spacing between box and text */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.2s;
}

.checkmark::after {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  display: none;
  /* Reset previous checkmark arrow styles */
  border: none;
  transform: none;
}

/* Checked Logic */
.checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

.checkbox-container input:checked ~ .checkmark {
  box-shadow: 0 0 5px var(--accent-primary);
}

/* Color change for text when checked - tricky without :has or JS, 
   but we can assume text is just text node. 
   Let's wrap text in span in HTML or just rely on the box.
   Actually, we can use a sibling for text if we restructure HTML, 
   but simply highlighting the box is enough. 
*/
.checkbox-container:active {
  transform: scale(0.98);
}

.review-actions {
  display: flex;
  gap: 2rem;
}

.btn {
  padding: 1rem 2rem;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  border: 2px solid #666;
}

.btn:disabled:hover {
  transform: none;
  background: #333;
  color: #666;
}

.btn-primary {
  background: var(--accent-primary);
  color: #000;
  border: none;
}

.btn-primary:hover {
  background: #fff;
  transform: scale(1.05);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}

.btn-outline:hover {
  background: #fff;
  color: #000;
}

/* Permission UI */
.permission-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
  width: 100%;
  pointer-events: none; /* Let clicks pass through container, but catch on button */
}

.permission-content {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.permission-text {
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  margin: 0;
  padding: 0 16px;
}

#btn-grant-permission {
  font-size: 1rem;
  padding: 12px 30px;
  letter-spacing: 2px;
}
