/**
 * Pollopolis TCG — Live Mobile Stylesheet (v1.2.0)
 * Diseño Portrait 9:16 ultra-compacto estilo Pokémon TCG Live.
 * Ocupa el 100% del ancho y alto real de cualquier pantalla móvil sin redimensionarse.
 */

:root {
  --bg-app: #f8fafc;
  --bg-shell: #f8fafc;
  --bg-panel: #ffffff;
  --border-light: #e2e8f0;
  --border-mid: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #4338ca;
  --col-refri: #16a34a;
  --col-asador: #dc2626;
  --col-conge: #0284c7;
  --col-inco: #64748b;
  --topbar-h: 42px;
  --strip-h: 50px;
  --hand-h: 88px;
  --hud-h: 30px;
  --slot-act-h: 0px;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

*::selection {
  background: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  width: 100vw;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-shell);
  color: var(--text-main);
  user-select: none;
  -webkit-text-size-adjust: 100%;
}

/* Contenedor 100% pantalla completa en todos los dispositivos móviles */
.live-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  background: var(--bg-shell);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--strip-h) minmax(0, 1fr) var(--hand-h);
  overflow: hidden;
}

/* ==========================================================================
   1. BARRA SUPERIOR MÓVIL CON BOTONES TÁCTILES REALES (42px)
   ========================================================================== */
.live-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 8px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-mid);
  min-width: 0;
  overflow: hidden;
  z-index: 20;
}

.live-topbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.topbar-rival-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-rival-indicator strong {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  padding: 5px 10px;
  min-height: 30px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}

.segmented-control {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid var(--border-mid);
  border-radius: 7px;
  padding: 2px;
  flex-shrink: 0;
}

.segmented-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  min-height: 26px;
  border-radius: 5px;
  cursor: pointer;
}

.segmented-btn.is-active {
  background: var(--accent);
  color: #ffffff;
}

.top-btn {
  border: 1px solid var(--border-mid);
  background: #ffffff;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  min-height: 30px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.top-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.top-btn--danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ==========================================================================
   2 & 4. ARENAS DE CAMPO (HÉROE IZQUIERDA + 4 AMIGOS EN 2x2 A LA DERECHA)
   ========================================================================== */
.arena-panel {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--hud-h) minmax(0, 1fr);
  gap: 4px;
  overflow: hidden;
}

.arena-panel--opp {
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
  grid-template-rows: var(--hud-h) minmax(0, 1fr);
}

.arena-panel--my {
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
  grid-template-rows: minmax(0, 1fr) var(--hud-h);
}

.arena-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 2px 7px;
  height: var(--hud-h);
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}

.arena-hud__identity {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  max-width: 31%;
}

.arena-hud__identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-hud__counters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.arena-hud__counters::-webkit-scrollbar {
  display: none;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  padding: 2px 6px;
  min-height: 22px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.hud-pill--alert {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.hud-pill--btn {
  cursor: pointer;
  background: #eef2ff;
  border-color: #a5b4fc;
  color: var(--accent);
}

.mini-supply {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f8fafc;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  padding: 2px 6px;
  min-height: 22px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-supply__lbl {
  color: var(--text-muted);
  font-size: 9.5px;
}

.mini-supply__val {
  font-weight: 800;
  color: var(--text-main);
}

.mini-supply__val--lit {
  color: #15803d;
  background: #dcfce7;
  padding: 0 4px;
  border-radius: 4px;
}

.mini-supply__val--off {
  color: #b45309;
  background: #fef3c7;
  padding: 0 4px;
  border-radius: 4px;
}

.revealed-strip {
  display: none !important;
}

.revealed-mini-card {
  font-size: 10px;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   GEOMETRÍA 2D DEL CAMPO: HÉROE A LA IZQUIERDA + 4 AMIGOS EN 2x2 A LA DERECHA
   ========================================================================== */
.live-field-grid {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 33% minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  align-items: stretch;
  overflow: hidden;
}

.field-slot {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px dashed #cbd5e1;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
}

.field-slot--heroe {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  border-color: #94a3b8;
  background: rgba(241, 245, 249, 0.94);
}

.field-slot.has-card {
  border-style: solid;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.slot-corner-tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  z-index: 2;
  pointer-events: none;
}

.slot-empty-box {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
}

.slot-empty-cta {
  background: var(--accent);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.28);
}

/* FICHA DE CAMPO (TOKEN ANCHO Y CLARO EN CUADRÍCULA 2x2 SIN MICRO-BOTONES) */
.live-token {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #94a3b8;
  background: #0f172a;
}

.live-token--refrigerador { border-color: var(--col-refri); }
.live-token--asador { border-color: var(--col-asador); }
.live-token--congelador { border-color: var(--col-conge); }
.live-token--incoloro { border-color: var(--col-inco); }

.live-token.is-actionable {
  box-shadow: 0 0 0 2.5px #4ade80, 0 4px 12px rgba(22, 163, 74, 0.35);
}

.live-token.is-tapped {
  transform: scale(0.94) rotate(-4deg);
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.live-token__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: 0;
}

.live-token__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.08) 45%, rgba(15, 23, 42, 0.88) 100%);
  z-index: 1;
}

.live-token__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  color: #ffffff;
  min-width: 0;
}

.live-token__name {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.live-token__lvl {
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 5px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.live-token__mid {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  min-width: 0;
}

.live-token__dmg-pill {
  background: rgba(220, 38, 38, 0.96);
  color: #ffffff;
  border: 1.5px solid #ffffff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.live-token__status-pill {
  background: rgba(34, 197, 94, 0.95);
  color: #052e16;
  border: 1px solid #ffffff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.live-token__obj-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-radius: 999px;
  padding: 1px 6px 1px 2px;
  font-size: 9px;
  font-weight: 800;
  max-width: 96%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.live-token__obj-pill--cfe {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}

.live-token__obj-pill img {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.live-token__bot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 5px 4px;
}

.live-stat-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.88);
}

.live-stat-chip--atk {
  background: rgba(185, 28, 28, 0.95);
}

.live-stat-chip--def {
  background: rgba(3, 105, 161, 0.95);
}

.slot-btn {
  border: 1px solid var(--border-mid);
  background: #f8fafc;
  color: var(--text-main);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  min-height: 22px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.slot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slot-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.slot-btn--danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ==========================================================================
   3. FRANJA CENTRAL DE FASE INTELIGENTE (PILL IZQUIERDO + 7/6 CUADROS FIJOS)
   ========================================================================== */
.live-battle-strip {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  height: var(--strip-h);
  background: #0f172a;
  color: #ffffff;
  z-index: 15;
  min-width: 0;
  overflow: hidden;
}

.turn-pill {
  cursor: pointer;
  user-select: none;
  border: 1.5px solid #22c55e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  background: #15803d;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.turn-pill--locked {
  background: #334155;
  border-color: #64748b;
  color: #cbd5e1;
}

.turn-pill--victory {
  background: #15803d !important;
  border-color: #4ade80 !important;
  cursor: pointer;
}

.phase-steps-bar {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  align-items: stretch;
}

.phase-steps-bar.has-rd {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.phase-step-box {
  border: 1.5px solid #334155;
  background: #1e293b;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 3px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.08;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.phase-step-box:disabled {
  cursor: default;
  opacity: 0.55;
}

.phase-step-box.is-done {
  background: rgba(15, 118, 110, 0.32);
  border-color: #0d9488;
  color: #5eead4;
  opacity: 0.78;
}

.phase-step-box.is-current {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  opacity: 1 !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.phase-step-box.is-next {
  border-color: #cbd5e1;
  background: #334155;
  color: #f8fafc;
  opacity: 0.95;
}

.phase-step-box--rd {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  opacity: 1 !important;
}

.phase-step-box--end {
  border-color: #f87171;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  opacity: 1;
}

.phase-step-box--end.is-suggested:not(:disabled) {
  border-color: #fde047;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  animation: endTurnSuggestPulse 1.35s ease-in-out infinite;
}

.phase-step-box--end.is-auto-ending:not(:disabled) {
  border-color: #fef08a;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

@keyframes endTurnSuggestPulse {
  0%, 100% {
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 15px rgba(253, 224, 71, 0.98), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(-0.5px);
  }
}

.phase-step-box--end:disabled {
  border-color: #334155;
  background: #1e293b;
  color: #64748b;
  opacity: 0.4;
}

/* ==========================================================================
   5. CAJÓN DESLIZABLE INFERIOR: MI MANO LIMPIA SIN MICRO-BOTONES (88px)
   ========================================================================== */
.hand-drawer {
  background: #ffffff;
  border-top: 1.5px solid var(--border-mid);
  display: flex;
  flex-direction: column;
  z-index: 30;
  min-width: 0;
  overflow: hidden;
}

.hand-drawer.is-expanded {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78%;
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.32);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.hand-drawer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  height: 26px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  flex-shrink: 0;
}

.hand-drawer__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.hand-drawer__cfe-pills {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
}

.hand-drawer__close-btn {
  display: none;
  border: 1px solid var(--border-mid);
  background: #ffffff;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

.hand-drawer__close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.hand-drawer.is-expanded .hand-drawer__close-btn {
  display: inline-flex;
  align-items: center;
}

.hud-pill--cfe-on {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
}

.hud-pill--cfe-off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
}

.hand-drawer__handle {
  width: 24px;
  height: 3.5px;
  border-radius: 999px;
  background: #94a3b8;
}

.hand-drawer__toggle {
  border: 1px solid var(--border-mid);
  background: #ffffff;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.hand-cards {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.hand-card-item {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  border: 2px solid var(--border-mid);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
}

.hand-card-item.is-playable {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.22);
}

.hand-card-stage {
  width: 72px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  pointer-events: none;
}

.hand-card-stage .tcg-card {
  transform: scale(0.302);
  transform-origin: top left;
}

.hand-card-chip {
  position: absolute;
  bottom: 3px;
  left: 3px;
  right: 3px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.hand-card-item.is-playable .hand-card-chip {
  background: #15803d;
}

.hand-drawer.is-expanded .hand-card-chip {
  font-size: 13px;
  padding: 3px 6px;
  bottom: 6px;
  left: 6px;
  right: 6px;
  border-radius: 6px;
}

.spectator-count-pill {
  background: #e0e7ff;
  color: #3730a3;
  border: 1.5px solid #a5b4fc;
  font-weight: 800;
  padding: 2px 8px;
}

.spectator-drawer-panel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  border-radius: 8px;
}

.spectator-drawer-panel__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spectator-drawer-panel__title {
  font-size: 11px;
  font-weight: 800;
  color: #e0e7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spectator-drawer-panel__sub {
  font-size: 9.5px;
  color: #a5b4fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spectator-drawer-panel__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hand-drawer.is-expanded .hand-card-stage {
  width: 202px;
  height: 282px;
}

.hand-drawer.is-expanded .hand-card-stage .tcg-card {
  transform: scale(0.85);
  transform-origin: top left;
}

/* BOTONES GRANDES MÓVILES EN EL INSPECTOR DE ACCIÓN DE CARTA */
.inspector-actions-col {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.inspector-action-btn {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 10px;
  border: 1.5px solid var(--border-mid);
  background: #f8fafc;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.inspector-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.inspector-action-btn--primary {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.inspector-action-btn--attack {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border-color: #b91c1c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.inspector-action-btn--danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ==========================================================================
   RENDERIZADOR OFICIAL DE CARTA COMPLETA (.tcg-card)
   ========================================================================== */
.tcg-card {
  width: 238px;
  height: 332px;
  border-radius: 12px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  background: linear-gradient(145deg, #cbd5e1, #94a3b8);
  border: 2px solid #475569;
  text-align: left;
  font-family: 'Inter', sans-serif;
  user-select: none;
}

.tcg-card--refrigerador {
  background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);
  border-color: #14532d;
}

.tcg-card--asador {
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%);
  border-color: #7f1d1d;
}

.tcg-card--congelador {
  background: linear-gradient(145deg, #38bdf8 0%, #0369a1 100%);
  border-color: #0c4a6e;
}

.tcg-card--incoloro {
  background: linear-gradient(145deg, #e2e8f0 0%, #94a3b8 100%);
  border-color: #475569;
}

.tcg-card--ayuda {
  background: linear-gradient(145deg, #a855f7 0%, #6b21a8 100%);
  border-color: #4c1d95;
}

.tcg-card--objeto {
  background: linear-gradient(145deg, #f59e0b 0%, #b45309 100%);
  border-color: #78350f;
}

.tcg-card--energia {
  background: linear-gradient(145deg, #facc15 0%, #ca8a04 100%);
  border-color: #713f12;
}

.tcg-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 7px;
  padding: 3px 6px;
  min-height: 26px;
}

.tcg-card__badge,
.tcg-card__cost {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 800;
}

.tcg-card__badge-label {
  font-size: 7.5px;
  text-transform: uppercase;
  opacity: 0.85;
}

.tcg-card__cost svg {
  width: 10px;
  height: 10px;
  fill: #facc15;
}

.tcg-card__name {
  flex: 1;
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcg-card__element {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.tcg-card__element svg {
  width: 16px;
  height: 16px;
}

.tcg-card__art {
  position: relative;
  flex: 1;
  min-height: 128px;
  border-radius: 7px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.35);
}

.tcg-card--heroe .tcg-card__art {
  min-height: 232px;
}

.tcg-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tcg-card__art-tag {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}

.tcg-card__stats {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.tcg-card__stat {
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.tcg-card__stat-value {
  font-size: 12px;
  font-weight: 800;
}

.tcg-card__stat-label {
  font-size: 8px;
  text-transform: uppercase;
  color: #cbd5e1;
}

.tcg-card__text {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 7px;
  padding: 5px 7px;
  height: 78px;
  overflow-y: auto;
  font-size: 9.5px;
  line-height: 1.28;
  color: #1e293b;
}

.tcg-card__text p {
  margin: 0;
}

.tcg-card__ability {
  display: block;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}

.tcg-card__foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: rgba(255, 255, 255, 0.95);
  padding: 0 2px;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.45);
}

.tcg-card--incoloro .tcg-card__foot,
.tcg-card--energia .tcg-card__foot {
  color: #0f172a;
  text-shadow: none;
}

.tcg-card__foot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  line-height: 1.2;
}

.tcg-card__foot-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.tcg-card__set {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 11px;
  padding: 0 3.5px;
  border-radius: 2.5px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: none;
}

.tcg-card__id {
  font-size: 7.8px;
  font-weight: 750;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.tcg-card__reg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 6.8px;
  font-weight: 800;
  line-height: 1;
}

.tcg-card__rarity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.tcg-card__rarity svg {
  display: block;
}

.tcg-card__illus {
  font-size: 7.2px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.25;
  padding-right: 1.5px;
  white-space: nowrap;
  opacity: 0.96;
}

.tcg-card__foot-legal {
  text-align: center;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  opacity: 0.9;
  white-space: nowrap;
}

/* ==========================================================================
   MODALES Y SHEETS MÓVILES
   ========================================================================== */
.live-sheet {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 96vw;
  width: 96vw;
  max-height: 90%;
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
}

.live-sheet::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.live-sheet--full {
  width: 96vw;
  height: 92%;
  max-height: 92%;
}

.live-sheet__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

.live-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-mid);
  background: #f8fafc;
}

.live-sheet__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.live-sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.live-sheet__foot {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-mid);
  background: #f8fafc;
}

.live-sheet__card-box {
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

.inspector-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.inspector-extra-note {
  background: #f1f5f9;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-main);
  max-width: 260px;
  text-align: center;
}

.drawer-controls {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-row {
  display: flex;
  gap: 4px;
}

.input-modern {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-mid);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
}

.drawer-links {
  display: flex;
  gap: 10px;
}

.drawer-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.drawer-log-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 52vh;
  padding: 6px 10px;
}

.drawer-log-box__title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.log-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 5px 7px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
}

.log-item,
.log-entry {
  line-height: 1.38;
  padding: 3.5px 4px;
  border-bottom: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  border-radius: 5px;
}

.log-entry--victory {
  background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%);
  border: 1px solid #fcd34d;
  padding: 5px 6px;
}

.log-turn-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  color: #475569;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.log-turn-divider::before,
.log-turn-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #cbd5e1;
}

.log-turn-divider span {
  background: #e2e8f0;
  color: #334155;
  padding: 1px 7px;
  border-radius: 999px;
}

.log-item__time,
.log-entry__time {
  color: #64748b;
  font-size: 9.5px;
  font-family: monospace;
  flex-shrink: 0;
}

.log-entry__author {
  font-size: 9.5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.log-entry__text {
  color: #0f172a;
  word-break: break-word;
  font-weight: 500;
}

.log-card-chip {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #312e81;
  font-weight: 800;
  font-size: 10px;
  line-height: 1.3;
}

.log-meta {
  color: #64748b;
  font-size: 9.5px;
  font-weight: 600;
}

.chat-form {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.deck-tracker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-mid);
}

.deck-tracker-bar__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tracker-chip {
  font-size: 9.5px;
  background: #ffffff;
  border: 1px solid var(--border-mid);
  border-radius: 5px;
  padding: 1px 5px;
}

.tracker-chip--primary {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: var(--accent);
}

.builder-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.builder-chosen-section {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 12px;
}

.builder-section-title--chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.builder-chosen-order-hint {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 8px;
}

.deck-chosen-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 14px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.deck-card-qty-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 6;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fde047;
  border: 2px solid #facc15;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.deck-builder-grid,
.zone-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px;
}

.deck-card-item,
.zone-card-item {
  background: #f8fafc;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.deck-card-item.has-copies,
.zone-card-item.is-selected {
  border-color: var(--accent);
  background: #eef2ff;
}

.modal-card-stage {
  width: 126px;
  height: 176px;
  overflow: hidden;
  border-radius: 6px;
}

.modal-card-stage .tcg-card {
  transform: scale(0.53);
  transform-origin: top left;
}

.deck-card-item__ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  border: 1px solid var(--border-mid);
  background: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.qty-val {
  font-size: 11px;
  font-weight: 800;
  min-width: 16px;
  text-align: center;
}

.deck-card-item .modal-card-stage {
  cursor: zoom-in;
  position: relative;
  transition: transform 0.14s ease;
}

.deck-card-item .modal-card-stage:active {
  transform: scale(0.97);
}

.deck-card-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
}

.deck-card-zoom-overlay[hidden] {
  display: none !important;
}

.deck-zoom-top-pill {
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.deck-zoom-card-stage {
  width: 286px;
  height: 398px;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-out;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: deckZoomPopIn 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.deck-zoom-card-stage .tcg-card {
  transform: scale(1.2);
  transform-origin: top left;
}

@keyframes deckZoomPopIn {
  from {
    opacity: 0;
    transform: scale(0.84);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.deck-zoom-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.deck-zoom-ctrl-bar .qty-btn {
  min-width: 38px;
  min-height: 36px;
  font-size: 15px;
  padding: 4px 10px;
  border-radius: 8px;
}

.deck-zoom-ctrl-bar .qty-val {
  font-size: 16px;
  min-width: 28px;
  color: #0f172a;
}

.deck-zoom-hint {
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.target-slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.target-slot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: #f8fafc;
  border: 1.5px solid var(--border-mid);
  border-radius: 9px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}

.target-slot-btn:hover {
  border-color: #64748b;
  background: #f1f5f9;
}

.target-slot-btn:active {
  transform: scale(0.99);
}

.target-slot-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.target-slot-thumb {
  width: 44px;
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #94a3b8;
  background: #0f172a;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  display: inline-flex;
}

.target-slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.target-slot-thumb--refrigerador { border-color: #22c55e; }
.target-slot-thumb--asador       { border-color: #ef4444; }
.target-slot-thumb--congelador   { border-color: #38bdf8; }
.target-slot-thumb--incoloro     { border-color: #a855f7; }

.target-slot-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.target-slot-cta {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.target-slot-cta--atk {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.target-slot-cta--primary {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.modal-hint {
  margin: 0 0 6px;
  padding: 5px 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 10.5px;
  color: #1e3a8a;
}

.victory-modal__banner {
  background: linear-gradient(135deg, #14532d 0%, #15803d 100%);
  color: #ffffff;
  padding: 12px 14px;
  text-align: center;
}

.victory-modal__banner--defeat {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.victory-modal__kicker {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 3px;
}

.victory-modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.victory-modal__sub {
  margin: 3px 0 0;
  font-size: 10.5px;
  color: #dcfce7;
}

.victory-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.victory-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.victory-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

@keyframes fxFloatPop {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.75); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(0.92); }
}

.fx-floating-pop {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 30;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid #ffffff;
  animation: fxFloatPop 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-floating-pop--dmg { background: #dc2626; color: #ffffff; }
.fx-floating-pop--ko { background: #7f1d1d; color: #fef08a; }
.fx-floating-pop--heal { background: #16a34a; color: #ffffff; }
.fx-floating-pop--spec { background: #4338ca; color: #ffffff; }

@keyframes fxAyudaCenterToDiscard {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--start-dx, 0px)), calc(-50% + var(--start-dy, 180px))) scale(0.22) rotate(-540deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.82) rotate(0deg);
  }
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.82) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--end-dx, -120px)), calc(-50% + var(--end-dy, 80px))) scale(0.14) rotate(540deg);
  }
}

.fx-ayuda-showcase {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 94vw;
  box-sizing: border-box;
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(15, 23, 42, 0.55));
  animation: fxAyudaCenterToDiscard 3.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-ayuda-showcase--pair {
  animation-duration: 3.85s;
}

.fx-ayuda-showcase__pill {
  background: #4338ca;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  max-width: 92vw;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.fx-ayuda-showcase__pill--reveal {
  background: linear-gradient(90deg, #4338ca 0%, #0d9488 100%);
  border-color: #fde047;
}

.fx-ayuda-showcase__pill--spec {
  background: linear-gradient(90deg, #6d28d9 0%, #2563eb 100%);
  border-color: #facc15;
}

.fx-ayuda-showcase__subpill-effect {
  background: rgba(15, 23, 42, 0.94);
  color: #fef08a;
  border: 1.5px solid #facc15;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 10.5px;
  font-weight: 800;
  max-width: 92vw;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.fx-showcase-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.9);
  padding: 8px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.28);
}

.fx-showcase-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.fx-showcase-subpill {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.fx-showcase-subpill--found {
  background: #15803d;
  color: #fef08a;
  border-color: #fde047;
}

.fx-showcase-card-slot {
  width: 152px;
  height: 212px;
  position: relative;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.fx-showcase-card-slot .tcg-card {
  transform: scale(0.6386);
  transform-origin: top left;
}

.fx-showcase-card-slot--found {
  box-shadow: 0 0 0 2.5px #facc15, 0 0 16px rgba(250, 204, 21, 0.65);
}

.fx-showcase-arrow {
  font-size: 18px;
  font-weight: 900;
  color: #facc15;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  padding: 0 1px;
  flex-shrink: 0;
}

.fx-turn-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 120;
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border: 2px solid #818cf8;
  border-radius: 9px;
  padding: 6px 14px;
  text-align: center;
  pointer-events: none;
}

.fx-turn-banner__title {
  font-size: 12px;
  font-weight: 800;
}

.fx-turn-banner__sub {
  font-size: 10px;
  color: #cbd5e1;
}

/* Escalado proporcional automático cuando un móvil tiene "Sitio para computadora" (viewport 980px en vertical) */
@media (min-width: 600px) and (orientation: portrait) {
  :root {
    --topbar-h: 68px;
    --strip-h: 76px;
    --hand-h: 164px;
    --hud-h: 48px;
    --slot-act-h: 40px;
  }

  .room-chip,
  .segmented-btn,
  .top-btn,
  .arena-hud__identity,
  .hud-pill,
  .mini-supply,
  .turn-pill,
  .phase-step-box,
  .hand-drawer__title,
  .hand-drawer__toggle,
  .slot-btn,
  .live-token__name,
  .live-token__lvl,
  .live-stat-chip,
  .live-token__dmg-pill,
  .live-token__status-pill,
  .live-token__obj-pill {
    font-size: 17px;
  }

  .hand-drawer__bar {
    height: 44px;
  }

  .hand-card-stage {
    width: 116px;
    height: 72px;
  }

  .hand-card-stage .tcg-card {
    transform: scale(0.486);
    transform-origin: top left;
  }

  .hand-drawer.is-expanded .hand-card-stage {
    width: 238px;
    height: 332px;
  }

  .hand-drawer.is-expanded .hand-card-stage .tcg-card {
    transform: scale(1);
    transform-origin: top left;
  }
}

/* ==========================================================================
   VISTAS MÓVILES DE USUARIOS, LOGIN, LOBBY DE 3 MAZOS, RETOS Y RANKING ELO (Live 2.1)
   ========================================================================== */
.live-overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.live-overlay-screen[hidden] {
  display: none !important;
}

/* BOTONES TÁCTILES NATIVOS PARA AUTH Y LOBBY MÓVIL */
.lobby-btn,
#live-auth-screen .top-btn,
#live-lobby-screen .top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  border: 1.5px solid var(--border-mid);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.lobby-btn:active,
#live-auth-screen .top-btn:active,
#live-lobby-screen .top-btn:active {
  transform: scale(0.98);
}

.lobby-btn--primary,
#live-auth-screen .top-btn--primary,
#live-lobby-screen .top-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
}

.lobby-btn--danger,
#live-lobby-screen .top-btn--danger {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.lobby-btn:disabled,
#live-auth-screen .top-btn:disabled,
#live-lobby-screen .top-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* PANTALLA DE LOGIN MÓVIL */
#live-auth-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: env(safe-area-inset-top, 10px) 12px env(safe-area-inset-bottom, 12px);
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: #ffffff;
  border: 1.5px solid var(--border-mid);
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.auth-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.auth-brand__kicker {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.auth-brand__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.auth-card__instruction {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.auth-users-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 2px solid var(--border-mid);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}

.auth-user-btn:active {
  transform: scale(0.98);
}

.auth-user-btn.is-selected {
  border-color: var(--accent);
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.16);
}

.auth-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.auth-user-btn.is-selected .auth-user-avatar {
  background: var(--accent);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot--online {
  background: #16a34a;
  box-shadow: 0 0 0 2px #dcfce7;
}

.status-dot--busy {
  background: #f59e0b;
  box-shadow: 0 0 0 2px #fef3c7;
}

.auth-user-info {
  min-width: 0;
  flex: 1;
}

.auth-user-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.auth-user-meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-pin-box {
  background: #f8fafc;
  border: 1.5px solid var(--border-mid);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-pin-box__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.auth-selected-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.auth-selected-label strong {
  color: var(--text-main);
  font-size: 14px;
}

.auth-pin-input {
  width: 100%;
  min-height: 46px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 5px;
  border-radius: 10px;
  border: 1.5px solid var(--border-mid);
}

.auth-submit-btn {
  width: 100%;
  min-height: 48px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
}

.auth-error-msg {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  color: #dc2626;
  text-align: center;
}

/* PANTALLA DE LOBBY MÓVIL */
.lobby-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.lobby-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-mid);
  flex-shrink: 0;
}

.lobby-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lobby-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lobby-user-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lobby-user-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.lobby-elo-pill {
  background: #0f172a;
  color: #facc15;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.lobby-user-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.lobby-header__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
  width: 100%;
}

.lobby-header__actions .top-btn {
  width: 100%;
  min-height: 44px;
  font-size: 13px;
  padding: 8px 10px;
}

.lobby-challenge-banner {
  background: #eef2ff;
  border-bottom: 2px solid var(--accent);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.challenge-banner__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #1e1b4b;
}

.challenge-banner__controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.challenge-banner__controls .top-btn {
  flex: 1;
  min-height: 44px;
  font-size: 13.5px;
}

.challenge-deck-select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid #818cf8;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.lobby-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #ffffff;
  border-top: 1.5px solid var(--border-mid);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.06);
  z-index: 20;
  position: relative;
}

.lobby-tab {
  border: none;
  border-top: 3px solid transparent;
  background: transparent;
  min-height: 54px;
  padding: 5px 2px 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lobby-tab__icon {
  font-size: 18px;
  line-height: 1.1;
}

.lobby-tab__label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.lobby-tab.is-active {
  color: var(--accent);
  border-top-color: var(--accent);
  background: #eef2ff;
}

.lobby-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.lobby-body[hidden] {
  display: none !important;
}

.lobby-section {
  background: #ffffff;
  border: 1.5px solid var(--border-mid);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.lobby-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lobby-section__title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.lobby-section__hint {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

/* TARJETAS MÓVILES DE LOS 3 MAZOS GUARDADOS (APILADAS VERTICALMENTE PARA PULGAR) */
.lobby-decks-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-deck-card {
  border: 2px solid var(--border-mid);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-deck-card.is-selected {
  border-color: var(--accent);
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.12);
}

.saved-deck-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.saved-deck-card__slot {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.saved-deck-card__badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
}

.saved-deck-card__name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-deck-card__meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.saved-deck-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.saved-deck-card__actions .top-btn {
  width: 100%;
  min-height: 44px;
  font-size: 13.5px;
  text-align: center;
}

/* LISTA MÓVIL DE RIVALES, RANKING Y PARTIDAS */
.lobby-rivals-list,
.lobby-ranking-list,
.lobby-matches-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rival-row,
.ranking-row,
.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1.5px solid var(--border-mid);
  border-radius: 12px;
}

.rival-row.is-online {
  border-color: #4ade80;
  background: #f0fdf4;
}

.rival-row__left,
.ranking-row__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.rival-row__name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.rival-row__sub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.rival-row__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rival-row__actions .top-btn {
  min-height: 44px;
  min-width: 104px;
  padding: 8px 14px;
  font-size: 13.5px;
}

.rank-pos-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-pos-badge--1 {
  background: #facc15;
  color: #0f172a;
}

.rank-pos-badge--2 {
  background: #cbd5e1;
  color: #0f172a;
}

.rank-pos-badge--3 {
  background: #fed7aa;
  color: #7c2d12;
}

.match-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.match-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.match-row__players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.match-elo-gain {
  color: #15803d;
  font-weight: 800;
}

.match-elo-loss {
  color: #b91c1c;
  font-weight: 800;
}

/* BARRA DE RANURA Y NOMBRE EN ARMADOR DE MAZO */
.deck-slot-editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.deck-slot-pills {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.deck-slot-pills .segmented-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.victory-elo-box {
  width: 100%;
  background: #eef2ff;
  border: 1.5px solid #818cf8;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e1b4b;
}

/* ==========================================================================
   TARJETAS DE SALA VERDE Y SALA ROJA + 4 MAZOS (30 Y 40 CARTAS)
   ========================================================================== */
.lobby-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.room-card {
  border: 2px solid var(--border-mid);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  min-width: 0;
  overflow: hidden;
}

.room-card--verde {
  border-color: #22c55e;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.room-card--roja {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.room-card--occupied {
  opacity: 0.92;
}

.room-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.room-card__title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-card--verde .room-card__title {
  color: #15803d;
}

.room-card--roja .room-card__title {
  color: #b91c1c;
}

.room-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-badge--free {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.room-badge--busy {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.room-badge--active {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #a5b4fc;
}

.room-card__body {
  font-size: 12.5px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-card__mode-btns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.room-card__mode-btns--stack {
  grid-template-columns: minmax(0, 1fr);
}

.room-card__invite-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.room-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border-mid);
}

.room-deck-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.saved-deck-card--valid {
  border-color: #22c55e;
  background: #f0fdf4;
}

.saved-deck-card--empty {
  border-style: dashed;
  border-color: #94a3b8;
  background: #f8fafc;
}

.saved-deck-card__badge--valid {
  background: #16a34a;
  color: #ffffff;
}

.saved-deck-card__badge--empty {
  background: #64748b;
  color: #ffffff;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
}

/* ==========================================================================
   VISTA LIGA ROUND ROBIN (TEMPORADA 1: CASA Y VISITANTE)
   ========================================================================== */
.liga-tiebreak-note {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 7px 10px;
  line-height: 1.35;
}

.liga-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  background: #ffffff;
}

.liga-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: center;
}

.liga-table th {
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 7px 4px;
  border-bottom: 1.5px solid var(--border-mid);
  white-space: nowrap;
}

.liga-table td {
  padding: 7px 4px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.liga-table tbody tr:last-child td {
  border-bottom: none;
}

.liga-table tbody tr.is-me-row {
  background: #eef2ff;
}

.liga-table th.col-player,
.liga-table td.col-player {
  text-align: left;
  padding-left: 6px;
  font-weight: 800;
}

.liga-table td.col-pts {
  font-weight: 900;
  color: #3730a3;
  background: rgba(67, 56, 202, 0.06);
  font-size: 12.5px;
}

.liga-table td.col-dif-pos {
  color: #15803d;
  font-weight: 800;
}

.liga-table td.col-dif-neg {
  color: #b91c1c;
  font-weight: 800;
}

.liga-pos-mini {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.liga-pos-mini--1 {
  background: #facc15;
  color: #0f172a;
}

.liga-pos-mini--2 {
  background: #cbd5e1;
  color: #0f172a;
}

.liga-pos-mini--3 {
  background: #fed7aa;
  color: #7c2d12;
}

.liga-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
}

.liga-filter-bar .segmented-btn {
  min-height: 32px;
  padding: 4px 4px;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.liga-matches-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.liga-match-card {
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  padding: 9px 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.liga-match-card--mine {
  border-color: #818cf8;
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%);
}

.liga-match-card--waiting {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 0 0 1.5px rgba(245, 158, 11, 0.16);
}

.liga-match-card--live {
  border-color: #ef4444;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
  box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.18);
}

.liga-match-card--done {
  border-color: #86efac;
  background: #f0fdf4;
}

.liga-match-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.liga-match-card__teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.liga-team-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.liga-team-box--winner {
  border-color: #16a34a;
  background: #dcfce7;
}

.liga-team-box--ready {
  border-color: #4338ca;
  background: #e0e7ff;
}

.liga-team-box__role {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #475569;
}

.liga-team-box__name {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.liga-score-pill {
  font-size: 12px;
  font-weight: 900;
  color: #1e293b;
  background: #e2e8f0;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}

.liga-match-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.liga-match-card__status {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  min-width: 0;
  flex: 1 1 130px;
}

.liga-match-card__btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
}

.liga-btn-compact {
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.liga-btn-compact--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.liga-btn-compact--danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* ========================================================================
   MENÚ FLOTANTE DEL 5TO BOTÓN (MENÚ: STAPLES, HISTORIAL, REGLAS)
   ======================================================================== */
.lobby-more-popover {
  position: absolute;
  right: 8px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
  width: min(250px, calc(100vw - 24px));
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 35;
  animation: popMoreMenu 0.14s ease-out;
}

.lobby-more-popover[hidden] {
  display: none !important;
}

@keyframes popMoreMenu {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lobby-more-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.lobby-more-item:hover,
.lobby-more-item:active {
  background: #f1f5f9;
}

.lobby-more-item.is-active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: var(--accent);
}

.lobby-more-item__icon {
  font-size: 19px;
  line-height: 1;
  flex-shrink: 0;
}

.lobby-more-item__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lobby-more-item__text strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.lobby-more-item__text small {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ========================================================================
   VISTA STAPLES: USO DE CARTAS (MÁS USADAS A NUNCA USADAS)
   ======================================================================== */
.staples-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.staples-kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 7px 8px;
  text-align: center;
}

.staples-kpi-card__val {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
}

.staples-kpi-card__lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.staples-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.staples-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.staples-card-row {
  display: grid;
  grid-template-columns: 24px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.staples-card-row:hover,
.staples-card-row:active {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.staples-card-row.is-unused {
  opacity: 0.78;
  background: #fafafa;
}

.staples-rank {
  font-size: 11px;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
}

.staples-thumb {
  width: 38px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
}

.staples-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.staples-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.staples-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staples-meta {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staples-bar-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.staples-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #0ea5e9);
  border-radius: 999px;
}

.staples-stats {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.staples-pct {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
}

.staples-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.staples-badge--staple {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.staples-badge--freq {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.staples-badge--niche {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.staples-badge--unused {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ========================================================================
   VISTA DE CAMPO EN PC Y TABLET: 5 ESPACIOS EN 1 SOLA FILA CON CARTA COMPLETA
   (Celulares < 720px conservan intacto el diseño Héroe + 2x2)
   ======================================================================== */
.live-token__fullcard {
  display: none;
}

@media (min-width: 720px) and (orientation: landscape), (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .live-field-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }

  .field-slot--heroe {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .live-token {
    background: #1e293b;
    align-items: center;
    justify-content: center;
    padding: 3px;
  }

  .live-token__art,
  .live-token__scrim,
  .live-token__top {
    display: none !important;
  }

  .live-token__fullcard {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 2px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
  }

  .live-token__fullcard-scaler {
    width: calc(238px * var(--field-card-scale, 0.48));
    height: calc(332px * var(--field-card-scale, 0.48));
    position: relative;
    flex-shrink: 0;
  }

  .live-token__fullcard-scaler .tcg-card {
    transform: scale(var(--field-card-scale, 0.48));
    transform-origin: top left;
    pointer-events: none;
  }

  .live-token__mid {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    z-index: 3;
    justify-content: center;
  }

  .live-token__bot {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    z-index: 3;
    pointer-events: none;
  }
}





/* ==========================================================================
   REGISTRO POR CORREO + PANEL ADMIN (MOTOBAKA) + LANZADOR DE LIGA
   ========================================================================== */
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-mid);
}

.auth-mode-tabs .segmented-btn {
  min-height: 36px;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 8px;
}

.auth-form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field__label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.auth-form-stack .input-modern {
  width: 100%;
  min-height: 42px;
  font-size: 14px;
}

.auth-code-input {
  text-align: center;
  font-size: 22px !important;
  font-weight: 900;
  letter-spacing: 8px;
}

.auth-submit-btn--full {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
}

.auth-helper-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 9px 11px;
}

.auth-verify-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-notice-banner {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
}

.auth-notice-banner--warn {
  border-color: #fde047;
  background: #fefce8;
  color: #854d0e;
}

.lobby-admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.lobby-admin-alert {
  margin: 8px 10px 0;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-admin-alert__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: #92400e;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  flex-wrap: wrap;
}

.admin-user-row__btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  margin-left: 4px;
}

.liga-participants-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.liga-participant-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: #f8fafc;
  border: 1.5px solid var(--border-mid);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.liga-participant-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Modal de confirmación anti-clic accidental (Rendirse / Salir) */
.live-confirm-dialog {
  max-width: 390px;
  width: 92vw;
  border-radius: 14px;
  overflow: hidden;
}

.live-confirm-dialog__head {
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  padding: 12px 14px;
}

.live-confirm-dialog__head h2 {
  font-size: 14.5px;
  font-weight: 800;
  color: #991b1b;
}

.live-confirm-dialog__body {
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
}

.live-confirm-dialog__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.live-confirm-dialog__foot .top-btn {
  flex: 1;
  justify-content: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
}

/* ==========================================================================
   VISTA HISTORIA / LORE (MENÚ HAMBURGUESA DEL LOBBY)
   ========================================================================== */
.lore-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  border: 1.5px solid #334155;
  padding: 16px 14px;
}

.lore-hero-card__header {
  text-align: center;
  margin-bottom: 14px;
}

.lore-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 6px;
}

.lore-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.lore-subtitle {
  margin: 0;
  font-size: 12.5px;
  color: #cbd5e1;
}

.lore-portraits-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lore-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 6px 4px;
}

.lore-portrait--ref { border-color: rgba(34, 197, 94, 0.65); }
.lore-portrait--asa { border-color: rgba(239, 68, 68, 0.65); }
.lore-portrait--con { border-color: rgba(56, 189, 248, 0.65); }
.lore-portrait--inc { border-color: rgba(251, 191, 36, 0.65); }

.lore-portrait img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.lore-portrait span {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
}

.lore-chapter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lore-paragraph {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
}

.lore-finale-banner {
  background: linear-gradient(135deg, #14532d 0%, #15803d 48%, #b91c1c 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.lore-finale-banner__lead {
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
}

.lore-finale-banner__Set {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fef08a;
}

/* ==========================================================================
   ESTRELLAS DE CAMPEÓN DE TEMPORADA (ESTILO FÚTBOL) Y PALMARÉS DE LIGA
   ========================================================================== */
.champ-stars {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: #f59e0b;
  font-size: 0.95em;
  letter-spacing: 1px;
  line-height: 1;
  vertical-align: baseline;
  filter: drop-shadow(0 1px 1px rgba(180, 83, 9, 0.4));
}

.liga-champion-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 60%, #422006 100%);
  color: #ffffff;
  border: 2px solid #f59e0b;
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.liga-champion-card__kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 6px;
}

.liga-champion-card__title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  color: #fef08a;
}

.liga-champion-card__sub {
  margin: 0;
  font-size: 12.5px;
  color: #e2e8f0;
}

.liga-palmares-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.liga-palmares-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  font-size: 12.5px;
}

.liga-palmares-item__season {
  font-weight: 800;
  color: #92400e;
}

.liga-palmares-item__champ {
  font-weight: 800;
  color: #0f172a;
}

/* ==========================================================================
   SISTEMA COMPLETO DE COREOGRAFÍA DE COMBATE Y FX DE CAMPO (MÓVIL + PC)
   ========================================================================== */
.fx-combat-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 108;
  overflow: hidden;
}

/* 1. Cinta Rápida de Combate (No invasiva sobre el centro) */
.fx-combat-ribbon {
  position: fixed;
  left: 50%;
  top: var(--combat-ribbon-y, 50%);
  transform: translate(-50%, -50%);
  z-index: 112;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(94vw, 680px);
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.78);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.45), 0 0 14px rgba(251, 191, 36, 0.28);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  animation: fxCombatRibbonAnim 1.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-combat-ribbon--ko {
  border-color: #f87171;
  box-shadow: 0 8px 24px rgba(127, 29, 29, 0.55), 0 0 18px rgba(239, 68, 68, 0.45);
}

.fx-combat-ribbon__atk { color: #fde047; }
.fx-combat-ribbon__arrow { color: #94a3b8; font-weight: 900; }
.fx-combat-ribbon__def { color: #ffffff; }
.fx-combat-ribbon__dmg {
  background: #dc2626;
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
}
.fx-combat-ribbon__shield {
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid #38bdf8;
  color: #bae6fd;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
}
.fx-combat-ribbon__ko {
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.03em;
}

@keyframes fxCombatRibbonAnim {
  0% { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(0.9); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 8px)) scale(0.96); }
}

/* 2. Foco del Atacante y Mira sobre el Objetivo */
.fx-attacker-aura {
  position: fixed;
  border-radius: 10px;
  border: 2.5px solid var(--fx-elem-color, #fbbf24);
  box-shadow: 0 0 18px var(--fx-elem-glow, rgba(251, 191, 36, 0.8)), inset 0 0 12px var(--fx-elem-glow, rgba(251, 191, 36, 0.45));
  pointer-events: none;
  animation: fxAuraPulse 0.55s ease-out forwards;
}

@keyframes fxAuraPulse {
  0% { opacity: 0; transform: scale(0.94); }
  25% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.08); }
}

.fx-target-reticle {
  position: fixed;
  border-radius: 10px;
  border: 2.5px dashed #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.65), inset 0 0 14px rgba(239, 68, 68, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: fxReticleLock 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-target-reticle--sniper {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), inset 0 0 14px rgba(245, 158, 11, 0.32);
}

.fx-target-reticle__icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.65));
}

@keyframes fxReticleLock {
  0% { opacity: 0; transform: scale(1.26); }
  30% { opacity: 1; transform: scale(0.98); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.94); }
}

/* 3. Estela Elemental SVG y Ficha Fantasma en Embestida */
.fx-attack-svg-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
}

.fx-beam-glow {
  fill: none;
  stroke-linecap: round;
  opacity: 0.72;
  filter: blur(4px);
  animation: fxBeamFade 0.5s ease-out forwards;
}

.fx-beam-core {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: fxBeamShoot 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fxBeamShoot {
  0% { stroke-dashoffset: 900; opacity: 1; }
  55% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes fxBeamFade {
  0% { opacity: 0; }
  35% { opacity: 0.82; }
  100% { opacity: 0; }
}

.fx-flying-striker {
  position: fixed;
  width: var(--striker-w, 68px);
  height: var(--striker-h, 88px);
  left: var(--start-x, 0px);
  top: var(--start-y, 0px);
  transform: translate(-50%, -50%);
  border-radius: 10px;
  overflow: hidden;
  border: 2.5px solid var(--fx-elem-color, #fbbf24);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.6), 0 0 18px var(--fx-elem-glow, rgba(251, 191, 36, 0.85));
  background: #0f172a;
  pointer-events: none;
  animation: fxStrikerLunge 0.44s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.fx-flying-striker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fx-flying-striker__badge {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--fx-elem-color, #fbbf24);
  color: #fde047;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

@keyframes fxStrikerLunge {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.92);
  }
  20% {
    opacity: 1;
    transform: translate(calc(-50% - var(--lunge-dx, 0px) * 0.08), calc(-50% - var(--lunge-dy, 0px) * 0.08)) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translate(calc(-50% + var(--lunge-dx, 0px)), calc(-50% + var(--lunge-dy, 0px))) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--lunge-dx, 0px) * 0.78), calc(-50% + var(--lunge-dy, 0px) * 0.78)) scale(0.86);
  }
}

/* 4. Estallido de Impacto en Objetivo */
.fx-impact-burst {
  position: fixed;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.96) 0%, rgba(239, 68, 68, 0.82) 42%, rgba(239, 68, 68, 0) 72%);
  pointer-events: none;
  animation: fxImpactBoom 0.44s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fx-impact-burst--ko {
  width: 126px;
  height: 126px;
  background: radial-gradient(circle, #ffffff 0%, #fde047 26%, #ef4444 56%, rgba(127, 29, 29, 0) 76%);
}

.fx-impact-burst--shield {
  background: radial-gradient(circle, #e0f2fe 0%, rgba(56, 189, 248, 0.85) 45%, rgba(14, 165, 233, 0) 74%);
}

.fx-impact-burst::before,
.fx-impact-burst::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #ffffff 50%, transparent 100%);
  border-radius: 999px;
}

.fx-impact-burst::before { transform: translate(-50%, -50%) rotate(-38deg); }
.fx-impact-burst::after { transform: translate(-50%, -50%) rotate(38deg); }

@keyframes fxImpactBoom {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.28); }
  55% { opacity: 0.98; transform: translate(-50%, -50%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.42); }
}

/* 5. Fantasma de K.O. (Mantiene visible la carta derrotada antes de ir al Descarte) */
.fx-ko-ghost {
  position: fixed;
  border-radius: 9px;
  overflow: hidden;
  background: #0f172a;
  border: 2px solid #ef4444;
  box-shadow: 0 8px 22px rgba(127, 29, 29, 0.55);
  pointer-events: none;
}

.fx-ko-ghost__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.2s ease;
}

.fx-ko-ghost__name {
  position: absolute;
  top: 4px;
  left: 5px;
  right: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-ko-ghost__stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1.8);
  opacity: 0;
  background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
  border: 2px solid #fde047;
  color: #fef08a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

.fx-ko-ghost.is-struck {
  animation: fxKoGhostShatter 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-ko-ghost.is-struck .fx-ko-ghost__img {
  filter: grayscale(0.55) contrast(1.25) brightness(0.75) sepia(0.45) hue-rotate(-35deg);
}

.fx-ko-ghost.is-struck .fx-ko-ghost__stamp {
  animation: fxKoStampSlam 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fxKoStampSlam {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-18deg) scale(2.1); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-10deg) scale(1); }
}

@keyframes fxKoGhostShatter {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  18% { opacity: 1; transform: translate(-5px, 3px) scale(1.04) rotate(-3deg); }
  36% { opacity: 1; transform: translate(5px, -3px) scale(1.02) rotate(3deg); }
  62% { opacity: 0.96; transform: translate(0, 0) scale(0.98) rotate(-2deg); }
  100% {
    opacity: 0;
    transform: translate(var(--ko-exit-dx, 0px), var(--ko-exit-dy, 26px)) scale(0.28) rotate(14deg);
  }
}

/* 6. Números Flotantes Grandes en Escenario Global (Nunca recortados por overflow:hidden) */
.fx-stage-pop {
  position: fixed;
  transform: translate(-50%, -50%);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1.5px solid #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.45);
  pointer-events: none;
  animation: fxStagePopRise 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-stage-pop--dmg {
  background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
  color: #ffffff;
  font-size: 15px;
}

.fx-stage-pop--ko {
  background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
  border-color: #fde047;
  color: #fef08a;
  font-size: 15.5px;
}

.fx-stage-pop--shield {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #bae6fd;
  color: #ffffff;
  font-size: 11.5px;
}

.fx-stage-pop--overflow {
  background: linear-gradient(135deg, #f59e0b 0%, #b91c1c 100%);
  border-color: #fef08a;
  color: #ffffff;
  font-size: 14.5px;
}

.fx-stage-pop--buff {
  background: linear-gradient(135deg, #eab308 0%, #b45309 100%);
  border-color: #fef08a;
  color: #ffffff;
  font-size: 12px;
}

@keyframes fxStagePopRise {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.55); }
  18% { opacity: 1; transform: translate(-50%, -65%) scale(1.14); }
  32% { opacity: 1; transform: translate(-50%, -75%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -105%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.92); }
}

/* 7. Micro-animaciones al Equipar Objeto o Bolo/Dayuri (+DEF) */
.anim-equip-flash {
  animation: fxEquipSlotGlow 0.85s ease-out;
}

.anim-bolo-glow {
  animation: fxBoloSlotGlow 0.9s ease-out;
}

@keyframes fxEquipSlotGlow {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.9); }
  35% { box-shadow: 0 0 20px 5px rgba(56, 189, 248, 0.85), inset 0 0 14px rgba(56, 189, 248, 0.45); }
  100% { box-shadow: none; }
}

@keyframes fxBoloSlotGlow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.95); }
  35% { box-shadow: 0 0 22px 6px rgba(251, 191, 36, 0.9), inset 0 0 14px rgba(251, 191, 36, 0.5); }
  100% { box-shadow: none; }
}

/* Escalado enriquecido en Vista PC (Landscape ancho) */
@media (min-width: 720px) and (orientation: landscape), (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .fx-combat-ribbon {
    font-size: 13.5px;
    padding: 6px 16px;
    gap: 8px;
  }
  .fx-combat-ribbon__dmg,
  .fx-combat-ribbon__ko {
    font-size: 12.5px;
    padding: 2px 9px;
  }
  .fx-stage-pop--dmg,
  .fx-stage-pop--ko {
    font-size: 18px;
    padding: 4px 13px;
  }
  .fx-ko-ghost__stamp {
    font-size: 15px;
    padding: 3px 11px;
  }
}

/* ==========================================================================
   RELOJ DE AJEDREZ FISCHER (MODO C: 12:00+12s OFICIAL / RÁPIDA 8:00+8s / SIN RELOJ)
   ========================================================================== */
.chess-clock-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-right: auto;
  padding: 2px 6px;
  min-height: 21px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1.5px solid #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.chess-clock-pill[hidden] {
  display: none !important;
}

.chess-clock-pill.is-active {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #16a34a;
  color: #14532d;
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.28);
}

.chess-clock-pill.is-warn {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #d97706;
  color: #92400e;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.32);
}

.chess-clock-pill.is-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #dc2626;
  color: #991b1b;
  animation: chessClockDangerPulse 0.72s ease-in-out infinite alternate;
}

.chess-clock-pill.is-expired {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fef08a;
  box-shadow: none;
  animation: none;
}

.chess-clock-pill.is-free {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #64748b;
  font-weight: 800;
  box-shadow: none;
}

.chess-clock-pill.is-inc-flash {
  animation: chessClockIncrementPop 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.chess-clock-pill__inc-tag {
  font-size: 9px;
  font-weight: 900;
  color: #15803d;
  background: #ffffff;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 0 4px;
  margin-left: 2px;
}

@keyframes chessClockDangerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.35);
  }
  100% {
    transform: scale(1.04);
    box-shadow: 0 0 13px rgba(220, 38, 38, 0.72);
  }
}

@keyframes chessClockIncrementPop {
  0% { transform: scale(1); }
  28% { transform: scale(1.12); box-shadow: 0 0 14px rgba(22, 163, 74, 0.7); }
  100% { transform: scale(1); }
}

/* Selector de Modalidad y Reloj en Salas (Sala Verde y Sala Roja — 3 opciones) */
.room-preset-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 6px;
}

.room-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.room-preset-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.room-preset-btn__title {
  font-size: 11.5px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.room-preset-btn__sub {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.2;
}

.room-preset-btn.is-active {
  border-color: #4338ca;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  box-shadow: 0 0 0 1.5px rgba(67, 56, 202, 0.18);
}

.room-preset-btn.is-active .room-preset-btn__title {
  color: #312e81;
}

.room-preset-btn.is-active .room-preset-btn__sub {
  color: #4338ca;
}

.room-preset-btn--ranked.is-active {
  border-color: #d97706;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 0 0 1.5px rgba(217, 119, 6, 0.22);
}

.room-preset-btn--ranked.is-active .room-preset-btn__title {
  color: #92400e;
}

.room-preset-btn--ranked.is-active .room-preset-btn__sub {
  color: #b45309;
}

.room-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  width: fit-content;
}

.room-mode-pill--ranked {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.room-mode-pill--friendly {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

@media (max-width: 560px) {
  .room-preset-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .room-preset-picker .room-preset-btn:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 350px) {
  .room-preset-picker {
    grid-template-columns: minmax(0, 1fr);
  }
  .room-preset-picker .room-preset-btn:first-child {
    grid-column: auto;
  }
}

@media (min-width: 720px) and (orientation: landscape), (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .chess-clock-pill {
    font-size: 12.5px;
    padding: 3px 9px;
    min-height: 24px;
    border-radius: 7px;
  }
  .chess-clock-pill__inc-tag {
    font-size: 10px;
  }
}


/* ==========================================================================
   REPRODUCTOR DE REPLAYS INTERACTIVO + MODO ANÁLISIS CONDICIONAL (v3.1.47)
   ========================================================================== */
.live-shell.is-replay-mode {
  --hand-h: 94px;
}

.live-shell.is-replay-mode.is-replay-hands-open {
  --hand-h: 154px;
}

.live-shell.is-replay-mode #hand-drawer-bar {
  display: none !important;
}

.live-shell.is-replay-mode #my-hand-cards {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
}

.replay-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border: 1.5px solid #c4b5fd;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

#btn-replay-analysis-top.is-unlocked {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  border-color: #7dd3fc;
  color: #ffffff;
  font-weight: 800;
}

#btn-replay-analysis-top.is-unlocked.is-active {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: #86efac;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
}

#btn-replay-analysis-top.is-locked {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
  font-size: 10.5px;
}

.replay-dock {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 8px 6px;
  gap: 4px;
  box-sizing: border-box;
}

.replay-dock__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.replay-dock__step-pill {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: rgba(124, 58, 237, 0.28);
  border: 1px solid rgba(196, 181, 253, 0.55);
  color: #ede9fe;
  padding: 1px 7px;
  border-radius: 999px;
}

.replay-dock__caption {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replay-dock__privacy-tag {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
}

.replay-dock__privacy-tag--open {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.22);
  color: #bae6fd;
}

.replay-dock__scrubber-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
  padding: 0 2px;
}

.replay-scrubber {
  width: 100%;
  height: 5px;
  margin: 0;
  accent-color: #8b5cf6;
  cursor: pointer;
  z-index: 2;
}

.replay-ko-markers {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 0;
  pointer-events: none;
  z-index: 1;
}

.replay-ko-tick {
  position: absolute;
  top: -6px;
  width: 6px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #ef4444;
  border: 1px solid #fde047;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
}

.replay-dock__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.replay-dock__transport,
.replay-dock__tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.replay-btn {
  height: 28px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  user-select: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
}

.replay-btn:hover:not(:disabled) {
  background: #334155;
  border-color: #94a3b8;
}

.replay-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.replay-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.replay-btn--play {
  min-width: 44px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  border-color: #c4b5fd;
  color: #ffffff;
}

.replay-btn--play.is-playing {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #fde68a;
  color: #ffffff;
}

.replay-btn--analysis-on {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: #86efac;
  color: #ffffff;
}

.replay-btn--analysis-ready {
  background: rgba(14, 165, 233, 0.22);
  border-color: #38bdf8;
  color: #bae6fd;
}

.replay-btn--locked {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
}

.replay-hands-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 3px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 54px;
  -webkit-overflow-scrolling: touch;
}

.replay-hands-strip__meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 4px;
  border-right: 1px solid rgba(148, 163, 184, 0.25);
}

.replay-hands-strip__lbl {
  font-size: 9.5px;
  font-weight: 800;
  color: #bae6fd;
  white-space: nowrap;
}

.replay-mini-zone-btn {
  height: 21px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid #38bdf8;
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  font-size: 9.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.replay-mini-zone-btn:hover {
  background: rgba(14, 165, 233, 0.34);
}

.mini-supply.is-replay-clickable {
  cursor: pointer;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

/* Botones de Replay en Historial de Partidas y Liga */
.match-row__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed #e2e8f0;
}

.match-row__badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.match-row__btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.match-mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.match-mode-tag--friendly {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.match-mode-tag--liga {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.match-mode-tag--analysis {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.btn-watch-replay {
  height: 27px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid #6d28d9;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}

.btn-watch-replay:hover {
  filter: brightness(1.08);
}

.btn-share-replay {
  height: 27px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-share-replay:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

@media (max-width: 400px) {
  .replay-btn {
    min-width: 27px;
    padding: 0 5px;
    font-size: 10px;
  }
  .replay-btn--play {
    min-width: 38px;
  }
  .replay-dock__privacy-tag {
    display: none;
  }
}

@media (min-width: 720px) and (orientation: landscape), (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .live-shell.is-replay-mode {
    --hand-h: 98px;
  }
  .live-shell.is-replay-mode.is-replay-hands-open {
    --hand-h: 164px;
  }
}
