/* legal.css -- shared styling for the Terms of Service and Privacy
   Policy content. The standalone pages (views/tos.html,
   views/privacy.html) and the popup index.html opens over the
   register form both render the same ".legal-content" markup with
   this one stylesheet, so the wording is only ever edited in one
   place. Loaded after theme.css; uses its colour variables. Needs the
   Cinzel/Alegreya Sans/PT Sans Narrow fonts (see index.html's <link>s)
   for the titles to look right, but falls back gracefully without them. */

.legal-content {
  font-family: var(--body-font, "Alegreya Sans", "Segoe UI", sans-serif);
  color: #cdbfb3;
  line-height: 1.6;
}

.legal-content h1 {
  margin: 0 0 18px;
  font-family: var(--title-font, "Cinzel", Georgia, serif);
  font-size: 28px;
  color: var(--accent);
}

.legal-content h2 {
  margin: 1.6em 0 0.5em;
  font-family: var(--title-font, "Cinzel", Georgia, serif);
  font-size: 17px;
  letter-spacing: 0.03em;
  color: #e8c98a;
}

.legal-content p { margin: 0 0 1em; }
.legal-content a { color: var(--accent); }
.legal-content a:hover { color: #e8b968; }

.legal-content table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 14px; }
.legal-content th, .legal-content td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #4a3222;
}
.legal-content th { color: #e8c98a; font-family: var(--btn-font, inherit); }

.legal-note {
  background: #1f232c;
  border: 1px solid #7a4d30;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 1.6em;
  color: #a8998c;
}
.legal-note strong { color: #e8c98a; }
.legal-note code { color: #cdbfb3; }

/* ===== Standalone page (views/tos.html, views/privacy.html) =====
   Same background as the login page (fantasy.css's body rule),
   repeated here rather than shared, since these pages don't otherwise
   need the rest of fantasy.css's frame/parchment layout. */
body.legal-body {
  margin: 0;
  min-height: 100vh;
  background: #0c0a09 url("../images/background.jpg") center bottom / cover no-repeat fixed;
  color: #cdbfb3;
  font-family: var(--body-font, "Alegreya Sans", "Segoe UI", sans-serif);
}
body.legal-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0.1), rgba(0,0,0,0.6));
  pointer-events: none;
}
.legal-page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}
.legal-back { margin: 0 0 24px; }
.legal-back a {
  font-family: var(--btn-font, "PT Sans Narrow", "Arial Narrow", sans-serif);
  color: var(--accent);
  text-decoration: none;
}
.legal-back a:hover { text-decoration: underline; }

/* ===== Popup opened from the register form (index.html) ===== */
.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8,7,6,0.72);
}
.legal-overlay[hidden] { display: none; }

.legal-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(82vh, 640px);
  padding: 34px 30px 28px;
  background: linear-gradient(180deg, #201c19, #16130f);
  border: 2px solid #7a4d30;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
}

.legal-modal-body {
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
  scrollbar-width: thin;
  scrollbar-color: #7a4d30 transparent;
}

.legal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #cdbfb3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.legal-close:hover { color: #fff; background: rgba(0,0,0,0.55); }
.legal-close:focus-visible { outline: 2px solid #d08a4c; outline-offset: 2px; }
