/* Topos · Cómo jugar
   Paleta de carta aeronáutica: papel frío, tinta pizarra, azul de agua,
   magenta de pin y curvas de nivel ocre. */

/* Archivo (SIL OFL 1.1, ver fonts/OFL.txt), servida desde este mismo sitio. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f3f4ef;
  --paper-2: #e6e9e0;
  --paper-3: #dadfd2;
  --ink: #17232c;
  --ink-2: #4b5b64;
  --blue: #1f5f8b;
  --pin: #b0176b;
  --contour: #c29a6b;
  --rule: #c9cfc3;
  --ok: #2f6b3f;
  --tier-b: #a7724a;
  --tier-p: #8c979e;
  --tier-o: #c9a227;
  --tier-l: #7a3fa0;
  --radius: 6px;
  --measure: 68ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1b24;
    --paper-2: #16252f;
    --paper-3: #1e313d;
    --ink: #e4eae5;
    --ink-2: #9fb1b8;
    --blue: #82b8db;
    --pin: #f070b4;
    --contour: #6e5c45;
    --rule: #2a3d49;
    --ok: #7cc48f;
    --tier-b: #c98e62;
    --tier-p: #b3bec4;
    --tier-o: #e0bd45;
    --tier-l: #b27ad6;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variation-settings: "wdth" 100;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
}

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pin); outline-offset: 2px; border-radius: 2px; }

code, kbd {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 50;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--ink); text-decoration: none;
  font-weight: 800; font-variation-settings: "wdth" 125; font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.topbar .status {
  margin-left: auto;
  font-size: 0.85rem; color: var(--ink-2);
}
.topbar .status b { color: var(--ok); font-weight: 650; }
.toc-toggle { display: none; }

/* ---------- Portada ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero-map {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero-map .c { fill: none; stroke: var(--contour); stroke-width: 1.1; opacity: 0.75; }
.hero-map .c.idx { stroke-width: 2; opacity: 0.9; }
.hero-map .grid { stroke: var(--rule); stroke-width: 1; }
.hero-map .bearing { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.hero-map .ring { fill: none; stroke: var(--pin); stroke-width: 1.5; stroke-dasharray: 3 5; }
.hero-map .sight { fill: var(--blue); }
.hero-map .lbl { fill: var(--ink-2); font: 600 13px "Archivo", sans-serif; }

.hero-inner {
  position: relative;
  max-width: 1180px; margin: 0 auto;
  padding: clamp(3rem, 9vw, 7.5rem) 1rem clamp(2.5rem, 7vw, 5.5rem);
}
.hero h1 {
  margin: 0 0 1.25rem;
  max-width: 14ch;
  font-size: clamp(2.3rem, 6.6vw, 4.9rem);
  line-height: 0.98;
  font-weight: 850;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.015em;
}
.hero .premise {
  max-width: 40ch;
  margin: 0 0 2rem;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
}
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 700; text-decoration: none;
  border: 2px solid var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.secondary { background: var(--paper); color: var(--ink); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

.intel-card {
  position: absolute;
  right: max(1rem, calc((100vw - 1180px) / 2 + 1rem));
  bottom: clamp(1.5rem, 5vw, 3.5rem);
  width: min(320px, 40vw);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 10px 30px -18px rgba(10, 30, 40, 0.5);
}
.hero .promise {
  display: inline-block;
  margin: 1.25rem 0 0;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem; font-weight: 650;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--ok);
  border-radius: var(--radius);
}
.hero .promise a { white-space: nowrap; }
.intel-card p { margin: 0; }
.intel-card .from { color: var(--ink-2); font-size: 0.8rem; margin-bottom: 0.25rem; }

/* ---------- Diseño principal ---------- */

.layout {
  max-width: 1180px; margin: 0 auto;
  padding: 0 1rem 5rem;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 3.5rem;
}

.toc {
  position: sticky; top: 4.2rem;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: 2.5rem 0 1rem;
  font-size: 0.93rem;
}
.toc h2 {
  font-size: 0.95rem; margin: 0 0 0.6rem; color: var(--ink-2);
  font-weight: 650; font-variation-settings: "wdth" 100;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: flex; justify-content: space-between; gap: 0.5rem;
  padding: 0.28rem 0 0.28rem 0.75rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-2); text-decoration: none;
}
.toc a:hover { color: var(--ink); border-left-color: var(--ink-2); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--pin); font-weight: 650; }
  flex: none; width: 7px; height: 7px; margin-top: 0.55em;
  border: 1.5px dashed var(--ink-2); border-radius: 50%;
}

main { min-width: 0; }

section {
  padding-top: 3.5rem;
}
section + section { border-top: 1px solid var(--rule); margin-top: 3.5rem; }

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.08;
  margin: 0 0 1.1rem;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.01em;
  max-width: 24ch;
}
h3 {
  font-size: 1.3rem; line-height: 1.25;
  margin: 2.4rem 0 0.7rem;
  font-weight: 750;
  font-variation-settings: "wdth" 110;
}
h4 { font-size: 1.05rem; margin: 1.6rem 0 0.4rem; font-weight: 700; }

main p, main li { max-width: var(--measure); }
main ul, main ol { padding-left: 1.25rem; }
main li { margin: 0.3rem 0; }
.lede { font-size: 1.15rem; color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }

/* ---------- Avisos ---------- */

.callout {
  max-width: var(--measure);
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: var(--paper-2);
  border-radius: var(--radius);
  border-left: 4px solid var(--pin);
}
.callout p { margin: 0.25rem 0; }
.callout.info { border-left-color: var(--blue); }

/* ---------- Pasos ---------- */

.steps { list-style: none; padding: 0; counter-reset: s; margin: 1.5rem 0; }
.steps > li {
  counter-increment: s;
  position: relative;
  padding: 0 0 1.4rem 3.1rem;
  margin: 0;
}
.steps > li::before {
  content: counter(s);
  position: absolute; left: 0; top: -0.1rem;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-weight: 800; font-size: 0.95rem;
}
.steps > li::after {
  content: ""; position: absolute; left: 1.02rem; top: 2.3rem; bottom: 0.2rem;
  border-left: 2px dotted var(--rule);
}
.steps > li:last-child::after { display: none; }
.steps > li > strong:first-child { display: block; font-size: 1.08rem; }

/* ---------- Pestañas de dispositivo ---------- */

.devices { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1.25rem 0; }
.device {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.6rem;
  background: var(--paper);
}
.device h4 { margin: 0 0 0.5rem; font-size: 1.1rem; font-variation-settings: "wdth" 112; }
.device ol { padding-left: 1.2rem; margin: 0 0 0.6rem; font-size: 0.97rem; }
.device p { font-size: 0.9rem; color: var(--ink-2); margin: 0.4rem 0 0.6rem; }

/* ---------- Tablas ---------- */

.table-wrap { overflow-x: auto; margin: 1.25rem 0; max-width: 100%; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
caption { text-align: left; color: var(--ink-2); font-size: 0.88rem; padding-bottom: 0.4rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 700; border-bottom: 2px solid var(--ink); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }

/* ---------- Cronología de la ronda ---------- */

.clock {
  margin: 1.5rem 0 0.5rem;
  max-width: 760px;
}
.clock-bar {
  position: relative;
  height: 36px;
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.clock-bar .read { position: absolute; top: 0; bottom: 0; left: 0; width: 7.69%; background: repeating-linear-gradient(135deg, var(--paper-3) 0 6px, transparent 6px 12px); }
.clock-bar .open { position: absolute; top: 0; bottom: 0; left: 7.69%; right: 0; background: color-mix(in srgb, var(--blue) 16%, transparent); }
.clock-bar .close { position: absolute; top: 0; bottom: 0; left: 56.4%; width: 15.4%; background: color-mix(in srgb, var(--pin) 30%, transparent); border-left: 2px solid var(--pin); }
.clock-bar .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blue); }
.clock-scale { position: relative; height: 1.6rem; font-size: 0.78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.clock-scale span { position: absolute; transform: translateX(-50%); top: 0.3rem; white-space: nowrap; }
.clock-scale span:first-child { transform: none; }
.clock-scale span:last-child { transform: translateX(-100%); }
.clock-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 1rem; }
.clock-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; border: 1px solid var(--rule); }

.timeline { list-style: none; padding: 0; margin: 1rem 0; max-width: var(--measure); }
.timeline li {
  display: grid; grid-template-columns: 7.2rem 1fr; gap: 1rem;
  padding: 0.65rem 0; margin: 0;
  border-bottom: 1px dotted var(--rule);
}
.timeline .t { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--blue); }
.timeline li.hot .t { color: var(--pin); }

/* ---------- Roles ---------- */

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; max-width: 820px; }
.side { padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--rule); }
.side h4 { margin: 0 0 0.35rem; font-size: 1.15rem; font-variation-settings: "wdth" 115; }
.side p { margin: 0; font-size: 0.96rem; }
.side.agents { border-top: 4px solid var(--blue); }
.side.moles { border-top: 4px solid var(--pin); }

.dm {
  max-width: 420px;
  margin: 1rem 0;
  padding: 0.7rem 0.95rem;
  border-radius: 14px 14px 14px 4px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  font-size: 0.97rem;
}
.dm .who { display: block; font-size: 0.78rem; color: var(--ink-2); margin-bottom: 0.15rem; }

/* ---------- Privacidad ---------- */

.privacy-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin: 1.5rem 0 0.5rem; max-width: 760px;
}
.pcard {
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ok);
  border-radius: var(--radius);
  background: var(--paper);
}
.pcard h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.pcard p { margin: 0; font-size: 0.96rem; }

/* ---------- Medallas ---------- */

.tiers { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1rem 0; font-size: 0.92rem; }
.tier { display: inline-flex; align-items: center; gap: 0.4rem; }
.tier i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tb { background: var(--tier-b); }
.tp { background: var(--tier-p); }
.to { background: var(--tier-o); }
.tl { background: var(--tier-l); }

.medal-cats { list-style: none; padding: 0; margin: 1.25rem 0; max-width: 820px; }
.medal-cats li {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) 2.2rem 1fr;
  gap: 0.75rem; align-items: center;
  padding: 0.5rem 0; margin: 0; max-width: none;
  border-bottom: 1px dotted var(--rule);
  font-size: 0.95rem;
}
.medal-cats .n { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--paper-2); }
.bar span { display: block; height: 100%; }
.bar span + span { box-shadow: inset 1px 0 0 var(--paper); }

.medal-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin: 1.25rem 0; }
.medal {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.4;
}
.medal b { display: flex; align-items: center; gap: 0.45rem; font-size: 1rem; margin-bottom: 0.2rem; }
.medal b i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.medal span { color: var(--ink-2); }

/* ---------- Comandos ---------- */

.cmd-table td:first-child { white-space: nowrap; }

/* ---------- Preguntas ---------- */

.faq details, details.more {
  max-width: var(--measure);
  border-bottom: 1px solid var(--rule);
  padding: 0.25rem 0;
}
.faq summary, details.more summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 2rem 0.7rem 0;
  position: relative;
  font-weight: 700;
  font-size: 1.05rem;
}
.faq summary::-webkit-details-marker, details.more summary::-webkit-details-marker { display: none; }
.faq summary::after, details.more summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 0.55rem;
  font-size: 1.3rem; font-weight: 500; color: var(--pin);
}
details.more:not(details.more + details.more) { border-top: 1px solid var(--rule); margin-top: 1.25rem; }
.faq details[open] summary::after, details.more[open] summary::after { content: "−"; }
.faq details > div, details.more > div { padding: 0 0 0.9rem; }
.faq details > div p, details.more > div p { margin: 0.4rem 0; }

footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 1rem 3rem;
  text-align: center;
  color: var(--ink-2);
  font-size: 0.9rem;
}
footer svg { width: 36px; height: 36px; display: block; margin: 0 auto 0.5rem; }

/* ---------- Teléfono y tableta ---------- */

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc {
    position: fixed; top: 3.3rem; left: 0; right: 0;
    max-height: calc(100vh - 3.3rem);
    padding: 1rem 1rem 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 30px -20px rgba(0,0,0,0.5);
    display: none;
    z-index: 19;
  }
  .toc.open { display: block; }
  .toc-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font: inherit; font-size: 0.9rem; font-weight: 650;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--ink-2); border-radius: 999px;
    background: var(--paper); color: var(--ink);
    cursor: pointer;
  }
  .topbar .status { display: none; }
  .topbar .toc-toggle { margin-left: auto; }
  .intel-card { position: relative; right: auto; bottom: auto; width: auto; max-width: 360px; margin-top: 2rem; }
  .hero-inner { padding-bottom: 2.5rem; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .sides { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 5.6rem 1fr; gap: 0.7rem; }
  .clock-scale .zero { display: none; }
  .medal-cats li { grid-template-columns: 1fr 2rem; }
  .medal-cats .bar { grid-column: 1 / -1; }
  th, td { padding: 0.5rem 0.5rem; }
  section { padding-top: 2.5rem; }
  section + section { margin-top: 2.5rem; }
}
