:root {
  --bg: #000;
  --fg: #fff;
  --fg-dim: #c7c7c7;
  --accent: #9ef3ff;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
}

.loading-bar {
  width: 200px;
  height: 2px;
  background: rgba(147, 102, 96, 0.2);
  margin-bottom: 24px;
  overflow: hidden;
}

.loading-progress {
  height: 100%;
  background: rgba(147, 102, 96, 0.75);
  width: 0%;
  transition: width 0.1s linear;
}

.enter-button {
  background: var(--bg);
  color: rgba(147, 102, 96, 0.75);
  border: 1px solid rgba(147, 102, 96, 0.75);
  padding: 8px 16px;
  font-family: "VT323", monospace;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin: 0 auto 24px auto;
  width: 60px;
  height: 40px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enter-button::after {
  content: "○";
  font-size: 16px;
  color: rgba(147, 102, 96, 0.75);
}

.enter-button.ready {
  opacity: 1;
}

.enter-button:hover {
  background: rgba(147, 102, 96, 0.1);
}


.bg-container {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  inset: 0;
  background-image: url('visual.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.5;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden-hunt-text {
  position: absolute;
  top: 50%;
  left: 30%;
  color: transparent;
  font-size: 16px;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  pointer-events: auto;
  z-index: 1;
  cursor: text;
  padding: 10px;
  -webkit-touch-callout: default;
  -webkit-tap-highlight-color: rgba(158, 243, 255, 0.3);
}

.hidden-hunt-text::selection {
  background-color: rgba(158, 243, 255, 0.3);
  color: transparent;
}

.hidden-hunt-text::-moz-selection {
  background-color: rgba(158, 243, 255, 0.3);
  color: transparent;
}


.content {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto auto; /* text, spacer, logo */
  padding: 24px;
}

.mystery-text {
  align-self: start;
  justify-self: center;
  margin-top: 15vh; /* position in upper third */
  margin-left: 25%; /* more right than center */
  max-width: 700px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .mystery-text {
    margin-left: 5%; /* much more left on mobile */
    max-width: 90%;
  }
  
  /* Adjust specific line spacing for mobile */
  .mystery-text .line-4 {
    margin-left: -10ch; /* 10 spaces left */
  }
  
  .mystery-text .line-7 {
    margin-left: -8ch; /* 8 spaces left */
  }
}

.mystery-text p {
  color: rgba(147, 102, 96, 0.75);
  font-family: "VT323", monospace;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.mystery-text .glitch-char {
  color: rgba(147, 102, 96, 0.75);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  display: inline-block;
  width: 1ch;
  text-align: center;
}

.logo-wrap {
  align-self: end;
  justify-self: end;
}

.logo {
  display: block;
  height: auto;
  max-width: min(36vw, 420px);
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
  opacity: 0.5;
  animation: gentle-pulse 4s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

.center {
  text-align: center;
  max-width: 72ch;
}

.brand {
  margin: 0 0 8px 0;
  font-size: clamp(28px, 6vw, 72px);
  letter-spacing: 0.04em;
}

.tagline {
  margin: 0;
  color: var(--fg-dim);
  font-size: clamp(14px, 2.4vw, 20px);
}

/* Desktop-first refinements */
@media (min-width: 960px) {
  .content { padding: 48px; }
  .brand { font-weight: 650; }
}

/* Respect safe areas on modern phones */
@supports (padding: max(env(safe-area-inset-top), 0px)) {
  .content {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* BlobTV Branding */
.blobtv-branding {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10;
}

.blobtv-branding a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.blobtv-branding a:hover {
  opacity: 0.8;
}

.powered-by {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: rgba(147, 102, 96, 0.75);
  margin-bottom: 6px;
  text-transform: lowercase;
}

.blobtv-logo {
  height: 72px;
  width: auto;
}
