:root {
  /* Paleta Deep Dark Pro */
  --bg-color: #0c0d0f;
  --card-bg: #141517;
  --card-hover: #1c1e22;
  --accent-color: #f02c3d; /* Grandmaster Red */
  --text-main: #ffffff;
  --text-muted: #8b92a5;
  --text-gold: #c89b3c;
  --winrate-green: #00cfbc;
  --losses-red: #ff4e50;
  --gm-red: #f02c3d;
  
  /* Rango Gradients */
  --challenger: linear-gradient(135deg, #f4c465 0%, #ff8c00 100%);
  --master: linear-gradient(135deg, #cf91ff 0%, #8737e6 100%);
  --diamond: linear-gradient(90deg, #71cdff 0%, #3580ff 100%);
  --rank-yellow: #FABC3F;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

.glass-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(240, 44, 61, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(240, 44, 61, 0.05) 0%, transparent 40%);
  z-index: -1;
}

.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header & Timer */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.gradient-text {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, #8b92a5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.update-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}

.timer-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 700; display: block; }
.timer-value { font-weight: 800; font-size: 0.9rem; }

/* 🗂️ Tabs Navigation */
.tabs-navigation {
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 2rem;
  padding-bottom: 5px;
}

.player-tabs-list {
  display: flex;
  gap: 20px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 5px;
  cursor: pointer;
  transition: 0.3s;
  letter-spacing: 1px;
  position: relative;
}

.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--text-gold); }
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-gold);
}

/* 🌎 Views System */
.dashboard-view { display: none; }
.dashboard-view.active { 
  display: block; 
  animation: fadeIn 0.4s ease-out;
}

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

/* 🚀 Dashboard Layout (2 Columns) */
.dashboard-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.05);
}

.main-chart-container { height: 100%; min-height: 400px; }

/* 🏆 Leaderboard Styling */
.table-header {
  display: grid;
  grid-template-columns: 50px 1.8fr 1.8fr 1.2fr 1fr;
  padding: 8px 15px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.player-row {
  display: grid;
  grid-template-columns: 50px 1.8fr 1.8fr 1.2fr 1fr;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 8px 15px;
  margin-bottom: 6px;
  transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.03);
}
.player-row:hover { background: var(--card-hover); transform: translateX(5px); }

/* Rank Number */
.row-rank {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--rank-yellow);
}

/* Avatars & Names */
.col-profile { display: flex; align-items: center; gap: 12px; }
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
}

.name-main { font-weight: 700; font-size: 0.95rem; display: block; }
.name-sub { font-size: 0.7rem; color: var(--text-muted); }

/* LoL Account */
.account-wrapper { display: flex; align-items: center; gap: 10px; }
.helmet-icon {
  width: 32px;
  height: 32px;
  background: #000;
  border-radius: 50%;
  padding: 4px;
}

/* Elo Section */
.elo-wrapper { display: flex; align-items: center; gap: 10px; }
.rank-emblem { width: 32px; height: 32px; }
.tier-title { font-weight: 800; font-size: 0.75rem; text-transform: uppercase; display: block; }
.lp-value { font-size: 0.8rem; font-weight: 700; }

/* W / L Stats */
.wr-stats { font-weight: 800; font-size: 0.9rem; }
.wins-label { color: var(--winrate-green); }
.losses-label { color: var(--losses-red); }
.wr-pct { font-size: 0.7rem; color: var(--text-muted); font-weight:600; margin-top: 2px; }

/* 👤 Vista Perfil (NUEVO) */
.profile-header-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 2rem;
}

.profile-name-big { font-size: 2.2rem; font-weight: 800; }

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 2rem;
}

.stat-card-mini {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.03);
}

.stat-value { font-size: 1.6rem; font-weight: 800; display: block; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-top: 5px; }

/* Top Champions list */
.champions-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  justify-content: center;
}

.champ-mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  padding: 5px 10px;
  border-radius: 8px;
}
.champ-img-xs { width: 24px; height: 24px; border-radius: 50%; }
.champ-winrate-text { font-size: 0.75rem; font-weight: 800; color: var(--winrate-green); }

/* 📏 Rank Liner (Barras de Progreso) */
.liner-section {
  margin: 2rem 0;
}

.liner-row {
  background: #111214;
  border-radius: 12px;
  padding: 25px;
  border: 1px solid rgba(255,255,255,0.03);
}

.liner-title { 
  font-size: 0.8rem; 
  font-weight: 900; 
  color: #fff; 
  margin-bottom: 30px; 
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.progress-container {
  height: 12px;
  background: #1a1b1f;
  border-radius: 6px;
  width: 100%;
  position: relative;
  margin: 35px 0 15px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #8737e6 0%, #ff4e50 100%);
  position: relative;
  box-shadow: 0 0 15px rgba(135, 55, 230, 0.3);
}

.rank-marker {
  position: absolute;
  top: -32px;
  text-align: center;
}

.marker-name { font-size: 0.7rem; font-weight: 900; display: block; color: var(--text-muted); text-transform: uppercase; }
.marker-lp { font-size: 0.75rem; font-weight: 800; color: #fff; }

.marker-target { right: 0; text-align: right; }
.marker-current { color: #fff; transform: translateX(-50%); }

/* 📜 Historial de Partidas */
.match-day-group { margin-bottom: 2rem; }

.match-day-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 15px;
}
.day-text { font-weight: 700; color: var(--text-muted); font-size: 0.9rem; }
.day-points { color: var(--winrate-green); font-weight: 800; }

.match-card {
  display: grid;
  grid-template-columns: 120px 1.5fr 1.5fr 2fr 1.5fr;
  align-items: center;
  background: rgba(0, 207, 188, 0.05); /* Win */
  border-left: 4px solid var(--winrate-green);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  transition: 0.2s;
}

.match-card.loss {
  background: rgba(255, 78, 80, 0.05);
  border-left-color: var(--losses-red);
}

.m-info { font-size: 0.75rem; text-align: center; }
.m-info .result { font-weight: 900; display: block; margin-bottom: 4px; }
.win-text { color: var(--winrate-green); }
.loss-text { color: var(--losses-red); }

.m-champ { display: flex; align-items: center; gap: 12px; }
.m-champ-icon { width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); }
.m-lvl { background: #000; font-size: 0.6rem; padding: 2px 5px; border-radius: 40%; position: absolute; bottom: 0; right: 0; }

.m-kda { text-align: center; }
.m-kda-stats { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; }
.m-kda-ratio { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

.m-items { display: flex; gap: 4px; justify-content: center; }
.m-item-box { width: 28px; height: 28px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.m-item-img { width: 100%; height: 100%; object-fit: cover; }

.m-players { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 0.65rem; color: var(--text-muted); }
.p-mini { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px;}
.p-champ-xs { width: 14px; height: 14px; border-radius: 2px; }
.p-link { color: var(--text-muted); text-decoration: none; transition: 0.2s; }
.p-link:hover { color: #fff; }
.p-me { color: var(--text-gold); font-weight: 800; text-decoration: none; transition: 0.2s; }
.p-me:hover { filter: brightness(1.2); }

/* 📸 Social Footer */
.social-footer {
  margin-top: 4rem;
  padding: 3rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: center;
}

.footer-title { font-size: 2rem; font-weight: 800; margin-bottom: 2.5rem; }
.highlight { color: #ccff00; }

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.social-card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transition: 0.3s;
}
.social-card:hover { transform: translateY(-5px); background: var(--card-hover); }

.social-icon { font-size: 2.5rem; }
.social-info { display: flex; flex-direction: column; gap: 4px; }
.count { font-size: 1.4rem; font-weight: 800; }
.label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.subscribe-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.youtube-card .count { color: #f00; }
.twitch-card .subscribe-btn { background: #9146ff; color: #fff; }
.discord-card .subscribe-btn { background: var(--gm-red); color: #fff; box-shadow: 0 0 15px rgba(240, 44, 61, 0.4); }
.kick-card .subscribe-btn { background: #53fc18; color: #000; }

/* Responsive */
@media (max-width: 1100px) {
  .dashboard-top { grid-template-columns: 1fr; }
  .match-card {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .m-players { display: none; }
}

@media (max-width: 600px) {
  .table-header, .player-row { grid-template-columns: 40px 1fr 1fr; }
  .col-account, .col-wr { display: none; }
}
