/* El Sapo · estilos propios (todo con el prefijo .sapo). El resto viene de /comun/base.css. */
.sapo { position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; color: var(--blanco); font-family: var(--texto); background: #1b1916; }
.sapo-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.sapo-lienzo:active { cursor: grabbing; }

/* ---------- marcador ---------- */
.sapo-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: 8px 10px 0; display: grid; gap: 6px; max-width: 720px; margin: 0 auto; pointer-events: none; }
.sapo-fila { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; }
.sapo-caja { background: rgba(17, 17, 17, .58); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 253, 248, .1); border-radius: 16px; padding: 6px 12px; min-height: 54px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.sapo-caja small { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #cfc6ba; line-height: 1.2; }
.sapo-izq { align-items: flex-start; }
.sapo-izq .sapo-num { font-family: var(--titulo); font-weight: 900; font-size: 30px; line-height: .9; color: var(--celeste); }
.sapo-izq .sapo-sub { color: var(--kraft); letter-spacing: .06em; text-transform: none; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sapo.multi .sapo-izq small { letter-spacing: .08em; }
.sapo.multi .sapo-izq { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
.sapo-quien { display: flex; flex-direction: column; min-width: 0; }
.sapo-quien b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--celeste); }
.sapo-izq.es-bot .sapo-quien b { color: var(--papel); }
.sapo-centro { align-items: center; min-width: 116px; padding: 4px 16px; }
.sapo-pts { font-family: var(--titulo); font-weight: 900; font-size: 42px; line-height: .88; color: var(--blanco); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.sapo-der { align-items: flex-end; }
.sapo-tejos { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 3px; margin-bottom: 3px; }
.sapo-tejos.dos { display: grid; grid-template-columns: repeat(5, 11px); gap: 3px; }
.sapo-tejos i { flex: none; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1c2, #e2b25a 45%, #8a5c1f); box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.sapo-tejos i.usado { background: rgba(255, 253, 248, .12); box-shadow: inset 0 0 0 1px rgba(255, 253, 248, .22); }

.sapo-meta { position: relative; height: 24px; margin: 0 14px; }
.sapo-meta-barra { position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 3px; background: rgba(255, 253, 248, .16); overflow: hidden; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.sapo-meta-barra i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--kraft), var(--celeste)); transition: width .5s cubic-bezier(.2, .9, .3, 1); }
.sapo-meta .m { position: absolute; top: 0; transform: translateX(-50%); font-size: 19px; line-height: 24px; color: rgba(255, 253, 248, .38); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); transition: color .2s, transform .25s; }
.sapo-meta .m:last-child { transform: translateX(-80%); }
.sapo-meta .m.on { color: var(--sol); transform: translateX(-50%) scale(1.18); }
.sapo-meta .m.on:last-child { transform: translateX(-80%) scale(1.18); }

.sapo-jug { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; overflow: hidden; }
.sapo-chip { --aro: var(--celeste); display: flex; align-items: center; gap: 6px; background: rgba(17, 17, 17, .58); border: 1px solid rgba(255, 253, 248, .1); border-radius: 999px; padding: 3px 10px 3px 3px; min-width: 0; flex: 0 1 auto; }
.sapo-chip .n { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; color: #e8e0d4; }
.sapo-chip b { font-family: var(--titulo); font-size: 19px; font-weight: 900; line-height: 1; }
.sapo-chip small.q { display: grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; font-size: 11px; font-weight: 800; color: #1a120a; background: radial-gradient(circle at 35% 30%, #fff1c2, #e2b25a 55%, #9a6a26); }
.sapo-chip small.q.listo { background: rgba(135, 206, 235, .25); color: var(--celeste); }
.sapo-chip .avatar { box-shadow: 0 0 0 2px var(--aro); }
.sapo-chip.actual { background: rgba(135, 206, 235, .2); border-color: var(--aro); }
.sapo-chip.actual .n { color: var(--blanco); }
.sapo-jug.muchos .sapo-chip:not(.actual) .n { display: none; }

.sapo-viento { position: absolute; left: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 2; display: flex; align-items: center; gap: 8px; background: rgba(17, 17, 17, .62); border: 1px solid rgba(179, 139, 93, .4); border-radius: 14px; padding: 6px 12px 6px 8px; font-size: 13px; font-weight: 800; pointer-events: none; }
.sapo-viento .ic { font-size: 20px; color: var(--kraft); animation: sapo-sopla 1.1s ease-in-out infinite; }
.sapo-viento small { display: block; font-size: 10px; font-weight: 600; color: #cfc6ba; }
@keyframes sapo-sopla { 50% { transform: translateX(3px); } }

.sapo-ayuda { position: absolute; left: 50%; bottom: calc(118px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2; background: rgba(17, 17, 17, .72); border: 1px solid rgba(135, 206, 235, .4); color: var(--blanco); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; animation: sapo-flota 1.6s ease-in-out infinite; }
@keyframes sapo-flota { 50% { transform: translate(-50%, -5px); } }
.sapo-toast { position: absolute; left: 50%; top: 31%; translate: -50% 0; z-index: 3; max-width: calc(100% - 32px); background: rgba(17, 17, 17, .86); border: 1px solid rgba(255, 253, 248, .14); border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 15px; text-align: center; pointer-events: none; box-shadow: var(--sombra); }
.sapo-toast.entra { animation: subir .25s ease both; }

/* ---------- capas propias ---------- */
.sapo-capa { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: rgba(17, 17, 17, .58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); overflow: auto; animation: aparecer .18s ease both; color: var(--tinta); }
.sapo-capa.intro, .sapo-capa.tuto { background: rgba(17, 17, 17, .32); -webkit-backdrop-filter: none; backdrop-filter: none; align-items: start; }
.sapo-tarjeta { position: relative; width: 100%; max-width: 420px; background: var(--papel); color: var(--tinta); border-radius: 24px; padding: 22px 22px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); animation: subir .28s cubic-bezier(.2, .9, .3, 1.2) both; }
.sapo-tarjeta.arriba { margin-top: clamp(70px, 14vh, 140px); }
.sapo-tarjeta.abajo { align-self: end; margin-bottom: max(8px, env(safe-area-inset-bottom)); }
.sapo-tarjeta.chica { padding: 18px 20px; }
.sapo-tarjeta.centro { text-align: center; }
.sapo-tarjeta.centro .etiqueta { justify-content: center; }
.sapo-tarjeta .titulo { font-size: clamp(34px, 9vw, 44px); margin: 6px 0 8px; }
.sapo-tarjeta p { margin: 8px 0; font-size: 15px; color: #3a342d; }
.sapo-tarjeta .btn { margin-top: 12px; }
.sapo-tarjeta .avatar.enorme { display: grid; margin: 0 auto 10px; }
.sapo-aviso-nivel { font-size: 17px !important; font-weight: 700; color: var(--tinta) !important; }
.sapo-chips { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sapo-chips li { background: rgba(179, 139, 93, .2); color: var(--kraft-osc); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 800; }
.sapo-objetivos { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 4px; background: var(--blanco); border-radius: 14px; padding: 10px 12px; }
.sapo-objetivos > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sapo-objetivos b { font-family: var(--titulo); font-size: 24px; font-weight: 900; line-height: 1; }
.sapo-tabla { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.sapo-tabla li { display: flex; align-items: baseline; gap: 12px; background: var(--blanco); border-radius: 12px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.sapo-tabla b { font-family: var(--titulo); font-size: 26px; font-weight: 900; min-width: 88px; color: var(--negro); }
.sapo-tabla li:first-child b { color: var(--celeste-osc); }

.sapo-est { display: inline-flex; gap: 1px; line-height: 1; }
.sapo-est i { font-style: normal; color: rgba(17, 17, 17, .16); font-size: 12px; }
.sapo-est i.on { color: var(--sol); text-shadow: 0 1px 0 rgba(122, 90, 54, .4); }
.sapo-est.mini i { font-size: 11px; }
.sapo-est.grande { gap: 8px; margin: 6px 0 2px; }
.sapo-est.grande i { font-size: 46px; animation: sapo-estrella .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.sapo-est.grande i:nth-child(2) { animation-delay: .25s; font-size: 56px; }
.sapo-est.grande i:nth-child(3) { animation-delay: .5s; }
@keyframes sapo-estrella { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sapo-gran-numero { font-family: var(--titulo); font-size: 66px; font-weight: 900; line-height: .9; margin-top: 4px; }
.sapo-tarjeta .sapo-consejo { background: rgba(179, 139, 93, .16); color: var(--kraft-osc); border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.sapo-botones { display: grid; gap: 8px; margin-top: 8px; }
.sapo-botones .btn { margin-top: 0; }
.sapo-tarjeta .btn.fantasma { border-color: rgba(17, 17, 17, .25); color: var(--negro); }

/* elegir nivel */
.sapo-panel { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--papel); color: var(--tinta); border-radius: 24px; padding: 20px 18px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); animation: subir .26s cubic-bezier(.2, .9, .3, 1.2) both; overscroll-behavior: contain; touch-action: pan-y; }
.sapo-cabeza { display: grid; gap: 2px; margin-bottom: 12px; }
.sapo-cabeza .titulo { font-size: clamp(36px, 10vw, 48px); }
.sapo-total { font-weight: 800; font-size: 14px; color: var(--kraft-osc); }
.sapo-tramos { display: grid; gap: 14px; }
.sapo-tramo header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sapo-tramo header b { font-family: var(--titulo); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.sapo-tramo header span { font-size: 12px; font-weight: 800; color: var(--kraft-osc); }
.sapo-grilla { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sapo-nivel { border: 2px solid rgba(17, 17, 17, .08); background: var(--blanco); border-radius: 14px; min-height: 58px; aspect-ratio: 1 / 1.02; display: grid; place-items: center; align-content: center; gap: 4px; cursor: pointer; padding: 4px; transition: transform .12s ease, box-shadow .12s ease; }
.sapo-nivel b { font-family: var(--titulo); font-size: 28px; font-weight: 900; line-height: .9; }
.sapo-nivel:hover { transform: translateY(-2px); box-shadow: var(--sombra-chica); }
.sapo-nivel:focus-visible { outline: 3px solid var(--celeste-osc); outline-offset: 2px; }
.sapo-nivel.cerrado { background: var(--papel-2); cursor: default; opacity: .7; }
.sapo-nivel.cerrado b { font-size: 18px; filter: grayscale(1); }
.sapo-nivel.cerrado small { font-size: 11px; font-weight: 800; color: var(--gris); }
.sapo-nivel.sigue { border-color: var(--negro); background: var(--negro); color: var(--celeste); animation: latir 1.4s ease-in-out infinite; }
.sapo-nivel.sigue .sapo-est i { color: rgba(255, 253, 248, .25); }
.sapo-nivel.sigue .sapo-est i.on { color: var(--sol); }

/* tutorial: el dedo que muestra el arrastre */
.sapo-dedo { position: absolute; width: 0; height: 0; pointer-events: none; }
.sapo-dedo i { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--celeste); background: rgba(135, 206, 235, .28); box-shadow: 0 0 0 8px rgba(135, 206, 235, .12); animation: sapo-arrastre 1.8s cubic-bezier(.45, 0, .3, 1) infinite; }
.sapo-dedo::before { content: ''; position: absolute; left: -2px; top: -190px; width: 4px; height: 170px; border-radius: 2px; background: repeating-linear-gradient(to top, rgba(244, 236, 224, .7) 0 6px, transparent 6px 14px); opacity: .7; }
@keyframes sapo-arrastre { 0% { transform: translateY(0) scale(1); opacity: 0; } 12% { opacity: 1; } 70% { transform: translateY(-170px) scale(.96); opacity: 1; } 85%, 100% { transform: translateY(-190px) scale(.7); opacity: 0; } }

/* panel de la tabla, solo en pantallas anchas */
.sapo-lado { display: none; }
@media (min-width: 1040px) {
  .sapo-lado { display: block; position: absolute; z-index: 2; left: max(24px, calc(50% - 600px)); top: 50%; transform: translateY(-50%); width: 230px; background: rgba(17, 17, 17, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 253, 248, .1); border-radius: 20px; padding: 18px 18px 16px; pointer-events: none; }
  .sapo-lado .etiqueta { color: var(--kraft); }
  .sapo-lado ul { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 4px; }
  .sapo-lado li { display: flex; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; color: #e8e0d4; }
  .sapo-lado li b { font-family: var(--titulo); font-weight: 900; font-size: 26px; line-height: 1; min-width: 58px; color: var(--blanco); }
  .sapo-lado li:first-child b { color: var(--celeste); }
  .sapo-lado p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: #cfc6ba; }
  .sapo-lado p b { color: var(--blanco); }
  .sapo-lado .sapo-lado-mano { border-top: 1px solid rgba(255, 253, 248, .12); padding-top: 10px; color: var(--celeste); font-weight: 700; }
}
@media (min-width: 900px) {
  .sapo-hud { padding-top: 12px; }
  .sapo-pts { font-size: 48px; }
  .sapo-viento { left: auto; bottom: auto; top: 140px; right: max(16px, calc(50% - 480px)); }
}
@media (max-width: 360px) {
  .sapo-centro { min-width: 92px; padding: 4px 10px; }
  .sapo-pts { font-size: 36px; }
  .sapo-caja { padding: 6px 9px; }
}
