html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  visibility: hidden;
}

.screen.on { visibility: visible; }

#reset {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #777;
  letter-spacing: 0.02em;
  margin: 0;
  text-align: center;
}

/* ---------- Landing: fake site behind an 18+ gate ---------- */

#intro {
  background: #15121a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.site {
  position: absolute;
  inset: 0;
  filter: blur(7px) brightness(0.55);
  transform: scale(1.03);
  overflow: hidden;
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: #1f1a26;
}
.logo { font-size: 26px; font-weight: 800; color: #ff3d9a; letter-spacing: -0.02em; }
.logo b { color: #fff; font-weight: 800; }
.search { flex: 1; max-width: 420px; height: 34px; margin: 0 auto; border-radius: 17px; background: #2d2636; }
.pill { width: 90px; height: 34px; border-radius: 17px; background: #3a3145; }
.pill.hot { background: #ff3d9a; }

.tabs { display: flex; gap: 14px; padding: 16px 24px; }
.tabs span { width: 80px; height: 26px; border-radius: 13px; background: #2d2636; }
.tabs span:first-child { background: #ff3d9a; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  padding: 0 24px;
}
.tile { aspect-ratio: 16 / 10; border-radius: 6px; }
.tile-cap { height: 10px; margin: 6px 0 14px; width: 70%; border-radius: 5px; background: #3a3145; }

.gate {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 26px 24px 22px;
  background: #fff;
  color: #222;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: opacity 300ms ease;
}
.gate.fade { opacity: 0; }

.gate h1 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.02em;
}

.terms {
  overflow-y: auto;
  max-height: 34vh;
  min-height: 90px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  font-size: 12px;
  line-height: 1.5;
  color: #444;
  user-select: text;
  -webkit-user-select: text;
}
.terms p { margin: 0 0 10px; }
.terms ul { margin: 0 0 10px; padding-left: 22px; }

.warn {
  margin: 12px 0 18px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #e00;
}

.buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.gate-btn {
  min-width: 170px;
  padding: 11px 18px;
  border-radius: 5px;
  font: 600 14px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.gate-btn.exit { background: #fff; color: #333; border: 1px solid #999; }
.gate-btn.agree { background: #ff3d9a; color: #fff; border: 1px solid #ff3d9a; text-transform: uppercase; font-weight: 800; }
.gate-btn:focus-visible { outline: 2px solid #ff3d9a; outline-offset: 2px; }

@media (max-width: 480px) {
  .gate { padding: 20px 16px 18px; }
  .gate-btn { flex: 1 1 100%; min-width: 0; }
  .topbar { padding: 0 16px; }
}

#reset {
  background: none;
  border: 0;
  padding: 16px 24px;
  cursor: pointer;
}
#reset:focus-visible { outline: 1px solid #555; }

/* The face layer: shown by a visibility swap only, never transitioned. */
#face { overflow: hidden; z-index: 10; }

#face-move {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}

.fimg {
  position: absolute;
  max-width: none;
  display: block;
}

/* RGB split: each copy keeps one color channel (multiply) and is added on top (screen). */
.chan {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
  opacity: 0;
}
.chan.red { background: #f00; }
.chan.cyan { background: #0ff; }
.chan .fimg { mix-blend-mode: multiply; }

/* Glitch slices: horizontal bands of the face, torn sideways. */
#slices, .slice {
  position: absolute;
  inset: 0;
}
.slice { visibility: hidden; }
.slice.on { visibility: visible; }

/* Red throb, capped at 2.5 Hz with limited contrast for photosensitive safety. */
#pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #b00000;
  mix-blend-mode: multiply;
  opacity: 0;
}

.wash, .vignette, #flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wash {
  background: radial-gradient(ellipse at center, rgba(150, 0, 0, 0.25) 0%, rgba(40, 0, 0, 0.5) 100%);
}

.vignette {
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0.55) 70%,
    rgba(0, 0, 0, 0.9) 100%);
}

#flash {
  background: #fff;
  opacity: 0.85;
  visibility: hidden;
}
#flash.on { visibility: visible; }
