/* ==========================================================================
   S9 GAME — legal.css  (privacy-policy.html, terms.html)
   ========================================================================== */

.legal {
  display: grid;
  gap: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}

/* --- Table of contents --- */
.toc {
  border-radius: var(--r-md);
  border: 1px solid var(--color-border);
  background: var(--grad-surface);
  padding: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  box-shadow: var(--shadow-card);
}
.toc__title {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--color-border);
}
.toc__list { counter-reset: toc; }
.toc__list li { counter-increment: toc; margin-bottom: 0.2rem; }
.toc__list a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--color-text-muted);
  border-inline-start: 2px solid transparent;
  transition: all var(--dur-fast);
}
.toc__list a::before {
  content: counter(toc, decimal-leading-zero) '. ';
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.toc__list a:hover {
  color: var(--color-text-primary);
  background: rgba(46, 21, 27, 0.5);
  border-inline-start-color: var(--color-border-hair-2);
}
.toc__list a.is-active {
  color: var(--color-gold-soft);
  background: rgba(122, 17, 40, 0.2);
  border-inline-start-color: var(--color-gold);
}

.legal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--sp-6);
}
.legal__meta span {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-xs);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: rgba(26, 11, 15, 0.6);
}

/* --- Article sections --- */
.legal__section {
  padding-top: var(--sp-7);
  margin-top: var(--sp-7);
  border-top: 1px solid var(--color-border-soft);
  scroll-margin-top: 110px;
}
.legal__section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.legal__section > h2 {
  font-size: var(--fs-h3);
  margin-bottom: var(--sp-4);
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
}
.legal__section > h2 .n {
  font-size: 0.72em;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.legal__section h3 {
  font-size: var(--fs-lg);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-3);
  color: var(--color-gold-soft);
}
.legal__section p,
.legal__section li { font-size: var(--fs-sm); }
.legal__section ul,
.legal__section ol {
  padding-left: 1.35rem;
  margin-bottom: var(--sp-4);
}
html[dir='rtl'] .legal__section ul,
html[dir='rtl'] .legal__section ol { padding-left: 0; padding-right: 1.35rem; }
.legal__section li { margin-bottom: 0.5rem; }
.legal__section li::marker { color: var(--color-gold); }
.legal__section a {
  color: var(--color-gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border-hair-2);
}
.legal__section a:hover { color: var(--color-gold); }

.deflist {
  display: grid;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}
.deflist__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(26, 11, 15, 0.45);
}
.deflist__row:last-child { border-bottom: 0; }
.deflist__term { font-weight: 700; color: var(--color-text-primary); font-size: var(--fs-sm); }
.deflist__def { font-size: var(--fs-sm); color: var(--color-text-secondary); }

@media (min-width: 640px) {
  .deflist__row { grid-template-columns: 200px 1fr; gap: var(--sp-4); }
}

@media (min-width: 1024px) {
  .legal { grid-template-columns: 280px 1fr; gap: var(--sp-8); }
  .toc {
    position: sticky;
    top: 108px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}
