/* ─── DASHBOARD ──────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(0,212,122,.08), rgba(0,212,122,.02));
  border: 1px solid rgba(0,212,122,.15);
  border-radius: 16px; padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.welcome-banner h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.welcome-banner p  { font-size: .85rem; color: var(--text2); }
.welcome-actions   { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 24px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
}

/* Match list inside card */
.match-list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.match-list-item:last-child { border-bottom: none; }
.match-list-item:hover { background: rgba(255,255,255,.02); }
.match-info { flex: 1; min-width: 0; }
.match-vs   { font-size: .82rem; font-weight: 600; margin-bottom: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-meta { font-size: .7rem; color: var(--text2); }

/* Activity feed */
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.act-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; flex-shrink: 0;
}
.act-text  { font-size: .78rem; color: var(--text2); line-height: 1.5; }
.act-text strong { color: var(--text); font-weight: 600; }
.act-time  { font-size: .65rem; color: var(--text3); margin-top: 2px; }

/* ─── TORNEOS ────────────────────────────────────────── */
.torneos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.torneo-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all var(--t); cursor: pointer;
}
.torneo-card:hover { border-color: rgba(0,212,122,.2); transform: translateY(-2px); }
.torneo-banner {
  height: 120px; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; position: relative;
  overflow: hidden;
}
.torneo-body { padding: 16px; }
.torneo-name { font-size: .9rem; font-weight: 700; margin-bottom: 3px; }
.torneo-org  { font-size: .72rem; color: var(--text2); margin-bottom: 12px; }
.torneo-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.torneo-footer {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.slots-label { font-size: .7rem; color: var(--text2); margin-bottom: 4px; }
.slots-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; width: 120px; }
.slots-fill { height: 100%; border-radius: 2px; background: var(--green); transition: width .4s ease; }
.slots-fill.almost { background: var(--gold); }
.prize-label { font-size: .65rem; color: var(--text3); margin-bottom: 1px; text-align: right; }
.prize-val   { font-size: .92rem; font-weight: 800; color: var(--gold); }

/* Torneo detail view */
.torneo-detail-header {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; margin-bottom: 20px;
}
.torneo-detail-banner { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.torneo-detail-body { padding: 24px; }

/* ─── LIGAS ──────────────────────────────────────────── */
.liga-header,
.liga-row {
  display: grid;
  grid-template-columns: 36px 1fr 40px 40px 40px 40px 70px 72px;
  gap: 8px;
  padding: 10px 16px;
  align-items: center;
}
.liga-header {
  font-size: .65rem; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.liga-row {
  border-bottom: 1px solid var(--border);
  transition: background var(--t); cursor: pointer;
}
.liga-row:last-child { border-bottom: none; }
.liga-row:hover { background: rgba(255,255,255,.02); }
.liga-row.me    { background: rgba(0,212,122,.03); border-color: rgba(0,212,122,.1); }

.liga-pos { font-size: .82rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.pos-1 { color: var(--gold); }
.pos-2 { color: #C0C0C0; }
.pos-3 { color: #CD7F32; }
.pos-up { color: var(--green); }
.pos-down { color: var(--red); }

.liga-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.liga-pname  { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liga-plat   { font-size: .65rem; color: var(--text3); }

.liga-num { font-size: .82rem; text-align: center; color: var(--text2); font-variant-numeric: tabular-nums; }
.liga-pts { font-size: .9rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }

.league-zone-label {
  font-size: .65rem; padding: 6px 16px;
  border-top: 1px solid var(--border);
}
.zone-label-up   { color: var(--green); background: rgba(0,212,122,.03); }
.zone-label-down { color: var(--red);   background: rgba(255,74,110,.02); }

.zone-legend {
  display: flex; gap: 20px; padding: 12px 16px;
  font-size: .7rem; color: var(--text2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.zl-stripe {
  display: inline-block; width: 10px; height: 3px;
  border-radius: 2px; margin-right: 5px; vertical-align: middle;
}

/* ─── RANKING ────────────────────────────────────────── */
.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.podium-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 16px; text-align: center;
  position: relative; overflow: hidden;
}
.podium-card.p1 {
  border-color: rgba(255,184,0,.2);
}
.podium-card.p1::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,184,0,.07), transparent);
}
.podium-pos    { font-size: 1.5rem; margin-bottom: 10px; }
.podium-name   { font-size: .85rem; font-weight: 700; margin-bottom: 2px; }
.podium-country{ font-size: .7rem; color: var(--text2); margin-bottom: 10px; }
.podium-elo    { font-size: 1.1rem; font-weight: 900; color: var(--green); }
.podium-elo-lbl{ font-size: .65rem; color: var(--text2); }

.rank-table { width: 100%; }
.rank-header,
.rank-row {
  display: grid;
  grid-template-columns: 52px 1fr 80px 80px 90px 80px;
  gap: 8px; padding: 11px 20px;
  align-items: center;
}
.rank-header {
  font-size: .65rem; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.rank-row {
  border-bottom: 1px solid var(--border);
  transition: background var(--t); cursor: pointer;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: rgba(255,255,255,.02); }
.rank-row.me    { background: rgba(0,212,122,.04); }
.rank-pos  { font-size: .88rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--text2); }
.rank-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-name   { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-country{ font-size: .65rem; color: var(--text2); }
.rank-num    { font-size: .82rem; text-align: center; color: var(--text2); font-variant-numeric: tabular-nums; }
.rank-elo    { font-size: .9rem; font-weight: 800; text-align: center; color: var(--green); font-variant-numeric: tabular-nums; }
.fp-high { color: var(--green); font-weight: 700; }
.fp-mid  { color: var(--gold);  font-weight: 700; }
.fp-low  { color: var(--red);   font-weight: 700; }

.ranking-controls {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px; align-items: center;
}

/* ─── PERFIL ─────────────────────────────────────────── */
.profile-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; margin-bottom: 20px;
}
.profile-banner {
  height: 200px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #001F12, #001A30, #0D001A);
  background-size: cover; background-position: center;
}
.profile-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}
.profile-info {
  display: flex; align-items: flex-end; gap: 20px;
  padding: 0 28px 24px; margin-top: -44px; position: relative; z-index: 1;
  flex-wrap: wrap;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-wrap .avatar {
  width: 88px; height: 88px; font-size: 1.8rem;
  border: 3px solid var(--card); box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.profile-meta { flex: 1; min-width: 0; padding-bottom: 4px; }
.profile-name  { font-size: 1.3rem; font-weight: 900; line-height: 1.1; margin-bottom: 6px; }
.profile-tags  { display: flex; gap: 6px; flex-wrap: wrap; }
.ptag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
}
.ptag-plat { background: rgba(0,212,122,.1); border-color: rgba(0,212,122,.3); color: var(--green); }
.ptag-div  { background: rgba(255,184,0,.1);  border-color: rgba(255,184,0,.3); color: var(--gold); }

.profile-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}

.profile-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 16px;
}

/* History list */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }
.result-chip {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; flex-shrink: 0;
}
.result-w { background: rgba(0,212,122,.15); color: var(--green); }
.result-d { background: rgba(255,184,0,.1);  color: var(--gold); }
.result-l { background: rgba(255,74,110,.1); color: var(--red); }
.hist-opp  { font-size: .82rem; font-weight: 600; }
.hist-meta { font-size: .68rem; color: var(--text2); }
.hist-score{ font-size: .88rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Trophy list */
.trophy-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 8px;
}
.trophy-icon { font-size: 1.2rem; width: 32px; text-align: center; flex-shrink: 0; }
.trophy-name { font-size: .82rem; font-weight: 600; }
.trophy-date { font-size: .68rem; color: var(--text2); }

/* ─── BILLETERA ──────────────────────────────────────── */
.wallet-header {
  background: linear-gradient(135deg, rgba(255,184,0,.08), rgba(255,184,0,.02));
  border: 1px solid rgba(255,184,0,.15);
  border-radius: 16px; padding: 28px;
  margin-bottom: 24px; text-align: center;
}
.wallet-balance { font-size: 3rem; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.wallet-usd     { font-size: .85rem; color: var(--text2); margin-top: 4px; }
.wallet-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

.tx-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon   { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
             display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.tx-info   { flex: 1; }
.tx-desc   { font-size: .82rem; font-weight: 600; }
.tx-date   { font-size: .7rem; color: var(--text2); }
.tx-amount { font-size: .9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tx-in     { color: var(--green); }
.tx-out    { color: var(--red); }

/* ─── AUTH SHELL ─────────────────────────────────────── */
.auth-shell {
  display: flex; min-height: 100vh;
}

/* LEFT */
.auth-left {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  padding: 60px 56px;
}
.auth-left-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 50%, rgba(0,212,122,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 20%, rgba(0,212,122,.06) 0%, transparent 60%);
}
.auth-left::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}
.auth-left-inner { position: relative; z-index: 1; max-width: 440px; }
.auth-brand {
  margin-bottom: 40px; display: flex; align-items: center;
}
.auth-brand-logo {
  height: 160px; width: auto; max-width: 320px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(0,212,122,.4));
}
.auth-headline {
  font-size: 2.4rem; font-weight: 900; line-height: 1.15;
  letter-spacing: -.8px; margin-bottom: 20px;
}
.auth-headline em {
  font-style: normal; color: var(--green);
}
.auth-subline {
  font-size: .95rem; color: var(--text2); line-height: 1.7;
  margin-bottom: 40px; max-width: 360px;
}
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  font-size: .88rem; color: var(--text2);
}
.auth-feature-icon { font-size: 1.1rem; flex-shrink: 0; }

/* RIGHT */
.auth-right {
  width: 480px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 40px 40px;
}
.auth-card { width: 100%; max-width: 380px; }

/* TABS */
.auth-tabs {
  display: flex; gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1; padding: 10px 0; border: none; cursor: pointer;
  border-radius: 9px; font-size: .85rem; font-weight: 600;
  color: var(--text2); background: transparent;
  transition: background var(--t), color var(--t);
}
.auth-tab.active { background: var(--card); color: var(--text); }

/* OAUTH BUTTONS */
.auth-oauth { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); transition: all var(--t);
}
.btn-google { background: #fff; color: #111; }
.btn-google:hover { background: #f5f5f5; border-color: #ddd; }
.btn-discord { background: #5865F2; color: #fff; border-color: #5865F2; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }

/* FORM */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: .75rem; font-weight: 600; color: var(--text2); }
.auth-hint { font-size: .7rem; color: var(--text3); margin-top: 2px; }
.auth-tos { font-size: .72rem; color: var(--text2); line-height: 1.6; }
.auth-tos a { color: var(--green); text-decoration: none; }
.auth-tos strong { color: var(--text); }

/* DIVIDER */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text3); font-size: .75rem; margin: 6px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* RESPONSIVE — stack on mobile */
@media (max-width: 800px) {
  .auth-shell { flex-direction: column; }
  .auth-left { display: none; }
  .auth-right { width: 100%; min-height: 100vh; padding: 32px 24px; align-items: flex-start; padding-top: 48px; }
  .auth-headline { font-size: 1.8rem; }
}

/* ─── COMPLETAR PERFIL ───────────────────────────────── */
.completar-header { margin-bottom: 24px; }
.completar-step   { font-size: .7rem; font-weight: 700; color: var(--green); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.completar-title  { font-size: 1.4rem; font-weight: 900; margin-bottom: 4px; }
.completar-sub    { font-size: .82rem; color: var(--text2); }

.input-with-prefix { display: flex; align-items: center; }
.input-prefix {
  background: var(--card2); border: 1px solid var(--border);
  border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 12px; height: 42px; display: flex; align-items: center;
  font-size: .9rem; color: var(--text2); flex-shrink: 0;
}
.input-prefixed { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* ─── RESPONSIVE OVERRIDES ───────────────────────────── */
@media (max-width: 800px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .podium-grid  { grid-template-columns: 1fr; }
  .profile-stats-row { grid-template-columns: repeat(3, 1fr); }
  .profile-banner { height: 130px; }
  .profile-info { margin-top: -36px; padding: 0 16px 20px; gap: 12px; }
  .profile-avatar-wrap .avatar { width: 72px; height: 72px; font-size: 1.4rem; }
  .profile-name { font-size: 1.1rem; }
  .profile-meta { padding-bottom: 0; }

  .liga-header, .liga-row {
    grid-template-columns: 32px 1fr 36px 36px 56px;
  }
  .liga-header > *:nth-child(4), .liga-row > *:nth-child(4),
  .liga-header > *:nth-child(5), .liga-row > *:nth-child(5),
  .liga-header > *:nth-child(6), .liga-row > *:nth-child(6) { display: none; }

  .rank-header, .rank-row {
    grid-template-columns: 40px 1fr 70px 80px;
  }
  .rank-header > *:nth-child(3), .rank-row > *:nth-child(3),
  .rank-header > *:nth-child(5), .rank-row > *:nth-child(5),
  .rank-header > *:nth-child(6), .rank-row > *:nth-child(6) { display: none; }
}

/* ── Login OAuth-only ─────────────────────────────────── */
.auth-card-oauth {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; text-align: center; padding: 40px 32px;
}
.auth-brand-mobile { display: none; margin-bottom: 16px; }
.auth-brand-logo-sm { height: 72px; }
.auth-oauth-title { font-size: 24px; font-weight: 800; color: var(--text1); margin: 0 0 8px; }
.auth-oauth-sub   { font-size: 14px; color: var(--text3); margin: 0 0 28px; }
.auth-card-oauth .auth-oauth { width: 100%; flex-direction: column; gap: 12px; }
.auth-card-oauth .btn-oauth  { width: 100%; justify-content: center; font-size: 15px; padding: 13px 20px; }
.auth-tos-center { font-size: 11px; color: var(--text3); margin-top: 20px; line-height: 1.5; }
.auth-tos-center a { color: var(--text2); }

@media (max-width: 700px) {
  .auth-brand-mobile { display: block; }
}
