/**
 * 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: 35%;
}

.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: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: 138px;
  border-radius: 7px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.35);
}

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

.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: 82px;
  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;
  justify-content: space-between;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  padding: 0 2px;
}

/* ==========================================================================
   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.35;
  padding: 3px 0;
  border-bottom: 1px dashed #e2e8f0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
}

.log-item__time,
.log-entry__time {
  color: #64748b;
  font-size: 9.5px;
  margin-right: 2px;
  font-family: monospace;
}

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

.log-entry__text {
  color: #1e293b;
  word-break: break-word;
}

.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;
}

.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: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid var(--border-mid);
  border-radius: 8px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.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: 1fr 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;
}
