/* Consent Gate Modal - shown at registration and re-consent */

.consent-gate-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  /* ABOVE EVERY DECORATIVE OVERLAY. The gate is a legal blocker — nothing may
     sit between the player and it. At 9999 it lost to the invite arrival ticket
     (10050), the starter grant (10020) and the invitation brief (10040), and a
     new player arriving on an invite link had the ticket painted over the Terms
     with every click on the consent checkbox swallowed by it. A signup blocker
     on the exact flow the invite campaign depends on, invisible to any test
     that signs up without an invite link.
     Contract: tests/unit/styles/consentGateOutranksOverlays.test.js */
  z-index: 10200;
  /* flex-start + child margin:auto centres the modal when it fits but lets the
     overlay SCROLL when the modal is taller than a short landscape phone —
     align-items:center would strand the "Create Account" button off-screen
     with no way to reach it (a literal signup blocker). Identical on desktop. */
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(env(safe-area-inset-top, 0px), 16px) 16px max(env(safe-area-inset-bottom, 0px), 16px);
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.consent-gate-overlay.visible {
  display: flex;
  opacity: 1;
}

.consent-gate-modal {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 1px solid rgba(138, 100, 200, 0.3);
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(138, 100, 200, 0.1);
  padding: 36px 32px;
  max-width: 480px;
  width: 90%;
  /* centres in free space, top-aligns + scrolls with the overlay when tall */
  margin: auto;
  text-align: center;
  color: #d4d4e0;
}

.consent-gate-title {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
  margin-bottom: 8px;
}

.consent-gate-subtitle {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 28px;
}

.consent-gate-checkboxes {
  text-align: left;
  margin-bottom: 24px;
}

.consent-gate-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
}

.consent-gate-check input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #8a64c8;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-gate-check label {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #c4c4d4;
  cursor: pointer;
}

/* Optional marketing opt-in: visually de-emphasized so it never reads as a
   gate to entry. Separated from the mandatory rows with a hairline divider. */
.consent-gate-check.consent-gate-optional {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.consent-gate-check.consent-gate-optional label {
  font-size: 0.85rem;
  color: #9f9fb2;
}

/* Recognizable consent-category row: short noun title + Optional pill on the
   first line, a muted one-line description beneath (mirrors the rows inside a
   "Manage preferences" panel). */
.consent-gate-optional-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #d2d2e2;
}

.consent-gate-optional-desc {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #8a8a9c;
}

.consent-gate-optional-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(138, 100, 200, 0.18);
  color: #b99adc;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.consent-gate-info {
  text-align: left;
  margin: -2px 0 16px;
  padding-left: 28px;
}

.consent-gate-info p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #9f9fb2;
}

.consent-gate-info a,
.consent-gate-check label a {
  color: #8a64c8;
  text-decoration: underline;
  text-decoration-color: rgba(138, 100, 200, 0.4);
}

.consent-gate-info a:hover,
.consent-gate-check label a:hover {
  color: #b99adc;
}

.consent-gate-submit {
  background: linear-gradient(135deg, #8a64c8, #6b4e9e);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s, transform 0.15s;
}

.consent-gate-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.consent-gate-submit:not(:disabled):hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Re-consent variant (for ToS/Privacy updates) */
.consent-gate-modal.re-consent .consent-gate-title {
  font-size: 1.4rem;
}

.consent-gate-updated-badge {
  display: inline-block;
  background: rgba(138, 100, 200, 0.2);
  color: #b99adc;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

@media (max-width: 500px) {
  .consent-gate-modal {
    padding: 24px 20px;
  }

  .consent-gate-title {
    font-size: 1.3rem;
  }
}
