/* Pruebas nuevas (2): multitud, nonograma, circuito, ganzúa y almacén. */

/* ---------- La multitud ---------- */
.mt-wrap { display: grid; gap: 12px; }
.mt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.mt-card { display: flex; align-items: center; gap: 14px; flex: 1 1 340px; padding: 10px 14px 10px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.mt-ficha-img { display: block; width: 72px; height: 72px; border-radius: 8px; border: 2px solid var(--ink); flex: none; image-rendering: auto; }
.mt-round { margin: 0 0 2px; font: 700 .75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.mt-round strong { color: var(--red); }
.mt-desc { margin: 0; font-size: .92rem; color: var(--ink-2); line-height: 1.4; }
.mt-scroll { overflow-x: auto; overflow-y: hidden; border-radius: 10px; background: #08130E; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); overscroll-behavior-x: contain; }
.mt-view { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; cursor: none; touch-action: pan-x pan-y; }
.mt-fb { margin: 0; min-height: 1.5em; font-weight: 600; color: var(--ink-2); }
.mt-fb strong { color: var(--red); }
@media (max-width: 760px) {
  .mt-view { width: 960px; max-width: none; cursor: crosshair; }
  .mt-card { flex-basis: 100%; }
  .mt-ficha-img { width: 60px; height: 60px; }
}

/* ---------- Nonograma ---------- */
.ng-wrap { display: grid; gap: 14px; justify-items: center; }
.ng-intro { margin: 0; color: var(--ink-2); justify-self: stretch; }
.ng-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; justify-self: stretch; }
.ng-modes { display: inline-flex; padding: 4px; gap: 4px; border-radius: 99px; background: var(--paper-3, #DCE4D0); }
.ng-mode { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); font: 700 .9rem var(--sans); cursor: pointer; }
.ng-mode.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.ng-sw { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; font-style: normal; font-weight: 700; line-height: 1; }
.ng-sw.fill { background: var(--ink); }
.ng-sw.x { border: 1.5px solid var(--ink-3); color: var(--red); }
.ng-frame { max-width: 100%; overflow-x: auto; padding: 4px; }
.ng-board { --cell: clamp(24px, 7.4vw, 36px); display: grid; grid-template-columns: auto repeat(var(--c), var(--cell)); grid-template-rows: auto repeat(var(--r), var(--cell)); user-select: none; -webkit-user-select: none; touch-action: none; }
.ng-corner { background: transparent; }
.ng-cclue, .ng-rclue { display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 4px 2px; font: 700 .82rem var(--mono); color: var(--ink); transition: color .2s, opacity .2s; }
.ng-cclue { flex-direction: column; align-items: center; justify-content: flex-end; border-bottom: 2px solid var(--ink); }
.ng-rclue { justify-content: flex-end; align-items: center; gap: 7px; padding: 0 8px 0 4px; border-right: 2px solid var(--ink); }
.ng-cclue:nth-child(odd), .ng-rclue.alt { background: rgba(23, 48, 31, .04); }
.ng-cclue.ok, .ng-rclue.ok { color: var(--ink-3); opacity: .55; }
.ng-cell { position: relative; padding: 0; margin: 0; border: 0; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); background: #fff; cursor: pointer; touch-action: none; transition: background .12s; }
.ng-cell.sr { border-right: 2px solid var(--ink-3); }
.ng-cell.sb { border-bottom: 2px solid var(--ink-3); }
.ng-cell:hover { background: #EEF3E6; }
.ng-cell.f { background: var(--ink); }
.ng-cell.x::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--red); font: 700 1.05rem var(--sans); }
.ng-cell.hint { animation: ngHint .9s ease-out; }
@keyframes ngHint { 0% { box-shadow: inset 0 0 0 3px var(--hot); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.ng-board.solved .ng-cell { border-color: transparent; }
.ng-board.solved .ng-cell.f { background: var(--red); animation: ngPop .5s var(--ease) both; }
.ng-board.solved .ng-cell:not(.f) { background: #FBF7EE; }
@keyframes ngPop { from { transform: scale(.4); } to { transform: scale(1); } }
.ng-fb { margin: 0; min-height: 1.5em; font-weight: 600; color: var(--ink-2); justify-self: stretch; }
.ng-fb strong { color: var(--red); }
@media (max-width: 480px) {
  .ng-cclue, .ng-rclue { font-size: .72rem; }
  .ng-rclue { gap: 5px; padding-right: 5px; }
}

/* ---------- El cuadro eléctrico ---------- */
.ci-wrap { display: grid; gap: 14px; }
.ci-intro { margin: 0; color: var(--ink-2); }
.ci-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ci-lv { margin: 0; font-weight: 600; color: var(--ink-2); }
.ci-lv strong { font: 700 1.2rem var(--mono); color: var(--red); }
.ci-stage { --size: min(100%, 460px); position: relative; justify-self: center; width: var(--size); padding: 14px 40px; border-radius: 14px; background: #0B1A12; box-shadow: inset 0 0 0 2px #1F3A2A, 0 30px 60px -30px rgba(0, 0, 0, .9); }
.ci-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; }
.ci-tile { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; background: #13281C; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ci-tile:hover { background: #1A3426; }
.ci-tile svg { display: block; width: 100%; height: 100%; transform: rotate(var(--rot)); transition: transform .18s var(--ease); }
.ci-pipe-bg { fill: none; stroke: #0A140E; stroke-width: 30; stroke-linecap: butt; }
.ci-pipe { fill: none; stroke: #4C6A57; stroke-width: 17; stroke-linecap: butt; transition: stroke .2s; }
.ci-knot { fill: #4C6A57; r: 10; transition: fill .2s; }
.ci-cap { fill: #13281C; stroke: #4C6A57; stroke-width: 6; transition: stroke .2s; }
.ci-tile.on .ci-pipe { stroke: #F2C94C; }
.ci-tile.on .ci-knot { fill: #F2C94C; }
.ci-tile.on .ci-cap { stroke: #F2C94C; }
.ci-tile.on { background: #1C3324; box-shadow: 0 0 14px -4px rgba(242, 201, 76, .55); }
.ci-src, .ci-cam { position: absolute; width: 30px; height: 30px; display: grid; place-items: center; top: calc(14px + (100% - 28px) * (var(--row) + .5) / var(--n) - 15px); border-radius: 8px; background: #13281C; color: #6E8B78; transition: color .3s, background .3s, box-shadow .3s; }
.ci-src { left: 5px; }
.ci-cam { right: 5px; }
.ci-src svg { width: 18px; height: 18px; fill: currentColor; }
.ci-cam svg { width: 20px; height: 20px; }
.ci-src.on { color: #F2C94C; }
.ci-cam.on { color: #0B1A12; background: #F2C94C; box-shadow: 0 0 20px rgba(242, 201, 76, .7); }
.ci-stage.solved { box-shadow: inset 0 0 0 2px #F2C94C, 0 0 40px -10px rgba(242, 201, 76, .6); }
.ci-fb { margin: 0; min-height: 1.5em; font-weight: 600; color: var(--ink-2); }
.ci-fb strong { color: var(--red); }
@media (max-width: 480px) { .ci-stage { padding: 10px 34px; } .ci-src, .ci-cam { width: 26px; height: 26px; top: calc(10px + (100% - 20px) * (var(--row) + .5) / var(--n) - 13px); } .ci-src { left: 4px; } .ci-cam { right: 4px; } }

/* ---------- La ganzúa ---------- */
.gz-wrap { display: grid; gap: 14px; }
.gz-intro { margin: 0; color: var(--ink-2); }
.gz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.gz-count { margin: 0; font-weight: 600; color: var(--ink-2); }
.gz-count strong { font: 700 1.3rem var(--mono); color: var(--red); }
.gz-box { justify-self: center; width: min(100%, 340px); padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.gz-box:focus-visible { outline: 3px solid var(--hot); outline-offset: 6px; }
.gz-lock { display: block; width: 100%; height: auto; overflow: visible; }
.gz-rim { fill: #2A1C10; stroke: #C9A227; stroke-width: 5; }
.gz-face { fill: #0E1C14; }
.gz-track { fill: none; stroke: #1F3A2A; stroke-width: 14; }
.gz-spot { fill: none; stroke: var(--hot); stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(229, 57, 79, .7)); }
.gz-spot.pop { animation: gzPop .35s var(--ease); }
@keyframes gzPop { from { opacity: 0; } to { opacity: 1; } }
.gz-needle path { fill: #F2EBD2; }
.gz-hole circle, .gz-hole path { fill: #050B07; }
.gz-pins circle { fill: #3B4A40; stroke: #0E1C14; stroke-width: 1.5; transition: fill .2s, transform .25s var(--ease); }
.gz-pins circle.up { fill: #F2C94C; }
.gz-box.miss { animation: gzShake .35s; }
@keyframes gzShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.gz-box.open .gz-rim { stroke: #F2C94C; }
.gz-box.open .gz-hole { transform: rotate(90deg); transition: transform .6s var(--ease); }
.gz-box.open .gz-spot { opacity: 0; }
.gz-fb { margin: 0; min-height: 1.5em; font-weight: 600; color: var(--ink-2); text-align: center; }
.gz-fb strong { color: var(--red); }

/* ---------- El almacén ---------- */
.al-wrap { display: grid; gap: 14px; }
.al-intro { margin: 0; color: var(--ink-2); }
.al-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.al-lv { margin: 0; font-weight: 600; color: var(--ink-2); }
.al-lv strong { font: 700 1.2rem var(--mono); color: var(--red); }
.al-stage { display: grid; justify-items: center; gap: 14px; }
.al-board { --cs: min(52px, calc((100vw - 64px) / var(--w))); position: relative; display: grid; grid-template-columns: repeat(var(--w), var(--cs)); grid-template-rows: repeat(var(--h), var(--cs)); touch-action: none; user-select: none; -webkit-user-select: none; }
.al-cell { width: var(--cs); height: var(--cs); }
.al-cell.wall { background: #2B3A30; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 2px 0 rgba(255, 255, 255, .06); border-radius: 3px; }
.al-cell.floor { background: #C9B48E; background-image: linear-gradient(90deg, rgba(0, 0, 0, .06) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .06) 1px, transparent 1px); background-size: 50% 50%; }
.al-cell.goal { position: relative; }
.al-cell.goal::after { content: ""; position: absolute; inset: 26%; border: 2.5px dashed #F7F5EC; border-radius: 50%; }
.al-box, .al-me { position: absolute; left: calc(var(--j) * var(--cs)); top: calc(var(--i) * var(--cs)); width: var(--cs); height: var(--cs); transition: left .1s, top .1s; }
.al-box::before { content: ""; position: absolute; inset: 8%; border-radius: 5px; background: #A8743F; box-shadow: inset 0 0 0 3px #7A5129, inset 0 -5px 0 rgba(0, 0, 0, .15); background-image: linear-gradient(45deg, transparent 46%, #7A5129 46%, #7A5129 54%, transparent 54%); }
.al-box.ok::before { background-color: #C42238; box-shadow: inset 0 0 0 3px #8E1527, inset 0 -5px 0 rgba(0, 0, 0, .15); background-image: none; }
.al-box.ok::after { content: ""; position: absolute; inset: 0; margin: auto; width: 38%; height: 38%; background: #fff; clip-path: path("M50% 90% C 0% 55%, 5% 10%, 50% 30% C 95% 10%, 100% 55%, 50% 90% Z"); }
.al-me::before { content: ""; position: absolute; left: 22%; right: 22%; top: 34%; bottom: 10%; border-radius: 40% 40% 20% 20%; background: #6B4B2E; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.al-me::after { content: ""; position: absolute; left: 30%; right: 30%; top: 8%; height: 34%; border-radius: 50%; background: #F1C9A5; box-shadow: 0 -4px 0 -1px #17110C; }
.al-pad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; }
.al-key { display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--ink); color: var(--paper); cursor: pointer; touch-action: manipulation; }
.al-key .ico { width: 24px; height: 24px; }
.al-key:active { transform: scale(.94); }
.al-up { grid-column: 2; grid-row: 1; }
.al-left { grid-column: 1; grid-row: 2; }
.al-down { grid-column: 2; grid-row: 2; }
.al-right { grid-column: 3; grid-row: 2; }
.al-fb { margin: 0; min-height: 1.5em; font-weight: 600; color: var(--ink-2); }
.al-fb strong { color: var(--red); }
@media (hover: none), (max-width: 760px) { .al-pad { display: grid; } }
