:root {
  --paper: #f5f1ea;
  --card: #fffdf9;
  --ink: #1d222b;
  --ink-2: #4d5562;
  --ink-3: #8a909a;
  --line: #e3ddd2;
  --line-strong: #2a303a;
  --accent: #2f5d8a;
  --accent-ink: #ffffff;
  --accent-soft: #dfe8f1;
  --accent-softer: #edf2f7;
  --same: #c9d9ea;
  --warn: #b5432f;
  --warn-soft: #f6dfd9;
  --good: #3c7a52;
  --gold: #b0842b;
  --shadow: 0 1px 2px rgba(29,34,43,.06), 0 6px 20px rgba(29,34,43,.06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --top-h: 60px;
  --bottom-h: 0px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #14171d;
  --card: #1c2028;
  --ink: #e9e6df;
  --ink-2: #b4b2ab;
  --ink-3: #7c7f86;
  --line: #2c313b;
  --line-strong: #a9acb2;
  --accent: #7fb0e0;
  --accent-ink: #0f141b;
  --accent-soft: #243447;
  --accent-softer: #1f2833;
  --same: #2e4560;
  --warn: #ff8f78;
  --warn-soft: #43261f;
  --good: #7cc495;
  --gold: #e0b45a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { line-height: 1.55; margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
  height: calc(var(--top-h) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); }
.brand svg { width: 30px; height: 30px; color: var(--ink); }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tabs button { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-size: 15px; }
.tabs button:hover { color: var(--ink); background: var(--accent-softer); }
.tabs button.on { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; position: relative; color: var(--ink-2); }
.icon-btn:hover { background: var(--accent-softer); color: var(--ink); }
.icon-btn svg { width: 23px; height: 23px; }
.icon-btn .dot { position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--paper); }

/* Móvil: las secciones van arriba, bajo la cabecera. La esquina inferior derecha
   queda libre porque Netlify pone ahí su distintivo en el plan gratuito. */
@media (max-width: 760px) {
  :root { --top-h: 54px; --bottom-h: 0px; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { flex-wrap: wrap; height: auto; row-gap: 0; padding-bottom: 8px; }
  .brand, .top-actions { height: var(--top-h); align-items: center; }
  .brand { font-size: 19px; }
  .brand svg { width: 27px; height: 27px; }
  .tabs {
    order: 3; width: 100%; margin: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    padding: 3px; border-radius: 12px; background: var(--accent-softer);
  }
  .tabs button { padding: 8px 0; font-size: 13.5px; text-align: center; border-radius: 9px; }
  .tabs button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
  body.playing .tabs { display: none; }
  body.playing .topbar { padding-bottom: 0; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- Vistas ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; outline: none; }
@media (max-width: 760px) { main { padding: 20px 16px 32px; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head p { margin-top: 6px; }
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15.5px;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--accent-softer); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.hero { display: grid; gap: 18px; align-content: space-between; min-height: 240px; position: relative; overflow: hidden; }
.hero .big { font-family: var(--serif); font-size: clamp(44px, 8vw, 64px); line-height: 1; font-weight: 600; }
.hero .deco { position: absolute; right: -24px; bottom: -24px; width: 190px; opacity: .9; pointer-events: none; z-index: 0; }
.hero > :not(.deco) { position: relative; z-index: 1; }
.hero .row .btn.ghost { background: var(--card); }
@media (max-width: 520px) { .hero .deco { width: 120px; right: -30px; top: -30px; bottom: auto; opacity: .35; } }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--accent-softer); color: var(--ink-2); }
.pill.d0 { background: #e3efe6; color: #2f6b45; }
.pill.d1 { background: #e5edf6; color: #2f5d8a; }
.pill.d2 { background: #f5ead6; color: #8a6020; }
.pill.d3 { background: #f4e1da; color: #9a3f27; }
.pill.d4 { background: #e9e1f1; color: #5d3b86; }
.pill.d5 { background: #def0ee; color: #2c6e67; }
:root[data-theme="dark"] .pill.d5 { background: #1d3533; color: #8fd3ca; }
:root[data-theme="dark"] .pill.d0 { background: #20352a; color: #8fd0a6; }
:root[data-theme="dark"] .pill.d1 { background: #213246; color: #9cc3ea; }
:root[data-theme="dark"] .pill.d2 { background: #3b2f1b; color: #e8c07a; }
:root[data-theme="dark"] .pill.d3 { background: #3e231b; color: #f1a48f; }
:root[data-theme="dark"] .pill.d4 { background: #30253f; color: #c9aaf0; }

.stat { display: grid; gap: 4px; }
.stat b { font-family: var(--serif); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.list { display: grid; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }

/* Dificultades (modo libre) */
.diffs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 900px) { .diffs { grid-template-columns: repeat(2, 1fr); } }
.diff-card { text-align: left; display: grid; gap: 10px; align-content: start; min-height: 150px; position: relative; transition: transform .1s ease, border-color .15s; }
.diff-card:hover:not(.locked) { transform: translateY(-2px); border-color: var(--accent); }
.diff-card.locked { opacity: .62; cursor: not-allowed; }
.diff-card .bars { display: flex; gap: 3px; }
.diff-card .bars i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.diff-card .bars i.on { background: var(--ink); }
.lock { width: 16px; height: 16px; vertical-align: -2px; }

/* Niveles */
.tier { margin-bottom: 26px; }
.tier-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.tier-head .faint { font-size: 14px; }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.lvl {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; align-content: center; gap: 2px; font-weight: 650; font-size: 17px; font-variant-numeric: tabular-nums;
}
.lvl small { font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.lvl.done { background: var(--accent-softer); border-color: transparent; }
.lvl.done small { color: var(--ink-2); }
.lvl.current { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.lvl.current small { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); }
.lvl.locked { color: var(--ink-3); background: transparent; border-style: dashed; cursor: default; }
.lvl:not(.locked):hover { border-color: var(--accent); }

/* ---------- Juego ---------- */
.game { display: grid; grid-template-columns: minmax(0, auto) 320px; gap: 32px; justify-content: center; align-items: start; }
@media (max-width: 860px) { .game { grid-template-columns: 1fr; gap: 14px; justify-items: center; } }
.game-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; width: 100%; }
.game-head .title { display: grid; gap: 2px; }
.game-head .title b { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.timer { margin-left: auto; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; }
.timer .pen { font-size: 12.5px; color: var(--warn); font-weight: 600; }
.back-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); }
.back-btn svg { width: 20px; height: 20px; }

/* Tamaño del tablero en una variable (--bw) para fijar la altura de cada fila: así una fila
   totalmente vacía no se aplasta en Safari antiguos (iPhone XS y similares). */
.board-wrap { position: relative; --bw: max(280px, min(92vw, 540px, calc(100vh - var(--top-h) - 330px))); width: var(--bw); }
@supports (height: 100dvh) { .board-wrap { --bw: max(280px, min(92vw, 540px, calc(100dvh - var(--top-h) - 330px))); } }
@media (min-width: 861px) {
  .board-wrap { --bw: max(380px, min(560px, calc(100vh - var(--top-h) - 150px))); }
  @supports (height: 100dvh) { .board-wrap { --bw: max(380px, min(560px, calc(100dvh - var(--top-h) - 150px))); } }
}
.board {
  display: grid; width: var(--bw); height: var(--bw);
  grid-template-columns: repeat(9, calc((var(--bw) - 4px) / 9));
  grid-template-rows: repeat(9, calc((var(--bw) - 4px) / 9));
  background: var(--card); border: 2px solid var(--line-strong); border-radius: 10px; overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.cell {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: clamp(19px, 5.4vw, 31px); font-weight: 500; color: var(--accent);
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color .08s;
}
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.br { border-right: 2px solid var(--line-strong); }
.cell.bb { border-bottom: 2px solid var(--line-strong); }
.cell.given { color: var(--ink); font-weight: 650; }
.cell.peer { background: var(--accent-softer); }
.cell.same { background: var(--same); }
.cell.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cell.conflict { color: var(--warn); }
.cell.conflict.given { background: var(--warn-soft); }
.cell.hinted { color: var(--gold); }
.cell.pop { animation: pop .22s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
.notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.notes span { display: grid; place-items: center; font-size: clamp(8.5px, 2.2vw, 12.5px); color: var(--ink-2); font-weight: 500; line-height: 1; }
.notes span.hl { color: var(--accent); font-weight: 750; }
.board.paused .cell { color: transparent !important; }
.board.paused .notes { visibility: hidden; }
.pause-cover { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 10px; }
.board.win { animation: glow 1.2s ease; }
@keyframes glow { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--good) 40%, transparent); } }

.controls { display: grid; gap: 14px; width: 100%; max-width: 540px; }
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tool { white-space: nowrap; display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; font-size: 12px; color: var(--ink-2); position: relative; }
.tool svg { width: 25px; height: 25px; }
.tool:hover { background: var(--accent-softer); color: var(--ink); }
.tool.on { color: var(--accent); background: var(--accent-softer); }
.tool .badge { position: absolute; top: 4px; right: calc(50% - 26px); font-size: 10px; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 1px 5px; border-radius: 999px; }
.tool.on .badge { background: var(--accent); }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
@media (min-width: 861px) { .pad { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.key {
  display: grid; place-items: center; gap: 0; aspect-ratio: 1 / 1.25; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: clamp(22px, 6vw, 28px); font-weight: 550; color: var(--accent); font-variant-numeric: tabular-nums;
}
@media (min-width: 861px) { .key { aspect-ratio: 1.25 / 1; font-size: 30px; } }
.key small { font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-top: -4px; }
.key:active { transform: scale(.96); }
.key.done { opacity: .28; }
.notes-mode .key { color: var(--ink-2); font-size: clamp(16px, 4.5vw, 21px); }
.side-info { display: none; }
@media (min-width: 861px) { .side-info { display: block; font-size: 13.5px; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 18, 24, .45); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border-radius: 20px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.sheet h2 { margin-bottom: 8px; }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
@media (max-width: 520px) { .sheet .actions .btn { flex: 1; } }

.win-time { font-family: var(--serif); font-size: 54px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; margin: 6px 0 4px; }
.compare { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--accent-softer); display: grid; gap: 12px; }
.compare .headline { font-size: 17px; font-weight: 600; }
.hist { width: 100%; height: 86px; display: block; }
.top-list { display: grid; gap: 2px; margin-top: 4px; font-size: 14px; }
.top-list div { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.top-list div.you { background: var(--accent-soft); font-weight: 650; }
.top-list .pos { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Tutorial */
.tut-steps { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.tut-steps i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tut-steps i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.tut-art { display: grid; place-items: center; height: 170px; margin: 4px 0 16px; border-radius: 14px; background: var(--accent-softer); }
.tut-art svg { height: 140px; }

/* Formularios */
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); width: 100%;
}
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--accent-softer); }
.seg button { padding: 8px 14px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch input { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.msg { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: var(--accent-softer); }
.msg.err { background: var(--warn-soft); color: var(--warn); }

/* Gráfico de progreso */
.chart { width: 100%; height: 190px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.vs { display: grid; gap: 14px; }
.vs-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; font-size: 14px; }
.vs-bars { display: grid; gap: 4px; }
.vs-bar { height: 10px; border-radius: 5px; background: var(--accent); min-width: 4px; }
.vs-bar.them { background: var(--ink-3); opacity: .55; }
.vs-cap { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 14.5px; transition: all .2s ease; max-width: calc(100vw - 32px); text-wrap: balance; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.help-sec { display: grid; gap: 10px; }
.help-sec ul { margin: 0; padding-left: 20px; line-height: 1.7; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; gap: 12px; min-height: 50vh; color: var(--ink-2); }

@media (max-width: 640px) {
  .list .pr-best { display: none; }
  .list .pr-name { width: auto !important; flex: 1; }
}

/* Bienvenida */
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); transition: border-color .15s, transform .08s; }
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.99); }
.choice .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.choice .ico svg { width: 24px; height: 24px; }
.choice b { display: block; font-size: 16px; }
.choice small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }

.danger-link { color: var(--warn); font-size: 14px; font-weight: 600; }
.danger-link:hover { text-decoration: underline; }
.btn.danger { background: var(--warn); color: #fff; }

.alias-badge { justify-self: start; font-family: var(--serif); font-size: 24px; font-weight: 600; padding: 6px 14px; border-radius: 12px; background: var(--accent-softer); }

/* Iniciación: casillas de «Paso» con otro estilo y bloque plegable */
.lvl.step { border-radius: 18px; border-color: color-mix(in srgb, #2c6e67 25%, var(--line)); }
.lvl.step .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #2c6e67; margin-bottom: -2px; }
.lvl.step.done { background: #def0ee; }
.lvl.step.current { background: #2c6e67; color: #fff; }
.lvl.step.current .lbl, .lvl.step.current small { color: rgba(255,255,255,.85); }
:root[data-theme="dark"] .lvl.step .lbl { color: #8fd3ca; }
:root[data-theme="dark"] .lvl.step.done { background: #1d3533; }
:root[data-theme="dark"] .lvl.step.current { background: #3d8f86; }
.intro-fold { margin-top: 8px; padding: 14px 18px; box-shadow: none; }
.intro-fold summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
.intro-fold summary::-webkit-details-marker { display: none; }
.intro-fold summary .faint { font-size: 14px; }
.intro-fold .fold-cta { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent); }
.intro-fold[open] .fold-cta { visibility: hidden; }

.go-btn .go-sub { font-weight: 500; opacity: .85; }

/* Aviso de versión nueva */
.upd-bar { position: fixed; z-index: 70; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--ink); color: var(--paper); box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 14.5px; width: max-content; max-width: calc(100vw - 24px); animation: rise .2s ease; }
.upd-bar .btn { background: var(--paper); color: var(--ink); }

.adm-list > div { gap: 8px; }
.adm-mail { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-txt { color: var(--warn); }

.upd-btn { color: var(--accent); }
.upd-btn .dot { background: var(--warn); }

.forgot-link { justify-self: end; margin-top: -4px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.forgot-link:hover { text-decoration: underline; }

/* Descargar la app */
.install-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-softer); box-shadow: none; }
.install-card .ico, .inst-steps .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--accent); }
.install-card .ico svg, .inst-steps .ico svg { width: 24px; height: 24px; }
.install-card b { display: block; font-size: 16px; }
.install-card small { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.install-card .inst-x { width: 32px; height: 32px; font-size: 14px; color: var(--ink-3); flex: none; }
@media (max-width: 520px) { .install-card { flex-wrap: wrap; } .install-card > div { flex-basis: calc(100% - 100px) !important; } .install-card #instBtn { margin-left: 56px; } }
.inst-steps { list-style: none; padding: 0; margin: 18px 0 10px; display: grid; gap: 14px; }
.inst-steps li { display: flex; gap: 14px; align-items: flex-start; }
.inst-steps .ico { background: var(--accent-softer); }
.inst-steps small { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; margin-top: 3px; }
.inst-steps .step-n { color: var(--accent); }

/* Presentación */
.pres-head { display: flex; gap: 14px; align-items: center; }
.pres-head svg { width: 52px; height: 52px; flex: none; color: var(--ink); }
.pres-head h2 { margin: 0; }
.pres-head p { margin-top: 2px; }
.feat { list-style: none; padding: 0; margin: 18px 0 4px; display: grid; gap: 12px; }
.feat li { display: flex; gap: 12px; align-items: flex-start; }
.feat .fi { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-softer); font-size: 19px; color: var(--accent); font-weight: 700; }
.feat b { display: block; font-size: 15.5px; }
.feat small { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; margin-top: 1px; }
@media (min-width: 640px) { .feat { grid-template-columns: 1fr 1fr; column-gap: 18px; } }
.sticky-actions { position: sticky; bottom: -24px; margin: 18px -24px -24px; padding: 14px 24px 20px; background: linear-gradient(to bottom, transparent, var(--card) 22%); }

/* Pie con enlaces por tema (útil para buscadores) */
.site-foot { max-width: 1080px; margin: 0 auto; padding: 8px 20px 28px; color: var(--ink-3); font-size: 13px; text-align: center; }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 8px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
body.playing .site-foot { display: none; }
.seo-static { max-width: 680px; line-height: 1.6; }
.seo-static a { color: var(--accent); }
