/* Mi Terapia Virtual v33 — Laberintos (encima de objetivo.css + cognitivas.css + fina.css) */
body.lab-body { background: #F2F8F4; }
.lab-home { max-width: 1240px; margin: 0 auto; }
.lab-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
.lab-card { position: relative; font: inherit; text-align: left; border: none; cursor: pointer; border-radius: 22px; padding: 0.7rem 0.75rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.2rem; color: #2f2a46; box-shadow: 0 5px 16px rgba(61,51,96,0.12); -webkit-tap-highlight-color: transparent;
  background: linear-gradient(160deg, #fff, #F6F1FF); min-height: 13.5rem; }
.lab-card:active { transform: scale(0.97); }
.lab-card.mint { background: linear-gradient(160deg, #F2FBF6, #D9F1E4); } .lab-card.sky { background: linear-gradient(160deg, #F1F8FE, #D6E9FA); }
.lab-card.lilac { background: linear-gradient(160deg, #F7F3FE, #E4DAF7); } .lab-card.peach { background: linear-gradient(160deg, #FFF6EF, #FFE0CC); }
.lab-card.lemon { background: linear-gradient(160deg, #FFFCEB, #FFEFB8); } .lab-card.rose { background: linear-gradient(160deg, #FFF3F6, #FCD9E3); }
.lab-card.aqua { background: linear-gradient(160deg, #EFFAF9, #CDEDEA); } .lab-card.green { background: linear-gradient(160deg, #F3FAEE, #DCEFCD); }
.lab-num { position: absolute; top: 0.55rem; left: 0.6rem; z-index: 2; min-width: 1.9rem; height: 1.9rem; border-radius: 99px; background: #fff; color: #3d3360; font-weight: 900; font-size: 1rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(61,51,96,0.18); }
.lab-ctag { position: absolute; top: 0.55rem; right: 0.6rem; background: #fff; border-radius: 99px; padding: 0.1rem 0.5rem; font-size: 0.8rem; font-weight: 800; color: #6d5a8a; }
.lab-cprev { display: block; height: 128px; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.55); }
.lab-cprev svg { width: 100%; height: 100%; display: block; }
.lab-cname { font-weight: 900; font-size: 1.22rem; line-height: 1.15; margin-top: 0.3rem; color: #3d3360; }
.lab-cdesc { font-size: 0.93rem; line-height: 1.28; color: #5b4b63; }
.lab-err { color: #b5325a; font-size: 0.8rem; padding: 0.4rem; }
@media (max-width: 900px) { .lab-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .lab-cprev { height: 118px; } }
@media (max-width: 600px) { .lab-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- tipo / niveles --- */
.lab-type { max-width: 1240px; margin: 0 auto; }
.lab-tybody { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.lab-prev { background: #fff; border-radius: 22px; padding: 0.6rem; box-shadow: 0 6px 18px rgba(61,51,96,0.1); height: min(54vh, 470px); display: flex; }
.lab-prev svg { width: 100%; height: 100%; display: block; }
.lab-seedrow { display: flex; align-items: center; gap: 0.6rem; margin: 0.7rem 0 0.2rem; flex-wrap: wrap; font-size: 1.1rem; color: #3d3360; }
.lab-seedrow b { font-size: 1.25rem; }
.lab-mini { font: inherit; font-weight: 900; border: none; border-radius: 14px; min-height: 2.9rem; padding: 0.4rem 1rem; background: #3d3360; color: #fff; cursor: pointer; }
.lab-mini.sec { background: #fff; color: #3d3360; border: 2px solid #3d3360; }
.lab-paper { margin: 0.5rem 0 0; color: #6d5a8a; font-size: 0.98rem; line-height: 1.35; background: #FBF8FF; border-radius: 14px; padding: 0.55rem 0.8rem; }
.lab-tycol2 .o-how { font-size: 1.15rem; line-height: 1.4; margin-top: 0; }
.lab-tycol2 .o-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; }
.lab-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin: 0.9rem 0; }
.lab-modes[hidden] { display: none; }
.lab-mode { font: inherit; font-weight: 800; font-size: 1.05rem; min-height: 3.4rem; border-radius: 18px; border: 3px solid transparent; background: #fff; color: #3d3360; cursor: pointer; box-shadow: 0 3px 10px rgba(61,51,96,0.1); }
.lab-mode.sel { border-color: #3d3360; background: #F1EAFE; }
.lab-startrow { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.lab-startrow .o-start { flex: 1 1 100%; }
.lab-print { flex: 1; font: inherit; font-size: 1.15rem; font-weight: 900; min-height: 3.6rem; border-radius: 18px; border: 2px solid #3d3360; background: #fff; color: #3d3360; cursor: pointer; }
.lab-startrow .o-evolbtn { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 3.6rem; }
@media (max-width: 900px) {
  .lab-tybody { grid-template-columns: 1fr; }
  .lab-prev { height: min(42vh, 520px); }
}

/* --- juego --- */
.lab-game { height: 100dvh; }
.lab-stage { position: relative; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; background: radial-gradient(circle at 30% 20%, #FFFFFF, #F3FAF6 70%) !important; }
.lab-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.lab-trail { stroke: rgba(111,178,238,0.62); }
.lab-trail.t1 { stroke: rgba(255,143,163,0.62); }
.lab-trail.done { stroke: rgba(232,93,140,0.75); }
.lab-trail.old { opacity: 0.8; }
.lab-tokhalo { fill: rgba(255,255,255,0.55); stroke: rgba(61,51,96,0.18); stroke-width: 0.03; }
.lab-token.act .lab-tokhalo { stroke: #FF8FA3; stroke-width: 0.07; }
.lab-token.pulse > g { animation: labPulse 0.6s ease 2; transform-box: fill-box; transform-origin: center; }
@keyframes labPulse { 50% { transform: scale(1.18); } }
.lab-solpath.anim { stroke-dasharray: 100; stroke-dashoffset: 100; animation: labSol 2.4s ease forwards; }
@keyframes labSol { to { stroke-dashoffset: 0; } }
.lab-item { transition: opacity 0.35s, transform 0.35s; }
.lab-item.got { opacity: 0; }
[data-need] { transition: opacity 0.4s; }
[data-need].open { opacity: 0.12; }
[data-needall].open { opacity: 0; transition: opacity 0.4s; }
[data-td] .td-closed { transition: opacity 0.35s; }
[data-td].open .td-closed { opacity: 0.1; }
[data-td].soon .td-closed { animation: labBlink 0.5s ease infinite alternate; }
[data-td].open .td-open { opacity: 1; }
[data-td] .td-open { opacity: 0; transition: opacity 0.35s; }
@keyframes labBlink { to { opacity: 0.45; } }
.lab-pop circle { animation: labPop 0.65s ease forwards; transform-box: fill-box; transform-origin: center; }
@keyframes labPop { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.lab-confeti .cf { animation: labCf 1.3s ease-out forwards; }
@keyframes labCf { from { opacity: 1; } to { opacity: 0; translate: var(--dx) var(--dy); } }
.lab-solflag { background: #FFF1C9 !important; color: #8a6d2e; }
.lab-game.paused .lab-stage { filter: saturate(0.4) opacity(0.6); }
#v-play .lab-actions button.on { background: #FFE3EA; border-color: #E2557A; color: #9c2f55; }
#v-play .lab-actions button[hidden] { display: none; }
.lab-prompt { min-height: 2.2rem !important; font-size: 1.08rem !important; }

/* --- resumen --- */
.lab-snapfig { margin: 1rem auto 0; max-width: 760px; text-align: center; }
.lab-snapfig svg { width: 100%; height: auto; max-height: 52vh; background: #fff; border-radius: 16px; box-shadow: 0 4px 14px rgba(61,51,96,0.12); }
.lab-snapfig figcaption { font-weight: 700; color: #6d6488; margin-top: 0.4rem; }
.lab-sum .grid small { font-size: 0.85rem; color: #7a6f8a; }

/* --- imprimir --- */
.lab-pbox { max-width: 760px; }
.lab-pthumbs { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.3rem 0 0.6rem; }
.lab-pthumbs figure { margin: 0; flex: 0 0 auto; text-align: center; }
.lab-pthumbs svg { width: 150px; height: 212px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.18); border-radius: 4px; display: block; }
.lab-pthumbs figcaption { font-size: 0.85rem; font-weight: 700; color: #6d6488; margin-top: 0.2rem; }
.lab-pout a.tbtn { text-align: center; text-decoration: none; color: #111; }
#lab-printarea { display: none; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  body.lab-printing > *:not(#lab-printarea) { display: none !important; }
  body.lab-printing { background: #fff !important; }
  body.lab-printing #lab-printarea { display: block !important; }
  #lab-printarea svg.lab-page { display: block; width: 210mm; height: 296mm; page-break-after: always; break-after: page; }
}
.lab-reveal { opacity: 0; transition: opacity 0.8s ease; }
.lab-won .lab-reveal, .lab-page .lab-reveal { opacity: 1; }
.lab-xact { display: inline-flex; gap: 14px; margin-right: 10px; }
.lab-xact[hidden] { display: none; }
.lab-actions .lab-xbtn { min-width: 120px; min-height: 64px; font-size: 1.25rem; border-radius: 18px; border: 3px solid #8E79B8; background: #F4EEFF; color: #3d3360; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.lab-actions .lab-xbtn b { font-size: 2rem; line-height: 1; vertical-align: middle; }
.lab-actions .lab-xbtn:active { transform: scale(0.96); background: #E6DAFB; }
