/* Rompecabezas · motor Rompecabezas (sesión de los motores, 19 oct, tanda 3). Mismo aire que Sopa y Crucigrama. Sin scroll. */
.rb {
  --rb-noche: #1B2A5C; --rb-noche-2: #121c40; --rb-oro: #F5C542; --rb-crema: #fff8e8; --rb-tinta: #2b2140; --rb-bien: #2fa866; --rb-mal: #d9534f;
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #26397a 0%, var(--rb-noche-2) 70%); color: #fff;
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.rb * { box-sizing: border-box; }
.rb button { font-family: inherit; }
.rb [hidden] { display: none !important; }
.rb button:focus-visible, .rb-celda:focus-visible { outline: 3px solid var(--rb-oro); outline-offset: 2px; }
.rb-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--rb-noche); border-bottom: 1px solid rgba(245,197,66,.25); min-height: 72px; flex: 0 0 auto; }
.sj-hay-casa .rb-top { padding-left: 80px; }
.rb-casa { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 26px; cursor: pointer; }
.rb-globo { flex: 1; min-width: 0; background: var(--rb-crema); color: var(--rb-tinta); border-radius: 18px; padding: 6px 12px; min-height: 56px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.rb-globo-txt { font-weight: 800; font-size: clamp(18px, 4.4vw, 24px); line-height: 1.15; }
.rb-globo-sub { font-size: 18px; font-weight: 600; opacity: .85; line-height: 1.2; }
.rb-contador { flex: 0 0 auto; font-weight: 800; color: var(--rb-oro); min-width: 44px; text-align: center; font-size: 18px; }
.rb-cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.rb-mesa { position: relative; flex: 1 1 55%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.rb-tablero { display: grid; gap: 0; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.08) center / 100% 100% no-repeat; box-shadow: 0 0 0 3px rgba(255,255,255,.25), 0 6px 0 rgba(0,0,0,.25); }
.rb-tablero.guia { background-blend-mode: luminosity; }
.rb-celda { position: relative; border: 1px dashed rgba(255,255,255,.35); background: rgba(18,28,64,.55); cursor: pointer; }
.rb-tablero.guia .rb-celda { background: rgba(18,28,64,.72); }
.rb-celda.llena { border: 0; background: none; }
.rb-celda.no { background: rgba(217,83,79,.65); animation: rb-no .35s ease; }
.rb-celda { min-width: 0; min-height: 0; overflow: hidden; }
.rb-celda canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.rb-entero { position: absolute; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 3px var(--rb-oro), 0 6px 0 rgba(0,0,0,.25); }
.rb-mesa.armado .rb-entero { animation: rb-brillo .8s ease; }
.rb-nombre { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); background: var(--rb-crema); color: var(--rb-tinta); border-radius: 999px; padding: 4px 18px; font-size: 26px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.25); white-space: nowrap; }
.rb-lado { flex: 1 1 45%; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.rb-bandeja { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 8px; }
.rb-pieza { width: var(--rb-pw, 72px); height: var(--rb-ph, 72px); min-width: 48px; min-height: 48px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: grab; box-shadow: 0 4px 0 rgba(0,0,0,.35); touch-action: none; overflow: hidden; }
.rb-pieza canvas { display: block; width: 100%; height: 100%; transition: transform .15s ease; }
.rb-pieza.sel { box-shadow: 0 0 0 4px var(--rb-oro), 0 4px 0 rgba(0,0,0,.35); transform: translateY(-3px); }
.rb-pieza.no { animation: rb-no .35s ease; }
.rb-fantasma { position: absolute; width: var(--rb-pw, 72px); height: var(--rb-ph, 72px); transform: translate(-50%, -50%); pointer-events: none; opacity: .85; z-index: 4; border-radius: 10px; box-shadow: 0 8px 16px rgba(0,0,0,.4); }
.rb-ver { align-self: center; min-height: 52px; min-width: 130px; padding: 4px 18px; border-radius: 18px; border: 2px solid rgba(245,197,66,.6); background: rgba(245,197,66,.15); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.rb-ver:disabled, .rb-ver[aria-disabled="true"] { opacity: .45; cursor: default; }
.rb-fin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(18,28,64,.82); z-index: 5; }
.rb-fin-caja { background: var(--rb-crema); color: var(--rb-tinta); border-radius: 24px; padding: 22px 26px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.rb-fin-caja h2 { margin: 0 0 4px; font-size: 30px; color: #b07a00; }
.rb-fin-caja p { margin: 0; font-size: 18px; font-weight: 700; }
@keyframes rb-no { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes rb-brillo { from { filter: brightness(1.6); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) { .rb-celda.no, .rb-pieza.no, .rb-mesa.armado .rb-entero { animation: none; } .rb-pieza canvas { transition: none; } }
@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {
  .rb-cuerpo { flex-direction: row; }
  .rb-mesa { flex: 1 1 55%; }
  .rb-lado { flex: 1 1 45%; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .rb-top { min-height: 56px; padding: 4px 8px; }
  .rb-globo { min-height: 46px; padding: 3px 10px; }
  .rb-ver { min-height: 48px; }
}
