/* Crear sala en tres pasos (Juego · Ajustes · Sala) y la pizarra de «Cada uno en su iPad» */
.sp-main { max-width: 1500px; }
.sp-head { flex-wrap: wrap; }
.sp-head h1 { flex: 1 1 auto; }
body[data-paso="1"] #sp-vista, body[data-paso="2"] #sp-vista, body[data-paso="0"][data-fase="sp-sin"] #sp-vista { display: none; }
body[data-paso="0"] .sp-pasos { display: none; }
body[data-fase="sp-carrera"] .sp-head, body[data-fase="sp-final"] .sp-head { display: none; }
.sp-pasos { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-pasos button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 18px 6px 8px; border: 0; border-radius: 999px; background: rgba(255, 250, 240, .28); color: #fff; font-family: inherit; font-weight: 800; font-size: 19px; line-height: 1; cursor: pointer; }
.sp-pasos button b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 250, 240, .35); }
.sp-pasos button.on { background: #fffaf0; color: #1d1410; }
.sp-pasos button.on b { background: #1d1410; color: #fff; }
.sp-pasos button.hecho b { background: #2f8f63; color: #fff; font-size: 0; }
.sp-pasos button.hecho b::after { content: "✓"; font-size: 17px; }
.sp-pasos button:disabled { cursor: default; }
.sp-pasos button:not(:disabled):hover { background: rgba(255, 250, 240, .45); }
.sp-grande { font-size: clamp(24px, 2.4vw, 34px) !important; margin: 0 0 4px !important; }
.sp-sub { margin: 0 0 16px; color: #6b5a4e; font-size: 18px; }
.sp-ico { display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; }
.sp-ico svg { width: 100%; height: 100%; overflow: visible; display: block; }
.sp-ico.game-icon { padding: 0; background: none; box-shadow: none; border-radius: 0; }

/* Paso 1 */
.sp-repetir { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 16px; border: 3px dashed #d8682a; border-radius: 16px; background: #fff1e2; }
.sp-repetir > div { flex: 1; display: grid; gap: 2px; font-size: 18px; }
.sp-repetir > div b { font-size: 22px; }
.sp-filtros { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sp-filtro { min-height: 46px; padding: 6px 18px; border: 2px solid #1d1410; border-radius: 999px; background: #fff; font-family: inherit; font-weight: 800; font-size: 18px; line-height: 1; cursor: pointer; }
.sp-filtro.on { background: #1d1410; color: #fff; }
.sp-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.sp-tarjeta { display: flex; align-items: center; gap: 16px; min-height: 150px; padding: 16px; border: 3px solid #eadccb; border-radius: 18px; background: #fff; text-align: left; font-family: inherit; color: #1d1410; cursor: pointer; transition: transform .12s, border-color .12s; }
.sp-tarjeta:hover, .sp-tarjeta:focus-visible { border-color: #d8682a; transform: translateY(-2px); outline: none; }
.sp-tarjeta.ultima { border-color: #d8682a; }
.sp-tarjeta .sp-ico { width: 96px; height: 96px; }
.sp-t-txt { display: grid; gap: 6px; }
.sp-t-txt b { font-size: 22px; line-height: 1.1; }
.sp-t-txt > span:not(.sp-etqs) { color: #6b5a4e; font-size: 17px; line-height: 1.25; }
.sp-etqs { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-etq { font-style: normal; font-size: 15px; font-weight: 800; padding: 3px 9px; border-radius: 8px; background: #e3edfb; color: #1d4f9a; }
.sp-etq.sin { background: #e1f3e8; color: #1e6b40; }
.sp-etq.equipos { background: #fde6d8; color: #9a3d12; }
.sp-etq.nivel { background: #efe5fb; color: #5b2f99; }

/* Paso 2 */
.sp-dos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.sp-dos:not([hidden]) { display: grid; }
#sp-filas > .sp-fila, #sp-filas > #sp-tablet > .sp-fila { padding: 12px 0; border-bottom: 1px solid #eadccb; }
.sp-fila > span:first-child { min-width: 210px; font-size: 19px; }
.sp-mas { margin-top: 12px; }
.sp-mas > summary { cursor: pointer; font-size: 18px; color: #6b5a4e; padding: 8px 0; }
.sp-mas > summary b { color: #a2400f; font-size: 21px; }
.sp-mas[open] > summary { margin-bottom: 10px; }
.sp-entre { justify-content: space-between; align-items: center; }
.sp-lado { text-align: left; }
.sp-ico-grande { display: grid; width: 150px; height: 150px; margin: 0 auto 12px; }
.sp-datos { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; font-size: 20px; }
.sp-aviso, .sp-lado-nota { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #fff1e2; font-size: 17px; line-height: 1.35; }
.sp-lado-nota { background: #f6efe6; }

/* Paso 3 */
.sp-resumen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 16px; border-radius: 16px; background: #fff1e2; font-size: 20px; }
.sp-resumen .sp-ico { width: 48px; height: 48px; }
.sp-resumen > span:not(.sp-ico) { flex: 1; color: #4a3a30; }
.sp-tres { display: grid; grid-template-columns: minmax(320px, 2fr) 3fr; gap: 18px; align-items: start; }
.sp-cod-panel { text-align: center; }
.sp-codigo { --cn-fondo: #fffaf0; margin: 10px auto; max-width: 620px; color: #1d1410; letter-spacing: 0; font-size: 16px; }
.sp-codigo .cn-svg { display: block; width: 100%; height: auto; }
.sp-quien h2 small { font-size: 17px; font-weight: 600; color: #6b5a4e; }
.sp-quien .sp-jugadores { justify-content: flex-start; }
.sp-grupo { font-size: 18px; color: #4a3a30; }
.sp-grupo select { font: inherit; font-weight: 800; padding: 6px 10px; border: 2px solid #1d1410; border-radius: 10px; background: #fff; }
.sp-t-nom { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
#sp-turnos .sp-panel h2 small { font-size: 16px; font-weight: 600; color: #6b5a4e; }

/* Cada uno en su iPad: la pizarra */
.sp-car-cab { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sp-car-cab .sp-ico { width: 84px; height: 84px; }
.sp-car-cab h2 { flex: 1; margin: 0; font-size: clamp(30px, 3.4vw, 60px); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); line-height: 1.05; }
.sp-pill-t { background: rgba(70, 28, 6, .55); color: #fff; }
.sp-car-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 420px); gap: 18px; }
.sp-car-cuerpo:not([hidden]) { display: grid; }
.sp-calles { position: relative; height: calc(100vh - 230px); min-height: 380px; overflow: hidden; padding: 10px 20px; }
.sp-calle { position: absolute; left: 20px; right: 20px; top: 10px; height: var(--alto); display: grid; grid-template-columns: 3.2ch minmax(120px, 22%) 1fr auto; align-items: center; gap: 16px;
  font-size: calc(var(--alto) * .3); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.sp-calles { --alto: 120px; }
.sp-calle { height: calc(var(--alto) - 6px); font-size: clamp(16px, calc(var(--alto) * .3), 44px); }
.sp-calle .pos { font-weight: 900; color: #8b7a6c; font-size: .8em; }
.sp-calle:nth-child(n) .pos { color: #8b7a6c; }
.sp-calle .quien { display: grid; gap: 2px; min-width: 0; }
.sp-calle .quien b { font-size: 1.05em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-calle .niv { justify-self: start; font-style: normal; font-weight: 800; font-size: max(13px, .4em); padding: 1px 8px; border-radius: 6px; background: #d8682a; color: #fff; }
.sp-calle .niv.medium { background: #7a4520; }
.sp-calle .niv.hard { background: #1d1410; }
.sp-calle .pista { position: relative; height: 52%; border-radius: 999px; background: #efe4d5; overflow: visible; }
.sp-calle .barra { position: absolute; inset: 0; border-radius: 999px; overflow: hidden; }
.sp-calle .barra::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--c); transform: translateX(calc((var(--f) - 1) * 100%)); transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.sp-calle .mueve { position: absolute; inset: 0; transform: translateX(calc(var(--f) * 100%)); transition: transform .8s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.sp-calle .ficha { position: absolute; left: 0; top: 50%; transform: translate(-110%, -50%); font-size: .9em; }
.sp-calle .racha { position: absolute; left: 0; bottom: 78%; transform: translateX(-60%); padding: 2px 8px; border-radius: 8px; background: #1d1410; color: #fff; font-weight: 900; font-size: max(13px, .38em); white-space: nowrap; }
.sp-calle .num { display: grid; justify-items: end; line-height: 1; min-width: 3.4em; }
.sp-calle .num b { font-size: 1.15em; font-weight: 900; }
.sp-calle .num small { font-size: max(13px, .38em); color: #8b7a6c; font-weight: 700; }
.sp-calle.acabado .barra::before { opacity: .55; }
.sp-calles.anon .sp-calle { grid-template-columns: 0 0 1fr auto; }
.sp-car-lado { display: grid; gap: 18px; align-content: start; }
.sp-reto { text-align: center; position: relative; }
.sp-reto h3, .sp-ahora h3 { margin: 0 0 8px; font-size: clamp(20px, 1.6vw, 30px); }
.sp-reto #sp-reto { position: relative; }
.sp-donut { width: min(100%, 260px); display: block; margin: 0 auto; }
.sp-donut circle { fill: none; stroke-width: 14; }
.sp-donut .fondo { stroke: #efe4d5; }
.sp-donut .lleno { stroke: #2f8f63; stroke-linecap: round; }
.sp-donut-n { position: absolute; left: 0; right: 0; top: 0; height: min(100%, 260px); aspect-ratio: 1; margin: 0 auto; display: grid; place-content: center; line-height: 1; max-width: 260px; }
.sp-donut-n b { font-size: clamp(40px, 4.4vw, 84px); font-weight: 900; }
.sp-donut-n span { font-size: clamp(16px, 1.3vw, 24px); color: #6b5a4e; font-weight: 700; }
.sp-reto p { margin: 10px 0 0; font-size: clamp(16px, 1.3vw, 24px); }
.sp-ahora ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sp-ahora li { padding: 8px 0; border-bottom: 1px solid #eadccb; font-size: clamp(16px, 1.3vw, 24px); animation: sp-entra .4s ease-out; }
.sp-ahora li.vacio { color: #8b7a6c; animation: none; }
@keyframes sp-entra { from { opacity: 0; transform: translateY(-8px); } }
.sp-car-cuerpo.solo-reto { grid-template-columns: 1fr; }
.sp-car-cuerpo.solo-reto .sp-calles, .sp-car-cuerpo.solo-reto .sp-ahora { display: none; }
.sp-car-cuerpo.solo-reto .sp-donut, .sp-car-cuerpo.solo-reto .sp-donut-n { max-width: 520px; width: min(100%, 520px); height: auto; }
.sp-car-cuerpo.solo-reto .sp-donut-n b { font-size: clamp(80px, 9vw, 180px); }
.sp-car-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.sp-car-ver { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #fff; font-size: 20px; }
.sp-car-ver[hidden] { display: none; }
.sp-vbtn { min-height: 46px; padding: 6px 16px; border: 0; border-radius: 12px; background: #fffaf0; font-family: inherit; font-weight: 800; font-size: 19px; line-height: 1; cursor: pointer; }
.sp-vbtn.on { background: #1d1410; color: #fff; }
.sp-pie-txt { color: #fff; font-weight: 800; font-size: 19px; }

/* Final: podio y premios */
.sp-podio-box { display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; align-items: end; gap: 18px; min-height: 340px; padding-top: 20px; }
.sp-podio-box:not([hidden]) { display: grid; }
.sp-puesto { display: grid; justify-items: center; gap: 4px; text-align: center; animation: sp-sube .7s cubic-bezier(.2, .8, .2, 1) both; }
.sp-puesto .nom { font-size: clamp(26px, 2.8vw, 54px); line-height: 1.05; }
.sp-puesto .det { font-size: clamp(16px, 1.4vw, 26px); color: #6b5a4e; font-weight: 700; }
.sp-puesto .cajon { width: 100%; display: grid; place-items: center; margin-top: 8px; border-radius: 16px 16px 0 0; color: #fff; font-size: clamp(50px, 5vw, 110px); font-weight: 900; }
.sp-puesto.p1 .cajon { height: 210px; background: #c98c00; }
.sp-puesto.p2 .cajon { height: 150px; background: #7f8a96; }
.sp-puesto.p3 .cajon { height: 110px; background: #a9652f; }
.sp-puesto.p2 { animation-delay: .25s; } .sp-puesto.p3 { animation-delay: .5s; }
@keyframes sp-sube { from { opacity: 0; transform: translateY(40px); } }
.sp-premios { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.sp-premios:not([hidden]) { display: grid; }
.sp-premio { display: grid; gap: 4px; padding: 14px 18px; border-radius: 14px; background: #fff1e2; font-size: clamp(16px, 1.3vw, 24px); }
.sp-premio b { font-size: 1.25em; }

@media (max-width: 1000px) {
  .sp-dos, .sp-dos:not([hidden]), .sp-tres { grid-template-columns: 1fr; }
  .sp-car-cuerpo, .sp-car-cuerpo:not([hidden]) { grid-template-columns: 1fr; }
  .sp-calles { height: 60vh; }
}
@media (max-width: 600px) {
  .sp-tarjetas { grid-template-columns: 1fr; }
  .sp-tarjeta { min-height: 0; }
  .sp-tarjeta .sp-ico { width: 72px; height: 72px; }
  .sp-fila > span:first-child { min-width: 100%; }
  .sp-repetir { flex-wrap: wrap; }
  .sp-podio-box, .sp-podio-box:not([hidden]) { gap: 8px; min-height: 0; }
  .sp-calle { grid-template-columns: 2.4ch minmax(70px, 26%) 1fr auto; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-calle, .sp-calle .barra::before, .sp-calle .mueve, .sp-puesto, .sp-ahora li, .sp-tarjeta { transition: none; animation: none; }
}

/* La vagoneta de los regalos: cada calle es un trozo de la mina, un farol por nota y la vagoneta de cada uno */
.sp-mina .sp-calle .pista { height: 80%; border-radius: 12px; background: #1a1018 url(../../vagoneta/img/fondo.webp) repeat-x 0 64% / auto 330%; image-rendering: pixelated; box-shadow: inset 0 0 0 3px #2a1620, inset 0 0 28px rgba(0, 0, 0, .55); }
.sp-mina .sp-calle .barra { display: none; }
.sp-mina .sp-calle .mueve { z-index: 1; }
.sp-mina .sp-calle .farol { position: absolute; top: 22%; width: 9px; height: 13px; margin-left: -4px; border-radius: 3px; background: #3a4a78; box-shadow: 0 0 6px 2px rgba(120, 170, 255, .35); transition: background .4s, box-shadow .4s; }
.sp-mina .sp-calle .farol.on { background: #ffd27a; box-shadow: 0 0 12px 6px rgba(255, 170, 70, .7), 0 0 30px 12px rgba(255, 140, 50, .3); }
.sp-mina .sp-calle .farol:last-child { width: 16px; height: 22px; margin-left: -14px; top: 12%; background: #c9a25a; border-radius: 4px 4px 2px 2px; }
.sp-mina .sp-calle .farol:last-child.on { background: #ffe9a8; }
.sp-mina .sp-calle .ficha { width: calc(var(--alto) * .62 * 77 / 61); height: calc(var(--alto) * .62); bottom: 6%; top: auto; transform: translateX(calc(var(--f) * -104%)); background: url(../../vagoneta/img/vagoneta.webp) 0 0 / 400% 100% no-repeat; image-rendering: pixelated; display: grid; place-items: start center; font-size: .7em; line-height: 0; }
.sp-mina .sp-calle.acabado .pista { box-shadow: inset 0 0 0 3px #c9a25a, inset 0 0 28px rgba(0, 0, 0, .4); }
/* el teleférico: noche de montaña con el cable, una estrella por nota y una cabina roja que sube */
.sp-monte .sp-calle .pista { height: 80%; border-radius: 12px; background: linear-gradient(#101a3a, #33466e 70%, #e8f0ff 70%); box-shadow: inset 0 0 0 3px #1a2448, inset 0 0 28px rgba(0, 0, 0, .45); }
.sp-monte .sp-calle .pista::before { content: ""; position: absolute; left: 0; right: 0; top: 24%; height: 3px; background: #3a3a4a; }
.sp-monte .sp-calle .barra { display: none; }
.sp-monte .sp-calle .mueve { z-index: 1; }
.sp-monte .sp-calle .farol { position: absolute; top: 8%; width: 12px; height: 12px; margin-left: -6px; background: #3a4a78; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); transition: background .4s; }
.sp-monte .sp-calle .farol.on { background: #ffe9a8; filter: drop-shadow(0 0 5px rgba(255, 210, 120, .9)); }
.sp-monte .sp-calle .farol:last-child { width: 18px; height: 18px; margin-left: -16px; top: 4%; background: #c9a25a; clip-path: polygon(50% 0, 100% 45%, 100% 100%, 0 100%, 0 45%); }
.sp-monte .sp-calle .ficha { width: calc(var(--alto) * .5); height: calc(var(--alto) * .36); top: 27%; transform: translateX(calc(var(--f) * -104%)); background: linear-gradient(#e8f0ff 0 18%, #c9a25a 18% 26%, #a82838 26% 62%, #ffd27a 62% 100%); border-radius: 3px; display: grid; place-items: start center; font-size: .7em; line-height: 0; }
.sp-monte .sp-calle.acabado .pista { box-shadow: inset 0 0 0 3px #c9a25a, inset 0 0 28px rgba(0, 0, 0, .4); }
