/* Mesas de Chinchón y Escoba (v2/mesa.js): va encima de v2/style.css y uno/uno.css (de ahí salen
   tanteador, mano en abanico, chips y resumen de ronda). Acá: baraja española sobre el paño,
   la mano, las combinaciones, los fósforos y la tabla de la escoba. */

.mesa-chinchon .title-ribbon { background: var(--teal); }
.mesa-escoba .title-ribbon { background: var(--violet); }

/* ── centro del paño ── */
.felt-center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; gap: 5%; pointer-events: auto; }
.felt-center .card { box-shadow: 3px 4px 0 rgba(29, 18, 66, .35); }
.sp-piles { width: 30%; }
.sp-deck, .sp-pozo { position: relative; flex: none; width: 42%; aspect-ratio: 200 / 307; padding: 0; background: none; border: 0; cursor: default; }
.sp-deck i { position: absolute; inset: 0; background: url(../assets/cards/dorso.png) center / cover, #2a1c5e; border: 2px solid var(--ink); border-radius: 7% / 4.6%; }
.sp-deck i:nth-child(1) { transform: translate(-6%, 4%) rotate(-4deg); }
.sp-deck i:nth-child(2) { transform: translate(-3%, 2%) rotate(-2deg); }
.sp-pozo .card { position: absolute; inset: 0; width: 100%; transform: rotate(5deg); }
.sp-pozo:empty { border: 3px dashed rgba(255, 249, 236, .6); border-radius: 8px; }
.sp-deck.can, .sp-pozo.can { cursor: pointer; }
.sp-deck.can i:nth-child(3), .sp-pozo.can .card { box-shadow: 0 0 0 4px var(--sun), 0 0 0 7px var(--ink); animation: pulse 1s ease-in-out infinite alternate; }
.sp-table { width: 70%; flex-direction: column; gap: 4%; }
.sp-table-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.4%; width: 100%; }
.sp-table-cards .card { width: 13%; transition: transform .15s; }
.sp-table-cards .card.hl { transform: translateY(-14%); box-shadow: 0 0 0 4px var(--sun), 0 0 0 7px var(--ink); }
.sp-empty { padding: 4px 14px; font-size: 13px; color: var(--paper); border: 3px dashed rgba(255, 249, 236, .7); border-radius: 99px; }
.sp-deckmini { position: absolute; right: -16%; top: 50%; display: flex; align-items: center; gap: 4px; transform: translateY(-50%); }
.sp-deckmini i { display: block; width: 26px; aspect-ratio: 200 / 307; background: url(../assets/cards/dorso.png) center / cover; border: 2px solid var(--ink); border-radius: 3px; }
.sp-deckmini b { padding: 0 6px; font-family: var(--f-display); font-weight: 400; font-size: 12px; background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; }

/* ── tu mano ── */
.card.fan-card { position: absolute; border-width: 3px; cursor: default; transition: transform .14s var(--ease-pop), filter .2s; }
.card.fan-card.playable { cursor: pointer; }
.card.fan-card.playable:hover { z-index: 99 !important; transform: translateY(-14%); }
.card.fan-card.sel { transform: translateY(-20%); box-shadow: 0 0 0 4px var(--sun), 0 0 0 7px var(--ink); z-index: 99 !important; }
.card.fan-card.takes { box-shadow: 0 0 0 3px var(--teal-2), 0 0 0 5px var(--ink); }
/* chinchón: las combinaciones con una marca, las sueltas apagadas */
.card.fan-card.meld::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 7%; background: var(--teal); border-top: 2px solid var(--ink); }
.card.fan-card.loose { filter: saturate(.75); }
.count-chip b { font-family: var(--f-display); font-weight: 400; font-size: 15px; }

/* ── chapas: lo levantado en la escoba ── */
.plate .extra { display: flex; gap: 4px; }
.pile-tag { padding: 0 6px; font-size: 11px; color: var(--ink); text-shadow: none; background: var(--paper); border: 2px solid var(--ink); border-radius: 99px; }

/* ── tanteador ── */
.us-row.danger b { color: var(--red); }
.ms-heads { display: flex; }
.ms-col { width: 30px; display: flex; flex-direction: column; align-items: center; }
.ms-col i { max-width: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-style: normal; }
.ms-col b { font-family: var(--f-display); font-weight: 400; font-size: 13px; }
.ms-col.me i { text-decoration: underline 2px var(--sun); }
.ms-pad { display: block; margin-top: 2px; overflow: visible; }

/* ── resumen de la mano ── */
.ro-list { display: flex; flex-direction: column; gap: 6px; }
.ro-cards.sp { gap: 6px; }
.ro-cards.sp .card { width: 26px; border-width: 1.5px; box-shadow: none; }
.ro-cards.sp .card.loose { filter: grayscale(.6); opacity: .8; }
.ro-meld { display: inline-flex; gap: 1px; padding: 2px; background: var(--teal); border: 2px solid var(--ink); border-radius: 6px; }
.ro-stats { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; }
.ro-stats th { font-size: 10px; letter-spacing: .06em; padding: 2px 4px; }
.ro-stats td { padding: 4px; border-top: 2px dashed rgba(29, 18, 66, .15); }
.ro-stats td:first-child { text-align: left; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-stats td.won { font-weight: 900; background: var(--sun-2); border-radius: 6px; }
.ro-stats tr.me td:first-child { text-decoration: underline 3px var(--sun); }
#ro-close { align-self: center; }

@media (orientation: portrait) {
  .sp-piles { width: 40%; }
  .sp-table { width: 86%; }
  .sp-table-cards .card { width: 15%; }
  .sp-deckmini { right: -8%; top: auto; bottom: -26%; transform: none; }
  .ro-stats { font-size: 11px; }
  .ro-cards.sp .card { width: 20px; }
}

/* Escoba: la última jugada (qué tiró y qué levantó cada uno) */
.sp-last {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px;
  max-width: 100%; padding: 4px 12px 4px 6px;
  font-size: 13px; font-weight: 900; color: var(--ink);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink);
}
.sp-last.took { background: #e6fff8; }
.sp-last.escoba { background: var(--sun); }
.sp-last.fresh { animation: sp-last-in .45s var(--ease-pop); }
.sp-last-who { padding: 1px 8px; color: var(--paper); background: var(--ink); border-radius: 99px; white-space: nowrap; }
.sp-last .card.mini { width: 42px; flex: none; border-width: 2px; }
.sp-last-line { flex-basis: 100%; text-align: center; font-size: 12px; }
.sp-last-op { white-space: nowrap; }
@keyframes sp-last-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (orientation: portrait) {
  .sp-last { font-size: 11px; gap: 3px; padding: 3px 8px 3px 4px; }
  .sp-last .card.mini { width: 34px; }
  .sp-last-line { font-size: 11px; }
}
