/* AfterHourz.tv compliance layer: age gate, Terms modal, footer legal links.
   Builds on the app's existing .modal / .btn / .eyebrow / .age-label / .fine styles. */

/* Hide the app until age is confirmed. Applied synchronously by compliance.js. */
html.ah-gated #app {
  visibility: hidden;
}
html.ah-locked,
html.ah-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

/* ---- Age gate ---- */
.ah-gate::backdrop {
  background: #09090d;
}
.ah-gate .modal-body {
  display: grid;
  gap: 14px;
  text-align: center;
  justify-items: center;
}
.ah-gate-title {
  font-size: 28px;
  line-height: 1.2;
}
.ah-gate .muted,
.ah-gate-zero {
  font-size: 14px;
}
.ah-gate-zero {
  color: #df9fb9;
  border: 1px solid #75465e;
  background: #9b47651c;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}
.ah-gate .btn {
  margin-top: 6px;
}
.ah-exit {
  margin: 0 auto;
}
.modal.ah-gate .fine {
  display: block;
  margin: 0 !important;
  line-height: 1.6;
}
@media (max-height: 700px) {
  .ah-gate .modal-body {
    gap: 10px;
    padding-block: 24px;
  }
}
.ah-inline-link {
  display: inline;
  padding: 0;
  color: var(--purple);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- Terms modal ---- */
.modal.ah-terms {
  width: min(820px, calc(100% - 32px));
  height: calc(100dvh - 40px);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.modal.ah-terms[open] {
  display: flex;
}
.ah-terms-head,
.ah-terms-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  flex-shrink: 0;
}
.ah-terms-head {
  border-bottom: 1px solid #2c2433;
}
.ah-terms-head h2 {
  font-size: 18px;
}
.ah-terms-close {
  font-size: 24px;
  line-height: 1;
}
.ah-terms-foot {
  border-top: 1px solid #2c2433;
}
.ah-terms-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 22px 28px;
  font-size: 14px;
  line-height: 1.65;
  color: #d9d2e2;
}
.ah-terms-body:focus-visible {
  outline: none;
}

/* Legal document typography: shared by the modal and legal/terms.html. */
.ah-legal h1 {
  font-size: 26px;
  margin: 18px 0 8px;
}
.ah-legal h2 {
  font-size: 18px;
  margin: 30px 0 10px;
  color: var(--text);
  scroll-margin-top: 12px;
}
.ah-legal p,
.ah-legal ul,
.ah-legal ol,
.ah-legal blockquote,
.ah-legal table {
  margin: 0 0 12px;
}
.ah-legal ul,
.ah-legal ol {
  padding-left: 22px;
}
.ah-legal li {
  margin: 4px 0;
}
.ah-legal strong {
  color: var(--text);
}
.ah-legal a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ah-legal hr {
  border: 0;
  border-top: 1px solid #2c2433;
  margin: 24px 0;
}
.ah-legal blockquote {
  border-left: 3px solid var(--accent);
  background: #ffffff08;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}
.ah-legal table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}
.ah-legal th,
.ah-legal td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #2c2433;
}
.ah-legal mark.ah-todo {
  background: #f5c54226;
  color: #f5d27a;
  border-radius: 3px;
  padding: 0 3px;
}

/* ---- Footer legal links (rendered by the app bundle) ---- */
.footer-legal {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-legal button {
  padding: 0;
  font-size: 11px;
  color: #b9adc6;
  font-weight: 600;
}
.footer-legal button:hover {
  color: var(--purple);
}

@media (max-width: 560px) {
  .ah-gate .modal-body {
    padding: 28px 20px;
  }
  .ah-gate-title {
    font-size: 24px;
  }
  .ah-terms-head,
  .ah-terms-foot {
    padding: 14px 16px;
  }
  .ah-terms-body {
    padding: 4px 16px 24px;
  }
}
