/* D:\projects\fanzanian\app\static\shared\age-gate.css */

/*
 * SEO + age-safety contract:
 * - Protected SSR content must remain present and CSS-visible to crawlers.
 * - Before the interactive gate is built, an opaque fixed shield prevents any
 *   user-visible flash of adult content.
 * - Once built, JS adds .age-gate-mounted so the temporary root pseudo shield
 *   retires and .age-gate-root owns the visible age confirmation surface.
 */
html.age-gate-pending,
html.age-gate-loading,
html.age-gate-denied {
  overflow: hidden !important;
  background: #08080a;
}

html.age-gate-pending body,
html.age-gate-loading body,
html.age-gate-denied body {
  overflow: hidden !important;
}

html.age-gate-pending:not(.age-gate-mounted)::before,
html.age-gate-loading:not(.age-gate-mounted)::before,
html.age-gate-denied:not(.age-gate-mounted)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: #08080a;
  pointer-events: none;
}

html.age-gate-pending body > :not(.age-gate-root):not(noscript),
html.age-gate-loading body > :not(.age-gate-root):not(noscript),
html.age-gate-denied body > :not(.age-gate-root):not(noscript) {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.age-gate-root {
  position: fixed;
  inset: 0;
  /* Must remain above the opaque pre-paint shield (2147483646). */
  z-index: 2147483647;
  display: grid;
  place-items: center;
  overflow: auto;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    max(18px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(18px, env(safe-area-inset-left, 0px));
  /* Keep the terminal color fully opaque: this is the visible age barrier. */
  background:
    radial-gradient(circle at 50% 5%, rgba(255, 255, 255, 0.08), transparent 38%),
    #08080a;
  color: #f7f7f8;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.age-gate-card {
  width: min(100%, 460px);
  padding: clamp(26px, 6vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(18, 18, 21, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.age-gate-brand,
.age-gate-eyebrow,
.age-gate-description,
.age-gate-note,
.age-gate-status,
.age-gate-card h1 {
  margin: 0;
}

.age-gate-brand {
  margin-bottom: 24px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.age-gate-eyebrow {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.age-gate-card h1 {
  font-size: clamp(1.65rem, 6vw, 2.35rem);
  line-height: 1.2;
}

.age-gate-description {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.75;
}

.age-gate-actions {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.age-gate-button {
  min-height: 50px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.age-gate-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.age-gate-button-primary {
  background: #f4f4f5;
  color: #09090b;
}

.age-gate-button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f7f8;
}

.age-gate-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.88);
  outline-offset: 3px;
}

.age-gate-status {
  min-height: 1.4em;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  line-height: 1.5;
}

.age-gate-note {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.74rem;
  line-height: 1.65;
}

.age-gate-noscript-panel {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #08080a;
  color: #f7f7f8;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-align: center;
}

.age-gate-noscript-panel > div {
  width: min(100%, 440px);
}

.age-gate-noscript-panel strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.35rem;
}

.age-gate-noscript-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

@media (max-height: 560px) {
  .age-gate-root {
    place-items: start center;
  }

  .age-gate-card {
    padding: 22px;
    border-radius: 18px;
  }

  .age-gate-brand {
    margin-bottom: 14px;
  }

  .age-gate-description {
    margin-top: 12px;
    line-height: 1.55;
  }

  .age-gate-actions {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .age-gate-root *,
  .age-gate-root *::before,
  .age-gate-root *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
