/* ==========================================================================
   GRAND LEGENDS TCG — SISTEMA DE DISEÑO 100% RESPONSIVE & ADAPTATIVO
   Compatible con Móviles (320px+), Tablets, Laptops, Desktops y 4K
   ========================================================================== */
:root {
  --gold: #F59E0B;
  --gold-light: #FDE68A;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --cyan: #00F0FF;
  --cyan-glow: rgba(0, 240, 255, 0.35);
  --bg-dark: #070B14;
  --bg-panel: #0F172A;
  --bg-card: #131E36;
  --border-card: #1E293B;
  --font-title: 'Cinzel', serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: #FFF;
  background: radial-gradient(circle at 50% 0, #1E3A6D, #050811 75%);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   TIPOGRAFÍA FLUIDA CON CLAMP()
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  letter-spacing: 0.5px;
  line-height: 1.25;
}

h1 { color: var(--gold-light); font-size: clamp(1.3rem, 3.5vw, 2.2rem); margin: 0; }
h2 { color: #FFF; font-size: clamp(1.15rem, 2.8vw, 1.7rem); margin: 0 0 8px; }
h3 { font-size: clamp(1rem, 2.2vw, 1.3rem); margin-bottom: 6px; }
h4 { font-size: clamp(0.85rem, 1.8vw, 1rem); }

.sub { opacity: 0.85; font-size: clamp(0.72rem, 1.8vw, 0.85rem); margin-top: 4px; }
.subtitle-text { font-size: clamp(0.82rem, 2vw, 0.95rem); color: #94A3B8; margin-bottom: 16px; }

/* ==========================================================================
   BARRA SUPERIOR (HEADER)
   ========================================================================== */
header#gameHeader {
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 8px clamp(10px, 2.5vw, 24px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
}

.brand-logo-icon {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.header-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}

.header-sub {
  font-size: clamp(0.62rem, 1.5vw, 0.72rem);
  color: #94A3B8;
  font-family: var(--font-mono);
}

.header-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-head-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  padding: clamp(6px, 1.5vw, 9px) clamp(10px, 2vw, 15px);
  border-radius: var(--radius-sm);
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-head-action:hover {
  background: var(--gold);
  color: #070B14;
  border-color: var(--gold);
}

/* ==========================================================================
   BOTONES GLOBALES Y ACCIONES
   ========================================================================== */
button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: clamp(8px, 2vw, 11px) clamp(12px, 2.5vw, 18px);
  margin: 3px;
  background: var(--gold);
  color: #0B1120;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(0.8rem, 1.8vw, 0.95rem);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  background: #FBBF24;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
.doncard:focus-visible,
.arena-unit:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.small { font-size: 0.78rem; padding: 6px 10px; min-height: 32px; }

.btn-primary-action {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #070B14;
  font-weight: 800;
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: #EF4444;
  color: #FFF;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger {
  background: #EF4444;
  color: #FFF;
}
.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* ==========================================================================
   MODALES Y CONTENEDORES POPUP (RESPONSIVE VIEWPORTS)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 240;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal.open { display: flex; }

.modalbox {
  width: min(1050px, 100%);
  max-width: 100%;
  max-height: min(94vh, 94dvh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(15, 23, 42, 0.6);
  background: #10182A;
  border: 2px solid var(--gold);
  border-radius: clamp(12px, 2.5vw, var(--radius-lg));
  padding: clamp(12px, 2.5vw, 24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.12);
  margin: auto;
  position: relative;
}

/* Barra de Navegación Superior en Modales (Back + Close) */
.modal-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 10px;
  margin-bottom: 14px;
  gap: 8px;
}

.btn-nav-back {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  font-size: clamp(0.78rem, 2vw, 0.85rem);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 36px;
}

.btn-nav-back:hover {
  background: var(--gold);
  color: #070B14;
  border-color: var(--gold);
}

.modal-close-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  min-height: 32px;
  color: #FFF;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.modal-close-icon:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFF;
}

/* ==========================================================================
   MENÚ PRINCIPAL REDISEÑADO (#mainMenu)
   ========================================================================== */
.menu-modalbox {
  max-width: 1040px !important;
  width: min(1040px, 100%) !important;
  max-height: min(94vh, 94dvh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(15, 23, 42, 0.6);
  background: radial-gradient(circle at 50% -10%, rgba(30, 58, 138, 0.45), transparent 70%),
              radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.08), transparent 45%),
              radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.08), transparent 50%),
              #0B1120 !important;
  border: 2px solid rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(245, 158, 11, 0.15) !important;
  position: relative;
}

/* Partículas Ambientales de Maná / DON!! */
.ambient-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-particles .particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.35;
  animation: floatManah 9s infinite linear;
}

.ambient-particles .p1 { width: 6px; height: 6px; background: #F59E0B; left: 12%; bottom: -10px; animation-duration: 7s; animation-delay: 0s; }
.ambient-particles .p2 { width: 8px; height: 8px; background: #00F0FF; left: 28%; bottom: -10px; animation-duration: 9s; animation-delay: 2s; }
.ambient-particles .p3 { width: 5px; height: 5px; background: #FDE68A; left: 52%; bottom: -10px; animation-duration: 8s; animation-delay: 1s; }
.ambient-particles .p4 { width: 7px; height: 7px; background: #8B5CF6; left: 74%; bottom: -10px; animation-duration: 11s; animation-delay: 3s; }
.ambient-particles .p5 { width: 6px; height: 6px; background: #10B981; left: 88%; bottom: -10px; animation-duration: 10s; animation-delay: 1.5s; }
.ambient-particles .p6 { width: 4px; height: 4px; background: #F59E0B; left: 42%; bottom: -10px; animation-duration: 8.5s; animation-delay: 4s; }

@keyframes floatManah {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { opacity: 0.45; }
  85% { opacity: 0.35; }
  100% { transform: translateY(-700px) scale(1.2); opacity: 0; }
}

/* 1. BARRA SUPERIOR DE ESTADO DEL JUGADOR (GAMER HUB) */
.user-status-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  margin-bottom: 16px;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  position: relative;
  z-index: 1;
}

.player-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.player-profile-badge:hover {
  background: rgba(255, 255, 255, 0.06);
}

.player-avatar-ring {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #0F172A);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.rank-gem-sparkle {
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 0.75rem;
  color: #00F0FF;
  animation: pulseSparkle 2s infinite ease-in-out;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; color: #FDE68A; }
}

.player-meta-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-username {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  color: #FFF;
}

.player-rank-pill {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00F0FF;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 12px;
}

.player-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-level-text {
  font-size: 0.72rem;
  color: #94A3B8;
  white-space: nowrap;
}

.player-level-text b { color: var(--gold-light); }

.menu-xp-track {
  width: clamp(80px, 15vw, 130px);
  height: 6px;
  background: #1E293B;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #00F0FF);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.stats-pills-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.stat-glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-glass-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
}

.pill-gold { border-color: rgba(245, 158, 11, 0.4); }
.pill-gold:hover { border-color: var(--gold); box-shadow: 0 0 15px rgba(245, 158, 11, 0.25); }
.pill-cyan { border-color: rgba(0, 240, 255, 0.4); }
.pill-cyan:hover { border-color: #00F0FF; box-shadow: 0 0 15px rgba(0, 240, 255, 0.25); }

.pill-icon { font-size: 1.15rem; }
.pill-data { display: flex; flex-direction: column; line-height: 1.1; }
.pill-title { font-size: 0.62rem; color: #94A3B8; font-weight: 700; letter-spacing: 0.5px; }
.pill-value { font-size: 0.88rem; font-weight: 800; color: #FFF; position: relative; }
.pill-value small { font-size: 0.7rem; color: #64748B; margin-left: 2px; }

.pill-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  margin-left: 6px;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.btn-hub-quick {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  transition: all 0.2s ease;
}

.btn-hub-quick:hover {
  background: var(--gold);
  color: #0B1120;
  border-color: var(--gold);
}

/* Fallback para elementos previos */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 2. ENCABEZADO HERO & WIDGET DE LÍDER ACTIVO */
.menu-hero-showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

@media (min-width: 820px) {
  .menu-hero-showcase {
    grid-template-columns: 1.4fr 1fr;
    align-items: stretch;
  }
}

.main-menu-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: clamp(14px, 2.5vw, 20px);
}

.hero-emblem-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.emblem-sword {
  font-size: 1.4rem;
  opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}
.emblem-sword.left { transform: rotate(15deg); }
.emblem-sword.right { transform: rotate(-15deg); }

.menu-hero-icon {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.45));
}

.main-menu-title {
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 2px;
  margin: 2px 0 4px;
  position: relative;
}

.shimmer-logo {
  background: linear-gradient(110deg, #FDE68A 20%, #FFFFFF 45%, #F59E0B 70%, #D97706 90%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerSweep 4.5s linear infinite;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
}

.logo-gold {
  color: #00F0FF;
  -webkit-text-fill-color: #00F0FF;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

@keyframes shimmerSweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.main-menu-subtitle {
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  color: #94A3B8;
  margin-bottom: 8px;
}

.set-mini-tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: clamp(0.66rem, 1.5vw, 0.76rem);
  color: #CBD5E1;
}

.set-mini-tag b { color: var(--gold-light); }

/* WIDGET DEL LÍDER ACTIVO */
.menu-leader-widget {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.menu-leader-widget:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.15);
}

.leader-widget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.leader-widget-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.8px;
}

.deck-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.deck-status-pill.ready {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34D399;
}

.deck-status-pill.incomplete {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #FBBF24;
}

.leader-widget-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leader-widget-art {
  font-size: 2.8rem;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: radial-gradient(circle, #2C184A, #101524);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.leader-widget-details {
  flex: 1;
  min-width: 0;
}

.leader-widget-name {
  font-family: var(--font-title);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 800;
  color: #FFF;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-widget-stats {
  display: flex;
  gap: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-life { color: #F87171; }
.stat-power { color: #FBBF24; }

.leader-widget-ability {
  font-size: 0.72rem;
  color: #94A3B8;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-quick-leader-picker {
  width: 100%;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-quick-leader-picker:hover {
  background: var(--gold);
  color: #0B1120;
  border-color: var(--gold);
}

/* 3. BANDA DE BATALLA (HERO CTA & TORNEO) */
.menu-battle-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .menu-battle-strip {
    grid-template-columns: 1.8fr 1fr;
  }
}

.btn-hero-play {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 50%, #B45309 100%);
  border: 2px solid #FDE68A;
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(12px, 2.5vw, 16px) clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.btn-hero-play.radiant-glow {
  animation: radiantPulse 3.5s infinite;
}

@keyframes radiantPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 12px 40px rgba(245, 158, 11, 0.65), 0 0 25px rgba(253, 230, 138, 0.4); }
}

.btn-hero-play::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(25deg);
  animation: sweepLight 5s infinite;
}

@keyframes sweepLight {
  0%, 75% { left: -60%; }
  100% { left: 140%; }
}

.btn-hero-play:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 45px rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
}

.play-icon { font-size: clamp(1.8rem, 3.5vw, 2.3rem); flex-shrink: 0; }
.play-text { text-align: left; flex: 1; min-width: 0; }
.play-title { display: block; font-family: var(--font-title); font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 900; color: #070B14; }
.play-sub { display: block; font-size: clamp(0.72rem, 1.8vw, 0.82rem); color: #1E293B; font-weight: 600; white-space: normal; }
.play-arrow { font-size: clamp(1.4rem, 2.5vw, 1.8rem); color: #070B14; font-weight: 900; flex-shrink: 0; }

.btn-tournament-quick {
  background: linear-gradient(135deg, #6D28D9 0%, #4C1D95 100%);
  border: 2px solid #C4B5FD;
  border-radius: clamp(12px, 2vw, 16px);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  margin: 0;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
}

.btn-tournament-quick:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(109, 40, 217, 0.55), 0 0 20px rgba(196, 181, 253, 0.3);
  border-color: #EDE9FE;
}

.tourney-icon { font-size: 1.8rem; }
.tourney-text { text-align: left; flex: 1; }
.tourney-title { display: block; font-family: var(--font-title); font-size: 0.98rem; font-weight: 800; color: #FFF; }
.tourney-sub { display: block; font-size: 0.72rem; color: #DDD6FE; }
.tourney-arrow { font-size: 1.3rem; color: #DDD6FE; font-weight: 800; }

/* 4. GRID DE MÓDULOS DEL JUEGO (GLASSMORPHISM TEMÁTICO ELEMENTAL) */
.menu-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.menu-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.card-glow-edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: all 0.3s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
}

/* Temas elementales */
.menu-card.theme-sapphire:hover {
  border-color: #00F0FF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 240, 255, 0.25);
}
.menu-card.theme-sapphire:hover .card-glow-edge { background: #00F0FF; }

.menu-card.theme-gold:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(245, 158, 11, 0.25);
}
.menu-card.theme-gold:hover .card-glow-edge { background: var(--gold); }

.menu-card.theme-emerald:hover {
  border-color: #10B981;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(16, 185, 129, 0.25);
}
.menu-card.theme-emerald:hover .card-glow-edge { background: #10B981; }

.menu-card.theme-amethyst:hover {
  border-color: #8B5CF6;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(139, 92, 246, 0.25);
}
.menu-card.theme-amethyst:hover .card-glow-edge { background: #8B5CF6; }

.menu-card.theme-ruby:hover {
  border-color: #EC4899;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 22px rgba(236, 72, 153, 0.25);
}
.menu-card.theme-ruby:hover .card-glow-edge { background: #EC4899; }

.menu-card.theme-slate:hover {
  border-color: #94A3B8;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.menu-card-icon {
  font-size: 1.8rem;
  transition: transform 0.2s ease;
}

.menu-card:hover .menu-card-icon {
  transform: scale(1.15) rotate(3deg);
}

.card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.card-badge.badge-sapphire { background: rgba(0, 240, 255, 0.15); border: 1px solid rgba(0, 240, 255, 0.4); color: #00F0FF; }
.card-badge.badge-gold { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); color: #FDE68A; }
.card-badge.badge-emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); color: #34D399; }
.card-badge.badge-amethyst { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.4); color: #C4B5FD; }
.card-badge.badge-ruby { background: rgba(236, 72, 153, 0.15); border: 1px solid rgba(236, 72, 153, 0.4); color: #F472B6; }
.card-badge.badge-slate { background: rgba(100, 116, 139, 0.15); border: 1px solid rgba(100, 116, 139, 0.4); color: #94A3B8; }
.card-badge.badge-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); color: #FBBF24; }

.menu-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: #FFF;
}

.menu-card p {
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.4;
  margin-bottom: 12px;
}

.menu-card-footer {
  display: flex;
  justify-content: flex-start;
}

.menu-card-cta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
  transition: transform 0.2s ease;
}

.menu-card:hover .menu-card-cta {
  transform: translateX(4px);
}

.menu-card-cta.status-paused {
  color: #64748B;
  font-size: 0.72rem;
}

/* 5. TABLÓN DE MISIONES Y DESAFÍOS */
.quests-board {
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  z-index: 1;
}

.quests-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.quests-board-title {
  font-family: var(--font-title);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.8px;
}

.quests-board-sub {
  font-size: 0.72rem;
  color: #94A3B8;
}

.quests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.quest-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.quest-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.quest-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.quest-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.quest-title {
  font-size: 0.82rem;
  color: #FFF;
}

.quest-reward {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}

.quest-desc {
  font-size: 0.72rem;
  color: #94A3B8;
  line-height: 1.25;
  margin-bottom: 6px;
}

.quest-progress-track {
  width: 100%;
  height: 5px;
  background: #1E293B;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #10B981);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quest-progress-text {
  font-size: 0.68rem;
  color: #CBD5E1;
  font-weight: 600;
}

.welcome-gift-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  text-align: center;
}

/* ==========================================================================
   SELECCIÓN DE MODOS DE JUEGO (VS IA / PVP)
   ========================================================================== */
.modes-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin: 16px 0;
}

.mode-card {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 24px);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: rgba(26, 41, 70, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.2);
}

.mode-icon { font-size: clamp(2.5rem, 6vw, 3.5rem); margin-bottom: 8px; }
.mode-card h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); margin-bottom: 6px; color: var(--gold-light); }
.mode-card p { font-size: clamp(0.8rem, 2vw, 0.88rem); color: #CBD5E1; margin-bottom: 16px; }

.btn-select-mode { width: 100%; margin: 0; padding: 11px; }
.modal-bottom-actions { margin-top: 14px; text-align: center; }

/* ==========================================================================
   LÍDERES, CARTAS Y GRIDS DE COLECCIÓN
   ========================================================================== */
.set-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px 0;
  max-width: 100%;
}

@media (max-width: 768px) {
  .set-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 4px 6px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .filter-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

.filter-tab {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 32px;
  margin: 2px;
}

.filter-tab:hover { border-color: var(--gold); color: #FFF; }
.filter-tab.active { background: var(--gold); color: #070B14; border-color: var(--gold); font-weight: 800; }

.leader-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 12px;
  margin: 14px 0;
}

.leader-choice {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid #56698E;
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 16px);
  transition: 0.18s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.leader-choice:hover { transform: translateY(-4px); border-color: var(--gold); background: rgba(255, 255, 255, 0.08); }
.leader-choice-art { font-size: clamp(45px, 8vw, 65px); text-align: center; }
.leader-choice h2 { font-size: 1.15rem; margin: 6px 0; }
.leader-choice p { font-size: 0.82rem; min-height: 38px; opacity: 0.9; margin: 4px 0; }
.leader-choice button { width: 100%; margin: 6px 0 0; }

.deckgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
}

.deckitem {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #56698E;
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
}

.deck-validation {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 8px 0 12px;
  color: #CBD5E1;
  font-size: 0.85rem;
}

.deck-validation.valid {
  border-color: rgba(34, 197, 94, 0.65);
  color: #86EFAC;
}

.deck-validation.invalid {
  border-color: rgba(239, 68, 68, 0.65);
  color: #FCA5A5;
}

.search {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #68789B;
  background: #080D18;
  color: #FFF;
  margin: 8px 0;
  font-size: 0.9rem;
  outline: none;
}
.search:focus { border-color: var(--gold); }

/* Catálogo de Sets y Enciclopedia de Cartas */
.sets-modalbox {
  width: min(1320px, 100%) !important;
  max-width: 1320px !important;
  height: min(92vh, 92dvh) !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 20px !important;
  background: radial-gradient(ellipse at 50% 10%, #151b2a 0%, #0c0f17 70%, #06080d 100%) !important;
  border: 2px solid var(--fm-gold-ancient) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 185, 76, 0.3) !important;
}

.sets-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sets-counter-pill {
  background: rgba(229, 185, 76, 0.18);
  border: 1px solid var(--fm-gold-ancient);
  color: #ffd700;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.sets-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(229, 185, 76, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.sets-controls-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sets-type-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.set-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(15, 23, 42, 0.4);
  white-space: nowrap;
  max-width: 100%;
}

.set-filter-tabs .filter-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  white-space: nowrap;
  cursor: pointer;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  transition: all 0.2s ease;
}

.set-filter-tabs .filter-tab:hover,
.set-filter-tabs .filter-tab.active {
  background: rgba(229, 185, 76, 0.2);
  border-color: var(--fm-gold-ancient);
  color: var(--gold-light);
}

.sets-cards-grid, .sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 280px;
  padding: 4px 4px 20px;
}

.catalog-card-tile {
  background: linear-gradient(180deg, #161e2e 0%, #0c101a 100%);
  border: 1.5px solid #374358;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.catalog-card-tile:hover {
  transform: translateY(-4px);
  border-color: var(--fm-gold-ancient);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.8), 0 0 14px rgba(229, 185, 76, 0.25);
  z-index: 5;
}

.set-card {
  border: 1px solid #596B95;
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(145deg, #101A30, #080C18);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.set-card h3 { margin: 0 0 6px; color: var(--gold-light); font-size: 1.1rem; }
.set-card p { opacity: 0.85; font-size: 0.82rem; }
.set-count { font-size: 0.8rem; opacity: 0.7; margin: 6px 0; }
.set-badge { display: inline-block; margin: 2px; padding: 2px 7px; border-radius: 999px; border: 1px solid #596B95; font-size: 0.72rem; }

.pack-opener-box {
  background: rgba(0, 0, 0, 0.4);
  border: 2px dashed var(--gold);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 4vw, 32px);
  margin: 14px 0;
  text-align: center;
}
.pack-visual-icon { font-size: clamp(3rem, 7vw, 4rem); margin-bottom: 8px; }
.btn-open-booster { font-size: clamp(1rem, 2.5vw, 1.2rem); padding: 12px 24px; }

/* ==========================================================================
   TABLERO DE BATALLA Y ARENA (FLUID VIEWPORT)
   ========================================================================== */
.wrap {
  max-width: 1350px;
  margin: auto;
  padding: clamp(8px, 2vw, 16px);
  width: 100%;
}

.topbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.panel, .zone {
  background: #0B1222ED;
  border: 1px solid #58698D;
  border-radius: var(--radius-md);
  padding: clamp(8px, 2vw, 12px);
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
}
.p1 { border-color: var(--gold); }
.p2 { border-color: #83A5DC; }

.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 25vw, 300px);
  gap: 10px;
}

@media (max-width: 980px) {
  .battle-layout { grid-template-columns: 1fr; }
  .battle-log { position: relative !important; top: auto !important; min-height: 250px !important; }
  .battle-log-list { height: 220px !important; }
}

.battle-arena {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle, #173C2D, #07100E 72%);
  padding: clamp(8px, 2vw, 14px);
}

.arena-row {
  display: grid;
  grid-template-columns: minmax(85px, 120px) 1fr;
  gap: 8px;
  align-items: center;
  min-height: 110px;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .arena-row {
    grid-template-columns: 78px 1fr;
    gap: 5px;
  }
  .arena-unit {
    width: clamp(80px, 22vw, 112px);
    min-height: clamp(78px, 18vw, 105px);
    padding: 4px;
    font-size: clamp(0.66rem, 1.6vw, 0.76rem);
  }
  .card {
    flex: 0 0 clamp(115px, 32vw, 160px);
    min-height: clamp(170px, 42vw, 240px);
  }
  .card .art {
    font-size: clamp(28px, 6vw, 38px);
  }
}

@media (max-width: 360px) {
  .arena-row {
    grid-template-columns: 68px 1fr;
    gap: 4px;
  }
  .arena-stat {
    padding: 2px;
    font-size: 0.68rem;
  }
  .arena-leader {
    padding: 4px;
    font-size: 0.72rem;
  }
}

@media (max-height: 540px) {
  header#gameHeader {
    padding: 4px clamp(8px, 2vw, 16px) !important;
  }
  .header-sub {
    display: none !important;
  }
  .brand-logo-icon {
    font-size: 1.2rem !important;
  }
  .btn-head-action {
    min-height: 28px !important;
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
  }
  .modal {
    padding: 4px !important;
  }
  .modalbox {
    max-height: 96dvh !important;
    padding: 10px 12px !important;
  }
  .menu-hero-icon {
    font-size: 2rem !important;
  }
  .main-menu-title {
    font-size: 1.3rem !important;
  }
  .main-menu-subtitle,
  .set-mini-tag {
    display: none !important;
  }
}

.arena-side { text-align: center; }
.arena-stat {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #66769A;
  border-radius: 8px;
  padding: 4px;
  margin: 3px 0;
  font-size: clamp(0.7rem, 1.8vw, 0.85rem);
}

.arena-leader {
  min-height: 95px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 6px;
  background: #39250F;
  text-align: center;
  font-size: clamp(0.75rem, 1.8vw, 0.88rem);
}
.arena-leader.enemy { border-color: #83A5DC; background: #12263E; }

.arena-field {
  min-height: 100px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 4px;
}

.arena-unit {
  width: clamp(95px, 22vw, 130px);
  min-height: clamp(85px, 18vw, 115px);
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: #F3D48A;
  color: #17110A;
  padding: 5px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
}
.arena-unit.enemy { border-color: #83A5DC; background: #BDD4EE; }
.arena-unit:hover { transform: translateY(-3px); }
.arena-art { font-size: clamp(24px, 5vw, 32px); }

.turn-banner {
  text-align: center;
  color: var(--gold-light);
  font-weight: bold;
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  margin: 4px 0;
}

.action-bar {
  text-align: center;
  margin: 8px 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-battle-action {
  padding: 8px 14px;
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
}
.btn-end-turn { background: linear-gradient(135deg, #10B981, #059669); color: #FFF; }
.btn-end-turn:hover { background: #059669; }

.donzone {
  margin: 8px 0;
  padding: 8px;
  border: 2px dashed var(--gold);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
}
.donzone.enemy { border-color: #83A5DC; }
.donpool { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; min-height: 32px; }

.doncard {
  width: clamp(32px, 7vw, 42px);
  height: clamp(44px, 10vw, 55px);
  border-radius: 7px;
  background: linear-gradient(145deg, #FFF0A0, #B8891F);
  color: #15100A;
  border: 1.5px solid #FFF0A0;
  display: grid;
  place-items: center;
  font-weight: bold;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  cursor: grab;
  user-select: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.hand {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px 14px;
  -webkit-overflow-scrolling: touch;
}

.card {
  flex: 0 0 clamp(140px, 36vw, 195px);
  min-height: clamp(210px, 46vw, 285px);
  padding: 8px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #FFF5CB, #B87322);
  color: #17110A;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease;
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
}
.card:hover { transform: translateY(-4px); }
.card .art { font-size: clamp(36px, 8vw, 48px); }

.battle-log {
  position: sticky;
  top: 75px;
  background: rgba(7, 12, 23, 0.94);
  border: 2px solid #56698D;
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 450px;
}
.battle-log-list { height: 380px; overflow-y: auto; font-size: 0.78rem; }
.battle-log-list div { padding: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

/* Badges y Paneles de Estado */
.badge { display: inline-block; padding: 3px 7px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); font-size: 0.72rem; }
.badge-gold { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--gold); color: var(--gold-light); }
.badge-cyan { background: rgba(0, 240, 255, 0.15); border: 1px solid var(--cyan); color: var(--cyan); }

.shadow-panel { margin: 10px 0; padding: 10px 14px; border: 2px solid #765B99; border-radius: var(--radius-md); background: linear-gradient(145deg, #1B1128, #090B15); font-size: 0.85rem; }
.shadow-panel b { color: #D9B7FF; }
.combo-panel { margin: 10px 0; padding: 10px 14px; border: 2px solid #9A5A30; border-radius: var(--radius-md); background: linear-gradient(145deg, #2A1710, #0B0C12); font-size: 0.85rem; }
.combo-panel b { color: #FFB36B; }
.log { max-height: 160px; overflow: auto; background: rgba(0, 0, 0, 0.45); border-radius: var(--radius-sm); padding: 8px; font-size: 0.82rem; }

/* ==========================================================================
   FORMULARIOS Y CUENTAS
   ========================================================================== */
.account-box input {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0;
  border-radius: var(--radius-sm);
  border: 1px solid #526D91;
  background: #101B2B;
  color: #FFF;
  font-size: 0.88rem;
}
.account-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.account-tabs button.active { background: var(--gold); color: #070B14; }
.account-msg { min-height: 20px; margin: 6px 0; color: var(--gold-light); font-size: 0.85rem; }
.profile-card { background: #14253A; border: 1px solid #526D91; border-radius: var(--radius-md); padding: 14px; margin-top: 10px; font-size: 0.88rem; }

.online-code { font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: clamp(4px, 1.5vw, 8px); text-align: center; padding: 12px; margin: 10px 0; background: #101B2B; border-radius: var(--radius-sm); color: var(--gold-light); font-weight: 900; }
.online-status { padding: 10px; border-radius: var(--radius-sm); background: #14253A; margin: 10px 0; text-align: center; font-size: 0.85rem; }
.online-row { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.online-row input { flex: 1; min-width: 160px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid #526D91; background: #101B2B; color: #FFF; }
.online-server { margin: 10px 0; padding: 10px; border: 1px solid #334155; border-radius: var(--radius-sm); background: #0F1A2B; font-size: 0.85rem; }
.online-server label { display: block; font-weight: 700; margin-bottom: 4px; }
.online-note { font-size: 0.78rem; opacity: 0.8; line-height: 1.4; }

.set-filter-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0 12px; flex-wrap: wrap; }
.set-filter-row select { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid #596B95; background: #11182A; color: #FFF; font-size: 0.85rem; }

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

/* Scrollbars Modernas */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }


/* ==========================================================================
   CENTRO INFORMATIVO & PERFIL PRE-BATALLA (TABS Y PANELES)
   ========================================================================== */
.hub-modalbox {
  max-width: 920px !important;
  background: radial-gradient(circle at 50% 0%, #15223D 0%, #080D1A 85%) !important;
}

.hub-modal-title {
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hub-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hub-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  padding: clamp(8px, 1.8vw, 10px) clamp(12px, 2.2vw, 18px);
  border-radius: var(--radius-sm);
  font-size: clamp(0.78rem, 1.8vw, 0.88rem);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hub-tab-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.hub-tab-btn.active {
  background: var(--gold);
  color: #070B14;
  border-color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.hub-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.hub-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-avatar-badge {
  width: clamp(48px, 10vw, 60px);
  height: clamp(48px, 10vw, 60px);
  background: linear-gradient(135deg, #1E3A6D, #0D1629);
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 4vw, 2rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.hub-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.hub-stat-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  transition: transform 0.2s ease;
}

.hub-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
}

.hub-stat-card .stat-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.hub-stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--gold-light);
}

.hub-stat-card .stat-label {
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 2px;
}

.hub-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.account-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.account-subtabs button {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.account-subtabs button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
}

.form-group {
  margin-bottom: 12px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  color: #94A3B8;
  margin-bottom: 4px;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: #0B1222;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: #FFF;
  font-size: 0.9rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.online-server-config {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}

.online-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.online-option-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.online-option-card h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--gold-light);
}

.online-option-card p {
  font-size: 0.78rem;
  color: #94A3B8;
  margin-bottom: 10px;
}

.hub-tactics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.hub-tactic-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  border-left: 3px solid var(--gold);
}

.hub-tactic-card .tactic-header {
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.hub-tactic-card p {
  font-size: 0.8rem;
  color: #CBD5E1;
  line-height: 1.45;
}


/* ==========================================================================
   ESTILOS MEJORADOS PARA CARTAS EN MANO & EFECTOS / HABILIDADES
   ========================================================================== */
.card {
  flex: 0 0 clamp(160px, 38vw, 210px) !important;
  min-height: clamp(230px, 50vw, 310px) !important;
  padding: 10px !important;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, #1E293B 0%, #0F172A 100%);
  color: #FFF;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #FDE68A;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 18px rgba(245, 158, 11, 0.3);
}
.card.card-playable {
  border-color: #34D399;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(52, 211, 153, 0.18);
}
.card.card-unavailable {
  opacity: 0.72;
}
.card.card-unavailable .btn-play-card {
  filter: grayscale(0.65);
}
.arena-unit.attack-ready {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 12px rgba(16, 185, 129, 0.45);
}
.arena-unit.has-don::after {
  content: 'DON ' attr(data-don-count);
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.9);
  color: #451A03;
  font-size: 0.58rem;
  font-weight: 900;
}
.arena-unit.ability-ready {
  border-color: #C084FC;
}
.arena-unit.targetable {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  animation: targetPulse 1.2s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 0 rgba(0, 240, 255, 0); }
  50% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 240, 255, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .arena-unit.targetable,
  .card,
  .arena-unit {
    animation: none;
    transition: none;
  }
}

.card .art {
  font-size: clamp(32px, 7vw, 44px);
  text-align: center;
  margin-bottom: 4px;
}

.card h3 {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--gold-light);
  margin-bottom: 4px;
  line-height: 1.25;
}

.card .card-stats {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.8vw, 0.82rem);
  color: #CBD5E1;
  font-weight: 600;
  margin-bottom: 4px;
}

.card .card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.card .ability {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 4px 0 8px;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  color: #F1F5F9;
  line-height: 1.35;
  text-align: left;
  flex: 1;
  overflow-y: auto;
  max-height: 85px;
  word-break: break-word;
}

.card .btn-play-card {
  width: 100%;
  background: linear-gradient(135deg, #10B981, #059669);
  border: 1px solid #34D399;
  color: #FFF;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.card .btn-play-card:hover {
  background: #059669;
  transform: scale(1.02);
}

.bottom-battle-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bottom-battle-controls .btn-battle-action {
  font-size: clamp(0.85rem, 2vw, 1rem);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}


/* ==========================================================================
   ESTADOS DE UNIDADES EN LA ARENA (INVOCADO, AGOTADO, LISTO)
   ========================================================================== */
.arena-unit {
  position: relative;
  transition: all 0.2s ease;
}

.arena-unit.exhausted {
  opacity: 0.78;
  filter: saturate(0.7);
  background: #C4A768 !important;
}
.arena-unit.enemy.exhausted {
  background: #9BB3CE !important;
}

.arena-unit.summoning-sick {
  border-style: dashed;
}

.unit-status-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
  display: inline-block;
  line-height: 1.2;
}

.unit-status-badge.status-sick {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--gold);
  color: #78350F;
}

.unit-status-badge.status-exhausted {
  background: rgba(100, 116, 139, 0.25);
  border: 1px solid #64748B;
  color: #334155;
}

.unit-status-badge.status-ready {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10B981;
  color: #065F46;
  font-weight: 800;
}

.btn-unit-attack {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  border: 1px solid #FCA5A5;
  color: #FFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 4px;
  width: 100%;
}

.btn-unit-attack:hover:not(:disabled) {
  background: #DC2626;
  transform: scale(1.02);
}

.btn-unit-attack.disabled, .btn-unit-attack:disabled {
  background: #64748B;
  border-color: #94A3B8;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}


/* ==========================================================================
   CAMPO DIVIDIDO EN 2 LADOS (LADO DEL RIVAL & LADO DEL JUGADOR)
   ========================================================================== */
.battle-arena {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  background: #070B14;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
}

.arena-half {
  padding: clamp(10px, 2vw, 16px);
  position: relative;
}

.enemy-half {
  background: radial-gradient(circle at 50% 0%, #2A1515 0%, #100C12 75%);
  border-bottom: 2px solid rgba(239, 68, 68, 0.4);
}

.player-half {
  background: radial-gradient(circle at 50% 100%, #152E20 0%, #07100D 75%);
  border-top: 2px solid rgba(16, 185, 129, 0.4);
}

.field-side-tag {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.field-side-tag span {
  font-family: var(--font-title);
  font-size: clamp(0.72rem, 1.8vw, 0.85rem);
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.enemy-tag span {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #FCA5A5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.player-tag span {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #6EE7B7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.field-zone-container {
  border-radius: var(--radius-md);
  padding: 8px;
  margin: 8px 0;
}

.enemy-zone {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(239, 68, 68, 0.4);
}

.player-zone {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(16, 185, 129, 0.4);
}

.field-zone-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94A3B8;
  text-align: center;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.arena-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.8);
  padding: 6px 12px;
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.arena-divider .turn-banner {
  font-family: var(--font-title);
  color: var(--gold-light);
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 900;
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 0 12px var(--gold-glow);
}

/* ==========================================================================
   MONEDAS DON!! CIRCULARES 3D (ORO PULIDO BRILLANTE)
   ========================================================================== */
.donzone {
  margin: 10px 0;
  padding: 10px 14px;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 0%, #1A281E, #09120C);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.donzone-header {
  font-family: var(--font-title);
  font-size: clamp(0.75rem, 1.8vw, 0.88rem);
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.donpool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  align-items: center;
}

.doncard, .don-coin {
  width: clamp(40px, 8vw, 48px) !important;
  height: clamp(40px, 8vw, 48px) !important;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #FFF4B8 0%, #F59E0B 50%, #B45309 85%, #78350F 100%) !important;
  border: 2px solid #FDE68A !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.8), inset 0 -3px 5px rgba(0, 0, 0, 0.6) !important;
  color: #451A03 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 900 !important;
  cursor: grab !important;
  user-select: none !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
  position: relative !important;
}

.doncard:hover, .don-coin:hover {
  transform: translateY(-4px) scale(1.12) !important;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.6), inset 0 2px 4px #FFF !important;
  border-color: #FFF !important;
}

.doncard.dragging {
  opacity: 0.45;
  transform: scale(1.2);
}

.doncard.selected {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
  transform: translateY(-2px);
}

.coin-symbol {
  font-size: clamp(14px, 3vw, 17px);
  line-height: 1;
}

.coin-label {
  font-family: var(--font-title);
  font-size: clamp(0.5rem, 1.1vw, 0.58rem);
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #451A03;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}



/* ==========================================================================
   SOLO LEVELING SYSTEM UI - RESUMEN POST-PARTIDA (ANDROID/MOBILE & DESKTOP)
   ========================================================================== */
.solo-system-overlay {
  background: rgba(4, 8, 19, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 99999 !important;
}

.solo-system-box {
  position: relative;
  background: linear-gradient(180deg, #0b1528 0%, #050a14 100%) !important;
  border: 2px solid #00f0ff !important;
  border-radius: 16px !important;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35), inset 0 0 25px rgba(0, 240, 255, 0.12) !important;
  max-width: 540px !important;
  width: 92% !important;
  padding: 24px 22px !important;
  color: #e2e8f0;
  overflow: hidden;
  animation: soloBoxPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Línea de escaneo holográfico */
.solo-system-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #00f0ff, transparent);
  box-shadow: 0 0 10px #00f0ff;
  opacity: 0.8;
  animation: soloScanline 4s linear infinite;
  pointer-events: none;
}

@keyframes soloScanline {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { top: 100%; opacity: 0; }
}

@keyframes soloBoxPop {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header superior */
.solo-system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding-bottom: 8px;
}

.solo-system-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #00f0ff;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.solo-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  animation: soloPulseDot 1.5s infinite;
}

@keyframes soloPulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

.solo-close {
  color: #64748b !important;
  font-size: 1.2rem;
  transition: all 0.2s;
}
.solo-close:hover {
  color: #00f0ff !important;
  text-shadow: 0 0 8px #00f0ff;
}

/* Estandarte de Resultado */
.solo-result-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.solo-result-banner.defeat {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: inset 0 0 15px rgba(239, 68, 68, 0.15);
}

.solo-banner-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8));
}
.solo-result-banner.defeat .solo-banner-icon {
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8));
}

.solo-result-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: 1.5px;
  color: #00f0ff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
}
.solo-result-banner.defeat .solo-result-title {
  color: #f87171;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.solo-result-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Evaluación de Rango */
.solo-rank-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: radial-gradient(circle, rgba(14, 28, 56, 0.8) 0%, rgba(5, 10, 20, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 12px 10px;
}

.solo-rank-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: #64748b;
  margin-bottom: 4px;
}

.solo-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  border-radius: 30px;
  animation: soloStampDrop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.solo-rank-letter {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.solo-rank-desc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

/* Rangos */
.rank-s {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
  border: 2px solid #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}
.rank-a {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.4));
  border: 2px solid #a855f7;
  color: #c084fc;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}
.rank-b {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(6, 182, 212, 0.4));
  border: 2px solid #00f0ff;
  color: #38bdf8;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}
.rank-c {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(21, 128, 61, 0.4));
  border: 2px solid #22c55e;
  color: #4ade80;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}
.rank-e {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.4));
  border: 2px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@keyframes soloStampDrop {
  0% {
    opacity: 0;
    transform: scale(2.5) rotate(-10deg);
    filter: blur(4px);
  }
  70% {
    opacity: 1;
    transform: scale(0.92) rotate(2deg);
    filter: blur(0);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Sección de Estadísticas */
.solo-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.solo-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.solo-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

.solo-stat-icon {
  font-size: 1.4rem;
}

.solo-stat-data {
  display: flex;
  flex-direction: column;
}

.solo-stat-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
}

.solo-stat-name {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Recompensas y Barra EXP */
.solo-rewards-section {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.solo-exp-box {
  margin-bottom: 12px;
}

.solo-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.solo-exp-level {
  color: #fbbf24;
}

.solo-exp-gained {
  font-family: 'IBM Plex Mono', monospace;
  color: #00f0ff;
  font-weight: 700;
}

.solo-exp-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.solo-exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #3b82f6, #a855f7);
  box-shadow: 0 0 10px #00f0ff;
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.solo-level-up-alert {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.4), rgba(245, 158, 11, 0.2));
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 8px;
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fbbf24;
  text-align: center;
  animation: soloGlowPulse 1.6s infinite ease-in-out;
}

@keyframes soloGlowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.85); }
}

/* Tarjetas de Botín */
.solo-loot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.solo-loot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
}

.solo-loot-icon {
  font-size: 1.4rem;
}

.solo-loot-info {
  display: flex;
  flex-direction: column;
}

.solo-loot-info b {
  font-size: 0.88rem;
  color: #f1f5f9;
}

.solo-loot-info small {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Botones de Acción */
.solo-actions-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-solo-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  color: #040d1a;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
  transition: all 0.25s ease;
}

.btn-solo-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.7);
}

.btn-solo-secondary {
  background: rgba(30, 41, 59, 0.9);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-solo-secondary:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #f0f9ff;
}

.btn-solo-tertiary {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-solo-tertiary:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}
/* ============================================================================
   SET 06 — EVOLUTION OF HOLE
   ============================================================================ */
.btn-unit-evolution{
  margin-top:5px;
  border:1px solid #9b7cff;
  background:linear-gradient(135deg,#241c52,#151b36);
  color:#efe9ff;
  box-shadow:0 0 12px #7656ff55;
}
.btn-unit-evolution:hover:not(:disabled){
  filter:brightness(1.15);
  transform:translateY(-1px);
}
.evolution-panel{
  border-color:#7c5cff !important;
  box-shadow:0 0 18px #5d43c833;
}


/* Sistema de mazos guardados */
.deck-save-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0;padding:10px;border:1px solid rgba(216,166,63,.35);border-radius:12px;background:rgba(0,0,0,.18)}
.saved-decks-panel{margin:10px 0 14px;padding:12px;border:1px solid rgba(80,180,255,.25);border-radius:12px;background:rgba(0,0,0,.16)}
.saved-decks-title{font-weight:800;margin-bottom:8px;color:#ffd86b}
.saved-decks-list{display:grid;gap:8px}
.saved-deck-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:rgba(255,255,255,.035)}
.saved-deck-item.active{border-color:rgba(255,216,107,.7);box-shadow:0 0 12px rgba(255,216,107,.12)}
.saved-deck-item small{display:block;opacity:.72;margin-top:3px}
.saved-deck-actions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.saved-deck-empty{opacity:.7;padding:8px}
.solo-battle-history-section{margin-top:14px}
.solo-battle-history{max-height:300px;overflow:auto;padding:10px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:rgba(0,0,0,.22);font-family:monospace;font-size:.82rem;line-height:1.45}
.solo-history-entry{padding:4px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.solo-history-entry:last-child{border-bottom:0}

/* ==========================================================================
   CONSTRUCTOR DE MAZOS TÁCTICO PROFESIONAL (PRO DECK BUILDER WORKSPACE)
   ========================================================================== */
.deck-modalbox {
  max-width: 1320px !important;
  width: min(1320px, 100%) !important;
  height: min(92vh, 92dvh) !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 20px !important;
  background: radial-gradient(ellipse at 50% 10%, #151b2a 0%, #0c0f17 70%, #06080d 100%) !important;
  border: 2px solid var(--fm-gold-ancient) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(229, 185, 76, 0.3) !important;
}

.deck-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-builder-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 1020px) {
  .deck-modalbox {
    width: min(1020px, 100%) !important;
    height: auto !important;
    max-height: min(95vh, 95dvh) !important;
    padding: 12px 14px !important;
    overflow-y: auto !important;
  }
  .deck-builder-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .deck-library-pane {
    overflow: visible;
    min-height: 320px;
  }
  .deckgrid {
    max-height: 48vh;
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  .deck-modalbox {
    padding: 10px 8px !important;
  }
  .deck-top-actions button {
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
    min-height: 32px !important;
  }
}

/* Columna Izquierda: Catálogo y Biblioteca */
.deck-library-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.library-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.library-hint {
  font-size: 0.78rem;
  color: #94a3b8;
}

.deck-filter-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(229, 185, 76, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
}

.filter-row-primary {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}

@media (max-width: 720px) {
  .filter-row-primary {
    grid-template-columns: 1fr;
  }
}

.search-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 9px 34px 9px 12px;
  background: #090d15;
  border: 1.5px solid #2d3748;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--fm-gold-bright);
}

.btn-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
}

.filter-select {
  width: 100%;
  padding: 8px 10px;
  background: #090d15;
  border: 1.5px solid #2d3748;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--fm-gold-bright);
}

.filter-row-secondary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pills-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: rgba(229, 185, 76, 0.15);
  border-color: var(--fm-gold-ancient);
  color: #fde68a;
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(229, 185, 76, 0.35), rgba(180, 83, 9, 0.4));
  border-color: var(--fm-gold-bright);
  color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.filter-cost-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cost-filter-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
  margin-right: 2px;
}

.cost-chip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.cost-chip:hover {
  background: rgba(229, 185, 76, 0.2);
  border-color: var(--fm-gold-ancient);
}

.cost-chip.active {
  background: radial-gradient(circle, #fde047, #d97706);
  color: #451a03;
  border-color: #fff;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* Grid de Cartas TCG en Biblioteca */
.deckgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 280px;
  height: 100%;
  padding: 4px 6px 14px 4px;
}

.deck-card-tile {
  background: linear-gradient(180deg, #182030 0%, #0d121c 100%);
  border: 1.5px solid #3b465c;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(210px, 45vw, 250px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.deck-card-tile:hover {
  transform: translateY(-4px);
  border-color: var(--fm-gold-ancient);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.8), 0 0 14px rgba(229, 185, 76, 0.25);
  z-index: 5;
}

.deck-card-tile.in-deck {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(180deg, #1b263b 0%, #0d1424 100%);
}

.deck-card-tile.type-personaje, .catalog-card-tile.type-personaje { border-top: 3px solid #38bdf8; }
.deck-card-tile.type-evento, .catalog-card-tile.type-evento { border-top: 3px solid #c084fc; }
.deck-card-tile.type-recurso, .catalog-card-tile.type-recurso { border-top: 3px solid #f59e0b; }
.deck-card-tile.type-lider, .catalog-card-tile.type-lider { border-top: 3px solid #ffd700; }

.tile-top-row, .deck-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tile-cost-badge {
  background: radial-gradient(circle at 35% 30%, #fde047, #d97706);
  color: #451a03;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.tile-life-badge {
  background: radial-gradient(circle at 35% 30%, #f43f5e, #be123c);
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.tile-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.tile-type-badge.type-personaje {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.tile-type-badge.type-evento {
  background: rgba(192, 132, 252, 0.18);
  border-color: rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
}

.tile-type-badge.type-recurso {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.tile-type-badge.type-lider {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
}

.tile-set-code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.tile-power, .tile-power-badge {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 2px 6px;
  margin: 4px 0 2px;
}

.tile-power-leader {
  color: #fef08a;
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(234, 179, 8, 0.45);
}

.tile-art {
  font-size: 38px;
  text-align: center;
  margin: 2px 0;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.tile-name {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.tile-meta {
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 3px 0;
}

.tile-ability, .tile-effect {
  font-size: 0.72rem;
  line-height: 1.3;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  padding: 5px 7px;
  min-height: 44px;
  max-height: 58px;
  overflow-y: auto;
  margin: 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  gap: 4px;
  font-size: 0.72rem;
}

.tile-rarity {
  color: var(--fm-gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
}

.tile-set-name {
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: var(--font-mono);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-copies-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: #94a3b8;
}

.tile-copies-badge.in-deck {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tile-copies-badge.max, .tile-copies-badge.max-copies {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.tile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.btn-tile-add, .tile-btn-add,
.btn-tile-remove, .tile-btn-sub {
  min-height: 28px !important;
  max-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  border: none !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
}

.btn-tile-add, .tile-btn-add {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35) !important;
}

.btn-tile-add:hover:not(:disabled), .tile-btn-add:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  transform: translateY(-1px) !important;
}

.btn-tile-add:disabled, .tile-btn-add:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.8) !important;
  transform: none !important;
  box-shadow: none !important;
}

.btn-tile-remove, .tile-btn-sub {
  background: rgba(239, 68, 68, 0.2) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
}

.btn-tile-remove:hover:not(:disabled), .tile-btn-sub:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.38) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.btn-tile-remove:disabled, .tile-btn-sub:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Columna Derecha: Panel del Mazo Activo */
.deck-tray-pane {
  background: rgba(8, 12, 18, 0.75);
  border: 1.5px solid rgba(229, 185, 76, 0.35);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.deck-leader-panel {
  background: linear-gradient(180deg, #2b1d14 0%, #170f0a 100%);
  border: 1.5px solid var(--fm-gold-ancient);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.leader-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.panel-subtitle {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--fm-gold-bright);
}

.btn-change-leader {
  background: rgba(229, 185, 76, 0.2);
  border: 1px solid var(--fm-gold-ancient);
  color: #fde68a;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-change-leader:hover {
  background: rgba(229, 185, 76, 0.35);
  color: #fff;
}

.leader-current-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leader-mini-art {
  font-size: 32px;
  background: rgba(0, 0, 0, 0.4);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--fm-gold-bright);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.leader-info-wrap {
  flex: 1;
  min-width: 0;
}

.leader-info-title {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 800;
  color: #fef08a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-info-stats {
  font-size: 0.72rem;
  color: #cbd5e1;
  margin-top: 2px;
}

/* Medidor y Barra de Progreso */
.deck-counter-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
}

.counter-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.counter-title {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e2e8f0;
}

.counter-badge {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 900;
  color: #fde047;
}

.deck-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #0f172a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.3s ease;
}

.deck-progress-fill.full {
  background: linear-gradient(90deg, #22c55e, #eab308);
}

.deck-validation {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
  margin: 4px 0 0 0 !important;
  border-radius: 6px !important;
}

/* Desglose de Tipos */
.deck-type-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 6px;
  text-align: center;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.stat-pill b {
  color: #f8fafc;
}

/* Curva de Costes de Maná */
.deck-curve-section {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.curve-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--fm-gold-bright);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.cost-curve-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 60px;
  padding: 0 4px;
}

.cost-curve-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.cost-curve-val {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 2px;
}

.cost-curve-bar {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #fde047, #b45309);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
}

.cost-curve-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  color: #cbd5e1;
  margin-top: 3px;
}

/* Lista Agrupada de Cartas en Mazo */
.deck-list-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 140px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  overflow: hidden;
}

.deck-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.deck-cards-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deck-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deck-card-row:hover {
  background: rgba(229, 185, 76, 0.12);
  border-color: rgba(229, 185, 76, 0.4);
  transform: translateX(2px);
}

.row-cost {
  background: #fde047;
  color: #451a03;
  font-weight: 900;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.row-art {
  font-size: 1rem;
  flex-shrink: 0;
}

.row-name {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-count {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.row-remove-btn {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.row-remove-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

.deck-use-footer {
  margin-top: auto;
  padding-top: 6px;
}

.btn-use-deck-main {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

