/**
 * StickPVP Legal Pages
 * Clean, mature, editorial styling matching the dark lobby atmosphere.
 */

:root {
  color-scheme: dark;
  --page: #05070a;
  --bar-bg: rgba(8, 11, 15, 0.92);
  --ink: #f1f5f9;
  --ink-body: #cbd5e1;
  --muted: #8492a6;
  --faint: #475569;
  --line: rgba(255, 255, 255, 0.08);
  --line-subtle: rgba(255, 255, 255, 0.05);
  --accent: #ff9d0a;
  --accent-soft: rgba(255, 157, 10, 0.12);
  --accent-link: #48b0f7;
  --topbar-height: 60px;
  --content-max-width: 780px;
  --font-heading: "Rajdhani", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top Bar ────────────────────────────────────────────────────────── */
.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--bar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.legal-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.legal-topbar__logo {
  height: 30px;
  width: auto;
  display: block;
}

.legal-topbar__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.legal-topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legal-nav-link {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.legal-nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.legal-nav-link.is-active {
  color: var(--ink);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}

.btn-lobby-return {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-lobby-return:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Content Container (Wall of text flow) ─────────────────────────── */
.legal-main {
  width: min(var(--content-max-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

/* Document Header */
.legal-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.legal-header h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.legal-header__date {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Jump to Section Navigation */
.legal-toc {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0 36px;
}

.legal-toc__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.legal-toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc__list li a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-toc__list li a:hover {
  color: var(--accent-link);
  text-decoration: underline;
}

/* ── Text Flow & Headings ──────────────────────────────────────────── */
.legal-section {
  margin-top: 36px;
}

.legal-section--notices {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.legal-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 22px 0 8px;
}

.legal-main p {
  margin: 0 0 16px;
  color: var(--ink-body);
}

.legal-main strong {
  color: #ffffff;
  font-weight: 600;
}

.legal-main ul,
.legal-main ol {
  margin: 0 0 18px 22px;
  padding: 0;
}

.legal-main li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.legal-main a {
  color: var(--accent-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-main a:hover {
  color: #ffffff;
}

/* Notice / Quote Block */
.legal-notice {
  margin: 20px 0;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 4px 4px 0;
  font-size: 14.5px;
}

.legal-notice p {
  margin: 0;
  color: var(--ink);
}

.legal-notice p + p {
  margin-top: 8px;
}

/* Tables */
.legal-table-wrap {
  overflow-x: auto;
  margin: 20px 0 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.legal-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.legal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--ink-body);
  vertical-align: top;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

/* Code / License text */
.legal-code {
  background: #090c10;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #94a3b8;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 14px 0 20px;
}

/* Footer */
.legal-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.legal-footer a {
  color: var(--muted);
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.legal-footer__links {
  display: flex;
  gap: 16px;
}

/* Responsive */
@media (max-width: 680px) {
  .legal-topbar {
    padding: 0 16px;
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .legal-topbar__nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .legal-main {
    padding: 32px 0 60px;
  }
  .legal-header h1 {
    font-size: 26px;
  }
  .legal-toc__list {
    flex-direction: column;
    gap: 8px;
  }
}
