:root {
  /* Identidad Bootcamp Pionero */
  --indigo: #323896; --indigo-d: #272C7A; --ink: #2A3C87; --azul: #4285CD; --cyan: #2AA7E1;
  --cyan-f: #1E9AD6; /* cian para bloques con texto blanco */
  --acento: #147FB8; /* cian para texto chico sobre blanco */
  --luz: #6CC7F0; /* cian claro sobre índigo */
  --wash: #DDF1FB; --lav: #E4E6F2; --bg: #F3F4FA; --muted: #637080; --line: #DCDFEE; --noche: #1B1F5C;
  --ok: #14855a; --ok-bg: #eaf7f1; --mal: #c8254a; --mal-bg: #fdecef; --mdf: #E8D3B0;
  --ease: cubic-bezier(.2, .7, .2, 1); --gut: max(20px, calc((100vw - 1240px) / 2));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; font-family: "Poppins", "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.en-sala { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: var(--acento); }
svg.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; }
:focus-visible { outline: 3px solid var(--cyan-f); outline-offset: 2px; }
.kicker { color: var(--acento); font-size: 12px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 2px solid var(--indigo); border-radius: 14px; padding: 11px 20px; background: var(--indigo); color: #fff; font-weight: 700; font-size: 15.5px; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s var(--ease); }
.btn:hover:not(:disabled) { background: var(--indigo-d); border-color: var(--indigo-d); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: #fff; color: var(--indigo); }
.btn.ghost:hover:not(:disabled) { background: var(--lav); border-color: var(--indigo); }
.btn.grande { padding: 15px 28px; font-size: 18px; border-radius: 16px; }
.circ { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 17px; cursor: pointer; }
.circ:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.circ:disabled { opacity: .35; cursor: default; }
.circ.claro { background: var(--lav); color: var(--indigo); }
.circ.claro:hover { background: var(--mal-bg); color: var(--mal); }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 21px; background: rgba(255,255,255,.16); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { background: rgba(255,255,255,.3); }
.stars svg { color: var(--line); }
.stars svg.on { color: var(--cyan); }

/* Barra */
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 9px var(--gut); background: #fff; border-bottom: 1px solid var(--line); }
.marca img { display: block; height: 46px; }
.tabs { display: flex; gap: 6px; margin: 0 auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 22px; color: var(--indigo); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.tabs a:hover { background: var(--lav); }
.tabs a.on { background: var(--indigo); color: #fff; }
.yo { display: flex; align-items: center; gap: 9px; padding: 4px 14px 4px 4px; border-radius: 24px; background: var(--lav); color: var(--indigo); text-decoration: none; font-size: 14px; max-width: 280px; }
/* El número del equipo: igual en toda la plataforma */
.num-eq { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--indigo); color: #fff; font-size: 18px; font-weight: 700; line-height: 1; }
.yo .num-eq { width: 36px; height: 36px; font-size: 15px; }
.yo b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.yo em { display: flex; align-items: center; gap: 3px; font-style: normal; font-weight: 700; color: var(--acento); }
@media (max-width: 760px) { .barra { flex-wrap: wrap; gap: 8px 12px; } .marca img { height: 38px; } .yo { margin-left: auto; } .yo b { display: none; } .yo { padding-right: 10px; } .tabs { order: 3; width: 100%; justify-content: space-between; } .tabs a { flex: 1; justify-content: center; padding: 8px 4px; font-size: 13px; gap: 4px; min-width: 0; } .tabs a svg { display: none; } }

/* Base de equipos */
.base { position: relative; overflow: hidden; padding: 44px var(--gut) 92px; background: var(--indigo); color: #fff; }
.base-marca { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.base-logo { width: 220px; max-width: 50%; height: auto; }
.base-aa { width: 170px; max-width: 34%; height: auto; }
.base h1 { font-size: clamp(42px, 7vw, 76px); line-height: 1.02; letter-spacing: -.01em; }
.base-sub { margin: 8px 0 26px; font-size: clamp(19px, 2.4vw, 26px); font-weight: 500; color: var(--luz); }
.base-pasos { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.base-pasos li { display: flex; align-items: center; gap: 9px; padding: 10px 18px; border-radius: 14px; background: #fff; color: var(--indigo); font-size: 15px; }
.base-pasos svg { color: var(--acento); }
.base-aviso { position: relative; z-index: 1; display: inline-block; margin-top: 16px; padding: 7px 14px; border-radius: 10px; background: var(--luz); color: var(--ink); font-size: 14px; }
.base-aviso b { font-weight: 700; }
.base-graf { position: absolute; right: 0; bottom: 0; width: min(48vw, 520px); height: auto; }
.pagina { padding: 36px var(--gut) 72px; }
.pagina h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; margin-bottom: 22px; }
.pagina h2 { font-size: 26px; margin: 0 0 18px; }
.equipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.eq-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 158px; padding: 14px; border: 0; border-radius: 20px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.eq-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -14px rgba(39,44,122,.7); }
.eq-card .num-eq { width: 60px; height: 60px; font-size: 24px; }
.eq-card.actual { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--cyan); }
.eq-card b { font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.eq-card small { display: flex; align-items: center; gap: 5px; margin-top: auto; font-size: 15px; font-weight: 700; color: var(--acento); }
.anillo { position: absolute; top: 14px; right: 14px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan-f) var(--p), var(--lav) 0); }
.anillo em { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-style: normal; font-weight: 700; font-size: 13px; }

/* Ruta */
.ruta { padding: 28px var(--gut) 60px; text-align: center; }
.ruta-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; text-align: left; }
.ruta-head h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.1; }
.ruta-score { display: flex; align-items: baseline; gap: 6px; padding: 8px 18px; border-radius: 16px; background: var(--indigo); color: #fff; font-size: 14px; }
.ruta-score b { font-size: 28px; line-height: 1; }
.ruta-score svg { align-self: center; color: var(--luz); }
.mapa { position: relative; height: 440px; margin: 20px 0 22px; border-radius: 28px; background: #fff; overflow: hidden; }
.mapa-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mapa-svg path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.base-p { stroke: var(--lav); stroke-width: 14; stroke-dasharray: 2 24; }
.hecho-p { stroke: var(--cyan); stroke-width: 10; }
.nodo { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -38px); display: flex; flex-direction: column; align-items: center; gap: 8px; width: 170px; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: none; cursor: pointer; }
.nodo-c { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: var(--indigo); color: #fff; font-size: 26px; box-shadow: 0 0 0 6px #fff; transition: transform .2s var(--ease); }
.nodo:hover:not(.lock) .nodo-c { transform: scale(1.1); }
.nodo.ok .nodo-c { background: var(--cyan-f); }
.nodo.lock { cursor: default; }
.nodo.lock .nodo-c { background: var(--lav); color: #8c93b8; }
.nodo.lock .nodo-t b, .nodo.lock .nodo-t em, .nodo.lock .nodo-t small { color: #7d84a8; }
.nodo.ahora .nodo-c { box-shadow: 0 0 0 6px #fff, 0 0 0 10px var(--cyan); animation: latido 1.8s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px #fff, 0 0 0 16px rgba(42,167,225,.35); } }
.nodo.final .nodo-c { border-radius: 24px; background: var(--azul); }
.nodo.final.lock .nodo-c { background: var(--lav); }
.nodo-t { display: flex; flex-direction: column; line-height: 1.2; }
.nodo-t small { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--acento); }
.nodo-t b { font-size: 19px; }
.nodo-t em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.nodo-t .stars { margin-top: 3px; font-size: 12px; }
@media (max-width: 900px) {
  .mapa { height: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
  .mapa-svg { display: none; }
  .nodo { position: static; transform: none; width: 100%; flex-direction: row; text-align: left; gap: 16px; }
  .nodo-c { width: 60px; height: 60px; flex: none; font-size: 20px; }
}
.cartas-sec { margin-top: 36px; text-align: left; }
.cartas-sec h2 { font-size: 24px; margin-bottom: 14px; }
.cartas-sec small { font-size: 14px; font-weight: 500; color: var(--muted); }
.cartas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 42vw), 1fr)); gap: 12px; }
.carta { padding: 0; aspect-ratio: 4 / 3; border: 0; background: none; cursor: pointer; perspective: 800px; }
.c-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .45s var(--ease); transform-style: preserve-3d; }
.carta.vuelta .c-in { transform: rotateY(180deg); }
.c-a, .c-b { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; }
.c-a img { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-b { display: grid; place-items: center; padding: 12px; background: var(--indigo); color: #fff; font-size: 15px; font-weight: 600; line-height: 1.25; text-align: center; transform: rotateY(180deg); }

/* Sala del video */
.sala { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--indigo); color: #fff; }
.sala-top { flex: none; display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 16px; }
.sala-top b { font-size: 18px; }
.stars-pill { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 14px; border-radius: 18px; background: rgba(255,255,255,.16); font-weight: 700; }
.stars-pill svg { color: var(--luz); }
.escena { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--noche); }
.vid { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; background: #000; transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease), border-radius .45s; }
.vid iframe, #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.capa-clic { position: absolute; inset: 0; cursor: pointer; }
.demo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--noche); text-align: center; }
.demo span { padding: 3px 10px; border-radius: 7px; background: var(--luz); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.demo b { font-size: clamp(26px, 5vw, 56px); }
.bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cyan-f); color: #fff; font-size: 30px; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,.4); }
/* En un reto el video se achica a la esquina y el reto toma la pantalla */
.enreto .vid { left: calc(100% - 316px); top: 16px; width: 300px; height: 169px; border-radius: 16px; box-shadow: 0 0 0 3px var(--cyan); }
.enreto .capa-clic { cursor: default; }
.enreto .bigplay { display: none; }
.enfoto .demo span { display: none; }
.enfoto .demo b { font-size: 17px; }
@media (max-width: 820px) { .enreto .demo span { display: none; } .enreto .demo b { font-size: 17px; } }
.lado { position: absolute; right: 16px; top: 200px; width: 300px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lado p { font-weight: 600; color: var(--luz); }
.reto { position: absolute; left: 16px; top: 16px; bottom: 16px; right: 332px; padding: 28px 32px; overflow: auto; border-radius: 24px; background: #fff; color: var(--ink); animation: entra-reto .4s var(--ease); }
@keyframes entra-reto { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.reto h2 { font-size: clamp(22px, 2.8vw, 32px); line-height: 1.15; margin-bottom: 20px; }
.reto-cuerpo { margin-bottom: 14px; }
.aviso-r { position: relative; min-height: 0; border-radius: 14px; font-weight: 600; }
.aviso-r:empty { display: none; }
.aviso-r.mal { padding: 11px 16px; background: var(--mal-bg); color: var(--mal); }
.aviso-r.bien { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; background: var(--ok-bg); font-size: 26px; animation: entra-reto .3s var(--ease); }
.aviso-r .btn { font-size: 16px; }
.sacude { animation: sacude .35s; }
@keyframes sacude { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.estallido { position: absolute; left: 50%; top: 50%; pointer-events: none; z-index: 5; }
.estallido i { position: absolute; color: var(--c); font-size: 26px; font-style: normal; font-weight: 700; animation: vuela-ast .9s var(--ease) forwards; }
@keyframes vuela-ast { to { transform: translate(var(--x), var(--y)) rotate(200deg) scale(.5); opacity: 0; } }
.ctrl { flex: none; display: flex; align-items: center; gap: 10px; height: 66px; padding: 0 16px; }
.tiempo { flex: none; width: 92px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.linea { position: relative; flex: 1; height: 14px; margin: 0 14px; border-radius: 7px; background: rgba(255,255,255,.22); cursor: pointer; }
.linea > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--cyan); }
.marca-r { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--indigo); box-shadow: 0 0 0 2px var(--luz); color: var(--luz); font-size: 15px; line-height: 1; }
.marca-r.ok { background: #fff; color: var(--indigo); box-shadow: none; }
@media (max-width: 820px) {
  .enreto .vid { left: 10px; top: 10px; width: 132px; height: 74px; border-radius: 10px; }
  .lado { left: 152px; right: 10px; top: 10px; width: auto; gap: 4px; }
  .lado p { font-size: 13px; }
  .lado .chip-btn { height: 34px; font-size: 13px; }
  .reto { left: 10px; right: 10px; top: 94px; bottom: 10px; padding: 18px; border-radius: 18px; }
  .ctrl { gap: 7px; padding: 0 10px; }
  .tiempo { display: none; }
  #b-full { padding: 0 11px; font-size: 0; gap: 0; }
  #b-full svg { font-size: 16px; }
}

/* Piezas de los retos */
.op { width: 100%; padding: 14px 18px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-weight: 600; font-size: 16.5px; text-align: left; cursor: pointer; transition: transform .12s var(--ease), border-color .15s, background .15s; }
.op:hover:not(:disabled) { border-color: var(--azul); background: var(--bg); transform: translateY(-1px); }
.op.sel { border-color: var(--azul); background: var(--wash); }
.op.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.op.no { border-color: var(--mal); background: var(--mal-bg); color: var(--mal); text-decoration: line-through; }
.op.usada { opacity: .3; }
.op:disabled { cursor: default; }
.r-ops { display: flex; flex-direction: column; gap: 9px; }
.r-ops.fila { flex-direction: row; flex-wrap: wrap; }
.r-ops.fila .op { width: auto; }
.r-par { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.r-seq { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; counter-reset: q; margin: 0 0 16px; padding: 12px; border-radius: 14px; background: var(--lav); }
.r-seq li { counter-increment: q; flex: 1 1 110px; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border-radius: 10px; background: #fff; font-size: 13.5px; font-weight: 600; line-height: 1.15; color: var(--ink); }
.r-seq li::before { content: counter(q); flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--lav); color: var(--indigo); font-weight: 700; font-size: 12.5px; }
.r-seq li.on::before { background: var(--cyan-f); color: #fff; }
.r-foto { position: relative; width: fit-content; max-width: min(100%, 620px); border-radius: 14px; overflow: hidden; cursor: crosshair; }
.r-foto img { display: block; width: auto; max-width: 100%; height: auto; max-height: max(180px, calc(100vh - 400px)); user-select: none; }
/* Retos de tocar una foto: la foto manda, el video queda en miniatura y los avisos van arriba para no tapar lo que hay que tocar */
.reto.foto .r-foto { max-width: 100%; margin: 0 auto; }
@media (min-width: 821px) {
  .enreto.enfoto .vid { left: calc(100% - 164px); top: 16px; width: 148px; height: 83px; border-radius: 12px; z-index: 3; }
  .enfoto .lado { top: 34px; right: 174px; width: auto; z-index: 3; }
  .enfoto .lado p { display: none; }
  .enfoto .lado .chip-btn { background: var(--lav); color: var(--indigo); }
  .enfoto .lado .chip-btn:hover { background: var(--line); }
  .reto.foto { left: 8px; right: 8px; top: 8px; bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 22px 62px minmax(0, 1fr); column-gap: 16px; padding: 12px 340px 10px 18px; overflow: hidden; border-radius: 18px; }
  .reto.foto .kicker { grid-column: 1; margin: 0; }
  .reto.foto h2 { grid-column: 1; margin: 0; font-size: clamp(19px, 2vw, 26px); }
  .reto.foto .aviso-r { grid-column: 2; grid-row: 1 / span 2; align-self: center; max-width: 320px; padding: 8px 14px; font-size: 14px; line-height: 1.25; }
  .reto.foto .aviso-r.bien { padding: 6px 10px; font-size: 20px; }
  .reto.foto .reto-cuerpo { grid-column: 1 / -1; grid-row: 3; margin: 0 -322px 0 0; }
  .reto.foto .r-foto { width: min(100%, calc((100vh - 246px) * 16 / 9)); } /* Alto de la sala menos márgenes y cabecera; las fotos son 16:9 */
  .reto.foto .r-foto img { width: 100%; max-height: none; }
}
@media (max-width: 820px) { .reto.foto .r-foto img { max-height: none; width: 100%; } .reto.foto { padding: 12px; } .reto.foto h2 { font-size: 20px; margin-bottom: 8px; } }
.pista { position: absolute; width: 56px; height: 56px; transform: translate(-50%, -50%); border: 4px solid #2ee59d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(0,0,0,.3); }
.panel-m { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; padding: 22px; border-radius: 20px; background: var(--noche); color: #fff; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 130px; padding: 14px 8px; border: 0; border-radius: 16px; background: rgba(255,255,255,.1); color: #fff; font-size: 14px; cursor: pointer; }
.ctl:hover { background: rgba(255,255,255,.2); }
.ctl b { font-weight: 600; }
.d-llave { position: relative; width: 58px; height: 58px; border-radius: 50%; background: #9aa1b8; box-shadow: inset 0 0 0 6px #6c7390; }
.d-llave::after { content: ""; position: absolute; left: 25px; top: 8px; width: 8px; height: 42px; border-radius: 4px; background: #fff; transition: transform .25s var(--ease); }
.ctl.on .d-llave::after { transform: rotate(90deg); }
.d-int { position: relative; width: 40px; height: 58px; border-radius: 8px; background: #6c7390; }
.d-int u { position: absolute; left: 4px; right: 4px; top: 4px; height: 25px; border-radius: 5px; background: #cfd3e2; transition: top .15s; }
.ctl.on .d-int { background: var(--cyan-f); }
.ctl.on .d-int u { top: 29px; background: #fff; }
.d-eme { width: 58px; height: 58px; border-radius: 50%; background: #e0303f; border: 6px solid #f0c419; transition: transform .15s, box-shadow .15s; box-shadow: 0 7px 0 #a01826; }
.ctl.on .d-eme { transform: translateY(6px); box-shadow: 0 1px 0 #a01826; }
.d-luz { width: 56px; height: 56px; border-radius: 50%; background: #3a3f6e; transition: background .3s, box-shadow .3s; }
.d-luz.on { background: #62f0a8; box-shadow: 0 0 34px 8px rgba(98,240,168,.65); }
.perillas { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; padding: 20px; border-radius: 18px; background: var(--lav); }
.perillas label { display: grid; grid-template-columns: 96px 1fr 72px; align-items: center; gap: 12px; font-weight: 600; }
.perillas b { text-align: right; font-size: 19px; color: var(--indigo); font-variant-numeric: tabular-nums; }
.perillas input { width: 100%; accent-color: var(--indigo); height: 26px; }
.cabe { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr; gap: 20px; align-items: center; }
.cabe > svg { width: 100%; max-height: 42vh; }
.cabe .pl { fill: var(--mdf); }
.cabe .pl-t { font-size: 1.8px; fill: #8a6a3c; font-weight: 600; }
.cabe .pz { fill: rgba(66,133,205,.55); stroke: var(--indigo); stroke-width: .35; }
.cabe-med { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.cabe .op { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 620px) { .cabe { grid-template-columns: minmax(0, 1fr); gap: 10px; } .cabe > svg { max-height: 30vh; } .cabe-med { font-size: 24px; margin-bottom: 8px; } .r-par { gap: 6px; } .op { font-size: 14.5px; padding: 11px 12px; } }
.fichas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 50px; margin-bottom: 14px; }
.ficha { padding: 10px 16px; border: 0; border-radius: 12px; background: var(--indigo); color: #fff; font-weight: 600; cursor: grab; touch-action: none; user-select: none; box-shadow: 0 3px 0 var(--indigo-d); }
.ficha.sel { outline: 3px solid var(--cyan); outline-offset: 2px; }
.ficha.vuela { position: relative; z-index: 9; cursor: grabbing; box-shadow: 0 12px 24px rgba(0,0,0,.35); }
.ficha:disabled { cursor: default; box-shadow: none; }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bin { min-height: 130px; padding: 12px; border: 3px dashed var(--line); border-radius: 18px; cursor: pointer; }
.bin h3 { margin-bottom: 9px; text-align: center; font-size: 19px; }
.bin.b0 { border-color: var(--ok); background: var(--ok-bg); } .bin.b0 h3 { color: var(--ok); } .bin.b0 .ficha { background: var(--ok); }
.bin.b1 { border-color: var(--mal); background: var(--mal-bg); } .bin.b1 h3 { color: var(--mal); } .bin.b1 .ficha { background: var(--mal); }
.bin-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bin-in .ficha { padding: 6px 11px; font-size: 13.5px; pointer-events: none; } /* Un toque sobre una ficha ya puesta debe llegar al grupo */

/* Premio */
.premio { position: absolute; inset: 0; overflow: auto; background: var(--indigo); }
.premio-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 900px; margin: 0 auto; padding: 18px 18px 30px; text-align: center; }
.premio .kicker { color: var(--luz); }
.premio h2 { font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; }
.premio-est { position: relative; display: flex; align-items: baseline; gap: 8px; }
.premio-est svg { align-self: center; color: var(--luz); font-size: 28px; }
.premio-est b { font-size: 56px; line-height: 1; }
.premio-tip { color: var(--luz); font-weight: 500; }
.premio .cartas { width: 100%; grid-template-columns: repeat(3, 1fr); margin: 6px 0 14px; }
.premio .c-b { background: #fff; color: var(--indigo); }
.premio-b { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.premio .btn { border-color: #fff; }
.premio .btn:not(.ghost) { background: #fff; color: var(--indigo); }
.premio .btn:not(.ghost):hover { background: var(--lav); }
.premio .btn.ghost { background: transparent; color: #fff; }
.premio .btn.ghost:hover { background: rgba(255,255,255,.16); border-color: #fff; }
@media (max-width: 620px) { .premio .cartas { grid-template-columns: 1fr 1fr; } }

/* Desafíos */
.des-pag { padding-top: 24px; }
.des-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }
.des-head h1 { margin: 0; }
/* La grilla no depende del contenido: las tarjetas nunca cambian de lugar ni de tamaño */
.desafios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 12px; }
.des { position: relative; display: flex; align-items: center; justify-content: center; padding: 14px 18px; border: 2px solid transparent; border-radius: 18px; background: #fff; color: var(--ink); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.des:hover { border-color: var(--azul); background: var(--wash); }
.des.luz { background: var(--indigo); color: #fff; }
.des b { font-size: 17.5px; line-height: 1.2; }
.des-ok { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-size: 12px; font-style: normal; }
@media (max-width: 900px) { .desafios { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .desafios { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 88px; gap: 8px; } .des { padding: 10px 26px 10px 12px; } .des b { font-size: 15px; } }
/* Popup del desafío */
/* Anclado arriba: al crecer solo se estira hacia abajo */
.dlg-des { width: min(560px, calc(100vw - 28px)); margin: 14px auto auto; top: clamp(0px, calc((100vh - 620px) / 2), 120px); max-height: calc(100vh - 28px); padding: 26px; overflow: hidden auto; border: 0; border-radius: 24px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px -20px rgba(27,31,92,.7); }
.dlg-des[open] { display: flex; flex-direction: column; gap: 10px; animation: entra-reto .25s var(--ease); }
/* Si la pantalla es baja, el espacio de la barra queda reservado: aparecer no cambia el ancho del texto */
@media (max-height: 680px) { .dlg-des { scrollbar-gutter: stable; } }
.dlg-des::backdrop { background: rgba(39,44,122,.6); }
.dlg-des .kicker { margin: 0; padding-right: 44px; }
.dlg-des h2 { margin: 0; padding-right: 44px; font-size: 28px; line-height: 1.15; }
.dlg-x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--lav); color: var(--indigo); font-size: 16px; font-weight: 700; cursor: pointer; }
.dlg-x:hover { background: var(--line); }
.det-preg { font-size: 16.5px; font-weight: 500; line-height: 1.4; }
.ideas { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.idea { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.idea:hover { border-color: var(--azul); background: var(--bg); }
.idea i { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--lav); color: var(--indigo); font-style: normal; font-weight: 700; }
.idea.on { border-color: var(--indigo); background: var(--indigo); color: #fff; }
.idea.on i { background: #fff; }
.det-ok { position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); }
.det-ok b { display: flex; align-items: center; gap: 6px; }
.det-ok .btn { padding: 8px 14px; font-size: 14px; }
.det-seg { display: flex; align-items: center; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--indigo); }
.det-seg svg { color: var(--acento); }
.cerrado { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.cerrado h1 { margin: 0; }
.candado { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; background: var(--lav); color: var(--indigo); font-size: 34px; }
.mini-ruta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 8px; }
.mini-ruta span { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; background: var(--lav); font-weight: 600; font-size: 14.5px; }
.mini-ruta .ok { background: var(--cyan-f); color: #fff; }

/* Tablero */
.ranking { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0 0 36px; padding: 0; }
.ranking li { display: grid; grid-template-columns: 34px 40px minmax(90px, 130px) 1fr 94px 64px; align-items: center; gap: 12px; padding: 6px 16px; border-radius: 18px; background: #fff; }
.pos { font-size: 20px; font-weight: 700; color: var(--acento); text-align: center; }
.mis { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; text-align: right; }
.ranking b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 17px; }
.barra-r { height: 14px; border-radius: 7px; background: var(--lav); overflow: hidden; }
.barra-r u { display: block; height: 100%; width: var(--w); border-radius: 7px; background: var(--indigo); }
.ranking em { display: flex; align-items: center; gap: 5px; justify-content: flex-end; font-style: normal; font-weight: 700; color: var(--indigo); }
@media (max-width: 620px) { .ranking li { grid-template-columns: 24px 40px 1fr auto 52px; gap: 8px; padding: 6px 10px; } .barra-r { display: none; } .mis { font-size: 12px; } }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.proy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px; border-radius: 18px; background: #fff; }
.proy .num-eq { margin-bottom: 6px; }
.proy small { font-size: 13px; font-weight: 600; color: var(--acento); }
.proy b { font-size: 17px; line-height: 1.2; }
.proy span:not(.num-eq) { font-size: 14px; line-height: 1.35; color: var(--muted); }
.vacio { color: var(--muted); }

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