/* Legal pages, beta feedback and the site footer. Layered on the tokens in
   css/styles.css; reuses the rulebook pattern from the Rules page. */

/* ───────── Site footer ───────── */
.site-footer {
  position: relative; z-index: 2;
  margin-top: 56px; padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 28px;
  font-size: 12.5px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--text-2); text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 4px; }
.site-footer a:focus-visible, .legal a:focus-visible, .legal-tabs a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.site-footer p { margin: 0; }
/* Out of the way while a question is on the clock. */
body[data-view="play"] .site-footer { display: none; }

/* ───────── Document layout ───────── */
.legal-tabs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 26px; }
.legal-tabs a {
  padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; color: var(--text-2); text-decoration: none; transition: border-color .2s, color .2s;
}
.legal-tabs a:hover { color: var(--text); border-color: rgba(217, 182, 106, 0.4); }
.legal-tabs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }

.legal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.legal-meta { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.legal-doc .rb-sec h2 { display: contents; font-family: var(--font-display); font-weight: 400; }
.legal-doc .rb-sec h2:focus { outline: none; }
.legal-doc .rb-sec .rb-t { font-size: 25px; line-height: 1.15; margin-bottom: 10px; }
.legal-body { grid-column: 2; }
.legal-body p, .legal-body li { font-size: 15.5px; line-height: 1.72; color: var(--text-2); max-width: 64ch; }
.legal-body p { margin: 0 0 12px; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body ul { margin: 0 0 12px; padding-left: 20px; }
.legal-body li { margin-bottom: 6px; }
.legal-body li::marker { color: var(--gold); }
.legal-body b { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(217, 182, 106, 0.4); text-underline-offset: 3px; }
.legal a:hover { text-decoration-color: var(--accent); }
.legal-tabs a, .legal-toc a { text-decoration: none; }

.legal-callout { border: 1px solid var(--panel-line); background: var(--well); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 14px; }
.legal-callout p { color: var(--text); }

.legal-table-wrap { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.legal-table th, .legal-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--text-2); }
.legal-table th { font-weight: 600; color: var(--text); font-size: 12.5px; background: var(--well); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table td[rowspan] { border-left: 1px solid var(--line); }

.legal-toc { position: sticky; top: 24px; padding: 20px 22px; }
.legal-toc ol { list-style: none; margin: 10px 0 0; padding: 0; }
.legal-toc li { padding: 5px 0; }
.legal-toc a { color: var(--text-2); font-size: 13.5px; }
.legal-toc a:hover { color: var(--accent); }

/* Details the operator still has to supply. */
.legal-todo { color: var(--danger); font-weight: 600; }
.legal-todo-block { border-left: 2px solid var(--danger); padding-left: 10px; }

/* ───────── Beta feedback form ───────── */
.beta-form { display: grid; gap: 18px; }
.beta-kinds { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.beta-kinds legend { font-family: var(--font-display); font-size: 23px; margin-bottom: 8px; padding: 0; }
.beta-kind { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); transition: border-color .2s; }
.beta-kind:hover { border-color: rgba(217, 182, 106, 0.4); }
.beta-kind:has(input:checked) { border-color: rgba(217, 182, 106, 0.6); color: var(--text); background: var(--well); }
.beta-kind input { accent-color: var(--gold); margin: 0; }
.beta-kind input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.beta-field { display: grid; gap: 6px; }
.beta-field[hidden] { display: none; }
.beta-field label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.beta-field .input { width: 100%; }
.beta-field textarea.input { resize: vertical; min-height: 110px; font: inherit; line-height: 1.55; }
.beta-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.beta-err { margin: 0; font-size: 13px; color: var(--danger); min-height: 0; }
.beta-err:empty { display: none; }
.beta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.beta-notes p { font-size: 14.5px; line-height: 1.7; color: var(--text-2); margin: 12px 0 0; }
.beta-notes b { color: var(--text); }

/* Top nav: "Beta feedback" shortens to "Beta" where the bar gets tight. */
.nav .nav-long { white-space: pre; }
@media (max-width: 600px) { .nav .nav-long { display: none; } }
/* The smallest phones (320px): tighten so all four links still fit. */
@media (max-width: 360px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .nav a { padding: 0 3px; font-size: 12.5px; }
  .nav a.active::after { left: 3px; right: 3px; }
  .brand-mark { font-size: 20px; }
}

@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc { position: static; order: -1; }
}
@media (max-width: 560px) {
  .legal-doc .rb-sec .rb-t { font-size: 22px; }
  .legal-body p, .legal-body li { font-size: 15px; }
  .legal-tabs a { padding: 6px 11px; font-size: 12.5px; }
  .site-footer { flex-direction: column; gap: 12px; }
  .beta-actions .btn { flex: 1 1 auto; }
}

/* ───────── Founder crown (js/founder.js) ───────── */
.founder-crown { display: inline-flex; align-items: center; vertical-align: -2px; margin: 0 1px 0 5px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 4px rgba(233, 196, 106, 0.35)); }
.profile-chip .founder-crown { margin: 0 -1px 0 1px; vertical-align: 0; }
.founder-crown-svg { display: block; overflow: visible; }
