/* =========================================================
   Legal Documentation — Shared Base Styles
   Reusable across all game legal pages on razzaq94.com
   Game-specific themes override CSS custom properties.
   ========================================================= */

:root {
  --legal-bg-deep: #080b12;
  --legal-bg-mid: #101722;
  --legal-bg-panel: #182331;
  --legal-text-muted: #aab5c1;
  --legal-text: #f3f6fa;
  --legal-accent: #ffd21f;
  --legal-accent-soft: #50c7ff;
  --legal-border: #2a3544;
  --legal-focus: #50c7ff;
  --legal-max-width: 46rem;
  --legal-radius: 1rem;
  --legal-font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --legal-font-body: Inter, "Segoe UI", system-ui, sans-serif;
  --legal-space-xs: 0.5rem;
  --legal-space-sm: 0.75rem;
  --legal-space-md: 1.25rem;
  --legal-space-lg: 2rem;
  --legal-space-xl: 3rem;
  --legal-space-2xl: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.legal-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--legal-font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--legal-text);
  background-color: var(--legal-bg-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.legal-page a {
  color: var(--legal-accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.legal-page a:hover {
  color: var(--legal-accent);
}

.legal-page a:focus-visible {
  outline: 2px solid var(--legal-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.legal-skip-link {
  position: absolute;
  left: var(--legal-space-md);
  top: -100px;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--legal-bg-panel);
  color: var(--legal-text);
  border: 1px solid var(--legal-border);
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

.legal-skip-link:focus {
  top: var(--legal-space-md);
}

.legal-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 56rem);
  margin: 0 auto;
  padding: var(--legal-space-lg) 0 var(--legal-space-xl);
}

@media (min-width: 768px) {
  .legal-shell {
    width: min(100% - 3rem, 56rem);
    padding-top: var(--legal-space-xl);
  }
}

/* Identity */
.legal-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 var(--legal-space-lg);
  padding: 0.35rem 0 1.15rem;
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  position: relative;
  z-index: 2;
}

a.legal-identity:hover .legal-identity__title,
a.legal-identity:focus-visible .legal-identity__title {
  color: var(--legal-accent-soft);
}

a.legal-identity:focus-visible {
  outline: 2px solid var(--legal-focus);
  outline-offset: 4px;
  border-radius: 0.5rem;
}

.legal-identity__mark {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin: 4px;
  border-radius: 50%;
  border: 1px solid var(--legal-border);
  background:
    radial-gradient(circle at 35% 35%, #dfe6ee 0%, #9aa7b5 42%, #5d6a78 70%, #2a3544 100%);
  box-shadow:
    inset -6px -4px 10px rgba(8, 11, 18, 0.45),
    0 0 0 1px rgba(80, 199, 255, 0.12);
}

.legal-identity__text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  overflow: visible;
}

.legal-identity__title {
  margin: 0;
  font-family: var(--legal-font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--legal-text);
  line-height: 1.35;
  overflow: visible;
  white-space: nowrap;
}

.legal-identity__label {
  margin: 0;
  font-size: clamp(0.62rem, 2.4vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--legal-text-muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Hero */
.legal-hero {
  margin-bottom: var(--legal-space-xl);
}

.legal-hero__label {
  display: inline-block;
  margin: 0 0 var(--legal-space-sm);
  font-family: var(--legal-font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--legal-accent);
}

.legal-hero h1 {
  margin: 0 0 var(--legal-space-md);
  font-family: var(--legal-font-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--legal-text);
}

.legal-hero__subtitle {
  margin: 0 0 var(--legal-space-md);
  max-width: 36rem;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--legal-text-muted);
}

.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--legal-text-muted);
}

.legal-hero__meta strong {
  color: var(--legal-text);
  font-weight: 600;
}

/* Document panel */
.legal-document {
  background: var(--legal-bg-panel);
  border: 1px solid var(--legal-border);
  border-radius: var(--legal-radius);
  padding: clamp(1.35rem, 4vw, 2.75rem);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.legal-document > :first-child {
  margin-top: 0;
}

.legal-section {
  margin: 0;
  padding: var(--legal-space-lg) 0;
  border-top: 1px solid rgba(42, 53, 68, 0.9);
}

.legal-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.legal-section:last-of-type {
  padding-bottom: 0;
}

.legal-section__number {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--legal-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--legal-accent);
}

.legal-section h2 {
  margin: 0 0 var(--legal-space-md);
  font-family: var(--legal-font-display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--legal-text);
}

.legal-section h3 {
  margin: var(--legal-space-lg) 0 var(--legal-space-sm);
  font-family: var(--legal-font-display);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--legal-text);
}

.legal-section p,
.legal-section li {
  color: #e4eaf1;
}

.legal-section p {
  margin: 0 0 var(--legal-space-md);
  max-width: var(--legal-max-width);
}

.legal-section p:last-child,
.legal-section ul:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0 0 var(--legal-space-md);
  padding-left: 1.25rem;
  max-width: var(--legal-max-width);
}

.legal-section li {
  margin-bottom: 0.45rem;
}

.legal-section li::marker {
  color: var(--legal-accent-soft);
}

.legal-section code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
  background: rgba(8, 11, 18, 0.55);
  border: 1px solid rgba(42, 53, 68, 0.9);
  color: var(--legal-accent-soft);
  word-break: break-word;
}

.legal-note {
  margin: var(--legal-space-md) 0 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--legal-accent-soft);
  background: rgba(80, 199, 255, 0.06);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.95rem;
  color: var(--legal-text-muted);
}

/* Footer */
.legal-footer {
  margin-top: var(--legal-space-xl);
  padding-top: var(--legal-space-lg);
  border-top: 1px solid var(--legal-border);
}

.legal-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 var(--legal-space-md);
  padding: 0;
  list-style: none;
}

.legal-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0;
  font-weight: 600;
  text-decoration: none;
  color: var(--legal-text-muted);
}

.legal-footer__nav a:hover {
  color: var(--legal-text);
}

.legal-footer__nav a[aria-current="page"] {
  color: var(--legal-accent);
}

.legal-footer__nav a[aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--legal-accent);
}

.legal-footer__copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--legal-text-muted);
}

.legal-footer__copy a {
  color: inherit;
  text-decoration: none;
}

.legal-footer__copy a:hover {
  color: var(--legal-accent-soft);
}

@media (max-width: 380px) {
  .legal-shell {
    width: min(100% - 1.25rem, 56rem);
  }

  .legal-identity {
    margin-bottom: var(--legal-space-lg);
  }

  .legal-hero {
    margin-bottom: var(--legal-space-lg);
  }
}
