:root {
  --bg: #F7F5EF; --surface: #FFFFFF; --tile: #EDEBE3; --tile-hover: #E4E1D7;
  --ink: #17181C; --ink-2: #4A4C55; --muted: #7A7D88; --line: #DDDAD0;
  --brand: #17181C; --brand-ink: #F7F5EF;
  --g1: #F3D24B; --g1-ink: #3A3000; --g2: #8FCB74; --g2-ink: #10300A;
  --g3: #86B7EA; --g3-ink: #0B2748; --g4: #BC93E4; --g4-ink: #2E0F4E;
  --honey: #F3D24B; --honey-ink: #3A3000; --cell: #E8E5DB; --cell-ink: #17181C;
  --danger: #B3261E;
  --shadow: 0 1px 2px rgba(23,24,28,.06), 0 10px 30px -18px rgba(23,24,28,.3);
  --f: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-num: "Segoe UI", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417; --surface: #1B1C21; --tile: #26282F; --tile-hover: #2F323A;
    --ink: #EEEDE8; --ink-2: #C2C3CB; --muted: #8B8E9A; --line: #2E3038;
    --brand: #EEEDE8; --brand-ink: #131417;
    --g1: #D9B93A; --g1-ink: #1F1900; --g2: #7DB865; --g2-ink: #0A1F06;
    --g3: #6FA3DA; --g3-ink: #061A33; --g4: #A87FD3; --g4-ink: #1E0A36;
    --honey: #E0BE3E; --honey-ink: #1F1900; --cell: #2A2D35; --cell-ink: #EEEDE8;
    --danger: #F28B82;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  --bg: #131417; --surface: #1B1C21; --tile: #26282F; --tile-hover: #2F323A;
  --ink: #EEEDE8; --ink-2: #C2C3CB; --muted: #8B8E9A; --line: #2E3038;
  --brand: #EEEDE8; --brand-ink: #131417;
  --g1: #D9B93A; --g1-ink: #1F1900; --g2: #7DB865; --g2-ink: #0A1F06;
  --g3: #6FA3DA; --g3-ink: #061A33; --g4: #A87FD3; --g4-ink: #1E0A36;
  --honey: #E0BE3E; --honey-ink: #1F1900; --cell: #2A2D35; --cell-ink: #EEEDE8;
  --danger: #F28B82;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; padding: 0 16px 80px; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 560px; margin: 0 auto; }
.prose { max-width: 62ch; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; }
.brand .mark i { display: block; border-radius: 2px; }
.brand .mark i:nth-child(1) { background: var(--g1); } .brand .mark i:nth-child(2) { background: var(--g2); }
.brand .mark i:nth-child(3) { background: var(--g3); } .brand .mark i:nth-child(4) { background: var(--g4); }
.brand b { font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: .02em; margin-top: -2px; }
.icons { display: flex; gap: 4px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.iconbtn:hover { background: var(--tile); color: var(--ink); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.gamehead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gamehead h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.gamehead .n { color: var(--muted); font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- progreso ---------- */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.progress .rank { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; }
.progress .bar { flex: 1; display: flex; align-items: center; justify-content: space-between; position: relative; height: 22px; }
.progress .bar::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: var(--line); }
.progress .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); position: relative; z-index: 1; transition: transform .2s ease, background .2s ease; }
.progress .bar i.done { background: var(--honey); }
.progress .bar i.cur { background: var(--honey); width: 22px; height: 22px; box-shadow: 0 0 0 3px var(--bg); }
.progress .pts { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.2ch; text-align: right; }
.nextline { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 14px; }
.nextline button { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: .85rem; }

/* ---------- entrada ---------- */
.typed {
  min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 1px;
  font-size: clamp(1.6rem, 8vw, 2.2rem); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 10px;
}
.typed { overflow: hidden; white-space: nowrap; }
.typed.long { font-size: clamp(1.2rem, 6vw, 1.7rem); letter-spacing: .02em; }
.typed.xlong { font-size: clamp(.95rem, 4.6vw, 1.3rem); letter-spacing: 0; }
.typed.empty { color: var(--muted); font-size: 1rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.typed .c { color: var(--honey); }
.typed .bad { color: var(--muted); opacity: .6; }
.typed .caret { display: inline-block; width: 2px; height: 1em; background: var(--honey); margin-left: 2px; animation: blink 1s steps(1) infinite; }
.typed.shake { animation: shake .45s ease; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

/* ---------- panal ---------- */
.hive { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 0 auto 14px; }
.hex {
  position: absolute; width: 31%; height: 35.5%; border: 0; padding: 0;
  background: var(--cell); color: var(--cell-ink);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-size: clamp(1.4rem, 7vw, 2rem); font-weight: 800; text-transform: uppercase;
  display: grid; place-items: center; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .1s ease, background .15s ease;
}
.hex:hover { background: var(--tile-hover); }
.hex:active, .hex.tap { transform: scale(.92); }
.hex.center { background: var(--honey); color: var(--honey-ink); }
.hex.center:hover { filter: brightness(1.05); }
.hex.p0 { left: 18%; top: 4%; }   .hex.p1 { left: 51%; top: 4%; }
.hex.p2 { left: 1.5%; top: 32.25%; } .hex.p3 { left: 34.5%; top: 32.25%; } .hex.p4 { left: 67.5%; top: 32.25%; }
.hex.p5 { left: 18%; top: 60.5%; } .hex.p6 { left: 51%; top: 60.5%; }

.actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn { border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: .95rem; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); transition: background .15s ease, opacity .15s ease; }
.btn:hover:not(:disabled) { background: var(--tile); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.icon { width: 46px; padding: 0; display: grid; place-items: center; }
.btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- palabras ---------- */
.foundbox { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.foundbox .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.foundbox .head b { font-size: .95rem; }
.foundbox .head button { background: none; border: 0; color: var(--muted); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.words { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .95rem; }
.words .w { padding: 2px 0; border-bottom: 1px solid var(--line); }
.words .w.pan { font-weight: 800; color: var(--honey-ink); background: var(--honey); border-radius: 6px; padding: 2px 8px; border-bottom: 0; }
.words .w.miss { color: var(--muted); }
.words .w.miss.pan { opacity: .75; }
.words .none { color: var(--muted); font-size: .9rem; }
#answers-wrap { margin-top: 12px; }
#answers-wrap .label { font-size: .8rem; color: var(--muted); margin-bottom: 6px; display: block; }

.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-10px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: .95rem; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.big { background: var(--honey); color: var(--honey-ink); font-size: 1.1rem; padding: 12px 20px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal.open { display: flex; }
.card { background: var(--surface); color: var(--ink); border-radius: 16px; max-width: 460px; width: 100%; padding: 24px 22px 22px; box-shadow: var(--shadow); position: relative; max-height: calc(100vh - 32px); overflow: auto; animation: pop .25s ease; }
@keyframes pop { 0% { transform: scale(.94); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.card h2 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.card .stack { display: flex; flex-direction: column; gap: 12px; }
.card .close { position: absolute; top: 10px; right: 10px; }
.card ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: .95rem; display: flex; flex-direction: column; gap: 6px; }
.card ul.ranks { list-style: none; padding: 0; gap: 0; }
.card ul.ranks li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.card ul.ranks li:last-child { border-bottom: 0; }
.card ul.ranks li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.minihive { display: flex; justify-content: center; gap: 4px; }
.minihive i { width: 34px; height: 38px; display: grid; place-items: center; font-style: normal; font-weight: 800; background: var(--cell); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); font-size: .95rem; }
.minihive i.c { background: var(--honey); color: var(--honey-ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 6px 0 4px; }
.stats b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.result { text-align: center; }
.result .next { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.result .next b { color: var(--ink); font-variant-numeric: tabular-nums; }
.share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.content { margin-top: 56px; display: flex; flex-direction: column; gap: 32px; }
.content h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.content p, .content li { color: var(--ink-2); font-size: .95rem; }
.content ul, .content ol { margin: 0; padding-left: 1.2em; }
.archive { display: flex; flex-wrap: wrap; gap: 8px; }
.archive a { text-decoration: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 11px; font-size: .88rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.archive a:hover { border-color: var(--ink); color: var(--ink); }
.archive a.done { border-color: var(--honey); }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: .95rem; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 6px; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: var(--muted); }
.ad-slot { min-height: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- bloque "Sigue jugando" del modal de resultados (seguir.js) ---------- */
.seguir { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; text-align: left; }
.seguir-t { margin: 0 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.seguir-lista { display: grid; gap: 8px; }
.seguir-j { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; text-decoration: none; background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.seguir-j:hover { border-color: var(--ink); }
.seguir-n { grid-column: 1; grid-row: 1; font-weight: 800; font-size: .98rem; color: var(--ink); letter-spacing: -.01em; }
.seguir-p { grid-column: 1; grid-row: 2; font-size: .8rem; color: var(--ink-2); }
.seguir-e { grid-column: 2; grid-row: 1 / span 2; justify-self: end; align-self: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: 5px 10px; background: var(--brand); color: var(--brand-ink); white-space: nowrap; }
.seguir-j.ya { opacity: .62; }
.seguir-j.ya .seguir-e { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.seguir-mas { display: block; text-align: center; margin-top: 10px; font-size: .88rem; font-weight: 700; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.seguir-mas:hover { color: var(--ink); }
