/* bricolage-grotesque-vietnamese-wght-normal */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/bricolage-grotesque-vietnamese-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* bricolage-grotesque-latin-ext-wght-normal */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2-variations');
  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;
}

/* bricolage-grotesque-latin-wght-normal */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2-variations');
  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;
}
/* Iconos mapache */
:root { --k-fur: #8c939c; --k-ear: #6f7780; --k-mask: #20242a; --k-eye: #ffffff; --k-sea: #2f5d84; --k-grid: #5f8fb8; --k-red: #e2483d; --k-stamp: #2f5d84; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --k-fur: #a7aeb7; --k-ear: #8b939c; --k-mask: #1b2027; --k-stamp: #7fb0d9; } }
:root[data-theme="dark"] { --k-fur: #a7aeb7; --k-ear: #8b939c; --k-mask: #1b2027; --k-stamp: #7fb0d9; }
.ic { display: block; width: 24px; height: 24px; flex: none; overflow: visible; }
.k-fur { fill: var(--k-fur); } .k-ear { fill: var(--k-ear); } .k-mask { fill: var(--k-mask); } .k-eye { fill: var(--k-eye); }
.k-sig { fill: var(--signal); } .k-red { fill: var(--k-red); } .k-pole { fill: var(--ink); } .k-sea { fill: var(--k-sea); }
.k-grid { fill: none; stroke: var(--k-grid); stroke-width: 1.4; }
.k-outline { stroke: var(--surface); stroke-width: 2.5; }
.k-ring-a { fill: var(--surface); stroke: var(--k-fur); stroke-width: 7; }
.k-ring-b { fill: none; stroke: var(--k-mask); stroke-width: 7; stroke-dasharray: 6.7 6.65; }
.k-stroke-dark, .k-stroke-fur, .k-stroke-mask { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.k-stroke-dark { stroke: var(--ink); } .k-stroke-fur { stroke: var(--k-fur); } .k-stroke-mask { stroke: var(--k-mask); stroke-width: 2.4; }
.k-ear-s { fill: none; stroke: var(--k-ear); stroke-width: 1.6; stroke-linejoin: round; }
.k-stamp { fill: none; stroke: var(--k-stamp); stroke-width: 1.8; } .k-stamp-d { fill: none; stroke: var(--k-stamp); stroke-width: 1; stroke-dasharray: 1.6 1.6; }
.k-line-f { fill: currentColor; }
.k-rim { stroke: var(--k-fur); stroke-width: 1.6; } .k-mask-inv { fill: var(--k-mask); opacity: .35; }
.inf-ic { width: 34px; height: 20px; }
.daily-ic, .compass-ic { width: 26px; height: 26px; }
.logo-ic { width: 40px; height: 45px; }
.k-happy { fill: none; stroke: var(--k-eye); stroke-width: 6; stroke-linecap: round; }
.k-brow { fill: none; stroke: var(--k-mask); stroke-width: 6; stroke-linecap: round; }
.k-wave { transform-origin: 43px 94px; transform-box: view-box; }
.mood-happy .k-wave, .logo-wrap:hover .k-wave, .logo-wrap:active .k-wave { animation: flagwave 1.1s ease-in-out; }
@keyframes flagwave { 20% { transform: skewY(-4deg) scaleX(.96); } 45% { transform: skewY(3deg) scaleX(1.02); } 70% { transform: skewY(-1.5deg); } }
.mood-sad .k-wave { transform: rotate(8deg) scaleX(.94); transition: transform .6s; }
.k-flo { fill: #ff7a00; } .k-fli { fill: #ffc531; } .k-ember { fill: #ffb000; }
.k-landb { fill: #8fc59a; }
.w-body { fill: none; stroke: var(--k-fur); stroke-width: 4.6; stroke-linecap: round; }
.w-tail { fill: none; stroke: var(--k-fur); stroke-width: 4.2; stroke-linecap: round; }
.w-tailb { fill: none; stroke: var(--k-mask); stroke-width: 4.2; stroke-dasharray: 2 2.2; }
.k-bin { fill: #8796a5; } .k-binl { fill: none; stroke: #6d7b8a; stroke-width: 1.3; stroke-linecap: round; } .k-lid { fill: #6d7b8a; }
.t-fur { fill: none; stroke: var(--k-fur); stroke-width: 4.6; stroke-linecap: round; }
.t-band { fill: none; stroke: var(--k-mask); stroke-width: 4.6; stroke-dasharray: 2.2 2.4; }
.fire-ic, .world-ic, .trash-ic { width: 26px; height: 26px; }

/* Concepto: carta náutica y banderas de señales. Una sola columna estrecha; la bandera cuelga de su mástil como protagonista. */
:root {
  --bg: #e9eff3;        /* papel de carta náutica */
  --surface: #ffffff;
  --ink: #18283a;       /* azul tinta */
  --muted: #5a6c7e;
  --line: #cfd9e1;
  --signal: #f2b200;    /* amarillo de bandera de señales: racha y acciones */
  --signal-ink: #1b1400;
  --good: #1a8f5f;
  --bad: #cc4237;
  --sea: #d6e3ec;
  --land: #b9c8d4;
  --land-line: #e9eff3;
  --shadow: 0 1px 0 rgba(24, 40, 58, .06), 0 10px 30px -18px rgba(24, 40, 58, .45);
  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", "Noto Sans", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  --r: 14px;
  /* Mascota (morsa): mismos colores en ambos temas */
  --m-body: #c38d63; --m-pad: #e6bb94; --m-dot: #9a6847; --m-stache: #5a3826; --m-ink: #22160f;
  --m-tusk: #fff8ea; --m-tusk-line: #d8c6a6; --m-blush: #f19a86; --m-cap: #1f3550; --m-brim: #142438; --m-shine: #ffffff;
  --hm-guess: #e9a29b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1925; --surface: #152535; --ink: #e5edf4; --muted: #8fa3b6; --line: #233649;
    --signal: #ffc531; --signal-ink: #1b1400; --good: #39c08a; --bad: #f06a5e;
    --sea: #10202f; --land: #2b4157; --land-line: #10202f; --hm-guess: #7a3a36;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1925; --surface: #152535; --ink: #e5edf4; --muted: #8fa3b6; --line: #233649;
  --signal: #ffc531; --signal-ink: #1b1400; --good: #39c08a; --bad: #f06a5e;
  --sea: #10202f; --land: #2b4157; --land-line: #10202f; --hm-guess: #7a3a36;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 30px -18px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
img { max-width: 100%; }

.app { max-width: 540px; margin: 0 auto; padding: 14px 16px 64px; display: flex; flex-direction: column; gap: 14px; }

/* Cabecera */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
#btn-menu { margin-inline-start: -8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-wrap { display: block; width: 44px; height: 50px; flex: none; }
.logo-wrap svg { width: 100%; height: 100%; }
.logo-wrap:hover svg { animation: wobble .6s ease-in-out; }
@keyframes wobble { 30% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
.mascot { overflow: hidden; }
.m-body { fill: var(--m-body); } .m-pad { fill: var(--m-pad); } .m-dot circle { fill: var(--m-dot); } .m-stache { fill: var(--m-stache); }
.m-ink { fill: var(--m-ink); } .m-shine { fill: var(--m-shine); } .m-blush { fill: var(--m-blush); opacity: .55; }
.m-line, .m-brow { fill: none; stroke: var(--m-ink); stroke-width: 4.2; stroke-linecap: round; }
.m-tusk { fill: var(--m-tusk); stroke: var(--m-tusk-line); stroke-width: 1.2; }
.m-cap { fill: var(--m-cap); } .m-brim { fill: var(--m-brim); } .m-badge { fill: var(--signal); }
.brand h1 { margin: 0; font: 800 26px/1 var(--display); letter-spacing: -0.02em; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.tools { display: flex; align-items: center; gap: 4px; flex: none; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--ink); }
.icon:hover { background: var(--surface); }
.icon svg:not(.ic) { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.streak { display: flex; align-items: center; gap: 3px; height: 36px; padding: 0 10px 0 7px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font: 700 15px var(--display); font-variant-numeric: tabular-nums; color: var(--muted); }
.streak svg { width: 20px; height: 20px; }
.streak.lit { border-color: var(--signal); color: var(--ink); }
.streak.lit svg { filter: drop-shadow(0 0 4px rgba(255, 150, 0, .5)); }
.streak.lit .fo, .streak-burst .fo, .fire .fo { fill: #ff7a00; }
.streak.lit .fi, .streak-burst .fi, .fire .fi { fill: #ffd23a; }

/* Selectores segmentados */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg.wrap { flex-wrap: wrap; }
.seg button { flex: 1 1 auto; border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Escenario */
.stage { display: flex; flex-direction: column; gap: 14px; }
.meta { display: flex; justify-content: space-between; margin: 4px 2px 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span:first-child { font-family: var(--display); font-weight: 700; color: var(--ink); }

/* La bandera cuelga de un mástil */
.flag-wrap { margin: 30px 0 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pole { position: relative; width: min(100%, 440px); padding-left: 22px; }
.pole::before { content: ""; position: absolute; left: 1px; top: -12px; bottom: -8px; width: 11px; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--muted) 80%, var(--surface)), var(--ink) 70%); }
.finial { position: absolute; left: -4.5px; top: -30px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe07a, var(--signal) 62%); box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .1); z-index: 2; }
.finial .ear { position: absolute; top: -6px; width: 9px; height: 11px; border-radius: 60% 60% 2px 2px / 80% 80% 2px 2px; background: var(--k-fur); z-index: -1; transform-origin: 50% 100%; }
.finial .ear::after { content: ""; position: absolute; inset: 3px 2.5px 1px; border-radius: inherit; background: var(--k-mask); }
.finial .ear.l { left: 0; transform: rotate(-16deg); animation: twitchL 6s ease-in-out infinite; }
.finial .ear.r { right: 0; transform: rotate(16deg); animation: twitchR 7.5s 1.2s ease-in-out infinite; }
@keyframes twitchL { 0%, 88%, 100% { transform: rotate(-16deg); } 91% { transform: rotate(-38deg); } 94% { transform: rotate(-10deg); } 96% { transform: rotate(-28deg); } }
@keyframes twitchR { 0%, 90%, 100% { transform: rotate(16deg); } 93% { transform: rotate(38deg); } 96% { transform: rotate(10deg); } }
.flag { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 2px 6px 6px 2px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flag::after { /* pliegues de tela */
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(100deg, rgba(0,0,0,.18) 0%, rgba(255,255,255,.22) 14%, rgba(0,0,0,.14) 30%, rgba(255,255,255,.2) 48%, rgba(0,0,0,.12) 66%, rgba(255,255,255,.18) 84%, rgba(0,0,0,.14) 100%);
  background-size: 200% 100%; animation: wave 4.5s cubic-bezier(.3,.1,.3,1) 1 both;
}
@keyframes wave { from { background-position: 100% 0; } to { background-position: 30% 0; } }
.flag.swap img { animation: hoist .45s ease-out both; }
@keyframes hoist { from { transform: translateY(12%); opacity: 0; } to { transform: none; opacity: 1; } }

figcaption { min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; text-align: start; }
figcaption > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mascot.react { width: 64px; height: 72px; flex: none; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
figcaption:empty { display: none; }
figcaption strong { font: 800 clamp(26px, 7vw, 36px)/1.1 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
figcaption .r-head { font-weight: 700; font-size: 14px; }
figcaption.won .r-head, figcaption.won strong { color: var(--good); }
figcaption.lost .r-head { color: var(--bad); }
figcaption.won strong { animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* Entrada de respuesta */
.guess-form { display: flex; gap: 8px; }
.combo { position: relative; flex: 1; min-width: 0; }
.combo input { width: 100%; height: 50px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 17px; }
.combo input:focus { outline: none; border-color: var(--ink); }
.sugg { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: min(420px, 60vh); overflow: auto; scroll-padding-bottom: 8px; }
.sugg li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.sugg li.act, .sugg li:hover { background: var(--bg); }
.sugg li.used { opacity: .45; }
.mini { width: 28px; height: 21px; object-fit: cover; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.hint { margin: 6px 2px 0; min-height: 1.2em; font-size: 14px; color: var(--bad); }
.hint:empty { display: none; }

.btn { height: 50px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--ink); background: transparent; font-weight: 700; }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.big { height: 56px; font-size: 18px; padding: 0 32px; }

/* Intentos */
.guesses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.guesses:empty { display: none; }
.guess { display: grid; grid-template-columns: 28px 1fr auto 26px 48px; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); border-radius: 10px; font-variant-numeric: tabular-nums; }
.guess .g-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess .g-km, .guess .g-pct { color: var(--muted); font-size: 14px; text-align: end; }
.g-dir { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); font-weight: 800; transform: rotate(var(--deg)); }
.g-check { background: var(--good); color: var(--surface); transform: none; }
.guess.ok { box-shadow: inset 0 0 0 2px var(--good); }
.guess.fresh { animation: slide .35s ease-out both; }
@keyframes slide { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Rondas extra */
.extras:empty { display: none; }
.x-intro { padding: 20px; border: 2px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.x-intro h2 { margin: 0; font: 800 22px/1.15 var(--display); }
.x-intro p { margin: 0; color: var(--muted); }
.x-preview { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; padding: 0; list-style: none; }
.x-preview li { padding: 3px 10px; border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 600; }

.pips { display: flex; gap: 5px; margin-bottom: 10px; }
.pip { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .3s; }
.pip.ok { background: var(--good); }
.pip.bad { background: var(--bad); }
.xlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.xrow { display: grid; grid-template-columns: 24px auto 1fr; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface); border-radius: 10px; animation: settle .35s ease-out both; }
@keyframes settle { from { transform: scaleY(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.xmark { font-weight: 800; text-align: center; }
.xrow.ok .xmark { color: var(--good); }
.xrow.bad .xmark { color: var(--bad); }
.xt { font-weight: 700; }
.xa { color: var(--muted); text-align: end; min-width: 0; }
.xcard { padding: 18px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.xcard.enter { animation: rise .45s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.x-kicker { margin: 0; display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); }
.xcard h3 { margin: 0 0 10px; font: 700 20px/1.25 var(--display); text-wrap: balance; }
.x-sub { margin: -4px 0 10px; color: var(--muted); font-size: 14px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { min-height: 54px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 600; text-align: start; line-height: 1.25; transition: transform .1s, border-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt.right, .chip.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.opt.wrong, .chip.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--surface)); animation: shake .3s; }
.opt:disabled:not(.right):not(.wrong) { opacity: .5; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.x-note { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.x-note:empty { display: none; }
.x-note.big { font: 800 20px var(--display); margin: 0; }
.x-note.good { color: var(--good); }
.x-note.badc { color: var(--bad); }
.next { margin-top: 12px; align-self: flex-end; }
.map-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.map-foot .x-note { margin: 0; }
.map-foot .next { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 14.5px; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--surface); }
.chip.none { padding-left: 12px; font-style: italic; }
.chip.missed { border-style: dashed; border-color: var(--good); }
.chip.dim { opacity: .45; }

/* Mapa */
.map-box { position: relative; border-radius: 12px; overflow: hidden; background: var(--sea); aspect-ratio: 960 / 500; touch-action: none; }
.map-svg { display: block; width: 100%; height: 100%; cursor: crosshair; }
.map-sea { fill: var(--sea); }
.map-land { fill: var(--land); stroke: var(--land-line); stroke-width: .5; }
.map-target { fill: var(--good); }
.map-svg circle.pick { fill: var(--signal); stroke: var(--ink); }
.map-svg circle.target { fill: var(--good); stroke: var(--surface); }
.map-svg line { stroke: var(--ink); stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }

/* Fin del día */
.dayend:empty { display: none; }
.dayend { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.x-score { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--muted); }
.x-score strong { font: 800 30px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.end-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--ink); color: var(--bg); border-radius: var(--r); }
.countdown { display: flex; flex-direction: column; font-size: 13px; opacity: .9; }
.countdown strong { font: 700 22px var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Infinito */
.inf-setup { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.lbl { margin: 0; font-weight: 700; font-size: 14px; color: var(--muted); }
.inf-start { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 4px; }
.best-line { margin: 0; color: var(--muted); }
.best-line strong { color: var(--ink); font-family: var(--display); }
.over { text-align: center; padding: 18px; background: var(--surface); border-radius: var(--r); display: flex; flex-direction: column; gap: 4px; order: -1; }
.over p { margin: 0; font-weight: 700; color: var(--muted); }
.over strong { font: 800 54px/1 var(--display); }
.over .mascot.react { width: 84px; height: 96px; margin: 0 auto 4px; }
.over .rec { color: var(--good); font-weight: 800; }
.hud { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud strong { color: var(--ink); font: 800 20px var(--display); margin-inline-start: 4px; }
.lives { display: flex; gap: 5px; }
.lives i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.lives i.on { background: var(--bad); }

/* Ventanas */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(8, 16, 26, .55); display: grid; place-items: end center; padding: 12px; }
.sheet { width: min(100%, 480px); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 18px; padding: 18px 20px 22px; animation: rise .3s ease-out both; }
@media (min-width: 640px) { .modal { place-items: center; } }
.sheet header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet h2 { margin: 0; font: 800 22px var(--display); }
.m-sub { font: 700 15px var(--display); margin: 20px 0 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stat-grid div { display: flex; flex-direction: column; gap: 2px; }
.stat-grid strong { font: 800 28px/1.1 var(--display); display: flex; align-items: center; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; }
.stat-grid span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.stat-grid .fire svg { width: 24px; height: 24px; }
.dist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.dist li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; font-weight: 700; }
.dist b { display: block; width: var(--w); padding: 2px 8px; text-align: end; background: var(--line); border-radius: 4px; }
.dist li.me b { background: var(--good); color: var(--surface); }
.help p { margin: 0 0 10px; }
.help-demo { float: inline-end; margin: 0 0 8px 12px; }
.help-m { width: 84px; height: 96px; }
select { width: 100%; height: 46px; margin: 6px 0 16px; padding: 0 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); }
.sheet .lbl { margin-bottom: 6px; }

/* Celebración de racha */
.streak-ov { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; text-align: center; padding: 24px; }
.streak-ov.on { opacity: 1; }
.streak-burst { position: relative; }
.streak-burst .mascot.big { width: 150px; height: 170px; display: block; animation: ignite .7s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes ignite { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flicker { to { transform: scale(1.04, .97) skewX(-2deg); } }
.streak-num { font: 800 84px/1 var(--display); font-variant-numeric: tabular-nums; }
.streak-ov.bumped .streak-num { animation: pop .45s cubic-bezier(.3,1.8,.5,1); color: #ff8a00; }
.streak-lbl { font: 800 22px var(--display); }
.streak-sub { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 40; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.copy-fallback { position: fixed; left: -9999px; }
.loading, .map-loading { height: 200px; }
.err { color: var(--bad); }

@media (max-width: 420px) {
  .opts { grid-template-columns: 1fr; }
  .guess { grid-template-columns: 28px 1fr auto 26px; }
  .guess .g-pct { display: none; }
  .stat-grid strong { font-size: 24px; }
  .brand p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Correcciones de especificidad para el resultado de vecinos */
.chips .chip.right { border-color: var(--good); border-style: solid; background: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.chips .chip.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.chips .chip:disabled { cursor: default; }
.extras { padding-top: 8px; }
figcaption.lost strong { color: var(--bad); }

/* Tablero: una columna en móvil, dos en ordenador */
.board { display: flex; flex-direction: column; gap: 14px; }
.side { position: relative; }

/* Mapa de ayuda */
.hm { position: relative; aspect-ratio: 960 / 500; border-radius: var(--r); overflow: hidden; background: var(--sea); box-shadow: var(--shadow); transition: width .3s ease, box-shadow .3s; }
.hm-canvas, .hm-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hm-svg { touch-action: none; cursor: grab; }
.hm-svg:active { cursor: grabbing; }
.hm-sea { fill: var(--sea); }
.hm-land { fill: var(--land); stroke: var(--land-line); cursor: pointer; transition: fill .2s; }
.hm-land:hover { fill: color-mix(in srgb, var(--land) 75%, var(--ink)); }
.hm-land.guessed { fill: var(--hm-guess); }
.hm-land.solved { fill: var(--good); }
.hm-labels text { fill: var(--ink); stroke: var(--sea); paint-order: stroke; stroke-linejoin: round; text-anchor: middle; dominant-baseline: middle; font-weight: 600; font-family: var(--body); pointer-events: none; }
.hm-label { position: absolute; bottom: 8px; inset-inline-start: 10px; margin: 0; padding: 3px 9px; border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--muted); pointer-events: none; z-index: 2; }
.side.after { display: none; }

/* Ordenador: el juego siempre centrado; el mapa vive en el margen derecho y nunca lo tapa */
@media (min-width: 1180px) {
  .board > .side { position: fixed; z-index: 4; top: 130px; inset-inline-end: 24px; width: min(440px, calc((100vw - 540px) / 2 - 56px)); }
  .side .hm { position: absolute; top: 0; inset-inline-end: 0; width: 100%; }
  .side:hover .hm, .side .hm:focus-within { width: min(600px, calc((100vw - 540px) / 2 - 32px)); box-shadow: 0 24px 60px -20px rgba(8, 16, 26, .45); }
  .side.after { display: block; }
}

/* Barra lateral desplegable */
.drawer { position: fixed; inset: 0; z-index: 25; background: rgba(8, 16, 26, 0); transition: background .25s; }
.drawer.on { background: rgba(8, 16, 26, .45); }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); overflow: auto; background: var(--surface); padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
[dir="rtl"] .drawer-panel { transform: translateX(100%); }
.drawer.on .drawer-panel { transform: none; }
.dr-head { display: flex; align-items: center; gap: 10px; }
.dr-head strong { font: 800 22px var(--display); flex: 1; }
.dr-group { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.dr-item { text-align: start; border: 0; background: none; padding: 11px 12px; border-radius: 10px; font-weight: 600; font-size: 16px; }
.dr-item:hover { background: var(--bg); }
.dr-item.on { background: var(--ink); color: var(--bg); }
.dr-title { margin: 0 0 6px; font: 700 15px var(--display); }
.dr-settings select { margin: 6px 0 12px; }
.dr-settings .seg { margin: 6px 0 14px; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + .sw { background: var(--good); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 3px solid var(--signal); outline-offset: 2px; }
.sugg li { display: flex; align-items: center; gap: 10px; }

/* Mapache */
.r-fur { fill: var(--r-fur, #8c939c); }
.r-ear { fill: var(--r-ear, #6f7780); }
.r-belly { fill: var(--r-belly, #cfd4da); }
.r-mask, .r-dark { fill: var(--r-dark, #23272e); }
.r-eye { fill: #fff; }
.r-muzzle { fill: #f4f5f7; }
.r-arc { fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; }
.r-arc.thin { stroke: #f4f5f7; stroke-width: 3; }
.r-pole { stroke: var(--r-pole, #18283a); stroke-width: 4.5; stroke-linecap: round; }
.r-flag { fill: var(--signal, #f2b200); }
.r-tail { fill: none; stroke: var(--r-fur, #8c939c); stroke-width: 17; stroke-linecap: round; }
.r-tail-bands { fill: none; stroke: var(--r-dark, #23272e); stroke-width: 17; stroke-dasharray: 7 9; stroke-dashoffset: -6; }
.r-globe { fill: var(--r-globe, #1f3550); }
.r-globe-line { fill: none; stroke: var(--r-globe-line, #3f6b8f); stroke-width: 6; stroke-linecap: round; }
.mascot { --r-pole: var(--ink); --r-globe: #1f3550; }

/* Cuenta */
.dr-account { gap: 8px; }
.acc-note { margin: 0; color: var(--muted); font-size: 14px; }
.acc-who { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border: 2px solid var(--line); background: var(--surface); }
.btn.google svg { width: 20px; height: 20px; }
.acc-or { margin: 2px 0; text-align: center; color: var(--muted); font-size: 13px; }
.acc-form { display: flex; flex-direction: column; gap: 8px; }
.acc-form input { height: 44px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); }
.acc-form input:focus { outline: none; border-color: var(--ink); }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc-row .btn { height: 44px; padding: 0 8px; font-size: 14.5px; }
.dr-account > .btn { height: 44px; }
.acc-link { border: 0; background: none; padding: 2px 0; color: var(--muted); text-decoration: underline; font-size: 13.5px; text-align: start; }
.acc-msg { margin: 0; font-size: 13.5px; color: var(--bad); }
.acc-msg:empty { display: none; }

/* Botón y ficha de información */
.xrow.has-info { grid-template-columns: 24px auto 1fr 30px; }
.info-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); font: italic 800 15px Georgia, serif; color: var(--ink); display: grid; place-items: center; padding: 0; transition: border-color .15s, transform .15s; animation: pop .4s .2s cubic-bezier(.3,1.6,.5,1) both; }
.info-btn:hover { border-color: var(--signal); transform: scale(1.08); }
.info { display: flex; flex-direction: column; gap: 14px; }
.info-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 10px; border-radius: 999px; background: var(--bg); font-size: 13.5px; color: var(--muted); }
.pill b { color: var(--ink); }
.info-body { display: flex; flex-direction: column; gap: 14px; }
.info-body section h3 { margin: 0 0 3px; font: 700 13.5px var(--display); color: var(--muted); }
.info-body p { margin: 0; line-height: 1.55; }
.info-body .fact { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--signal) 18%, var(--surface)); }
.info-body .fact h3 { color: var(--ink); }
.info-img { max-height: 140px; max-width: 100%; align-self: center; border-radius: 8px; object-fit: contain; }
.info-link { align-self: flex-start; font-weight: 700; color: var(--ink); text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.info-loading, .info-err { color: var(--muted); }
/* (los estilos de iconos están en icons.css) */

/* Cabecera e iconos en botones */
#btn-menu .ic, #btn-stats .ic { width: 26px; height: 26px; }
.logo-wrap { width: 40px; height: 45px; cursor: pointer; }
.logo-wrap .mascot { width: 100%; height: 100%; }
.btn.with-ic { display: inline-flex; align-items: center; gap: 8px; }
.btn.with-ic .ic { width: 20px; height: 20px; color: var(--signal-ink); }
.dr-item { display: flex; align-items: center; gap: 12px; }
.dr-title { display: flex; align-items: center; gap: 8px; }
.lbl.with-ic { display: flex; align-items: center; gap: 8px; }
.lbl.with-ic .ic { width: 20px; height: 20px; }

/* Pestañas Diario / Infinito con indicador deslizante */
.modes { position: relative; }
.modes::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 9px; background: var(--ink); transform: translateX(calc(var(--i, 0) * (100% + 4px))); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
[dir="rtl"] .modes::before { left: auto; right: 4px; transform: translateX(calc(var(--i, 0) * -1 * (100% + 4px))); }
.modes button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; transition: color .25s; }
.modes button[aria-pressed="true"] { background: none; }
.modes .ic { width: 24px; height: 24px; }
.modes .inf-ic { width: 32px; height: 20px; }
.modes button:hover:not([aria-pressed="true"]) .ic { animation: hop .4s ease; }
@keyframes hop { 40% { transform: translateY(-3px) rotate(-6deg); } }

/* Mapa de ayuda: brújula en la esquina (recentra el mapa) */
.hm-compass { position: absolute; z-index: 3; bottom: 8px; inset-inline-start: 8px; width: 40px; height: 40px; padding: 4px; border: 0; border-radius: 50%; background: var(--compass-bg); --surface: var(--compass-bg); box-shadow: var(--shadow); display: grid; place-items: center; }
.hm-compass .ic { width: 32px; height: 32px; }
.hm-compass .k-needle { transform-origin: 24px 24px; transform-box: view-box; transition: transform .9s cubic-bezier(.3, 1.2, .5, 1); }
.hm.in .k-needle { transform: rotate(360deg); }
.pin .pin-drop, .pick .pin-drop { animation: pindrop .45s cubic-bezier(.3, 1.5, .5, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pindrop { from { transform: translateY(-40px) scale(.6); opacity: 0; } 60% { opacity: 1; } }

/* Interruptor de tema */
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.theme-tg { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; font-weight: 600; }
.tg-track { position: relative; width: 68px; height: 36px; border-radius: 18px; background: #9fd3f3; overflow: hidden; transition: background .4s; flex: none; }
.tg-sun { position: absolute; top: 7px; right: 9px; width: 12px; height: 12px; border-radius: 50%; background: #ffd23a; box-shadow: 0 0 8px #ffd23a; transition: transform .4s, opacity .4s; }
.tg-stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .4s; }
.tg-stars i:nth-child(1) { top: 8px; left: 12px; } .tg-stars i:nth-child(2) { top: 20px; left: 22px; } .tg-stars i:nth-child(3) { top: 11px; left: 28px; }
.tg-knob { position: absolute; top: 2px; left: 2px; width: 32px; height: 32px; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.tg-knob svg { width: 100%; height: 100%; }
.tg-closed { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: 0; }
.tg-z { position: absolute; top: -2px; right: -2px; font: 800 11px var(--display); color: #fff; opacity: 0; }
.theme-tg[aria-checked="true"] .tg-track { background: #1d2f47; }
.theme-tg[aria-checked="true"] .tg-knob { transform: translateX(32px) rotate(-12deg); }
.theme-tg[aria-checked="true"] .tg-sun { transform: translateY(30px); opacity: 0; }
.theme-tg[aria-checked="true"] .tg-stars i { opacity: 1; }
.theme-tg[aria-checked="true"] .tg-open { opacity: 0; }
.theme-tg[aria-checked="true"] .tg-closed { opacity: 1; }
.theme-tg[aria-checked="true"] .tg-z { opacity: 1; animation: zz 1.6s ease-in-out infinite; }
@keyframes zz { 50% { transform: translate(3px, -3px); opacity: .5; } }

/* Sensación al tocar */
.btn, .opt, .chip, .icon, .seg button, .dr-item, .streak, .info-btn { transition: transform .12s ease, background .2s, border-color .2s, filter .2s; }
.btn:active:not(:disabled), .chip:active:not(:disabled), .icon:active, .seg button:active, .dr-item:active, .streak:active { transform: scale(.95); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); }

/* Fallo: la bandera tiembla. Acierto: confeti */
.flag.shake { animation: shakeit .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes shakeit { 15%, 85% { transform: translateX(-3px) rotate(-.5deg); } 30%, 70% { transform: translateX(5px) rotate(.6deg); } 50% { transform: translateX(-6px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); animation: conf var(--d) cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes conf { to { transform: translate(var(--dx), calc(var(--dy) + 160px)) rotate(var(--r)); opacity: 0; } }
.bump { animation: bumpit .35s cubic-bezier(.3, 1.8, .5, 1); display: inline-block; }
@keyframes bumpit { 40% { transform: scale(1.4); } }
.lives i { transition: background .3s; }
.lives i.lost { animation: lose .5s ease-out forwards; }
@keyframes lose { 0% { background: var(--bad); transform: scale(1.4); } 100% { background: var(--line); transform: scale(1); } }

/* Intentos: barra de cercanía y flecha que gira hasta su sitio */
.guess { position: relative; overflow: hidden; isolation: isolate; }
.guess::before { content: ""; position: absolute; inset: 0; z-index: -1; width: var(--p); background: color-mix(in srgb, var(--signal) 14%, transparent); transform-origin: left; }
[dir="rtl"] .guess::before { transform-origin: right; inset-inline-start: auto; right: 0; }
.guess.ok::before { background: color-mix(in srgb, var(--good) 14%, transparent); }
.guess.fresh::before { animation: grow .8s .15s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.guess.fresh .g-dir:not(.g-check) { animation: needle .9s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes needle { from { transform: rotate(calc(var(--deg) - 200deg)); } }
.guess.fresh .g-check { animation: pop .45s .1s cubic-bezier(.3, 1.8, .5, 1) both; }

/* Rondas extra: las opciones entran en cascada */
.xcard.enter .opt, .xcard.enter .chip { animation: rise .35s cubic-bezier(.2, .9, .3, 1.1) both; }
.xcard.enter .opt:nth-child(2), .xcard.enter .chip:nth-child(2) { animation-delay: .05s; }
.xcard.enter .opt:nth-child(3), .xcard.enter .chip:nth-child(3) { animation-delay: .1s; }
.xcard.enter .opt:nth-child(4), .xcard.enter .chip:nth-child(4) { animation-delay: .15s; }
.opt.right { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.pip.ok, .pip.bad { animation: pipfill .4s ease-out; transform-origin: left; }
@keyframes pipfill { from { transform: scaleX(.2); } }
.info-btn { padding: 2px; border: 0; background: none; width: 32px; height: 32px; }
.info-btn .ic { width: 26px; height: 26px; }
.info-btn:hover { transform: rotate(-8deg) scale(1.1); }
.streak.lit:hover svg { animation: flicker .5s ease-in-out 2 alternate; transform-origin: 50% 90%; }

/* Mapas: cursor de chincheta y país iluminado al pasar */
:root { --compass-bg: #f4f6f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --compass-bg: #2b3f55; } }
:root[data-theme="dark"] { --compass-bg: #2b3f55; }
.map-svg:not(.locked) .map-land:hover { fill: color-mix(in srgb, var(--land) 75%, var(--ink)); }
.map-land { transition: fill .15s; }

/* Ordenador: mapa de ayuda vertical en el margen derecho */
@media (min-width: 1180px) {
  .board > .side { aspect-ratio: auto; width: min(360px, calc((100vw - 540px) / 2 - 56px)); height: min(560px, calc(100vh - 160px)); }
  .side .hm { aspect-ratio: auto; height: 100%; }
  .side:hover .hm, .side .hm:focus-within { width: min(520px, calc((100vw - 540px) / 2 - 32px)); }
}

/* Modo infinito: selector de región con mapa */
.world-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; font-size: 16px; transition: transform .12s, border-color .2s, background .2s; }
.world-btn .ic { width: 26px; height: 26px; }
.world-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.world-btn:active { transform: scale(.98); }
.regmap { position: relative; border-radius: var(--r); background: var(--sea); overflow: hidden; aspect-ratio: 960 / 470; box-shadow: var(--shadow); }
.rm-svg { display: block; width: 100%; height: 100%; }
.rm-sea { fill: var(--sea); }
.rm-base { fill: var(--land); opacity: .5; }
.rm-reg { stroke: var(--sea); stroke-width: 1.5; cursor: pointer; transition: opacity .25s, filter .25s; }
.rm-Europe { fill: #6a8fc7; } .rm-Asia { fill: #d98f5a; } .rm-Africa { fill: #c9a64a; }
.rm-NA { fill: #6aa889; } .rm-SA { fill: #9b7ac2; } .rm-Oceania { fill: #4fb0b8; }
.rm-svg.has-sel .rm-reg:not(.on) { opacity: .28; }
.rm-reg.hover { opacity: 1 !important; filter: brightness(1.1); }
.rm-tip { position: absolute; top: 10px; left: 50%; transform: translate(-50%, -6px); margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.rm-tip.show { opacity: 1; transform: translate(-50%, 0); }
.rm-loading { height: 100%; }
.reg-now { margin: -6px 2px 0; color: var(--muted); font-size: 14px; }
.reg-now b { color: var(--ink); }
.best-card { display: flex; flex-direction: column; align-items: center; padding: 8px 22px; border-radius: 14px; background: color-mix(in srgb, var(--signal) 18%, var(--surface)); }
.best-card span { font-size: 13px; font-weight: 700; color: var(--muted); }
.best-card strong { font: 800 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.over { order: 0; }
.over.is-record { background: color-mix(in srgb, var(--signal) 22%, var(--surface)); }
.over .rec { display: inline-block; margin-top: 4px; padding: 4px 14px; border-radius: 999px; background: var(--signal); color: var(--signal-ink); font-weight: 800; animation: pop .5s .9s cubic-bezier(.3, 1.8, .5, 1) both; }
.rec-line { color: var(--muted); font-weight: 600; }
.rec-line b { color: var(--ink); }
.over .count { font-variant-numeric: tabular-nums; }

/* Durante la partida: capital bajo el país y récord superado */
figcaption .r-cap { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; color: var(--muted); }
.hud-best { transition: color .3s; }
.hud-best.gold strong { color: #d99500; text-shadow: 0 0 12px rgba(242, 178, 0, .45); }
#gstage { position: relative; }
.rec-banner { position: absolute; top: 120px; left: 50%; z-index: 6; transform: translateX(-50%); padding: 10px 22px; border-radius: 999px; background: var(--signal); color: var(--signal-ink); font: 800 20px var(--display); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); animation: banner 1.9s cubic-bezier(.3, 1.5, .5, 1) forwards; white-space: nowrap; }
@keyframes banner { 0% { transform: translateX(-50%) scale(.4); opacity: 0; } 15% { transform: translateX(-50%) scale(1.08); opacity: 1; } 25%, 80% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) translateY(-20px); opacity: 0; } }

/* Racha: cola de mapache en llamas */
.tailfire { width: 22px; height: 22px; overflow: visible; }
.t-fur { fill: none; stroke: var(--k-fur); stroke-width: 5.4; stroke-linecap: round; }
.t-band { fill: none; stroke: var(--k-mask); stroke-width: 5.4; stroke-dasharray: 2.4 2.6; }
.tailfire .fo { fill: #ff7a00; } .tailfire .fi { fill: #ffd23a; }
.streak:not(.lit) .tailfire .fo, .streak:not(.lit) .tailfire .fi { fill: var(--line); }
.streak:not(.lit) .tailfire .t-fur { stroke: var(--line); }
.streak:not(.lit) .tailfire .t-band { stroke: color-mix(in srgb, var(--line) 70%, var(--muted)); }
.streak svg path { transition: fill .3s, stroke .3s; }
.stat-grid .fire svg { width: 26px; height: 26px; }

/* Interruptores del mismo tamaño */
.tg-track { width: 44px; height: 26px; border-radius: 13px; }
.tg-knob { top: 2px; left: 2px; width: 22px; height: 22px; }
.theme-tg[aria-checked="true"] .tg-knob { transform: translateX(18px) rotate(-12deg); }
.tg-sun { top: 6px; right: 6px; width: 8px; height: 8px; }
.tg-stars i:nth-child(1) { top: 6px; left: 8px; } .tg-stars i:nth-child(2) { top: 15px; left: 13px; } .tg-stars i:nth-child(3) { top: 8px; left: 17px; }
.tg-z { font-size: 8px; top: -3px; right: -3px; }
.theme-row { margin: 4px 0 12px; }
.dr-settings select { margin: 0 0 12px; }

/* Lista de países: espacio extra para que se pueda bajar hasta el final */
body.sugg-open .app { padding-bottom: 55vh; }

/* Recuadros tocables de cada región */
.rm-zone { cursor: pointer; outline: none; }
.rm-svg.first .rm-zone { animation: fadein .35s calc(var(--i) * 60ms) ease both; }
@keyframes fadein { from { opacity: 0; } }
.rm-box { fill: transparent; stroke: var(--ink); stroke-opacity: .28; stroke-width: 2.5; stroke-dasharray: 8 7; transition: stroke-opacity .2s, fill .2s, stroke-width .2s; }
.rm-tag rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.rm-tag text { transition: fill .2s; }
.rm-tag text { text-anchor: middle; dominant-baseline: middle; font: 700 23px var(--body); fill: var(--ink); }
.rm-zone:hover .rm-box, .rm-zone:focus-visible .rm-box { stroke-opacity: .8; fill: color-mix(in srgb, var(--surface) 25%, transparent); stroke-dasharray: none; }
.rm-zone:hover .rm-tag rect, .rm-zone:focus-visible .rm-tag rect { stroke: var(--ink); }
.rm-zone.on .rm-box { stroke-opacity: 1; stroke-width: 4; stroke-dasharray: none; fill: color-mix(in srgb, var(--signal) 14%, transparent); }
.rm-zone.on .rm-tag rect { fill: var(--ink); stroke: var(--ink); }
.rm-zone.on .rm-tag text { fill: var(--bg); }
.rm-svg.has-sel .rm-zone:not(.on) .rm-tag { opacity: .7; }

/* Mapa de ayuda centrado en el margen derecho, sin pegarse al borde */
@media (min-width: 1180px) {
  .board > .side { --mw: min(360px, calc((100vw - 540px) / 2 - 64px)); width: var(--mw); inset-inline-end: calc(((100vw - 540px) / 2 - var(--mw)) / 2); }
}

/* Cola de mapache enrollada en el mástil */
.coil { position: absolute; left: -4px; top: 6%; bottom: 10%; width: 19px; z-index: 1; pointer-events: none; }
.coil i { position: absolute; left: -1px; top: calc(var(--n) * 12.5%); width: 21px; height: 10px; border-radius: 6px; background: var(--k-fur); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), inset 0 2px 0 rgba(255, 255, 255, .18); transform: rotate(-24deg); animation: garland 4s calc(var(--n) * 90ms) ease-in-out infinite; }
.coil i:nth-child(even) { background: var(--k-mask); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12); }
@keyframes garland { 0%, 78%, 100% { transform: rotate(-24deg); } 84% { transform: rotate(-24deg) translateX(1.5px) scaleX(1.08); } }
.coil::after { content: ""; position: absolute; left: 12px; bottom: -14px; width: 20px; height: 12px; border-radius: 0 10px 10px 10px; background: linear-gradient(90deg, var(--k-fur) 0 45%, var(--k-mask) 45% 75%, var(--k-fur) 75%); transform: rotate(18deg); transform-origin: left center; animation: tailflick 4s ease-in-out infinite; }
@keyframes tailflick { 0%, 80%, 100% { transform: rotate(18deg); } 86% { transform: rotate(-6deg); } 92% { transform: rotate(24deg); } }

/* La bandera se desenrolla desde el mástil */
.flag.unfurl { transform-origin: left center; animation: unfurl .8s cubic-bezier(.2, .85, .25, 1) both; }
.flag.unfurl img { animation: none; }
@keyframes unfurl {
  0% { clip-path: inset(0 100% 0 0 round 2px 6px 6px 2px); transform: perspective(700px) rotateY(-55deg) scaleX(.6); }
  60% { clip-path: inset(0 0 0 0 round 2px 6px 6px 2px); transform: perspective(700px) rotateY(6deg) scaleX(1.02); }
  100% { clip-path: inset(0 0 0 0 round 2px 6px 6px 2px); transform: none; }
}

/* Racha: llama animada con la cola ardiendo dentro */
.fire-ic { overflow: visible; }
.fire-ic .fl-o, .fire-ic .fl-i, .fire-ic .fl-t { transform-box: view-box; transform-origin: 16px 31px; }
.fire-ic .fl-o { animation: flick 1.3s ease-in-out infinite alternate; }
.fire-ic .fl-i { animation: flick 1s ease-in-out infinite alternate-reverse; }
.fire-ic .fl-t { transform-origin: 14px 30px; animation: sway 2.2s ease-in-out infinite alternate; }
.fire-ic .k-ember { animation: ember 1.8s ease-out infinite; transform-box: fill-box; }
.fire-ic .e2 { animation-delay: .6s; } .fire-ic .e3 { animation-delay: 1.2s; }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(1.04, .96) skewX(-3deg); } 100% { transform: scale(.97, 1.06) skewX(3deg); } }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes ember { 0% { transform: translateY(4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }
.streak .fire-ic { width: 24px; height: 24px; }
.streak:not(.lit) .fire-ic * { animation: none !important; }
.streak:not(.lit) .k-flo, .streak:not(.lit) .k-fli { fill: var(--line); }
.streak:not(.lit) .k-ember { display: none; }
.streak:not(.lit) .t-fur { stroke: color-mix(in srgb, var(--line) 60%, var(--muted)); }
.streak:not(.lit) .t-band { stroke: var(--muted); }
.stat-grid .fire .fire-ic { width: 28px; height: 28px; }

/* Celebración de racha centrada */
.streak-burst { position: relative; display: grid; place-items: center; }
.streak-burst > .fire-ic { width: 150px; height: 150px; position: static; animation: ignite .8s cubic-bezier(.3, 1.5, .5, 1) both; filter: drop-shadow(0 0 24px rgba(255, 140, 0, .45)); }
.streak-num { margin-top: -6px; }

/* Iconos con vida al pasar el ratón (movimientos cortos y coherentes) */
#btn-menu:hover .k-stroke-fur { animation: wag .6s ease-in-out; }
@keyframes wag { 30% { transform: translateX(-2px); } 65% { transform: translateX(2px); } }
#btn-stats:hover rect { animation: grow .5s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(.55); } }
#btn-archive:hover .ic, .back-today:hover .ic, #to-archive:hover .ic { animation: flip .55s ease; transform-origin: 50% 20%; }
@keyframes flip { 40% { transform: rotateX(70deg); } }
.dr-item:hover .ic { animation: hop .45s ease; }
.modes button:hover .inf-ic .k-eye { animation: blink .5s ease; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 45% { transform: scaleY(.1); } }
.world-btn .w-coon { transform-box: view-box; transform-origin: 16px 17px; transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.world-btn:hover .w-coon { transform: rotate(-360deg); }
.world-btn .world-ic { width: 30px; height: 30px; }
.with-ic:hover .ic .k-line-f { animation: wave .6s ease; transform-box: fill-box; transform-origin: left; }
@keyframes wave { 40% { transform: skewY(-8deg); } }
.trash-ic .tr-head { transition: transform .35s cubic-bezier(.3, 1.8, .5, 1); }
.trash-ic .tr-lid { transform-box: fill-box; transform-origin: left bottom; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.exit-btn:hover .tr-head { transform: translateY(-3px); }
.exit-btn:hover .tr-lid { transform: rotate(-28deg); }

/* Salir y reanudar en el modo infinito */
.exit-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 6px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; color: var(--muted); }
.exit-btn .trash-ic { width: 28px; height: 28px; overflow: visible; }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border-inline-start: 5px solid var(--signal); animation: rise .4s cubic-bezier(.2, .9, .3, 1.1) both; }
.rc-info { display: flex; flex-direction: column; gap: 2px; }
.rc-info > span:first-child { font-size: 13px; font-weight: 700; color: var(--muted); }
.rc-info strong { font: 800 24px var(--display); }
.rc-info small { font: 600 13px var(--body); color: var(--muted); }
.rc-btns { display: flex; gap: 8px; }
.rc-btns .btn { height: 44px; }

/* Histórico */
.archive { display: flex; flex-direction: column; gap: 12px; }
.arc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arc-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 800 22px var(--display); }
.arc-head .btn { height: 42px; }
.arc-note { margin: 0; color: var(--muted); font-size: 14px; }
.arc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.arc-day { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); text-align: start; animation: rise .35s calc(min(var(--i), 12) * 40ms) cubic-bezier(.2, .9, .3, 1.1) both; transition: transform .15s, border-color .2s; }
.arc-day:hover { transform: translateY(-2px); border-color: var(--ink); }
.arc-flag { width: 48px; height: 36px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: var(--bg); }
.arc-flag img { width: 100%; height: 100%; object-fit: cover; }
.arc-q { font: 800 20px var(--display); color: var(--muted); }
.arc-txt { display: flex; flex-direction: column; } .arc-txt b { font: 800 18px var(--display); } .arc-txt small { color: var(--muted); }
.arc-st { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); }
.arc-day.won .arc-st { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good); }
.arc-day.lost .arc-st { background: color-mix(in srgb, var(--bad) 15%, var(--surface)); color: var(--bad); }
.arc-day.half .arc-st { background: color-mix(in srgb, var(--signal) 22%, var(--surface)); }
.meta-title small { font-weight: 600; color: var(--muted); margin-inline-start: 6px; }
.back-today { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; }
.btn.ghost-inv { border-color: color-mix(in srgb, var(--bg) 40%, transparent); color: var(--bg); background: transparent; }

/* Compartir */
.share { display: flex; flex-direction: column; gap: 14px; }
.share-text { margin: 0; padding: 14px; border-radius: 12px; background: var(--bg); font: 600 15px/1.5 var(--body); white-space: pre-wrap; word-break: break-word; }
.share-copy { justify-content: center; }
.share-nets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.net { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 0; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; animation: rise .35s calc(var(--i) * 50ms) cubic-bezier(.2, .9, .3, 1.1) both; transition: transform .15s; }
.net:hover { transform: translateY(-2px); }
.net-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 16px var(--display); }
.net-whatsapp .net-dot { background: #25d366; } .net-x .net-dot { background: #111; } .net-telegram .net-dot { background: #2aabee; }
.net-facebook .net-dot { background: #1877f2; } .net-reddit .net-dot { background: #ff4500; } .net-more .net-dot { background: var(--muted); }

/* Aviso de almacenamiento y enlaces legales */
.notice { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 45; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); transform: translate(-50%, 140%); transition: transform .45s cubic-bezier(.3, 1.3, .5, 1); }
.notice.on { transform: translate(-50%, 0); }
.notice p { margin: 0; flex: 1; font-size: 14px; } .notice a { color: var(--ink); font-weight: 700; }
.notice .btn { height: 40px; flex: none; }
.notice-ic { width: 34px; height: 34px; flex: none; animation: hop 1s 1s ease 2; }
.dr-legal { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }
.dr-legal a { color: var(--muted); }

/* Páginas legales */
.app.legal { max-width: 680px; gap: 18px; padding-block: 18px 60px; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legal-home { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 24px var(--display); }
.legal-m { width: 40px; height: 45px; }
.legal-lang { width: auto; }
.legal-doc h1 { margin: 6px 0 6px; font: 800 clamp(28px, 6vw, 40px)/1.1 var(--display); text-wrap: balance; }
.legal-intro { font-size: 17px; color: var(--muted); margin: 0 0 8px; }
.legal-doc section { padding: 16px 18px; margin-top: 10px; border-radius: 14px; background: var(--surface); }
.legal-doc h2 { margin: 0 0 6px; font: 700 18px var(--display); }
.legal-doc p { margin: 0; line-height: 1.6; max-width: 65ch; }
.legal-date { margin-top: 16px !important; font-size: 13.5px; color: var(--muted); }
.legal-back { align-self: flex-start; display: inline-flex; align-items: center; text-decoration: none; }

.modes button[aria-pressed="true"] .inf-ic .k-mask { fill: var(--k-fur); }
.modes button[aria-pressed="true"] .inf-ic .k-eye { fill: var(--ink); }

/* Enlace al histórico bajo el resultado del día */
.arc-link { display: flex; width: fit-content; align-items: center; gap: 8px; margin: 14px auto 0; padding: 8px 14px; border: 1.5px dashed var(--line); border-radius: 999px; background: none; color: var(--ink); font: 600 14.5px var(--body); cursor: pointer; transition: border-color .2s, background .2s; }
.arc-link .ic { width: 20px; height: 20px; }
.arc-link:hover { border-color: var(--ink); border-style: solid; background: var(--surface); }
.arc-link:hover .ic { animation: flip .55s ease; transform-origin: 50% 20%; }

