/* ============================================================
   TCGCOMPETITIVE.com - Design System CSS
   Premium Esports & TCG Platform
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Bebas+Neue&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* === COLORS === */
  --color-bg-primary:    #0a0a0f;
  --color-bg-secondary:  #111118;
  --color-bg-card:       #16161f;
  --color-bg-card-hover: #1e1e2a;
  --color-bg-sidebar:    #0d0d15;
  --color-bg-elevated:   #1a1a25;

  --color-red:           #c41230;
  --color-red-dark:      #9e0f27;
  --color-red-light:     #e01535;
  --color-red-glow:      rgba(196,18,48, 0.25);

  --color-gold:          #d4a017;
  --color-gold-dark:     #b8890f;
  --color-gold-light:    #f0b832;
  --color-gold-glow:     rgba(212,160,23, 0.2);

  --color-white:         #ffffff;
  --color-gray-100:      #f1f1f5;
  --color-gray-200:      #e2e2ea;
  --color-gray-300:      #c8c8d4;
  --color-gray-400:      #9898a8;
  --color-gray-500:      #6b6b7e;
  --color-gray-600:      #4a4a58;
  --color-gray-700:      #2e2e3d;
  --color-gray-800:      #1f1f2d;
  --color-gray-900:      #131320;

  --color-success:       #10b981;
  --color-success-bg:    rgba(16, 185, 129, 0.1);
  --color-warning:       #f59e0b;
  --color-warning-bg:    rgba(245, 158, 11, 0.1);
  --color-danger:        #ef4444;
  --color-danger-bg:     rgba(239, 68, 68, 0.1);
  --color-info:          #3b82f6;
  --color-info-bg:       rgba(59, 130, 246, 0.1);

  /* === BORDERS === */
  --border-color:        rgba(255, 255, 255, 0.06);
  --border-red:          rgba(196,18,48, 0.4);
  --border-gold:         rgba(212,160,23, 0.3);
  --border-radius-sm:    6px;
  --border-radius:       10px;
  --border-radius-lg:    16px;
  --border-radius-xl:    24px;
  --border-radius-full:  9999px;

  /* === SHADOWS === */
  --shadow-sm:           0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:           0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:           0 8px 40px rgba(0,0,0,0.5);
  --shadow-red:          0 4px 20px rgba(196,18,48,0.3);
  --shadow-gold:         0 4px 20px rgba(212,160,23,0.25);
  --shadow-inset:        inset 0 1px 0 rgba(255,255,255,0.05);

  /* === TYPOGRAPHY === */
  --font-heading:        'Rajdhani', 'Inter', sans-serif;
  --font-body:           'Inter', sans-serif;
  --font-display:        'Bebas Neue', sans-serif;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;

  /* === SPACING === */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* === SIDEBAR === */
  --sidebar-width:          260px;
  --sidebar-width-collapsed: 70px;
  --header-height:          70px;

  /* === TRANSITIONS === */
  --transition-fast:   all 0.15s ease;
  --transition-normal: all 0.25s ease;
  --transition-slow:   all 0.4s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% 0%, rgba(196,18,48,0.2), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(212,160,23,0.11), transparent 24rem),
    linear-gradient(135deg, #07070b 0%, #101018 50%, #07070c 100%);
  color: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-red);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover { color: var(--color-red-light); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--color-gray-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-red); }

/* ============================================================
   LAYOUT: APP SHELL
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(13,13,21,0.96), rgba(8,8,13,0.98)),
    var(--color-bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 18px 0 55px rgba(0,0,0,0.28);
}

.sidebar-logo {
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-height);
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-white);
  line-height: 1.2;
}

.sidebar-logo-text span {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-gold);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  padding: var(--space-4) var(--space-5) var(--space-2);
  margin-top: var(--space-2);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.72rem var(--space-5);
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  user-select: none;
  min-height: 46px;
  margin-right: var(--space-3);
}

.sidebar-item:hover {
  color: var(--color-white);
  background: rgba(255,255,255,0.04);
  border-left-color: var(--color-gray-600);
}

.sidebar-item.active {
  color: var(--color-white);
  background:
    linear-gradient(90deg, rgba(196,18,48,0.28) 0%, rgba(196,18,48,0.06) 100%),
    rgba(255,255,255,0.03);
  border-left-color: var(--color-red);
}

.sidebar-item.active .sidebar-icon {
  color: var(--color-red);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-text { flex: 1; white-space: nowrap; }

.sidebar-badge {
  background: var(--color-red);
  color: var(--color-white);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--border-radius-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer - Perfil */
.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-4) var(--space-5);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-red);
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--color-gold);
}

/* Social Links en sidebar */
.sidebar-social {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5) var(--space-4);
}

.sidebar-social a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  transition: var(--transition-fast);
}

.sidebar-social a:hover {
  background: var(--color-red);
  color: var(--color-white);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-normal);
  position: relative;
  isolation: isolate;
}

.main-content::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.72), transparent 74%);
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  height: var(--header-height);
  background:
    radial-gradient(circle at 78% 50%, rgba(213,15,48,0.12), transparent 28%),
    linear-gradient(90deg, rgba(10,10,16,0.94), rgba(14,13,21,0.86) 52%, rgba(20,16,18,0.94));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-7, 1.75rem);
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  overflow: visible;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.header-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.header-menu-btn:hover { color: var(--color-white); background: rgba(255,255,255,0.05); }

.header-greeting {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-white);
  max-width: min(38vw, 460px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-greeting span { color: var(--color-red); }

.header-subtext {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
  flex-shrink: 0;
}

/* Stats en header */
.header-stats {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
}

.header-stat-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  min-width: 150px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    rgba(20,20,30,0.82);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 0.42rem 0.68rem;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.14);
}

.header-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.08) 50%, transparent 58% 100%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.header-stat-card:hover {
  border-color: rgba(213,15,48,0.62);
  background:
    linear-gradient(135deg, rgba(213,15,48,0.12), rgba(245,184,0,0.06)),
    var(--color-bg-card-hover);
  transform: none;
}

.header-stat-card:hover::before { transform: translateX(120%); }

.header-stat-card-points {
  border-color: rgba(245,184,0,0.24);
}

.header-stat-card-rank {
  min-width: 178px;
  border-color: rgba(213,15,48,0.22);
}

.header-stat-emblem {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--color-gold);
  background: linear-gradient(145deg, rgba(245,184,0,0.20), rgba(213,15,48,0.12));
  border: 1px solid rgba(245,184,0,0.28);
  box-shadow: 0 7px 14px rgba(245,184,0,0.08);
}

.header-rank-emblem {
  font-size: 1.15rem;
  color: var(--color-white);
  background: linear-gradient(145deg, rgba(213,15,48,0.22), rgba(245,184,0,0.16));
}

.header-stat-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.header-stat-topline {
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: 0.18rem;
}

.header-stat-value {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--color-gold);
  white-space: nowrap;
}

.header-rank-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-white);
  white-space: nowrap;
}

.header-stat-label {
  font-size: 0.64rem;
  color: var(--color-gray-500);
  white-space: nowrap;
}

.header-stat-arrow {
  margin-left: auto;
  color: var(--color-gray-600);
  transition: var(--transition-fast);
}

.header-stat-card:hover .header-stat-arrow {
  color: var(--color-gold);
  transform: translateX(2px);
}

.header-rank-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin: 0.25rem 0 0.18rem;
}

.header-rank-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-gold), var(--color-red));
  box-shadow: 0 0 14px rgba(245,184,0,0.28);
}

/* Notificaciones */
.notif-btn {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    var(--color-bg-card);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-gray-400);
  transition: var(--transition-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.14);
}

.notif-btn:hover {
  color: var(--color-white);
  border-color: rgba(213,15,48,0.72);
  transform: none;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-red);
  border-radius: 50%;
  border: 2px solid var(--color-bg-secondary);
  animation: pulse-red 2s infinite;
}

.notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--color-red);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(10,10,16,0.95);
  box-shadow: 0 0 0 3px rgba(213,15,48,0.18);
}

/* Avatar header */
.header-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  cursor: pointer;
  position: relative;
  min-height: 46px;
  padding: 0.28rem 0.58rem 0.28rem 0.28rem;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    linear-gradient(135deg, rgba(213,15,48,0.14), rgba(245,184,0,0.06) 42%, rgba(255,255,255,0.03)),
    rgba(20,20,30,0.76);
  transition: var(--transition-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.14);
}

.header-avatar-wrapper:hover {
  border-color: rgba(245,184,0,0.42);
  transform: none;
}

.header-avatar-frame {
  position: relative;
  display: block;
  flex-shrink: 0;
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  object-fit: cover;
  border: 2px solid rgba(245,184,0,0.70);
  transition: var(--transition-fast);
  box-shadow: 0 0 0 2px rgba(213,15,48,0.20), 0 7px 14px rgba(0,0,0,0.25);
}

.header-avatar:hover { border-color: var(--color-gold); }

.header-avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid rgba(10,10,16,0.95);
  box-shadow: 0 0 10px rgba(34,197,94,0.5);
}

.header-avatar-info {
  display: flex;
  flex-direction: column;
  min-width: 78px;
  line-height: 1.1;
}

.header-avatar-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-white);
  max-width: 112px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-avatar-level {
  font-size: 0.68rem;
  color: var(--color-gold);
  margin-top: 0.18rem;
}

.header-avatar-chevron {
  color: var(--color-gray-500);
  transition: var(--transition-fast);
}

.header-avatar-wrapper:hover .header-avatar-chevron {
  color: var(--color-gold);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: var(--space-8);
  overflow-x: hidden;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }

.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: rgba(22,22,31,0.76);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-inset), 0 18px 60px rgba(0,0,0,0.18);
  backdrop-filter: blur(14px);
}

.card:hover { border-color: rgba(255,255,255,0.1); box-shadow: var(--shadow-md); }

.card-red-accent {
  border-left: 3px solid var(--color-red);
  box-shadow: var(--shadow-inset);
}

.card-gold-accent { border-left: 3px solid var(--color-gold); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-white);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-title .icon { color: var(--color-red); }

.card-action {
  font-size: var(--text-xs);
  color: var(--color-red);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-action:hover { color: var(--color-red-light); }

.card-body { padding: var(--space-6); }

/* ============================================================
   STAT WIDGET CARDS
   ============================================================ */
.stat-widget {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.stat-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-red), var(--color-gold));
}

.stat-widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-red); }

.stat-widget-icon {
  width: 48px;
  height: 48px;
  background: var(--color-red-glow);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}

.stat-widget-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--color-white);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-widget-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-widget-change {
  font-size: var(--text-xs);
  color: var(--color-success);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.25rem;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
  color: var(--color-white);
  border-color: var(--color-red);
  box-shadow: 0 2px 12px rgba(196,18,48,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-red-light), var(--color-red));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(196,18,48,0.5);
  color: var(--color-white);
}

.btn-primary:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: #0a0a0f;
  border-color: var(--color-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--border-color);
}

.btn-outline:hover { border-color: var(--color-white); background: rgba(255,255,255,0.05); color: var(--color-white); }

.btn-outline-red {
  background: transparent;
  color: var(--color-red);
  border-color: var(--color-red);
}

.btn-outline-red:hover { background: var(--color-red); color: var(--color-white); }

.btn-ghost {
  background: transparent;
  color: var(--color-gray-400);
  border-color: transparent;
}

.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--color-white); }

.btn-danger { background: var(--color-danger); color: white; border-color: var(--color-danger); }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-success { background: var(--color-success); color: white; border-color: var(--color-success); }

.btn-sm { padding: 0.4rem 0.875rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.875rem 2rem; font-size: var(--text-base); }
.btn-xl { padding: 1rem 2.5rem; font-size: var(--text-lg); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

/* Loading spinner en botón */
.btn.loading .btn-text { opacity: 0; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gray-300);
  margin-bottom: var(--space-2);
}

.form-label .required { color: var(--color-red); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.625rem var(--space-4);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(196,18,48,0.15);
}

.form-control::placeholder { color: var(--color-gray-600); }

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.form-error {
  display: none;
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.form-group.has-error .form-control { border-color: var(--color-danger); }
.form-group.has-error .form-error { display: block; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--color-bg-elevated);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--color-red);
}

.form-check-label { font-size: var(--text-sm); color: var(--color-gray-300); line-height: 1.5; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar-wrapper { position: relative; }

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

.progress-bar-label .value { color: var(--color-gold); font-weight: 700; }

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-gray-800);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-red), var(--color-gold));
  border-radius: var(--border-radius-full);
  transition: width 1s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

.progress-bar-lg { height: 12px; }
.progress-bar-sm { height: 4px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-success  { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(16,185,129,0.3); }
.badge-danger   { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(239,68,68,0.3); }
.badge-warning  { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-info     { background: var(--color-info-bg); color: var(--color-info); border: 1px solid rgba(59,130,246,0.3); }
.badge-secondary { background: rgba(255,255,255,0.08); color: var(--color-gray-400); border: 1px solid var(--border-color); }
.badge-red      { background: rgba(196,18,48,0.15); color: var(--color-red); border: 1px solid rgba(196,18,48,0.3); }
.badge-gold     { background: var(--color-gold-glow); color: var(--color-gold); border: 1px solid rgba(212,160,23,0.3); }

/* Badges de rango */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
}

.rank-novato      { background: rgba(156,163,175,0.1); color: #9ca3af; border: 1px solid rgba(156,163,175,0.3); }
.rank-aprendiz    { background: rgba(107,114,128,0.1); color: #b0b8c8; border: 1px solid rgba(107,114,128,0.3); }
.rank-competidor  { background: rgba(196,18,48,0.1); color: var(--color-red); border: 1px solid var(--border-red); }
.rank-elite       { background: var(--color-gold-glow); color: var(--color-gold); border: 1px solid var(--border-gold); }
.rank-maestro     { background: linear-gradient(135deg, rgba(212,160,23,0.2), rgba(240,184,50,0.1)); color: var(--color-gold-light); border: 1px solid var(--color-gold); box-shadow: 0 0 12px rgba(212,160,23,0.2); }

/* ============================================================
   AVATARES
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm  { width: 32px; height: 32px; }
.avatar-md  { width: 48px; height: 48px; }
.avatar-lg  { width: 64px; height: 64px; }
.avatar-xl  { width: 96px; height: 96px; }
.avatar-2xl { width: 128px; height: 128px; }

.avatar-ring-red  { border: 2px solid var(--color-red); }
.avatar-ring-gold { border: 2px solid var(--color-gold); }
.avatar-ring-white { border: 2px solid rgba(255,255,255,0.2); }

/* Avatar group */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  border: 2px solid var(--color-bg-card);
  margin-left: -8px;
  transition: var(--transition-fast);
}

.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .avatar:hover { z-index: 10; transform: translateY(-2px); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  background: var(--color-bg-elevated);
  color: var(--color-gray-400);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-3) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--color-gray-300);
  vertical-align: middle;
}

.table tr:hover td { background: rgba(255,255,255,0.02); }
.table tr:last-child td { border-bottom: none; }

/* ============================================================
   BANNER / HERO
   ============================================================ */
.banner {
  position: relative;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0d0d15 0%, #1a0808 50%, #0d0d15 100%);
}

.banner-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0.15;
  transition: opacity 0.5s ease;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,15,0.95) 30%, rgba(196,18,48,0.08) 70%, rgba(212,160,23,0.05) 100%);
}

.banner-glow {
  position: absolute;
  top: -50px;
  right: 100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(196,18,48,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 2;
  padding: var(--space-10) var(--space-8);
  flex: 1;
}

.banner-pretitle {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-2);
}

.banner-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  color: var(--color-white);
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
}

.banner-title .accent { color: var(--color-red); }
.banner-title .gold { color: var(--color-gold); }

.banner-description {
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.banner-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.banner-logo-area {
  position: absolute;
  right: var(--space-8);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.12;
  pointer-events: none;
}

.banner-logo-area img {
  width: 200px;
  filter: grayscale(100%);
}

/* ============================================================
   RANK PROGRESSION
   ============================================================ */
.rank-progression {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.rank-step {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 80px;
  text-align: center;
}

.rank-step-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition-normal);
  position: relative;
}

.rank-step.current .rank-step-icon {
  border-color: var(--color-red);
  background: rgba(196,18,48,0.1);
  box-shadow: 0 0 16px rgba(196,18,48,0.3);
  transform: scale(1.15);
}

.rank-step.completed .rank-step-icon {
  border-color: var(--color-gold);
  background: rgba(212,160,23,0.1);
}

.rank-step-name {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-gray-500);
  letter-spacing: 0.05em;
}

.rank-step.current .rank-step-name { color: var(--color-red); }
.rank-step.completed .rank-step-name { color: var(--color-gold); }

.rank-connector {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  min-width: 20px;
  align-self: flex-start;
  margin-top: 25px;
}

.rank-connector.completed { background: linear-gradient(90deg, var(--color-gold), var(--color-red)); }

/* ============================================================
   PLAYER CARDS
   ============================================================ */
.player-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-red), transparent);
  opacity: 0;
  transition: var(--transition-normal);
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-red);
  box-shadow: var(--shadow-red);
}

.player-card:hover::before { opacity: 1; }

.player-card-avatar {
  position: relative;
}

.player-card-avatar .avatar {
  border: 3px solid var(--color-red);
}

.player-card-role {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-red);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.player-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
}

.player-card-nickname {
  font-size: var(--text-sm);
  color: var(--color-gold);
  font-weight: 600;
}

.player-card-tcg {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

/* ============================================================
   REWARD CARDS
   ============================================================ */
.reward-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition-normal);
  position: relative;
}

.reward-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.reward-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.reward-card-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.reward-card-featured {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--color-gold);
  color: #0a0a0f;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--border-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reward-card-body {
  padding: var(--space-4);
}

.reward-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-1);
  line-height: 1.3;
}

.reward-card-desc {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.reward-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reward-card-points {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reward-card-points .icon { font-size: 1.2rem; }
.reward-card-points .value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-gold);
}

.reward-card-points .label {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

/* ============================================================
   TOURNAMENT CARDS
   ============================================================ */
.tournament-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: var(--transition-normal);
}

.tournament-card:hover {
  border-color: var(--border-red);
  background: var(--color-bg-card-hover);
  transform: translateX(4px);
}

.tournament-date {
  background: var(--color-red-glow);
  border: 1px solid var(--border-red);
  border-radius: var(--border-radius);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}

.tournament-date-month {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-red);
  letter-spacing: 0.1em;
}

.tournament-date-day {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-white);
  line-height: 1;
}

.tournament-info { flex: 1; }

.tournament-name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-1);
}

.tournament-meta {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.tournament-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

/* ============================================================
   NEWS CARDS
   ============================================================ */
.news-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-color);
}

.news-card:last-child { border-bottom: none; }

.news-card-img {
  width: 72px;
  height: 56px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.news-card-img-placeholder {
  width: 72px;
  height: 56px;
  border-radius: var(--border-radius-sm);
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.news-card-category {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-red);
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.news-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-title:hover { color: var(--color-red); }

.news-card-date {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

/* ============================================================
   CLASS CARDS
   ============================================================ */
.class-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.class-card:hover {
  border-color: var(--border-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.class-card-type {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

.class-card-header { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }

.class-card-coach-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-red);
  flex-shrink: 0;
}

.class-card-coach-name {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.class-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
}

.class-card-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-bottom: var(--space-4);
}

.class-card-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.class-card-meta-icon { width: 14px; color: var(--color-red); flex-shrink: 0; }

.class-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
}

.class-spots {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.class-spots .count { color: var(--color-gold); font-weight: 700; }

/* ============================================================
   MEMBERSHIP CARD
   ============================================================ */
.membership-status-card {
  background: linear-gradient(135deg, rgba(196,18,48,0.08) 0%, rgba(212,160,23,0.05) 100%);
  border: 1px solid var(--border-red);
  border-radius: var(--border-radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.membership-status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-red), var(--color-gold));
}

.membership-active-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-success);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.membership-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse-green 2s infinite;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover { background: var(--color-danger-bg); color: var(--color-danger); }

.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid var(--border-color);
}

/* ============================================================
   TOASTS / ALERTS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
}

.toast {
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }

.toast-success { border-left: 3px solid var(--color-success); }
.toast-error   { border-left: 3px solid var(--color-danger); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-info    { border-left: 3px solid var(--color-info); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; font-size: var(--text-sm); color: var(--color-white); }
.toast-message { font-size: var(--text-xs); color: var(--color-gray-400); margin-top: 2px; }

/* Alert boxes */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--border-radius);
  font-size: var(--text-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid;
}

.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: rgba(16,185,129,0.3); }
.alert-danger  { background: var(--color-danger-bg); color: var(--color-danger); border-color: rgba(239,68,68,0.3); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(245,158,11,0.3); }
.alert-info    { background: var(--color-info-bg); color: var(--color-info); border-color: rgba(59,130,246,0.3); }

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, var(--color-gray-800) 50%, var(--color-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--border-radius-sm);
}

.skeleton-text { height: 1em; margin-bottom: var(--space-2); }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--border-radius-lg); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--color-gray-500);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-gray-400);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 300px;
  margin: 0 auto var(--space-6);
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition-fast);
  overflow: hidden;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-300);
  cursor: pointer;
  transition: var(--transition-fast);
}

.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--color-white); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: var(--color-danger-bg); }

.dropdown-divider { height: 1px; background: var(--border-color); margin: var(--space-2) 0; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) 0;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.page-btn:hover { border-color: var(--color-red); color: var(--color-white); }
.page-btn.active { background: var(--color-red); border-color: var(--color-red); color: white; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-gray-500);
  pointer-events: none;
}

.search-input {
  padding-left: 38px !important;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-btn:hover { color: var(--color-white); }
.tab-btn.active { color: var(--color-red); border-bottom-color: var(--color-red); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--color-bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition-fast);
  overflow: hidden;
}

.notif-btn.open .notif-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
}

.notif-panel-title {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-white);
}

.notif-panel-mark-all {
  appearance: none;
  border: none;
  background: transparent;
  font-size: var(--text-xs);
  color: var(--color-red);
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.notif-panel-mark-all:hover {
  color: var(--color-red-light);
  background: rgba(196,18,48,0.08);
}

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: var(--transition-fast);
}

.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(196,18,48,0.04); }

.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: var(--color-bg-card);
}

.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-white); line-height: 1.3; }
.notif-item-time { font-size: var(--text-xs); color: var(--color-gray-500); margin-top: 2px; }

.notif-item-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--color-bg-primary);
}

.auth-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0d0d15, #1a0808);
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(196,18,48,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 20%, rgba(212,160,23,0.06) 0%, transparent 50%);
}

.auth-bg-logo {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 280px;
  opacity: 0.04;
  filter: grayscale(100%);
}

.auth-left-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
}

.auth-left-logo {
  width: 120px;
  margin: 0 auto var(--space-6);
}

.auth-left-title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  color: var(--color-white);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.auth-left-title .red { color: var(--color-red); }
.auth-left-title .gold { color: var(--color-gold); }

.auth-left-desc {
  color: var(--color-gray-400);
  font-size: var(--text-base);
  line-height: 1.7;
}

.auth-right {
  width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12) var(--space-10);
  border-left: 1px solid var(--border-color);
  background: var(--color-bg-secondary);
  overflow-y: auto;
}

.auth-form-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-2);
}

.auth-form-subtitle {
  color: var(--color-gray-500);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

/* ============================================================
   ADMIN SPECIFIC
   ============================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  background: linear-gradient(180deg, #0a0a12 0%, #0d0a0f 100%);
  border-right-color: rgba(196,18,48,0.1);
}

.admin-header {
  background: linear-gradient(90deg, #0d0d15, #111118);
}

/* Stat cards admin */
.admin-stat {
  background: var(--color-bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.admin-stat:hover { transform: translateY(-2px); }

.admin-stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.admin-stat-icon.red   { background: var(--color-red-glow); }
.admin-stat-icon.gold  { background: var(--color-gold-glow); }
.admin-stat-icon.blue  { background: var(--color-info-bg); }
.admin-stat-icon.green { background: var(--color-success-bg); }

.admin-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  color: var(--color-white);
  line-height: 1;
}

.admin-stat-label {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-1);
}

.admin-stat-trend {
  font-size: var(--text-xs);
  color: var(--color-success);
  margin-top: var(--space-2);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-white { color: var(--color-white); }
.text-gray { color: var(--color-gray-400); }
.text-red { color: var(--color-red); }
.text-gold { color: var(--color-gold); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-muted { color: var(--color-gray-500); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-heading { font-family: var(--font-heading); }
.font-display { font-family: var(--font-display); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.hidden { display: none; }
.block { display: block; }

.divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-6) 0;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 8px rgba(196,18,48,0.3); }
  50% { box-shadow: 0 0 20px rgba(196,18,48,0.6); }
}

.animate-fade-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade { animation: fadeIn 0.3s ease forwards; }
.animate-slide-right { animation: slideInRight 0.4s ease forwards; }

/* Stagger animations para listas */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ============================================================
   RESPONSIVE - MOBILE FIRST
   ============================================================ */

/* Sidebar overlay en mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .app-header { padding: 0 var(--space-5); }
  .header-stat-card { min-width: 142px; }
  .header-stat-card-rank { min-width: 160px; }
  .header-stat-topline { display: none; }
  .header-avatar-info { min-width: 62px; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  /* Sidebar se convierte en offcanvas */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
  }

  .header-menu-btn { display: flex; }

  .page-content { padding: var(--space-4); }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .form-row { grid-template-columns: 1fr; }

  .auth-left { display: none; }
  .auth-right { width: 100%; border-left: none; padding: var(--space-6); }

  .header-stats { display: none; }

  .header-left {
    gap: var(--space-3);
    flex: 1;
  }

  .header-greeting {
    max-width: calc(100vw - 190px);
    font-size: var(--text-lg);
  }

  .header-subtext {
    display: none;
  }

  .header-avatar-wrapper {
    min-height: 48px;
    padding: 0.25rem;
    border-radius: 16px;
  }

  .header-avatar-info,
  .header-avatar-chevron {
    display: none;
  }

  .header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .notif-btn {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .banner { min-height: 180px; }
  .banner-title { font-size: var(--text-3xl); }
  .banner-logo-area { display: none; }

  .tournament-card { flex-wrap: wrap; }

  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }

  .modal { max-width: 100%; border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; }

  .notif-panel {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 16px;
    right: 16px;
    width: auto;
  }

  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .banner-actions { flex-direction: column; }
  .banner-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .app-header, .toast-container { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
}

/* Compact wordmark for TCGCOMPETITIVE.com. */
.sidebar-logo-text { font-size: 1.03rem; letter-spacing: -0.025em; white-space: nowrap; }
.sidebar-logo-text span { letter-spacing: 0.12em; }

.sidebar-logo-text span { text-transform: none; }
