/* =====================================================
   PORRA MUNDIAL 2026 — tema sobre Bootstrap 5
   Paleta inspirada en la identidad vibrante del Mundial
   ===================================================== */

:root {
  /* Paleta verde césped */
  --wc-lime:    #8FD14F;
  --wc-grass:   #2E9E3F;
  --wc-green:   #128A3E;   /* acento principal */
  --wc-pitch:   #0A6B33;
  --wc-forest:  #064E2A;
  --wc-deep:    #052E1C;   /* verde más oscuro */
  --wc-teal:    #0E9C82;
  --wc-gold:    #FFC72C;
  --wc-gold-d:  #E0A000;

  /* gradientes "césped" */
  --wc-grad:     linear-gradient(120deg, #052E1C 0%, #0A6B33 40%, #2E9E3F 75%, #6FBF3A 100%);
  --wc-grad-soft:linear-gradient(120deg, #0A6B33 0%, #2E9E3F 100%);

  /* alias de compatibilidad (usados por chips/textos existentes) */
  --wc-pink:    #128A3E;
  --wc-magenta: #2E9E3F;
  --wc-purple:  #0A6B33;
  --wc-violet:  #064E2A;
  --wc-indigo:  #064E2A;
  --wc-blue:    #0E9C82;
  --wc-cyan:    #8FD14F;

  --ink:    #14241a;
  --muted:  #5e7065;
  --bg:     #f1f6f1;
  --card:   #ffffff;
  --line:   #e2ece4;
  --radius: 16px;
  --shadow:    0 6px 24px rgba(6,78,42,.10);
  --shadow-h:  0 12px 32px rgba(6,78,42,.18);

  --bs-body-font-family: 'Inter', system-ui, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 100% -5%, rgba(46,158,63,.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(10,107,51,.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

h1,h2,h3,.wc-brand-text,.display-num { font-family: 'Poppins', sans-serif; }

a { text-decoration: none; }

/* ---------- NAVBAR ---------- */
.wc-navbar {
  background: var(--wc-grad);
  box-shadow: 0 4px 20px rgba(6,78,42,.35);
}
.wc-brand { font-weight: 800; font-size: 1.15rem; color: #fff !important; letter-spacing: .2px; }
.wc-ball  { font-size: 1.3rem; }
.wc-26 {
  background: var(--wc-gold);
  color: var(--wc-indigo);
  padding: 0 .35rem;
  border-radius: 7px;
  font-weight: 800;
}
.wc-navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  font-weight: 600;
  font-size: .92rem;
  border-radius: 10px;
  padding: .4rem .85rem !important;
  margin: 0 2px;
  transition: .15s;
}
.wc-navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.14); }
.wc-navbar .nav-link.active { color: var(--wc-indigo) !important; background: var(--wc-gold); }
.navbar-toggler { border-color: rgba(255,255,255,.4); }

/* ---------- LAYOUT ---------- */
.container { max-width: 760px; }
main.wc-main { padding-bottom: 90px; padding-top: 18px; }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wc-indigo);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 26px 0 12px;
}
.section-title i { color: var(--wc-pink); }
.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  background: var(--wc-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 14px 0 6px;
}
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; font-size: .9rem; margin: 12px 0; }
.back-link:hover { color: var(--wc-purple); }

/* ---------- BANDERAS ---------- */
.flag {
  display: inline-block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  vertical-align: middle;
  background: #ddd;
}
.flag--sm { width: 24px; height: 16px; }
.flag--md { width: 30px; height: 20px; }
.flag--lg { width: 44px; height: 30px; }
.flag--xl { width: 84px; height: 56px; border-radius: 8px; }
.flag--emoji { box-shadow: none; background: none; }
.flag--emoji.flag--md { font-size: 1.4rem; width:auto; height:auto; }
.flag--emoji.flag--xl { font-size: 3.5rem; width:auto; height:auto; }

/* ---------- BANNER PODIO ---------- */
.prize-banner { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.prize-card {
  flex: 1; min-width: 150px;
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.prize-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.prize-1 { background: linear-gradient(135deg, #FFB81C, #E09600); color: #4a3500; }
.prize-2 { background: linear-gradient(135deg, #b9c2cc, #8c97a3); color: #2a2f35; }
.prize-medal  { font-size: 2rem; line-height: 1; }
.prize-label  { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .8; }
.prize-name   { font-family: 'Poppins'; font-weight: 800; font-size: 1.25rem; }
.prize-pts    { font-size: .85rem; font-weight: 600; opacity: .85; }
.prize-amount { font-family: 'Poppins'; font-size: 1.8rem; font-weight: 800; margin-top: 4px; }

/* ---------- RANKING ---------- */
.ranking-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: .18s;
}
.ranking-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-h); color: var(--ink); }
.ranking-card + .ranking-card { margin-top: 10px; }
.rank-pos {
  font-family: 'Poppins'; font-weight: 800; font-size: 1.2rem;
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--bg); color: var(--muted);
}
.ranking-card.is-1 .rank-pos { background: var(--wc-gold); color: #4a3500; }
.ranking-card.is-2 .rank-pos { background: #c2cad3; color: #2a2f35; }
.ranking-card.is-3 .rank-pos { background: #e8a87c; color: #5a2e10; }
.rank-name { flex: 1; font-weight: 700; font-size: 1.02rem; }
.rank-bar-wrap { flex: 1; }
.rank-pts { font-family:'Poppins'; font-weight: 800; font-size: 1.1rem; color: var(--wc-purple); }
.rank-prize { font-size: .8rem; font-weight: 700; color: var(--wc-green); }
.rank-chevron { color: var(--line); font-size: 1.2rem; }

/* ---------- AVATAR ---------- */
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  background: var(--line);
}
.avatar--lg { width: 84px; height: 84px; }

/* ---------- PARTIDOS ---------- */
.match-date-header {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--wc-grad-soft);
  color: #fff; font-weight: 700; font-size: .82rem;
  padding: 6px 14px; border-radius: 20px; margin: 18px 0 10px;
}
.match-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.match-card + .match-card { margin-top: 10px; }
.match-card.is-live { border-color: var(--wc-green); box-shadow: 0 0 0 2px rgba(6,167,125,.25), var(--shadow); }
.live-badge {
  position: absolute; top: 12px; right: 14px;
  background: var(--wc-green); color: #fff;
  font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 5px;
}
.live-dot { width: 7px; height: 7px; background: #fff; border-radius: 50%; animation: blink 1.2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }

.match-teams { display: flex; align-items: center; gap: 10px; }
.team-cell { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-weight: 600; }
.tc-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.team-cell--away .tc-info { align-items: flex-end; }
.owner-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .68rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.owner-tag i { font-size: .62rem; opacity: .7; }
.team-cell a { color: var(--ink); }
.team-cell a:hover { color: var(--wc-purple); }
.team-cell--away { justify-content: flex-end; text-align: right; }
.team-name-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-cell--highlight a { color: var(--wc-purple); font-weight: 800; }
.team-placeholder {
  color: var(--muted); font-style: italic; font-weight: 600;
  background: var(--bg); padding: 2px 9px; border-radius: 7px;
  border: 1px dashed var(--line); font-size: .85rem;
}

.match-score {
  font-family: 'Poppins'; font-weight: 800; font-size: 1.2rem;
  min-width: 64px; text-align: center;
  background: var(--bg); border-radius: 10px; padding: 4px 8px;
}
.match-score.vs { font-size: .85rem; color: var(--muted); font-weight: 700; background: transparent; }
.match-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: .78rem; color: var(--muted);
}
.match-time { color: var(--wc-pink); font-weight: 700; }
.match-meta i { opacity: .7; }

/* ---------- BADGES ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}
.chip-group { background: rgba(10,107,51,.12); color: var(--wc-pitch); }
.chip-stage { background: rgba(14,156,130,.14); color: var(--wc-teal); }
.chip-share { background: var(--wc-gold); color: #4a3500; }
.chip-link:hover { filter: brightness(.95); }

/* ---------- TABLA GRUPO ---------- */
.standings-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.standings-table { margin: 0; font-size: .9rem; }
.standings-table thead th {
  background: var(--wc-indigo); color: #fff;
  font-weight: 600; font-size: .78rem; text-align: center;
  border: none; padding: 10px 6px;
}
.standings-table tbody td { text-align: center; vertical-align: middle; border-color: var(--line); }
.standings-table .td-team { text-align: left; font-weight: 600; }
.standings-table .td-team a { color: var(--ink); display: flex; align-items: center; gap: 8px; }
.standings-table .td-pts { font-family: 'Poppins'; font-weight: 800; color: var(--wc-purple); }
.standings-table .td-pos { font-weight: 700; color: var(--muted); }
.row-1st { background: rgba(6,167,125,.12) !important; }
.row-2nd { background: rgba(6,167,125,.06) !important; }
.row-3rd { background: rgba(255,184,28,.12) !important; }
.qual-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .qual-dot.d1 { background: var(--wc-green); }
.legend .qual-dot.d2 { background: rgba(6,167,125,.5); }
.legend .qual-dot.d3 { background: var(--wc-gold); }

/* ---------- JUGADOR ---------- */
.player-hero {
  background: var(--wc-grad);
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-h);
  position: relative; overflow: hidden;
}
.player-hero::after {
  content:''; position:absolute; right:-30px; bottom:-40px;
  width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.10);
}
.player-hero .avatar--lg { border-color: rgba(255,255,255,.7); }
.player-hero h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.player-hero .total {
  font-family: 'Poppins'; font-size: 2.2rem; font-weight: 800; line-height: 1;
}
.player-hero .total small { font-size: .9rem; font-weight: 600; opacity: .85; }

.team-score-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.team-score-card + .team-score-card { margin-top: 12px; }
.team-score-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
}
.team-score-head:hover { background: var(--bg); }
.tsh-name { flex: 1; font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.tsh-pts {
  font-family:'Poppins'; font-weight: 800; font-size: 1.15rem;
  color: var(--wc-green);
}
.tsh-pts.zero { color: var(--muted); }
/* Desglose de partidos por equipo (en página de jugador) */
.team-matches { padding: 6px 12px 12px; }
.tm-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
  font-size: .87rem;
}
.tm-row:first-child { border-top: none; }
.tm-stage { justify-self: start; white-space: nowrap; }
.tm-rival { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.tm-rival .team-name-txt, .tm-rival { overflow: hidden; text-overflow: ellipsis; }
.tm-vs { color: var(--muted); font-weight: 500; font-size: .8rem; }
.tm-score { text-align: right; white-space: nowrap; font-family: 'Poppins'; }
.tm-score strong { font-size: 1rem; }
.tm-when { color: var(--muted); font-size: .76rem; font-weight: 500; }
.tm-pts {
  text-align: right; min-width: 48px; font-weight: 800; font-family: 'Poppins';
  color: var(--wc-green);
}
.tm-pts .tm-zero { color: var(--line); font-weight: 700; }
/* color del marcador según resultado */
.tm-win  .tm-score strong { color: var(--wc-green); }
.tm-draw .tm-score strong { color: var(--wc-gold-d); }
.tm-loss .tm-score strong { color: #c0392b; }
.tm-bonus { background: rgba(255,199,44,.10); border-radius: 8px; }
.chip-gold { background: var(--wc-gold); color: #4a3500; }
.tm-note { color: var(--muted); font-size: .78rem; text-align: center; padding: 8px 4px 2px; font-style: italic; }

.pts-breakdown { list-style: none; margin: 0; padding: 0 16px 12px; }
.pts-breakdown li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem;
}
.pts-label { color: var(--ink); }
.pts-value { font-weight: 700; color: var(--wc-green); }
.pts-note  { color: var(--muted); font-size: .8rem; justify-content: center !important; }
.pts-empty { padding: 0 16px 14px; color: var(--muted); font-size: .85rem; }

/* ---------- EQUIPO ---------- */
.team-hero {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.team-hero h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; }
.owner-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  min-width: 110px; color: var(--ink); transition: .15s;
}
.owner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.owner-name { font-weight: 700; font-size: .92rem; }

/* ---------- GRUPOS OVERVIEW ---------- */
.groups-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.group-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transition: .18s;
}
.group-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); }
.group-card-head {
  background: var(--wc-grad-soft); color: #fff;
  padding: 10px 16px; font-family: 'Poppins'; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.group-card-head a { color: #fff; }
.group-team-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; font-size: .88rem; color: var(--ink);
  border-top: 1px solid var(--line);
}
.group-team-row:hover { background: var(--bg); }
.group-team-row.qualify { background: rgba(6,167,125,.06); }
.gt-pos { width: 18px; color: var(--muted); font-weight: 700; font-size: .8rem; }
.gt-name { flex: 1; font-weight: 600; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.gt-pts { color: var(--muted); font-weight: 700; font-size: .82rem; }

/* ---------- FILTROS ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.filter-btn {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 7px 16px; font-size: .85rem; font-weight: 600;
  color: var(--ink); transition: .15s;
}
.filter-btn:hover { border-color: var(--wc-purple); color: var(--wc-purple); }
.filter-btn.active { background: var(--wc-grad); color: #fff; border-color: transparent; }

/* ---------- ACCESO RÁPIDO GRUPOS ---------- */
.quick-groups { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.quick-group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 4px; text-align: center;
  font-family: 'Poppins'; font-weight: 700; color: var(--wc-indigo);
  box-shadow: var(--shadow); transition: .15s;
}
.quick-group:hover { background: var(--wc-grad); color: #fff; transform: translateY(-2px); }

/* ---------- ADMIN ---------- */
.admin-badge { background: var(--wc-gold); color: var(--wc-indigo); font-weight: 700; padding: 3px 12px; border-radius: 20px; font-size: .8rem; }
.score-input { width: 56px; text-align: center; font-weight: 700; }
.import-output {
  background: #052e1c; color: #8FD14F; padding: 16px; border-radius: var(--radius);
  font-family: ui-monospace, monospace; font-size: .82rem; white-space: pre-wrap;
}
.wc-footer {
  background: var(--wc-indigo); color: rgba(255,255,255,.8);
  padding: 18px 0; font-size: .85rem; margin-top: 30px;
}
.wc-footer-admin { color: var(--wc-gold); font-weight: 600; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 575.98px) {
  .page-title { font-size: 1.4rem; }
  .player-hero .total { font-size: 1.8rem; }
  .quick-groups { grid-template-columns: repeat(3,1fr); }
  .team-name-txt { font-size: .92rem; }
}

/* ------- Estado de actualización de datos + aviso temporal ------- */
.data-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin: .25rem 0 1rem;
  font-size: .82rem;
  color: #6b7280;
}
.data-status .bi { opacity: .7; }

.data-refresh-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: var(--wc-grad);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 8px 24px rgba(5, 46, 28, .35);
  animation: toast-in .3s ease;
}
.data-refresh-toast.is-hiding {
  opacity: 0;
  transition: opacity .3s ease;
}
.data-refresh-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
