/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Barlow', sans-serif;
  background: #0d1117;
  color: #e6edf3;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── VARIABLES ── */
:root {
  --gold: #f5c842;
  --dark: #0d1117;
  --dark2: #161b22;
  --dark3: #21262d;
  --border: rgba(255,255,255,0.1);
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #238636;
  --green-light: #4ac261;
  --red: #da3633;
  --blue: #1f6feb;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 50%, #0d1117 100%);
  border-bottom: 2px solid var(--gold);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(16px, 4vw, 24px);
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
}
.logo span { display: block; font-size: 0.65em; color: rgba(245,200,66,0.7); letter-spacing: 2px; }
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; color: var(--muted); display: none; }
@media (min-width: 480px) { .user-name { display: block; } }
.admin-badge {
  font-size: 10px; font-weight: 700;
  background: rgba(245,200,66,0.15);
  border: 1px solid rgba(245,200,66,0.4);
  color: var(--gold);
  padding: 2px 6px; border-radius: 20px;
  white-space: nowrap;
}
.btn-logout {
  background: none; border: 1px solid var(--border);
  color: var(--muted); padding: 5px 10px;
  border-radius: 6px; cursor: pointer;
  font-size: 12px; font-family: 'Barlow', sans-serif;
  transition: all 0.2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-logout:active { border-color: var(--red); color: var(--red); }

/* ── NAV ── */
.nav {
  display: flex;
  background: var(--dark2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
  background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--muted);
  padding: 12px 14px;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.nav-btn:active:not(.active) { color: var(--text); }
.nav-btn.admin-nav { color: rgba(245,200,66,0.6); }
.nav-btn.admin-nav.active { color: var(--gold); }

/* ── MAIN ── */
.main { padding: 12px; max-width: 720px; margin: 0 auto; }
@media (min-width: 640px) { .main { padding: 20px; } }

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; color: var(--gold);
  letter-spacing: 1px; margin-bottom: 12px;
}

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-btn {
  background: var(--dark3); border: 1px solid var(--border);
  color: var(--muted); padding: 6px 12px; border-radius: 20px;
  cursor: pointer; font-size: 12px; font-weight: 600;
  font-family: 'Barlow', sans-serif; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.filter-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ── MATCH CARD ── */
.match-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.match-card.is-live { border-color: rgba(245,200,66,0.4); }
.match-card.is-closed { opacity: 0.85; }

.match-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 10px; gap: 8px;
}
.match-meta { flex: 1; min-width: 0; }
.group-label { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.match-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.countdown { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 2px; }

.match-status {
  font-size: 10px; padding: 3px 8px;
  border-radius: 20px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.status-open   { background: rgba(35,134,54,0.2); color: var(--green-light); border: 1px solid rgba(35,134,54,0.4); }
.status-closed { background: rgba(139,148,158,0.15); color: var(--muted); border: 1px solid rgba(139,148,158,0.2); }
.status-live   { background: rgba(245,200,66,0.2); color: var(--gold); border: 1px solid rgba(245,200,66,0.4); }

/* ── TEAMS ROW ── */
.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.team-crest-wrap {
  position: relative; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 480px) { .team-crest-wrap { width: 68px; height: 68px; } }
.team-crest {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  transition: opacity 0.3s; z-index: 2;
}
.team-crest-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; z-index: 1;
}
@media (min-width: 480px) { .team-crest-fallback { font-size: 44px; } }
.team-name { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }
@media (min-width: 480px) { .team-name { font-size: 13px; } }
.team-rank {
  font-size: 9px; color: var(--gold); font-weight: 600;
  background: rgba(245,200,66,0.1);
  padding: 1px 6px; border-radius: 10px;
  border: 1px solid rgba(245,200,66,0.2);
}
@media (min-width: 480px) { .team-rank { font-size: 10px; } }

/* ── CENTER ZONE ── */
.vs-zone {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px; min-width: 100px;
}
@media (min-width: 480px) { .vs-zone { min-width: 120px; } }

.result-final {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; color: var(--gold); letter-spacing: 4px; line-height: 1;
}
.result-label { font-size: 9px; color: var(--muted); text-align: center; }

.score-inputs { display: flex; align-items: center; gap: 6px; }
.score-input {
  width: 40px; height: 40px;
  background: var(--dark3); border: 2px solid var(--border);
  color: var(--text); text-align: center;
  border-radius: var(--radius-sm);
  font-size: 20px; font-weight: 700;
  font-family: 'Bebas Neue', sans-serif;
  transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.score-input:focus { outline: none; border-color: var(--gold); }
.score-input:disabled { opacity: 0.35; cursor: not-allowed; }
.vs-text { color: var(--muted); font-size: 14px; font-weight: 700; }

.btn-predict {
  background: var(--green); color: #fff; border: none;
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 700;
  transition: opacity 0.2s; width: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-predict:active { opacity: 0.8; }
.prediction-saved { font-size: 11px; color: var(--green-light); text-align: center; }

/* ── PRONÓSTICOS REVELADOS (cuando empieza el partido) ── */
.preds-reveal {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.preds-reveal-title {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px;
  text-align: center;
}
.pred-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 5px 8px; border-radius: 6px;
  font-size: 12px; margin-bottom: 3px;
  background: var(--dark3);
}
.pred-row.correct-exact { background: rgba(245,200,66,0.12); }
.pred-row.correct-winner { background: rgba(35,134,54,0.12); }
.pred-row.wrong { background: rgba(218,54,51,0.08); }
.pred-player { font-weight: 600; flex: 1; }
.pred-score-val {
  font-family: 'Bebas Neue', sans-serif; font-size: 16px;
  color: var(--gold); letter-spacing: 2px; text-align: center; min-width: 48px;
}
.pred-pts {
  font-size: 11px; font-weight: 700; text-align: right; min-width: 40px;
}
.pred-pts.pts-3 { color: var(--gold); }
.pred-pts.pts-1 { color: var(--green-light); }
.pred-pts.pts-0 { color: var(--muted); }
.pred-pts.pts-pending { color: var(--muted); }

/* ── LEADERBOARD ── */
.live-badge {
  display: inline-block; font-size: 11px; color: var(--green-light);
  background: rgba(35,134,54,0.15); border: 1px solid rgba(35,134,54,0.3);
  padding: 3px 10px; border-radius: 20px; margin-bottom: 12px; font-weight: 600;
}
.points-info {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.points-info h3 { font-size: 13px; color: var(--gold); margin-bottom: 8px; font-weight: 700; }
.points-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 12px; border-bottom: 1px solid var(--border);
}
.points-row:last-child { border: none; }
.score-badge { font-family: 'Bebas Neue', sans-serif; font-size: 15px; color: var(--gold); }

.leaderboard-table {
  width: 100%; border-collapse: collapse;
  background: var(--dark2); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.leaderboard-table th {
  background: var(--dark3); padding: 10px 10px;
  text-align: left; font-size: 10px; color: var(--muted);
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.leaderboard-table td { padding: 12px 10px; border-top: 1px solid var(--border); font-size: 13px; }
.leaderboard-table tr:active td { background: rgba(255,255,255,0.03); }
.highlight-row td { background: rgba(245,200,66,0.05); }
.rank-n { color: var(--muted); font-family: 'Bebas Neue', sans-serif; font-size: 16px; }
.player-name { font-weight: 600; }
.pts { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--gold); }
.pts-label { font-size: 10px; color: var(--muted); }

/* ── GROUPS VIEW ── */
.groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 580px) { .groups-grid { grid-template-columns: 1fr 1fr; } }

.group-card {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.group-card-header {
  background: var(--dark3); padding: 8px 12px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; color: var(--gold); letter-spacing: 1px;
}
.group-table { width: 100%; border-collapse: collapse; }
.group-table th {
  font-size: 9px; color: var(--muted); font-weight: 700;
  padding: 4px 8px; text-align: center; letter-spacing: 0.5px;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
.group-table th:first-child { text-align: left; }
.group-table td {
  padding: 8px 8px; font-size: 12px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.group-table td:first-child { text-align: left; }
.group-table tr:last-child td { border-bottom: none; }
.group-team-cell {
  display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.group-team-mini-crest {
  width: 20px; height: 20px; object-fit: contain;
  flex-shrink: 0;
}
.group-qualified { background: rgba(35,134,54,0.12); }
.group-third { background: rgba(245,200,66,0.08); }
.pts-cell { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--gold); }

/* ── MY PREDS ── */
.my-score-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--dark2); border: 1px solid rgba(245,200,66,0.3);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; color: var(--muted);
}
.pred-item {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  margin-bottom: 8px; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.pred-match { flex: 1; min-width: 140px; }
.pred-score { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--gold); letter-spacing: 2px; text-align: center; }
.pred-score-label { font-size: 10px; color: var(--muted); text-align: center; }
.pred-result { font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.res-exact   { background: rgba(245,200,66,0.2); color: var(--gold); }
.res-winner  { background: rgba(35,134,54,0.2); color: var(--green-light); }
.res-wrong   { background: rgba(218,54,51,0.2); color: #f97070; }
.res-pending { background: rgba(139,148,158,0.15); color: var(--muted); }

/* ── ADMIN ── */
.admin-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px;
}
@media (min-width: 480px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.stat-num { font-family: 'Bebas Neue', sans-serif; font-size: 32px; color: var(--gold); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.admin-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.admin-matches { display: flex; flex-direction: column; gap: 10px; }
.admin-match-card {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.admin-match-card.has-result { border-color: rgba(35,134,54,0.35); }
.admin-match-info { margin-bottom: 10px; }
.admin-match-teams {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; flex-wrap: wrap; margin-bottom: 4px;
}
.admin-mini-crest { height: 20px; width: auto; object-fit: contain; vertical-align: middle; }
.admin-match-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.current-result-tag {
  font-size: 11px; color: var(--green-light);
  background: rgba(35,134,54,0.1); border: 1px solid rgba(35,134,54,0.25);
  display: inline-block; padding: 2px 8px; border-radius: 20px;
}
.pending-tag {
  font-size: 11px; color: var(--muted);
  background: rgba(139,148,158,0.1); display: inline-block; padding: 2px 8px; border-radius: 20px;
}
.admin-result-zone { display: flex; flex-direction: column; gap: 10px; }
.admin-score-row { display: flex; align-items: center; gap: 16px; justify-content: center; }
.admin-team-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.admin-flag-lg { width: 44px; height: 44px; object-fit: contain; }
.admin-team-name { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; max-width: 70px; }
.admin-score-input {
  width: 52px; height: 52px; background: var(--dark3);
  border: 2px solid var(--border); color: var(--text);
  text-align: center; border-radius: var(--radius-sm);
  font-size: 24px; font-weight: 700;
  font-family: 'Bebas Neue', sans-serif; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.admin-score-input:focus { outline: none; border-color: var(--gold); }
.admin-divider { font-size: 20px; color: var(--muted); font-weight: 700; padding-top: 24px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-save-result {
  background: var(--green); color: #fff; border: none;
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 700;
  transition: opacity 0.2s; white-space: nowrap; flex: 1;
  touch-action: manipulation;
}
.btn-save-result:active { opacity: 0.8; }
.btn-update { background: var(--blue); }
.btn-clear-result {
  background: none; border: 1px solid rgba(218,54,51,0.4); color: #f97070;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600;
  touch-action: manipulation;
}
.admin-players {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.admin-player-row:last-child { border-bottom: none; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 0%, #1a2540 0%, #0d1117 70%);
}
.login-box {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 20px;
  width: 100%; max-width: 400px; text-align: center;
}
.login-trophy { font-size: 52px; margin-bottom: 6px; }
.login-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 30px;
  color: var(--gold); letter-spacing: 3px; margin-bottom: 2px;
}
.login-sub { color: var(--muted); font-size: 12px; margin-bottom: 24px; }
.input-group { text-align: left; margin-bottom: 14px; }
.input-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.input-group input {
  width: 100%; background: var(--dark3);
  border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif; font-size: 15px;
  transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.input-group input:focus { outline: none; border-color: var(--gold); }
.btn-primary {
  width: 100%; background: var(--gold); color: #000; border: none;
  padding: 12px; border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 6px; transition: opacity 0.2s;
  touch-action: manipulation;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.login-toggle { margin-top: 16px; font-size: 13px; color: var(--muted); }
.login-toggle a { color: var(--gold); cursor: pointer; }
.error-msg {
  background: rgba(218,54,51,0.15); border: 1px solid rgba(218,54,51,0.4);
  color: #f97070; padding: 9px; border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 10px;
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--dark3); border: 1px solid var(--gold); color: var(--gold);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13px;
  opacity: 0; transition: all 0.3s; z-index: 1000; white-space: nowrap;
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.toast-err { border-color: var(--red); color: #f97070; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 40px 0; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── MISC ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ── ADMIN NAV BADGE ── */
.nav-btn.admin-nav { position: relative; }

/* ── LOGO GINDANGAS ── */
.logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0px;
  flex: 1;
  min-width: 0;
}
.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(245,200,66,0.3));
}
@media (min-width: 480px) {
  .logo-img { height: 42px; }
}
.logo-sub {
  font-family: 'Barlow', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: rgba(245,200,66,0.55);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -2px;
}

/* ── LOGIN LOGO ── */
.login-logo {
  width: 80%;
  max-width: 280px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 2px 12px rgba(245,200,66,0.25));
}

/* ── PENDING APPROVAL SCREEN ── */
.admin-player-row .btn-approve {
  background: var(--green); color: #fff; border: none;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-family: 'Barlow', sans-serif; font-size: 12px; font-weight: 700;
  touch-action: manipulation;
}
.admin-player-row .btn-reject {
  background: none; border: 1px solid rgba(218,54,51,0.5);
  color: #f97070; padding: 6px 10px; border-radius: 6px;
  cursor: pointer; font-family: 'Barlow', sans-serif; font-size: 12px;
  touch-action: manipulation;
}

/* ── CHAT ── */
.chat-container {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.chat-messages {
  height: 420px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
@media (max-width: 480px) { .chat-messages { height: 340px; } }

.chat-date-sep {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 6px 0;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.chat-msg-row.mine { flex-direction: row-reverse; }

.chat-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--dark3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
  flex-shrink: 0;
}
.chat-avatar.mine { background: rgba(245,200,66,0.2); color: var(--gold); }

.chat-bubble {
  max-width: 75%;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 10px;
}
.chat-bubble.mine {
  background: rgba(245,200,66,0.12);
  border-color: rgba(245,200,66,0.25);
  border-radius: 12px 12px 4px 12px;
}
.chat-username {
  font-size: 10px; font-weight: 700;
  color: var(--gold); margin-bottom: 2px;
}
.chat-text { font-size: 13px; line-height: 1.4; word-break: break-word; }
.chat-time {
  font-size: 9px; color: var(--muted);
  text-align: right; margin-top: 3px;
}

.chat-input-row {
  display: flex; gap: 8px; align-items: center;
}
.chat-input {
  flex: 1;
  background: var(--dark2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.chat-input:focus { outline: none; border-color: var(--gold); }
.chat-send-btn {
  background: var(--gold); color: #000; border: none;
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.chat-send-btn:active { opacity: 0.8; }

/* ── PERFIL Y SELECTOR DE CLUB ── */
.profile-card {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.profile-name { font-size: 17px; font-weight: 700; }
.profile-user { font-size: 12px; color: var(--muted); margin-top: 2px; }

.profile-section-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.club-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 480px) { .club-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .club-grid { grid-template-columns: repeat(5, 1fr); } }

.club-option {
  background: var(--dark2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer; transition: all 0.15s;
  position: relative; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.club-option:active { transform: scale(0.95); }
.club-option.selected { border-color: var(--gold); background: rgba(245,200,66,0.08); }

.club-option-img {
  width: 44px; height: 44px; object-fit: contain;
  display: block;
}
.club-option-fallback {
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  font-size: 28px;
}
.club-option-name {
  font-size: 9px; font-weight: 600; color: var(--muted);
  text-align: center; line-height: 1.2;
}
.club-option.selected .club-option-name { color: var(--gold); }
.club-check {
  position: absolute; top: 4px; right: 5px;
  font-size: 10px; font-weight: 700; color: var(--gold);
}

.profile-current-club {
  display: flex; align-items: center; gap: 10px;
  background: rgba(245,200,66,0.08);
  border: 1px solid rgba(245,200,66,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 14px;
}

/* Club badge en leaderboard y chat */
.chat-username img { vertical-align: middle; }

/* ── CLUB SELECTOR EN REGISTRO ── */
.reg-club-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px;
}
@media (min-width: 400px) { .reg-club-grid { grid-template-columns: repeat(6, 1fr); } }

.reg-club-option {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 4px;
  background: var(--dark3);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.reg-club-option:active { transform: scale(0.92); }
.reg-club-option.selected {
  border-color: var(--gold);
  background: rgba(245,200,66,0.1);
}

/* ── PODIO TOP 3 ── */
.podium-wrap {
  margin-bottom: 20px;
  padding: 14px 8px 10px;
  background: linear-gradient(180deg, rgba(245,200,66,0.08) 0%, transparent 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(245,200,66,0.15);
}
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
}
.podium-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  width: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.25s;
  position: relative;
}
.podium-card.me {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245,200,66,0.3);
}
.podium-medal {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--dark3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--text);
  overflow: hidden;
}
.podium-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-pts {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  line-height: 1;
}
.podium-streak {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  background: rgba(255,87,34,0.2);
  color: #ff7f50;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,127,80,0.35);
  font-weight: 700;
}

/* ── BADGE RACHA en tabla ── */
.streak-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(255,87,34,0.18);
  color: #ff7f50;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,127,80,0.3);
  margin-left: 6px;
  font-weight: 700;
  vertical-align: middle;
}

/* ── BANNER PRÓXIMO PARTIDO ── */
.next-match-banner {
  background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%);
  border: 1px solid rgba(245,200,66,0.25);
  border-radius: var(--radius);
  padding: 14px 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.next-match-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.next-match-banner.live {
  border-color: rgba(218,54,51,0.4);
  animation: livePulse 2s ease-in-out infinite;
}
.next-match-banner.live::before {
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218,54,51,0.25); }
  50% { box-shadow: 0 0 0 6px rgba(218,54,51,0); }
}
.next-match-label {
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.next-match-banner.live .next-match-label { color: #f97070; }
.next-match-teams {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 8px;
}
.next-match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.next-match-crest {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
@media (min-width: 480px) { .next-match-crest { width: 52px; height: 52px; } }
.next-match-team-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}
@media (min-width: 480px) { .next-match-team-name { font-size: 13px; } }
.next-match-center { text-align: center; }
.next-match-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 2px;
}
.next-match-countdown {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1.1;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 480px) { .next-match-countdown { font-size: 28px; } }
.next-match-banner.live .next-match-countdown { color: #f97070; }
.next-match-meta {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── ANIMACIÓN PULSE al guardar pronóstico ── */
@keyframes pulseSave {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,200,66,0.5); }
  50%  { transform: scale(1.015); box-shadow: 0 0 0 8px rgba(245,200,66,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,200,66,0); }
}
.match-card.pulse-save {
  animation: pulseSave 0.8s ease-out;
  border-color: var(--gold) !important;
}

/* ── MINI-RANKING POR FECHA ── */
.matchday-card {
  background: var(--dark2);
  border: 1px solid rgba(245,200,66,0.2);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.matchday-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 3px; bottom: 0;
  background: linear-gradient(180deg, var(--gold), transparent);
}
.matchday-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 4px;
}
.matchday-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 1px;
}
.matchday-date {
  font-size: 10px;
  color: var(--muted);
  text-transform: capitalize;
}
.md-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 6px;
  font-size: 13px;
}
.md-row.me {
  background: rgba(245,200,66,0.08);
}
.md-medal { font-size: 16px; }
.md-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.md-pts {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 1px;
}

/* ── REACCIONES EN EL CHAT ── */
.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.chat-msg-row.mine .chat-bubble-wrap {
  align-items: flex-end;
}
.chat-bubble { cursor: pointer; user-select: none; }
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
  padding: 0 4px;
}
.chat-react-chip {
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.chat-react-chip:active { transform: scale(0.92); }
.chat-react-chip.mine {
  background: rgba(245,200,66,0.18);
  border-color: rgba(245,200,66,0.4);
}
.react-picker {
  position: absolute;
  background: var(--dark3);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 100;
  margin-top: 4px;
  animation: fadeInReact 0.15s ease-out;
}
@keyframes fadeInReact {
  from { opacity: 0; transform: translateY(-4px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.react-picker-emoji {
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.react-picker-emoji:active {
  transform: scale(1.3);
  background: rgba(245,200,66,0.2);
}

/* chat-bubble-wrap is position-relative for react-picker positioning */
.chat-bubble-wrap { position: relative; }
