/* Estructura y layout. El color vive en a.css / b.css.
   Escritorio: tres columnas. Telefono: mapa a pantalla completa + hoja inferior. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* Las reglas de clase de abajo ganarian por especificidad sobre [hidden]. */
[hidden] { display: none !important; }
body {
  margin: 0; overflow: hidden; display: flex; flex-direction: column; height: 100dvh;
  font-family: var(--f-ui); color: var(--txt); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  opacity: 0; transition: opacity .5s ease;
}
body.listo { opacity: 1; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; }

/* ------------------------------------------------------------------ header */
.top {
  display: flex; align-items: center; gap: 20px;
  height: 62px; padding: 0 16px; flex: none;
  border-bottom: 1px solid var(--linea); background: var(--bg-panel);
  position: relative; z-index: 30;
}
.marca { display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
/* el gap va entre el sol y el nombre, no entre TERRATENIENTE y .fun */
.nombre-marca { display: flex; align-items: baseline; }
.sol {
  width: 30px; height: 30px; flex: none; object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 201, 92, .35));
}
.logo { font-family: var(--f-tit); font-size: 21px; font-weight: 800; color: var(--txt-fuerte); align-self: baseline; }
.tld { font-family: var(--f-tit); font-size: 21px; font-weight: 400; color: var(--acento); align-self: baseline; }
/* Franja de bandera al tope: el guiño, sin disfrazar el sitio de acto escolar. */
.top::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--celeste) 0 34%, #fff 34% 66%, var(--celeste) 66%);
  opacity: .7;
}
.tagline {
  margin: 0; font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--txt-suave); white-space: nowrap;
}
.marca, .cta, .switch { flex: none; }
.stats {
  display: flex; gap: 14px; margin-left: auto; font-size: 12.5px; flex: 0 1 auto;
  color: var(--txt-suave); min-width: 0; overflow: hidden;
}
.stat { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.stat b { font-family: var(--f-num); font-size: 14px; font-weight: 600; color: var(--txt-fuerte); }
.stat .oro { color: var(--oro); }
/* Los dos números de prueba social van en píldora: son los que empujan a
   comprar, no pueden perderse entre los demás. */
.s-vis, .s-duenos {
  padding: 5px 11px; border-radius: 999px; background: var(--met-bg);
  border: 1px solid var(--linea);
}
.s-duenos { border-color: color-mix(in srgb, var(--oro) 32%, transparent); }
.stat .vivo { color: var(--vivo); position: relative; padding-left: 13px; }
.stat .vivo::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: var(--vivo); transform: translateY(-50%); animation: latir 2s infinite;
}
@keyframes latir { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--vivo-glow); } 50% { opacity: .55; box-shadow: 0 0 0 5px transparent; } }

.cta {
  display: flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  background: var(--cta-bg); color: var(--cta-txt); border: 1px solid var(--cta-borde);
  box-shadow: var(--cta-sombra); transition: transform .15s, box-shadow .2s, filter .2s;
}
.cta:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: var(--cta-sombra-hover); }
.cta-precio { font-family: var(--f-num); font-weight: 700; }
.switch {
  display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--linea); background: var(--bg-panel); text-decoration: none;
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-tenue);
  transition: border-color .15s, color .15s;
}
.switch:hover { border-color: var(--acento); color: var(--txt-fuerte); }
.switch b { font-family: var(--f-tit); font-size: 13px; color: var(--acento); }

/* ------------------------------------------------------------------ cancha */
.cancha {
  display: grid; grid-template-columns: 312px minmax(0, 1fr) 332px;
  flex: 1; min-height: 0;
}
.col { display: flex; flex-direction: column; gap: 1px; overflow: hidden; background: var(--linea); }
.col.izq { border-right: 1px solid var(--linea); }
.col.der { border-left: 1px solid var(--linea); }
.panel { background: var(--bg-panel); padding: 13px 13px 11px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.col .panel[data-panel="guerra"] { flex: 1 1 58%; }
.col .panel[data-panel="trafico"] { flex: 1 1 42%; }
.col .panel[data-panel="ranking"] { flex: 0 0 auto; max-height: 46%; }
.col .panel[data-panel="libres"] { flex: 1 1 auto; }
.panel h2 {
  margin: 0 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--txt-suave); display: flex; align-items: center; gap: 7px;
}
.panel h2 .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vivo); animation: latir 2s infinite; }
.panel h2 .cont { margin-left: auto; font-size: 10px; letter-spacing: .04em; color: var(--txt-tenue); text-transform: none; }
.panel .sub { margin: -6px 0 10px; font-size: 11px; line-height: 1.45; color: var(--txt-tenue); }
.feed, .barras, .rank, .libres {
  overflow-y: auto; min-height: 0; margin: 0 -5px; padding: 0 5px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.feed::-webkit-scrollbar, .barras::-webkit-scrollbar, .libres::-webkit-scrollbar, .rank::-webkit-scrollbar { width: 5px; }
.feed::-webkit-scrollbar-thumb, .barras::-webkit-scrollbar-thumb,
.libres::-webkit-scrollbar-thumb, .rank::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 3px; }

.chip {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px;
  font-size: 9.5px; font-weight: 800; color: #fff; letter-spacing: -.02em;
  font-family: var(--f-tit); text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.chip.mini { width: 17px; height: 17px; border-radius: 5px; font-size: 7.5px; }
.chip.con-logo { background: #fff; padding: 2px; }
.chip.con-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.chip.xl { width: 52px; height: 52px; border-radius: 15px; font-size: 19px; }
.chip.vacio { background: var(--chip-vacio); color: var(--txt-suave); }

.fila-feed {
  display: grid; grid-template-columns: 24px 1fr auto auto; align-items: center;
  gap: 9px; width: 100%; padding: 7px 6px; border-radius: 8px; text-align: left;
  border-bottom: 1px solid var(--linea-suave); transition: background .12s;
}
.fila-feed:hover { background: var(--hover); }
.fila-feed.nueva { animation: entrar .5s cubic-bezier(.2,.9,.3,1); }
@keyframes entrar {
  from { opacity: 0; transform: translateX(-14px); background: var(--hover); }
}
.ff-txt { font-size: 12px; color: var(--txt-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-txt b { color: var(--txt-fuerte); font-weight: 600; }
.ff-monto { font-family: var(--f-num); font-size: 12px; font-weight: 600; color: var(--oro); }
.ff-hace { font-family: var(--f-num); font-size: 10.5px; color: var(--txt-tenue); min-width: 30px; text-align: right; }

.fila-barra {
  display: block; width: 100%; text-align: left; padding: 8px 6px 9px; border-radius: 8px;
  border-bottom: 1px solid var(--linea-suave); transition: background .12s;
}
.fila-barra:hover { background: var(--hover); }
.fb-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--txt-suave); }
.fb-top b { color: var(--txt-fuerte); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-n { margin-left: auto; font-family: var(--f-num); font-weight: 700; color: var(--txt-fuerte); }
.barra { display: block; height: 5px; border-radius: 3px; background: var(--barra-bg); margin: 6px 0 5px; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 3px; transition: width .5s ease; }
.fb-ctr { font-family: var(--f-num); font-size: 10px; color: var(--txt-tenue); }

.fila-rank {
  display: grid; grid-template-columns: 18px 24px 1fr auto; align-items: center; gap: 9px;
  padding: 7px 6px; border-bottom: 1px solid var(--linea-suave);
}
.pos { font-family: var(--f-num); font-size: 11px; color: var(--txt-tenue); text-align: center; }
.corona { color: var(--oro); font-size: 13px; font-style: normal; }
.fr-txt { overflow: hidden; }
.fr-txt b { display: block; font-size: 12.5px; font-weight: 600; color: var(--txt-fuerte); }
.fr-txt em { display: block; font-style: normal; font-size: 10.5px; color: var(--txt-tenue); }
.fr-plata { font-family: var(--f-num); font-size: 12px; font-weight: 600; }

.claim-all {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 9px;
  border-radius: 10px; background: var(--claim-bg); border: 1px dashed var(--claim-borde);
  transition: background .15s, border-color .15s;
}
.claim-all:hover { background: var(--claim-hover); border-color: var(--acento); }
.claim-all b { display: block; font-size: 12px; font-weight: 600; color: var(--txt-fuerte); }
.claim-all span { font-family: var(--f-num); font-size: 11px; color: var(--oro); }
.claim-all em { font-style: normal; color: var(--txt-tenue); text-decoration: line-through; }
.fila-libre {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px;
  width: 100%; padding: 7px 6px; border-radius: 8px; text-align: left;
  border-bottom: 1px solid var(--linea-suave); transition: background .12s;
}
.fila-libre:hover { background: var(--hover); }
.fl-iso { font-family: var(--f-num); font-size: 9.5px; font-weight: 700; color: var(--txt-tenue); letter-spacing: .03em; }
.fl-nom { font-size: 12px; color: var(--txt-fuerte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-nom em { display: block; font-style: normal; font-size: 10px; color: var(--txt-tenue); }
.fl-precio { font-family: var(--f-num); font-size: 12px; font-weight: 600; color: var(--oro); }

/* selector de nivel: la interacción más importante del mapa no puede quedar
   escondida detrás de "probá hacer zoom" */
.niveles {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 13;
  display: flex; gap: 3px; padding: 3px; border-radius: 999px;
  background: var(--inset-bg); border: 1px solid var(--linea); backdrop-filter: blur(8px);
}
.niveles button {
  padding: 7px 15px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--txt-tenue); white-space: nowrap; transition: background .15s, color .15s;
}
.niveles button:hover { color: var(--txt-fuerte); }
.niveles button.on { background: var(--acento); color: var(--sobre-acento); }

.pista {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 13;
  padding: 9px 16px; border-radius: 999px; font-size: 12px; color: var(--txt-suave);
  background: var(--tip-bg); border: 1px solid var(--linea);
  box-shadow: 0 8px 26px rgba(0,0,0,.3); animation: latido 2.4s ease-in-out infinite;
  pointer-events: none; max-width: calc(100% - 24px); text-align: center;
}
.pista b { color: var(--txt-fuerte); }
@keyframes latido { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }

/* paneles sin datos: explican qué va a pasar ahí en vez de quedar en blanco */
.vacio { padding: 14px 6px; }
.vacio b { display: block; font-size: 12.5px; color: var(--txt-fuerte); margin-bottom: 5px; }
.vacio span { display: block; font-size: 11.5px; line-height: 1.55; color: var(--txt-tenue); }

.primerazo {
  position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
  z-index: 14; width: min(420px, calc(100% - 28px)); padding: 15px 18px;
  border-radius: 14px; background: var(--tip-bg); border: 1px solid var(--acento);
  box-shadow: 0 14px 44px rgba(0,0,0,.45); transition: opacity .7s, transform .7s;
  animation: subir .45s cubic-bezier(.2,.85,.3,1);
}
.primerazo b { display: block; font-size: 14px; color: var(--txt-fuerte); margin-bottom: 5px; }
.primerazo span { display: block; font-size: 12px; line-height: 1.6; color: var(--txt-suave); }
.primerazo.yendo { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* -------------------------------------------------------------------- mapa */
.mapa-wrap { position: relative; display: flex; flex-direction: column; background: var(--bg-mapa); min-width: 0; overflow: hidden; }
.mapa { flex: 1; position: relative; min-height: 0; cursor: grab; touch-action: none; overflow: hidden; }
.mapa.agarrando { cursor: grabbing; }
/* El viewBox es 1:2,1: con meet entra completo y centrado sea cual sea el hueco. */
.mapa svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }

.capa { transition: opacity .25s ease; }
.capa.off { opacity: 0; pointer-events: none; }
.terr {
  fill: var(--terr-libre); stroke: var(--terr-borde); stroke-width: calc(0.6 / var(--k, 1));
  transition: filter .15s; cursor: pointer;
}
.terr:hover { filter: brightness(1.25) saturate(1.15); }
.terr.libre { fill: var(--terr-libre); }
.terr.apagado { fill: var(--terr-apagado); opacity: .45; }
.terr.contexto { fill: var(--terr-contexto); opacity: .4; pointer-events: none; }
/* Departamento gobernado por el dueño de la provincia: su color, pero apagado.
   Así se distingue de un departamento que alguien compró por separado. */
/* Departamento bajo la bandera de la provincia pero sin dueño propio: celeste
   de "se puede comprar" teñido con el color del gobernador. Pintarlo del color
   liso del dueño convertía la provincia entera en una mancha y escondía que
   sus departamentos siguen a la venta. */
.terr.heredado {
  fill: color-mix(in srgb, var(--dueno, #64748b) 34%, var(--terr-activo));
  opacity: .85;
}
.terr.heredado:hover { fill: color-mix(in srgb, var(--dueno, #64748b) 22%, var(--celeste-hover)); opacity: 1; }
/* Dentro de una provincia, sus departamentos libres tienen que leerse comprables. */
.terr.activo.libre { fill: var(--terr-activo); }
.terr.activo { stroke: var(--terr-activo-borde); stroke-width: calc(1.15 / var(--k, 1)); }
.terr.sel { stroke: var(--sel); stroke-width: calc(2 / var(--k, 1)); filter: url(#glow); }
.terr.flash { animation: flash 1.4s ease; }
@keyframes flash {
  0% { filter: brightness(3.2) saturate(1.6); }
  100% { filter: none; }
}
/* Limites provinciales por encima de los departamentos: sin esto uno se pierde. */
.borde-prov { fill: none; stroke: var(--borde-prov); stroke-width: calc(1.5 / var(--k, 1)); pointer-events: none; }
.capa-logos { pointer-events: none; }
.logo-t { pointer-events: auto; cursor: pointer; }
.logo-t .ini { text-anchor: middle; font-family: var(--f-tit); font-weight: 800; letter-spacing: -.04em; }
.logo-t:hover rect { stroke: var(--sel); stroke-width: 1.2; }

.mapa-tools { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 5px; z-index: 12; }
.mapa-tools button {
  width: 34px; height: 34px; border-radius: 10px; font-size: 15px;
  background: var(--bg-panel); border: 1px solid var(--linea); color: var(--txt-suave);
  display: grid; place-items: center; transition: background .15s, color .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.mapa-tools button:hover { background: var(--hover); color: var(--txt-fuerte); }
.mapa-tools #t-heat { width: auto; padding: 0 10px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.mapa-tools #t-heat.on { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }

.ruta { position: absolute; top: 12px; left: 14px; z-index: 12; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt-tenue); max-width: calc(100% - 130px); }
.ruta-act { color: var(--txt-fuerte); font-weight: 600; }
.ruta-hint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruta-volver {
  padding: 6px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-panel); border: 1px solid var(--linea); color: var(--txt-suave); white-space: nowrap;
}
.ruta-volver:hover { color: var(--txt-fuerte); border-color: var(--acento); }

.leyenda {
  position: absolute; bottom: 12px; left: 14px; z-index: 12; display: flex; align-items: center;
  gap: 10px; font-size: 10.5px; color: var(--txt-tenue); letter-spacing: .05em; text-transform: uppercase;
  pointer-events: none;
}
.lg-item { display: flex; align-items: center; gap: 5px; }
.lg-item i { width: 10px; height: 10px; border-radius: 3px; }
.mx-libre { background: var(--terr-libre); border: 1px solid var(--terr-activo-borde); }
.mx-tomado { background: linear-gradient(135deg, #ff5c39, #a855f7); }
.lg-hint { opacity: .6; display: none; }
.escala { display: flex; gap: 2px; }
.escala i { width: 16px; height: 8px; }
.lg-tit { font-weight: 700; color: var(--txt-suave); }

.inset {
  position: absolute; bottom: 40px; right: 14px; width: 150px; z-index: 11;
  border: 1px solid var(--linea); border-radius: 10px; padding: 17px 7px 7px;
  background: var(--inset-bg); backdrop-filter: blur(6px);
}
.inset-tit { position: absolute; top: 4px; left: 8px; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-tenue); }
.inset svg { width: 100%; height: auto; display: block; }
.inset-fila { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px; border-radius: 6px; font-size: 10px; color: var(--txt-suave); text-align: left; }
.inset-fila:hover { background: var(--hover); color: var(--txt-fuerte); }
.inset-punto { width: 8px; height: 8px; border-radius: 2px; flex: none; border: 1px solid var(--linea); }

/* avisos de conquista */
.avisos { position: absolute; bottom: 40px; left: 14px; z-index: 14; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.aviso {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 8px; border-radius: 11px;
  background: var(--tip-bg); border: 1px solid var(--linea); box-shadow: 0 8px 26px rgba(0,0,0,.3);
  font-size: 12px; color: var(--txt-suave); animation: subeAviso .35s cubic-bezier(.2,.9,.3,1);
  transition: opacity .55s, transform .55s; max-width: 320px;
}
.aviso b { color: var(--txt-fuerte); font-weight: 600; }
.av-monto { font-family: var(--f-num); color: var(--oro) !important; }
.aviso.propio { border-color: var(--vivo); box-shadow: 0 8px 30px var(--vivo-glow); }
.aviso.yendo { opacity: 0; transform: translateX(-18px); }
@keyframes subeAviso { from { opacity: 0; transform: translateY(10px); } }

/* ----------------------------------------------------------------- tooltip */
.tip {
  position: fixed; z-index: 60; pointer-events: none; display: flex; flex-direction: column; gap: 3px;
  padding: 9px 11px; border-radius: 10px; min-width: 148px;
  background: var(--tip-bg); border: 1px solid var(--linea);
  box-shadow: 0 8px 28px rgba(0,0,0,.3); font-size: 11.5px;
}
.tip b { font-size: 13px; color: var(--txt-fuerte); }
.tip-prov { font-size: 10.5px; color: var(--txt-tenue); }
.tip-dueno { display: flex; align-items: center; gap: 6px; color: var(--txt-suave); }
.tip-dueno i { width: 9px; height: 9px; border-radius: 3px; }
.tip-met { font-family: var(--f-num); font-size: 10.5px; color: var(--txt-tenue); }
.tip-libre { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--vivo); }
.tip-precio { font-family: var(--f-num); font-weight: 700; color: var(--oro); }

/* el festejo: la persona acaba de pagar y quiere ver su logo en el mapa */
.confeti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
.terr.festejo { animation: latirTerr 1.1s ease-in-out 3; transform-box: fill-box; transform-origin: center; }
@keyframes latirTerr {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.9) saturate(1.3) drop-shadow(0 0 14px currentColor); }
}

.fiesta {
  position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 20px;
  background: var(--velo); backdrop-filter: blur(4px); animation: aparecer .3s ease;
  transition: opacity .4s;
}
.fiesta.yendo { opacity: 0; }
.fiesta-caja {
  width: min(440px, 100%); padding: 28px 26px 24px; border-radius: 20px; text-align: center;
  background: var(--bg-panel); border: 1px solid var(--acento);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 60px -20px var(--acento);
  animation: subir .45s cubic-bezier(.2,.85,.3,1);
}
.fiesta-caja .chip.xl { margin: 0 auto 14px; }
.fiesta-caja h3 {
  margin: 0 0 6px; font-family: var(--f-tit); font-size: 27px; font-weight: 700;
  letter-spacing: -.025em; color: var(--txt-fuerte);
}
.fiesta-sub { margin: 0 0 18px; font-size: 13px; line-height: 1.5; color: var(--txt-suave); }
.fiesta-datos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px;
}
.fiesta-datos span { padding: 11px 8px; border-radius: 12px; background: var(--met-bg); }
.fiesta-datos b { display: block; font-family: var(--f-num); font-size: 17px; color: var(--txt-fuerte); }
.fiesta-datos em {
  display: block; font-style: normal; font-size: 9.5px; line-height: 1.3;
  color: var(--txt-tenue); margin-top: 3px;
}
.fiesta-botones { display: grid; gap: 8px; }
.bienvenida .sol { width: 46px; height: 46px; margin: 0 auto 12px; }
.bienvenida h3 { margin-bottom: 16px; }
.pasos { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 11px; text-align: left; counter-reset: paso; }
.pasos li {
  position: relative; padding-left: 34px; font-size: 13px; line-height: 1.5; color: var(--txt-suave);
}
.pasos li b { color: var(--txt-fuerte); font-weight: 600; }
.pasos li::before {
  counter-increment: paso; content: counter(paso);
  position: absolute; left: 0; top: -1px; width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--f-num); font-size: 11px; font-weight: 700;
  background: var(--met-bg); color: var(--oro); border: 1px solid var(--linea);
}
.fiesta-cerrar {
  padding: 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
  color: var(--txt-suave); background: var(--met-bg);
}
.fiesta-cerrar:hover { color: var(--txt-fuerte); background: var(--hover); }

/* Los legales y el arrepentimiento van en el header y no en un pie: la
   Resolución 424/2020 pide el botón de arrepentimiento a la vista, y esta
   página no scrollea nunca. */
.legal-top { display: flex; gap: 14px; align-items: center; flex: none; }
.legal-top a {
  font-size: 11px; color: var(--txt-tenue); text-decoration: none;
  border-bottom: 1px solid transparent; white-space: nowrap;
}
.legal-top a:hover { color: var(--txt-suave); border-bottom-color: var(--txt-tenue); }
.legal-compra { margin-top: 6px; line-height: 1.5; }
.legal-compra a { color: var(--txt-suave); }
.legal-compra a:hover { color: var(--acento); }
@media (max-width: 1100px) {
  /* en el teléfono baja a su propio renglón, que igual entra sin scrollear */
  .legal-top { order: 9; width: 100%; gap: 12px; padding-top: 2px; }
  .legal-top a { font-size: 10px; }
}

/* ------------------------------------------------------------ certificado */
/* La invitación aparece sólo en la ficha del que ya es dueño. No hay login:
   el que no compró no tiene nada que compartir, y el certificado se dibuja
   con los datos públicos del territorio igual. */
.cert-cta {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 12px 0 0;
  padding: 12px 14px; border-radius: 13px; text-align: left; font-size: 12.5px;
  color: var(--txt-suave); background: var(--met-bg);
  border: 1px dashed color-mix(in srgb, var(--acento) 45%, transparent);
  transition: background .15s, border-color .15s, color .15s;
}
.cert-cta span { flex: 1; }
.cert-cta b { color: var(--acento); font-weight: 700; }
.cert-cta i { font-style: normal; font-size: 14px; color: var(--acento); }
.cert-cta:hover {
  color: var(--txt-fuerte); background: var(--hover);
  border-color: var(--acento);
}

.cert {
  position: fixed; inset: 0; z-index: 98; display: grid; place-items: center; padding: 18px;
  background: var(--velo); backdrop-filter: blur(5px); animation: aparecer .25s ease;
  transition: opacity .3s;
}
.cert.yendo { opacity: 0; }
.cert-caja {
  position: relative; width: min(400px, 100%); max-height: 100%;
  display: flex; flex-direction: column; gap: 14px;
  animation: subir .4s cubic-bezier(.2,.85,.3,1);
}
.cert-caja .cerrar { top: -40px; right: 0; }
/* El canvas sale a 1080×1350: acá se muestra escalado, y así el que baja la
   imagen se lleva algo con resolución de verdad. */
.cert-lienzo {
  display: grid; place-items: center; min-height: 220px; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--linea);
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.cert-lienzo canvas { display: block; width: 100%; height: auto; }
.cert-cargando { font-size: 12.5px; color: var(--txt-tenue); padding: 40px 0; }
.cert-pie { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cert-bajar {
  padding: 0 18px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
  color: var(--txt-suave); background: var(--met-bg);
}
.cert-bajar:hover { color: var(--txt-fuerte); background: var(--hover); }
@media (max-width: 520px) {
  .cert { padding: 12px; }
  .cert-caja { width: 100%; }
}

/* ------------------------------------------------------------------- ficha */
.modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: var(--velo); backdrop-filter: blur(3px); padding: 20px; animation: aparecer .18s ease;
}
@keyframes aparecer { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(452px, 100%); max-height: 90dvh; overflow-y: auto;
  border-radius: 18px; background: var(--bg-panel); border: 1px solid var(--linea);
  box-shadow: 0 24px 70px rgba(0,0,0,.45); padding: 22px;
  animation: subir .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes subir { from { transform: translateY(14px); opacity: 0; } }
.cerrar { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 9px; color: var(--txt-tenue); }
.cerrar:hover { background: var(--hover); color: var(--txt-fuerte); }
.ficha-top { display: flex; gap: 14px; align-items: center; padding: 0 34px 16px 0; }
.f-nivel { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--txt-tenue); }
.ficha-top h3 { margin: 2px 0 4px; font-family: var(--f-tit); font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--txt-fuerte); line-height: 1.15; }
.f-dueno, .f-libre { margin: 0; font-size: 12px; color: var(--txt-suave); }
.f-dueno a { color: var(--acento); text-decoration: none; }
.f-dueno a:hover { text-decoration: underline; }
.f-libre { color: var(--vivo); }

/* el dueño actual: lo que más se toca de la ficha es este botón */
.dueno-box.heredada { box-shadow: inset 0 0 0 1px var(--linea); }
.dueno-box.heredada .visitar { background: var(--met-bg); color: var(--txt-fuerte); text-shadow: none; }
.aviso-heredado { margin-top: -6px; }
.tip-via { display: block; font-style: normal; font-size: 9.5px; color: var(--txt-tenue); }
.dueno-box {
  display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px;
  border-radius: 14px; background: var(--met-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent);
}
.chip.grande { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.db-txt { flex: 1; min-width: 0; }
.db-txt b { display: block; font-size: 14px; font-weight: 700; color: var(--txt-fuerte); }
.db-txt em {
  display: block; font-style: normal; font-size: 11.5px; color: var(--txt-suave);
  margin: 1px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.db-txt span { font-family: var(--f-num); font-size: 10.5px; color: var(--txt-tenue); }
.visitar {
  flex: none; display: flex; align-items: center; gap: 5px; padding: 11px 15px;
  border-radius: 11px; text-decoration: none; font-size: 12.5px; font-weight: 700;
  letter-spacing: .03em; background: var(--c); color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .14s, filter .2s;
}
.visitar:hover { transform: translateY(-1px); filter: brightness(1.12); }
.visitar i { font-style: normal; font-size: 13px; }

/* historia del territorio */
.historia { border-top: 1px solid var(--linea); margin-top: 18px; padding-top: 15px; }
.historia h4 {
  margin: 0 0 9px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--txt-suave); display: flex; gap: 8px; align-items: baseline;
}
.historia h4 span { font-size: 10px; letter-spacing: .03em; text-transform: none; color: var(--txt-tenue); }
.hist-fila {
  display: grid; grid-template-columns: 16px 24px 1fr auto auto; align-items: center; gap: 9px;
  padding: 7px 6px; border-radius: 9px; text-decoration: none;
  border-bottom: 1px solid var(--linea-suave); transition: background .12s;
}
.hist-fila:hover { background: var(--hover); }
.hist-pos { text-align: center; }
.hist-pos .corona { font-size: 12px; }
.hist-txt { overflow: hidden; }
.hist-txt b { display: block; font-size: 12.5px; font-weight: 600; color: var(--txt-fuerte); }
.hist-txt em {
  display: block; font-style: normal; font-family: var(--f-num); font-size: 10px;
  color: var(--txt-tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-fila.actual .hist-txt b { color: var(--oro); }
.hist-monto { font-family: var(--f-num); font-size: 12px; font-weight: 600; color: var(--txt-suave); }
.hist-hace { font-family: var(--f-num); font-size: 10px; color: var(--txt-tenue); min-width: 30px; text-align: right; }
.hist-pie, .hist-nada { margin: 10px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--txt-tenue); }

.metricas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.met { padding: 10px 6px; border-radius: 10px; background: var(--met-bg); text-align: center; }
.met b { display: block; font-family: var(--f-num); font-size: 15px; font-weight: 700; color: var(--txt-fuerte); }
.met em { font-style: normal; font-size: 9.5px; color: var(--txt-tenue); line-height: 1.25; display: block; margin-top: 2px; }
.met.destacada b { color: var(--acento); }
.nota-met { margin: 0 0 16px; font-size: 10.5px; line-height: 1.5; color: var(--txt-tenue); }

.ver-deptos {
  display: block; width: 100%; text-align: left; padding: 12px 13px; margin-bottom: 16px;
  border-radius: 11px; background: var(--met-bg); font-size: 12.5px; font-weight: 600;
  color: var(--txt-fuerte); transition: background .15s;
}
.ver-deptos:hover { background: var(--hover); }
.ver-deptos em { display: block; font-style: normal; font-size: 11px; font-weight: 400; color: var(--txt-tenue); margin-top: 2px; }

.compra { border-top: 1px solid var(--linea); padding-top: 15px; }
.precio-linea { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--txt-suave); margin-bottom: 5px; }
.precio-linea b { font-family: var(--f-num); font-size: 14px; color: var(--txt-fuerte); }
.precio-linea.grande b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.precio-linea .oro { color: var(--oro); }
.regla { margin: 8px 0 14px; font-size: 11px; line-height: 1.55; color: var(--txt-tenue); }
/* cargar la marca acá mismo: al acreditarse el pago ya sale al aire */
.tuya { padding: 14px 0 4px; }
.tuya-grid { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; align-items: start; }
.tuya-prev { text-align: center; }
.prev-chip {
  width: 68px; height: 68px; border-radius: 19px; display: grid; place-items: center;
  font-family: var(--f-tit); font-size: 23px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); overflow: hidden; transition: background .2s;
}
.prev-chip img { width: 84%; height: 84%; object-fit: contain; }
.tuya-prev em {
  display: block; margin-top: 5px; font-style: normal; font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--txt-tenue);
}
.tuya-campos { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.campo {
  display: flex; align-items: center; gap: 9px; padding: 0 11px; height: 40px;
  border-radius: 10px; background: var(--met-bg); border: 1.5px solid transparent;
  transition: border-color .14s;
}
.campo:focus-within { border-color: var(--acento); }
.campo > span {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--txt-tenue);
}
.campo input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0;
  font: inherit; font-size: 13px; color: var(--txt-fuerte);
}
.campo input:focus { outline: none; }
.campo input::placeholder { color: var(--txt-tenue); }

.tuya-fila { margin-top: 8px; }
.f-logo {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100%; min-height: 46px; padding: 7px 12px; border-radius: 10px;
  background: var(--met-bg); border: 1.5px dashed var(--claim-borde); text-align: left;
  transition: border-color .14s, background .14s;
}
.f-logo:hover { border-color: var(--acento); background: var(--hover); }
.f-logo b { font-size: 12.5px; font-weight: 600; color: var(--txt-fuerte); }
.f-logo em { font-style: normal; font-size: 10.5px; color: var(--txt-tenue); margin-top: 1px; }
.f-logo.cargado { border-style: solid; border-color: var(--vivo); }
.f-logo.cargado em { color: var(--vivo); }

.f-colores { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.f-colores > span {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--txt-tenue); margin-right: 2px;
}
.f-colores button {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); transition: transform .12s;
}
.f-colores button:hover { transform: scale(1.12); }
.f-colores button.on { border-color: var(--txt-fuerte); }
.f-otro-color { width: 24px; height: 24px; border-radius: 8px; overflow: hidden; position: relative; border: 1px dashed var(--claim-borde); }
.f-otro-color input { position: absolute; inset: -6px; width: 200%; height: 200%; border: 0; padding: 0; background: none; cursor: pointer; }
.f-error { margin: 10px 0 0; font-size: 11.5px; color: #ff7a70; }

/* elegir cuánto pagar: el monto es el blindaje contra el robo */
.blindaje { margin: 12px 0 14px; }
.bl-tit { display: block; font-size: 11.5px; font-weight: 600; color: var(--txt-fuerte); margin-bottom: 9px; }
.bl-tit em { display: block; font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--txt-tenue); margin-top: 2px; line-height: 1.4; }
.bl-ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bl-ops button, .bl-otro {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 7px 4px; border-radius: 11px; background: var(--met-bg);
  border: 1.5px solid transparent; transition: border-color .14s, background .14s;
  font-size: 12px; font-weight: 700; color: var(--txt-suave);
}
.bl-ops button b { font-family: var(--f-num); font-size: 10.5px; font-weight: 600; color: var(--txt-tenue); white-space: nowrap; }
.bl-ops button:hover { background: var(--hover); }
.bl-ops button.on { border-color: var(--acento); background: var(--met-destacada); color: var(--txt-fuerte); }
.bl-ops button.on b { color: var(--acento); }
.bl-otro { cursor: text; }
.bl-otro span { font-size: 10px; font-weight: 600; color: var(--txt-tenue); text-transform: uppercase; letter-spacing: .06em; }
.bl-otro input {
  width: 100%; min-width: 0; border: 0; background: none; text-align: center;
  font-family: var(--f-num); font-size: 12px; font-weight: 700; color: var(--txt-fuerte); padding: 0;
}
.bl-otro input:focus { outline: none; }
.bl-otro:focus-within { border-color: var(--acento); background: var(--met-destacada); }
.bl-otro input::-webkit-outer-spin-button, .bl-otro input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bl-res { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--txt-suave); }
.bl-res b { color: var(--txt-fuerte); font-family: var(--f-num); }
.bl-res.error { color: var(--robar-txt-error, #ff6b6b); }

.btn-comprar {
  width: 100%; padding: 14px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
  background: var(--cta-bg); color: var(--cta-txt); box-shadow: var(--cta-sombra);
  transition: transform .14s, filter .2s;
}
.btn-comprar:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-comprar:disabled { opacity: .42; transform: none; cursor: not-allowed; filter: grayscale(.5); }
.btn-comprar.pagando { opacity: .75; cursor: wait; filter: none; }
.btn-comprar.robar { background: var(--robar-bg); color: var(--robar-txt); }
.pago { margin: 9px 0 0; text-align: center; font-size: 10.5px; color: var(--txt-tenue); }

/* --------------------------------------------------- hoja inferior (movil) */
.hoja { display: none; }
.oculto-tab { display: none !important; }

@media (max-width: 1100px) {
  .top { height: auto; flex-wrap: wrap; gap: 6px; padding: 8px 11px 6px; }
  .tagline, .switch { display: none; }
  .marca { gap: 7px; min-width: 0; }
  .sol { width: 22px; height: 22px; }
  .logo, .tld { font-size: 15px; }
  .cta {
    order: 2; margin-left: auto; padding: 7px 11px; font-size: 9px; gap: 5px;
    letter-spacing: .02em; border-radius: 999px;
  }
  .cta-txt { display: none; }
  .cta::before { content: 'Comprar el país'; }
  .cta-precio { font-size: 10px; }
  .stats {
    order: 3; flex: 1 0 100%; margin: 1px 0 0; gap: 14px; font-size: 10.5px;
    overflow-x: auto; scrollbar-width: none;
  }
  .stats::-webkit-scrollbar { display: none; }
  /* En teléfono se recortan los números de contexto, nunca la prueba social. */
  .s-vis, .s-duenos { display: flex; padding: 4px 9px; }
  .s-clicks, .s-terr, .s-desde { display: none; }
  .stat b { font-size: 11.5px; }

  .cancha { grid-template-columns: 1fr; }
  .col { display: none; }
  .mapa-wrap { padding-bottom: 104px; }
  .inset { width: 88px; bottom: 108px; padding: 13px 4px 4px; opacity: .9; }
  .inset-fila { font-size: 9px; }
  .leyenda { bottom: 112px; font-size: 9.5px; }
  .lg-hint, .leyenda .lg-item { display: none; }
  .inset-tit { font-size: 7.5px; }
  .avisos { bottom: 112px; left: 10px; right: 10px; }
  .aviso { max-width: none; }
  .mapa-tools { top: 54px; }
  .mapa-tools button { width: 38px; height: 38px; font-size: 17px; }
  .mapa-tools #t-heat { height: 34px; font-size: 9.5px; padding: 0 8px; }
  /* El selector va arriba: abajo chocaba con el recuadro austral. */
  .niveles { top: 10px; font-size: 11px; }
  .niveles button { padding: 8px 13px; font-size: 11px; }
  .pista { top: 56px; font-size: 11px; padding: 8px 12px; }
  /* En vista país el breadcrumb solo dice "Argentina" y le roba lugar al
     selector, que ya dice dónde estás. Aparece solo al entrar a una provincia. */
  .ruta:not(:has(.ruta-volver)) { display: none; }
  .ruta {
    font-size: 11px; max-width: calc(100% - 62px); padding: 5px 10px; border-radius: 999px;
    background: var(--inset-bg); backdrop-filter: blur(6px); border: 1px solid var(--linea);
  }
  .ruta-volver { padding: 3px 8px; }

  .hoja {
    display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0;
    height: min(66dvh, 560px); z-index: 40;
    background: var(--bg-panel); border-top: 1px solid var(--linea);
    border-radius: 16px 16px 0 0; box-shadow: 0 -10px 34px rgba(0,0,0,.28);
    transform: translateY(calc(100% - 104px)); transition: transform .32s cubic-bezier(.2,.85,.3,1);
  }
  .hoja.abierta { transform: none; }
  .hoja-tirador { height: 22px; display: grid; place-items: center; flex: none; }
  .hoja-tirador::before { content: ''; width: 38px; height: 4px; border-radius: 2px; background: var(--scroll); }
  .hoja-tabs {
    display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; flex: none;
    scrollbar-width: none; border-bottom: 1px solid var(--linea);
  }
  .hoja-tabs::-webkit-scrollbar { display: none; }
  .hoja-tabs button {
    padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    color: var(--txt-tenue); background: var(--met-bg);
  }
  .hoja-tabs button.on { background: var(--acento); color: var(--sobre-acento); }
  .hoja-cuerpo { flex: 1; min-height: 0; display: flex; }
  .hoja-cuerpo .panel { flex: 1; padding: 12px 12px 16px; }
  .modal { place-items: end center; padding: 0; }
  .modal-box {
    width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    animation: subirHoja .3s cubic-bezier(.2,.85,.3,1);
  }
  @keyframes subirHoja { from { transform: translateY(100%); } }
  .f-colores { gap: 8px; }
  .f-colores button, .f-otro-color { width: 36px; height: 36px; border-radius: 10px; }
  .dueno-box { flex-wrap: wrap; }
  .visitar { flex: 1 0 100%; justify-content: center; padding: 13px; font-size: 13px; }
  .hist-fila { grid-template-columns: 14px 22px 1fr auto auto; gap: 7px; }
  .metricas { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .met { padding: 9px 3px; }
  .met b { font-size: 13px; }
  .met em { font-size: 8.5px; }
  .bl-ops { grid-template-columns: repeat(2, 1fr); }
  /* la ficha es larga en telefono: el boton de pago no puede quedar fuera de vista */
  #btn-comprar {
    position: sticky; bottom: 0; z-index: 3;
    box-shadow: 0 -14px 22px -8px var(--bg-panel), var(--cta-sombra);
  }
  .pago { padding-bottom: 2px; }
  .bl-ops button, .bl-otro { min-height: 58px; font-size: 13px; }
  .ficha-top h3 { font-size: 20px; }
  .btn-comprar { padding: 16px; font-size: 14px; }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .hoja { height: 82dvh; }
}

@media (max-width: 1500px) { .s-clicks { display: none; } }
@media (max-width: 1600px) { .tagline { display: none; } }
