/* Legal pages (/terms, /privacy): same Truth Glass look, tuned for long reading. Content = /legal/<doc>.json (shared with the game). */
.lg { --toc-w: 280px; }
.lg .scene__poster { filter: blur(10px); transform: scale(1.08); }
.lg .scene::after { background: rgba(15, 27, 45, .28); }
.lg .nav__inner { padding-right: 8px; }
.lg__docs { display: flex; gap: 4px; margin-left: auto; }
.lg__docs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: 15px; color: var(--ink-2); transition: color .25s, background-color .25s; }
.lg__docs a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.lg__docs a[aria-current="page"] { color: var(--navy); background: #fff; font-weight: 500; }
.lg__lang { flex: none; display: flex; height: 40px; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 1px var(--line) inset; }
.lg__lang button { min-width: 48px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .25s, color .25s; }
.lg__lang button[aria-pressed="true"] { background: #fff; color: var(--navy); }

.lg__progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.lg__progress i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }

.lg__wrap { max-width: var(--maxw); margin: 0 auto; padding: calc(var(--nav-h) + 28px) var(--pad) 0; display: grid; grid-template-columns: var(--toc-w) minmax(0, 1fr); gap: 24px; align-items: start; }
.lg__toc { position: sticky; top: calc(var(--nav-h) + 20px); max-height: calc(100svh - var(--nav-h) - 40px); overflow: auto; padding: 20px 14px 18px; border-radius: var(--r-md); scrollbar-width: thin; }
.lg__tocTitle { display: flex; align-items: center; gap: 8px; padding: 0 10px 10px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); list-style: none; }
.lg__tocTitle::-webkit-details-marker { display: none; }
.lg__tocTitle i { font-style: normal; letter-spacing: 0; }
.lg__top[hidden] { display: none; }
.lg__toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.lg__toc a { display: block; padding: 7px 10px; border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); text-decoration: none; transition: background-color .2s, color .2s; }
.lg__toc a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lg__toc a.is-on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 500; }
.lg__print { width: 100%; margin-top: 14px; }

.lg__doc { padding: clamp(24px, 4vw, 52px); min-width: 0; }
.lg__head h1 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.25; }
.lg__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.lg__meta div { padding: 8px 14px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .07); }
.lg__meta dt { font-size: 12px; color: var(--ink-3); }
.lg__meta dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.lg__binding { margin-top: 14px; font-size: 14px; color: var(--ink-3); max-width: 70ch; }
.lg__binding:empty { display: none; }

.lg__summary { margin: 28px 0 8px; padding: 22px 24px; border-radius: var(--r-md); background: rgba(79, 147, 216, .16); border: 1px solid rgba(124, 178, 232, .35); }
.lg__summary h2 { font-size: 19px; margin-bottom: 10px; }
.lg__summary ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 72ch; }
.lg__sumNote { margin-top: 12px; font-size: 13px; color: var(--ink-3); }

/* reading column: ~70ch measure, generous leading for Thai */
.lg__sections { max-width: 74ch; }
.lg__sec { padding-top: 34px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.lg__sec + .lg__sec { margin-top: 6px; border-top: 1px solid var(--line); }
.lg__sec > h2 { position: relative; font-size: clamp(21px, 2.2vw, 25px); line-height: 1.35; margin-bottom: 12px; }
.lg__anchor { position: absolute; left: -1.3em; top: 0; padding: 0 .3em; color: var(--ink-3); text-decoration: none; opacity: 0; transition: opacity .2s; font-weight: 400; }
.lg__sec > h2:hover .lg__anchor, .lg__anchor:focus-visible { opacity: 1; }
.lg__anchor.is-copied::after { content: attr(data-copied); position: absolute; left: 1.4em; top: 2px; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--mint); color: #fff; }
.lg__sec h3 { font-size: 17px; font-weight: 600; margin: 20px 0 6px; }
.lg__sec p, .lg__sec li { font-size: 16.5px; line-height: 1.85; color: rgba(255, 255, 255, .88); }
.lg__sec p + p { margin-top: 12px; }
.lg__sec ul, .lg__sec ol { margin: 10px 0; padding-left: 24px; display: grid; gap: 6px; }
.lg__sec li::marker { color: var(--ink-3); }
.lg__sec strong { color: #fff; font-weight: 600; }
.lg__sec a { color: #A9D2FF; text-underline-offset: 3px; word-break: break-word; }
.lg__note { display: flex; gap: 12px; margin: 14px 0; padding: 14px 16px; border-radius: var(--r-sm); background: rgba(224, 176, 90, .14); border: 1px solid rgba(224, 176, 90, .42); }
.lg__note::before { content: "!"; flex: none; width: 24px; height: 24px; margin-top: 3px; border-radius: 50%; display: grid; place-items: center; background: var(--honey); color: #3A2A0C; font-weight: 700; font-size: 14px; }
.lg__note p { margin: 0; }
.lg__table { margin: 14px 0; overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.lg__table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; min-width: 520px; }
.lg__table th, .lg__table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.lg__table th { position: sticky; top: 0; background: rgba(20, 32, 58, .95); font-weight: 600; font-size: 14px; color: #fff; }
.lg__table tr:last-child td { border-bottom: 0; }
.lg__table tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }
.lg__table td { color: rgba(255, 255, 255, .86); }
.lg__skel { display: grid; gap: 12px; padding-top: 30px; }
.lg__skel .skel { height: 16px; border-radius: 6px; }
.lg__err { padding: 30px 0; color: var(--ink-2); }

.lg__top { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; width: 46px; height: 46px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(13, 21, 40, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 1px var(--line) inset; color: #fff; transition: opacity .3s, transform .4s var(--ease); }
.lg__top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg__top:hover { transform: translateY(-2px); }
.lg .foot { margin-top: 80px; }

@media (max-width: 1024px) {
  .lg__wrap { grid-template-columns: 1fr; }
  .lg__toc { position: static; max-height: none; padding: 6px 8px; }
  .lg__tocTitle { min-height: 48px; padding: 0 12px; margin: 0; cursor: pointer; font-size: 15px; letter-spacing: 0; text-transform: none; color: #fff; font-weight: 500; }
  .lg__tocTitle i { margin-left: auto; color: var(--ink-3); font-size: 13px; }
  .lg__tocTitle::after { content: ""; width: 9px; height: 9px; margin: -4px 4px 0 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .3s var(--ease); }
  .lg__tocBox[open] .lg__tocTitle::after { transform: translateY(4px) rotate(-135deg); }
  .lg__tocBox[open] ol { padding-bottom: 8px; animation: swapin .35s var(--ease); }
  .lg__toc ol { grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .lg__print { display: none; }
}
@media (max-width: 760px) {
  .lg__docs a { padding: 8px 10px; font-size: 14px; }
  .lg .nav__logo { display: none; }
  .lg__docs { margin-left: 0; }
  .lg__lang { margin-left: auto; }
  .lg__toc ol { grid-template-columns: 1fr; }
  .lg__doc { padding: 22px 18px; border-radius: var(--r-md); }
  .lg__sec p, .lg__sec li { font-size: 16px; line-height: 1.8; }
  .lg__anchor { display: none; }
}

@media print {
  .scene, .nav, .lg__toc, .lg__top, .lg__progress, .foot, .skip { display: none !important; }
  body, .lg { background: #fff !important; color: #000 !important; }
  .lg__wrap { display: block; padding: 0; max-width: none; }
  .glass, .lg__doc { background: none !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; padding: 0 !important; }
  .lg__sec p, .lg__sec li, .lg__table td, .lg__meta dd, .lg__binding, .lg__sumNote, .lg__meta dt { color: #000 !important; }
  .lg__summary, .lg__note, .lg__meta div { background: none !important; border: 1px solid #999 !important; }
  .lg__table th { position: static; background: #eee !important; color: #000 !important; }
  .lg__sections { max-width: none; }
  .lg__sec { break-inside: avoid-page; }
  .lg__sec a { color: #000; }
  .lg__sec a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 12px; }
}
