/* Golkito legal pages (privacidad.html, aviso-legal.html). Standalone: same toon tokens as css/toon.css,
   without loading the game UI. Long-form reading first: paper card, ink outlines, 68ch measure. */
:root {
  --ink: #102f29;
  --deep: #123e32;
  --green: #28644c;
  --paper: #fff5dc;
  --yellow: #ffcf48;
  --mint: #b3e9b0;
  --coral: #ff9a77;
  --muted: #4d6558;
  --line: #d9cfae;
  --display: 'Lilita One', 'Arial Black', sans-serif;
  --text: 'Segoe UI', system-ui, -apple-system, 'Trebuchet MS', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 17px/1.65 var(--text);
  background: var(--deep) repeating-linear-gradient(90deg, #143f33 0 96px, #11392e 96px 192px);
}
/* Language: without JS both versions stay visible; js/legal.js sets html[data-lang] before first paint. */
html[data-lang="es"] [data-l="en"], html[data-lang="en"] [data-l="es"] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 10px 14px; border: 3px solid var(--ink);
  border-radius: 10px; background: var(--yellow); color: var(--ink); font-weight: 800; }
.skip:focus { top: 12px; }
a { color: #8a3f1f; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #f8be32; outline-offset: 3px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px clamp(14px, 4vw, 32px); background: #153e32; border-bottom: 3px solid #0b3025; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { display: block; width: auto; height: 38px; filter: drop-shadow(0 2px 0 rgba(4, 24, 19, .55)); }
.lang-switch { display: inline-flex; padding: 3px; gap: 3px; border: 2px solid #0c2d26; border-radius: 12px; background: #0f3429; }
.lang-switch button { min-width: 44px; min-height: 36px; padding: 4px 10px; border: 2px solid transparent; border-radius: 9px;
  background: transparent; color: #cfe3cf; font: 400 17px var(--display); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px #091f19; }
.lang-switch button:not([aria-pressed="true"]):hover { background: #285841; color: var(--paper); }
html:not([data-lang]) .lang-switch { display: none; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 3px solid var(--ink);
  border-radius: 12px; background: var(--yellow); color: var(--ink); text-decoration: none; font: 400 18px var(--display);
  box-shadow: inset 0 3px #fff5b27a, 0 4px 0 var(--ink); white-space: nowrap; }
.back:hover { background: #ffdf75; color: var(--ink); transform: translateY(-1px); }
.back:active { transform: translateY(3px); box-shadow: inset 0 3px #fff5b27a, 0 1px 0 var(--ink); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Page */
.page { max-width: 1120px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(12px, 3vw, 28px) 56px; }
.doc { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.doc + .doc { margin-top: 36px; }
.hero { grid-column: 1 / -1; color: var(--paper); }
.hero .kicker { display: inline-block; margin: 0 0 12px; padding: 5px 11px; border: 2px solid var(--ink); border-radius: 6px;
  background: var(--coral); color: #263f30; box-shadow: 2px 3px var(--ink); transform: rotate(-2deg);
  font: 400 15px var(--display); letter-spacing: .3px; }
.hero h1 { margin: 0; font: 400 clamp(34px, 6vw, 56px)/1.02 var(--display); letter-spacing: .2px; text-shadow: 2px 3px #092920; }
.hero p { margin: 10px 0 0; max-width: 62ch; color: #d6e8d2; }
.hero .updated { font-size: 15px; color: var(--mint); }

.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; padding: 16px 16px 12px;
  border: 3px solid var(--ink); border-radius: 16px; background: #1b4a3b; color: var(--paper); box-shadow: 0 5px 0 var(--ink); }
.toc h2 { margin: 0 0 8px; font: 400 18px var(--display); color: var(--yellow); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; padding: 6px 4px; border-radius: 8px; color: #e8f1e2; text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.toc a::before { content: counter(toc); flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 6px;
  background: #0f3429; color: var(--mint); font: 400 13px var(--display); }
.toc a:hover { background: #285841; color: #fff; }

.sheet { min-width: 0; padding: clamp(20px, 4vw, 44px); border: 3px solid var(--ink); border-radius: 18px; background: var(--paper);
  box-shadow: 0 6px 0 var(--ink); }
.sheet > :first-child { margin-top: 0; }
.sheet section { max-width: 72ch; }
.sheet section + section { margin-top: 34px; padding-top: 26px; border-top: 2px dashed var(--line); }
.sheet h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font: 400 clamp(23px, 3vw, 28px)/1.15 var(--display); }
.sheet h2 .n { flex: 0 0 auto; min-width: 34px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--yellow);
  box-shadow: 0 3px var(--ink); text-align: center; font-size: .78em; transform: rotate(-3deg); }
.sheet h3 { margin: 22px 0 6px; font-size: 18px; font-weight: 800; }
.sheet p, .sheet li { margin: 0 0 10px; }
.sheet ul { padding-left: 22px; margin: 0 0 12px; }
.sheet li::marker { color: var(--green); }
.sheet strong { font-weight: 750; }
code { padding: 1px 5px; border-radius: 5px; background: #efe3bf; font: 14.5px/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }

.summary { margin: 0 0 30px; padding: 16px 18px 8px; border: 2px solid var(--ink); border-radius: 14px; background: #e3f3d9; box-shadow: 0 4px 0 var(--ink); }
.summary h2 { font-size: 22px; }
.note { padding: 12px 14px; border-left: 5px solid var(--green); border-radius: 0 10px 10px 0; background: #f4ebcd; }
.idcard { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; padding: 14px 16px;
  border: 2px solid var(--ink); border-radius: 12px; background: #fffbef; }
.idcard dt { font-weight: 800; }
.idcard dd { margin: 0; overflow-wrap: anywhere; }

.table-wrap { margin: 8px 0 16px; overflow-x: auto; border: 2px solid var(--ink); border-radius: 12px; background: #fffbef; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--deep); color: var(--paper); font-weight: 700; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 750; }

/* "Your data" box (privacy page): export link always works; the delete form needs JS and a session. */
.data-box { margin: 14px 0 6px; padding: 16px 18px; border: 3px solid var(--ink); border-radius: 14px; background: #fffbef; box-shadow: 0 4px 0 var(--ink); }
.data-box h3 { margin-top: 0; }
.data-box [hidden] { display: none !important; }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 10px;
  background: #e8eedb; color: var(--ink); box-shadow: 0 3px 0 var(--ink); font: 700 15px var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: #fffaf0; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { background: #f6c3b3; color: #6b1d0c; }
.btn.danger:hover:not(:disabled) { background: #ffd9cc; }
.delete-form { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); }
.delete-form label { display: block; margin-bottom: 6px; font-weight: 700; }
.delete-form input { min-height: 44px; width: min(220px, 100%); padding: 8px 12px; border: 2px solid var(--ink); border-radius: 10px;
  background: #fff; color: var(--ink); font: 700 16px var(--text); letter-spacing: 1px; }
.status { margin: 8px 0 0; font-weight: 700; }
.status:empty { display: none; }
.status[data-kind="error"] { color: #a3321a; }
.status[data-kind="ok"] { color: var(--green); }

.pagefoot { max-width: 1120px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 28px) 40px; color: #cfe3cf; font-size: 14px; }
.pagefoot a { color: var(--yellow); }
.pagefoot p { margin: 4px 0; }

@media (max-width: 900px) {
  .doc { grid-template-columns: 1fr; gap: 18px; }
  .toc { position: static; max-height: none; }
  .toc ol { columns: 2 220px; column-gap: 12px; }
  .toc li { break-inside: avoid; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  html { scroll-padding-top: 120px; }
  .topbar { flex-wrap: nowrap; gap: 10px; }
  .brand img { height: 30px; }
  .lang-switch button { min-width: 40px; }
  /* Icon-only back button keeps the bar on one row; the label stays for screen readers. */
  .back { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .back-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .toc { padding: 12px 12px 8px; }
  .toc a { padding: 4px; font-size: 15px; }
  .sheet { border-radius: 14px; }
  .idcard { grid-template-columns: 1fr; }
  .idcard dt { margin-top: 6px; }
  /* Tables become labelled cards: no sideways scrolling for long legal text. */
  .table-wrap { overflow: visible; border: 0; background: none; }
  table, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { margin-bottom: 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fffbef; overflow: hidden; }
  tbody th { background: #e3f3d9; border-bottom: 1px solid var(--line); }
  td { border-bottom: 1px dashed var(--line); }
  td[data-h]::before { content: attr(data-h); display: block; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
}
@media print {
  body { background: #fff; }
  .topbar, .toc, .data-box, .skip { display: none !important; }
  .doc { display: block; }
  .hero { color: #000; } .hero h1 { text-shadow: none; } .hero p, .hero .updated { color: #000; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
}
