@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;600;700;800&display=swap');

/* ============================================================
   Porra Mundial 2026 — hoja de estilos única
   ============================================================ */
:root {
  --bg: #070b16;              /* noche de estadio */
  --surface: #101830;
  --surface-2: #182343;
  --border: #2a3658;
  --text: #eef1fa;
  --text-muted: #94a0c4;
  --red: #e8112d;             /* rojo Roja: ACCIÓN */
  --gold: #ffd255;            /* oro: PUNTOS y medallas */
  --green: #22b07d;           /* césped: ACIERTOS */
  --radius: 14px;
  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --grad-red: linear-gradient(135deg, #ff3554, #c80f2c);
  --grad-gold: linear-gradient(135deg, #ffe9a3, #ffd255 45%, #c9a23c);
  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 28px rgba(0,0,0,0.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-feature-settings: 'tnum';
  background:
    /* focos */
    radial-gradient(1100px 420px at 50% -120px, rgba(255, 210, 85, 0.1), transparent 70%),
    radial-gradient(900px 600px at 110% 10%, rgba(232, 17, 45, 0.08), transparent 65%),
    radial-gradient(900px 600px at -10% 30%, rgba(34, 176, 125, 0.06), transparent 65%),
    /* profundidad vertical: del palco al túnel */
    linear-gradient(180deg, #0c1228 0%, #080d1c 40%, #04060e 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

/* ---- Cabecera y navegación ---- */
header {
  text-align: center;
  padding: 28px 16px 8px;
}
header { position: relative; }
header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7em, 4.5vw, 2.5em);
  text-transform: uppercase;
  letter-spacing: 0.045em;
  line-height: 1.05;
  background: linear-gradient(112deg, #ffffff 30%, #ffe9a3 44%, var(--gold) 52%, #ffffff 66%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 14px rgba(255, 210, 85, 0.16));
  animation: title-shine 1.5s 0.15s cubic-bezier(0.3, 0.6, 0.3, 1) both;
}
@keyframes title-shine {
  from { background-position: 135% 0; opacity: 0; transform: translateY(6px); }
  to { background-position: 12% 0; opacity: 1; transform: none; }
}
header p { margin: 8px 0 0; color: var(--text-muted); font-size: 0.93em; letter-spacing: 0.01em; }

nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 14px;
  background: rgba(13, 15, 24, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-user { display: flex; align-items: center; gap: 8px; flex: none; }
.nav-name {
  color: var(--text-muted); font-size: 0.88em; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
nav a {
  white-space: nowrap;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}
nav a:hover { border-color: var(--gold); color: var(--text); }
nav a.active {
  background: var(--grad-red);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(232, 17, 45, 0.32), inset 0 1px 0 rgba(255,255,255,0.22);
}

main {
  position: relative; z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 16px 60px;
}
main.wide { max-width: 1180px; }
.header-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-align: left; max-width: 1180px; margin: 0 auto;
}
.header-bar h1 { margin-bottom: 2px; }
.mobile-hint { display: none; }

h2 {
  position: relative;
  font-size: 0.98em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 30px 0 8px;
  padding-left: 14px;
}
h2::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 1.05em; border-radius: 3px;
  background: linear-gradient(180deg, var(--red), var(--gold));
}
.note { color: var(--text-muted); font-size: 0.9em; margin: 0 0 14px; }
.empty { color: var(--text-muted); text-align: center; padding: 30px 0; }
.empty a { color: var(--gold); }

/* ---- Tarjetas ---- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0) 38%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.card.locked { opacity: 0.7; }

/* ---- Clasificación ---- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.rank { min-width: 38px; font-weight: 700; }
.name { font-weight: 600; flex: 1; min-width: 120px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.points {
  font-family: var(--font-display);
  font-size: 1.12em;
  min-width: 72px; text-align: right;
  background: var(--grad-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chip {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 2px 9px;
  font-size: 0.82em;
}
.chip-hit { background: var(--green); color: #fff; font-weight: 700; }
.chip-hidden, .chip-empty { color: var(--text-muted); }

/* ---- Partidos (predicción) ---- */
.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.badge { padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.95em; }
.badge-final { background: var(--green); color: #fff; }
.badge-locked { background: #8a6d00; color: #fff; }

.match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  font-weight: 600;
}
.match-row input {
  width: 58px;
  padding: 9px;
  text-align: center;
  font-size: 1.05em;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.match-row input:disabled { opacity: 0.5; }
.dash { color: var(--text-muted); }

/* ---- Selector de jugadores ---- */
.squad {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.player {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.15s;
}
.player:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.player.selected { background: var(--red); border-color: var(--gold); font-weight: 700; }
.player:disabled { opacity: 0.55; cursor: not-allowed; }

.counter {
  background: var(--surface-2);
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---- Formularios y botones ---- */
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.field-row label { font-size: 0.9em; color: var(--text-muted); }

input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95em;
}

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: var(--grad-red);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(232, 17, 45, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-small { padding: 8px 16px; margin-left: auto; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

/* ---- Toasts ---- */
#toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: linear-gradient(135deg, #2cc78f, #18936a);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: toast-in 0.25s ease;
}
.toast-error { background: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Móvil ---- */
@media (max-width: 560px) {
  .team { min-width: 105px; font-size: 0.9em; }
  .btn-small { margin-left: 0; width: 100%; }
}

/* ---- Landing ---- */
.landing { max-width: 640px; }
.hero ul { padding-left: 20px; }
.hero li { margin-bottom: 8px; line-height: 1.5; }
.auth-card form { margin: 0; }
.link {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}
.link:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Banner de estado del cierre ---- */
.banner {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
.banner-open { background: rgba(29, 158, 117, 0.15); border: 1px solid var(--green); }
.banner-locked { background: rgba(200, 16, 46, 0.15); border: 1px solid var(--red); }

/* ---- Grupos ---- */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.92em;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
}
.team-row:hover:not(:disabled) { border-color: var(--gold); }
.team-row:disabled { opacity: 0.55; cursor: not-allowed; }
.team-row.ranked { border-color: var(--gold); }
.team-row.auto-fourth { opacity: 0.75; }
.pos-badge {
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85em;
  color: var(--gold);
}
.team-row.auto-fourth .pos-badge { background: var(--surface); color: var(--text-muted); }

.btn-logout { margin-left: 8px; border-radius: 999px; padding: 9px 18px; font-weight: 600; }

/* ---- Medallas de posición en grupos ---- */
.pos-badge.pos-1 { background: #ffd700; color: #3a2f00; }
.pos-badge.pos-2 { background: #c4c9d4; color: #2a2f3a; }
.pos-badge.pos-3 { background: #cd7f32; color: #3a2208; }
.team-row .pos-badge.pos-4, .team-row.ranked .pos-badge:not(.pos-1):not(.pos-2):not(.pos-3) {
  background: var(--surface); color: var(--text-muted);
}
.chip.pos-chip-1 { background: #ffd700; color: #3a2f00; font-weight: 700; }
.chip.pos-chip-2 { background: #c4c9d4; color: #2a2f3a; font-weight: 700; }
.chip.pos-chip-3 { background: #cd7f32; color: #3a2208; font-weight: 700; }

/* ---- Eliminatorias ---- */
.round-card h3 { margin: 0 0 10px; font-size: 1.05em; }
.player.hit { outline: 2px solid var(--green); }
.champion-option { font-weight: 700; }
.position-block { margin-bottom: 16px; }
.position-block h4 { margin: 0 0 8px; color: var(--text-muted); font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.04em; }
.player small { opacity: 0.6; margin-left: 4px; }

/* ---- Clasificación clicable ---- */
button.row { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
button.row:hover { border-color: var(--gold); }

/* ---- Modal del visor ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  max-width: 720px; width: 100%; max-height: 85vh; overflow-y: auto;
  position: relative;
}
.modal h3 { margin-top: 0; }
.modal h4 { margin: 18px 0 8px; color: var(--gold); }
.modal-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.6em; cursor: pointer;
}
.viewer-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.viewer-group strong { min-width: 70px; }

/* ---- Cuadro de eliminatorias ---- */
#bracket { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.bracket-col {
  display: flex; flex-direction: column; justify-content: space-around;
  gap: 10px; min-width: 215px; flex-shrink: 0;
}
.bracket-round-label {
  text-align: center; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85em;
}
.bracket-match {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; position: relative;
}
.match-num {
  position: absolute; top: -8px; right: 8px; font-size: 0.7em;
  color: var(--text-muted); background: var(--bg); padding: 0 6px; border-radius: 6px;
}
.slot {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 9px; border-radius: 8px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-size: 0.88em;
  cursor: pointer; text-align: left;
}
.slot + .slot { margin-top: 4px; }
.slot:hover:not(:disabled):not(.slot-empty) { border-color: var(--gold); }
.slot:disabled { cursor: not-allowed; opacity: 0.7; }
.slot.winner { border-color: var(--gold); background: rgba(255, 215, 0, 0.12); font-weight: 700; }
.slot.winner.hit { border-color: var(--green); background: rgba(29, 158, 117, 0.18); }
.slot-empty { color: var(--text-muted); font-style: italic; cursor: default; }
.slot-label {
  min-width: 30px; font-size: 0.75em; color: var(--text-muted);
  font-weight: 700; font-style: normal;
}
.slot-name { flex: 1; }
.slot-tick { color: var(--gold); font-weight: 700; }
.slot.winner.hit .slot-tick { color: var(--green); }
.champion-box {
  background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius);
  padding: 22px 14px; text-align: center; font-size: 1.15em; font-weight: 800;
}
.champion-box.hit { border-color: var(--green); }
.champion-box.empty { border-style: dashed; border-color: var(--border); color: var(--text-muted); font-weight: 400; }

/* ---- Campo del XI (estilo diario) ---- */
.pitch-wrap { max-width: 560px; }
.pitch {
  position: relative; width: 100%; aspect-ratio: 3 / 4;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.06), transparent 32%),
    repeating-linear-gradient(0deg, #1e7a3c 0 12.5%, #1c7036 12.5% 25%);
  border: 2px solid rgba(255,255,255,0.45); border-radius: 12px; overflow: hidden;
}
.pitch-slot {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; color: #fff; z-index: 2;
  width: 92px;
}
.pitch-slot:disabled { cursor: not-allowed; opacity: 0.8; }
.pitch-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: 2px dashed rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.pitch-slot:hover:not(:disabled) .pitch-dot { transform: scale(1.12); }
.pitch-slot.filled .pitch-dot {
  background: var(--red); border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.pitch-name {
  font-size: 0.72em; font-weight: 700; text-align: center; line-height: 1.15;
  background: rgba(0,0,0,0.55); padding: 2px 7px; border-radius: 8px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modal-small { max-width: 420px; }
.picker-clear { border-color: var(--red); color: var(--red); }

/* ---- Fix: el atributo hidden manda sobre cualquier display ---- */
[hidden] { display: none !important; }

/* ---- Cuadro espejo (v2): 9 columnas, final en el centro, sin scroll ---- */
#bracket, #koResult {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}
.bcol { display: flex; flex-direction: column; min-width: 0; }
.bround {
  text-align: center; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72em;
  margin-bottom: 8px;
}
.bround-final { color: #ffd700; }
.bcol-matches {
  flex: 1; display: flex; flex-direction: column;
  justify-content: space-around; gap: 6px; min-height: 560px;
}
.bmatch {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; min-width: 0;
}
.bslot {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 7px; border-radius: 6px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  font-size: 0.8em; cursor: pointer; min-width: 0;
}
.bslot + .bslot { margin-top: 3px; }
.bslot:hover:not(:disabled):not(.bslot-empty) { border-color: var(--gold); }
.bslot:disabled { cursor: not-allowed; opacity: 0.7; }
.bslot.winner {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 210, 85, 0.2), rgba(255, 210, 85, 0.07));
  box-shadow: inset 0 0 0 1px rgba(255, 210, 85, 0.25);
  font-weight: 700;
}
.bslot.winner.hit { border-color: var(--green); background: rgba(29, 158, 117, 0.2); }
.bslot-empty { min-height: 29px; color: var(--text-muted); cursor: default; }
.bslot-label { font-size: 0.85em; color: var(--text-muted); font-weight: 700; }
.bslot-code { font-weight: 700; letter-spacing: 0.03em; }
.bslot-tick { margin-left: auto; color: var(--gold); font-weight: 700; }
.bslot.winner.hit .bslot-tick { color: var(--green); }
.bcol-center .bmatch { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 215, 0, 0.15); }
.bcol-center .bcol-matches { justify-content: center; gap: 12px; }
.bchampion {
  border: 2px solid var(--gold); border-radius: 8px; padding: 12px 6px;
  text-align: center; font-weight: 800; font-size: 0.92em;
  background: rgba(255, 215, 0, 0.08);
}
.bchampion.hit { border-color: var(--green); background: rgba(29, 158, 117, 0.15); }
.bchampion.empty {
  border-style: dashed; border-color: var(--border);
  color: var(--text-muted); font-weight: 400;
}
#bracket, #koResult { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
@media (max-width: 1100px) {
  .bslot { font-size: 0.72em; padding: 5px 5px; gap: 4px; }
  .bround { font-size: 0.62em; }
  .bcol-matches { min-height: 480px; }
}
@media (max-width: 900px) {
  /* En pantallas estrechas el cuadro NO encoge más: se desliza. */
  #bracket > .bcol, #koResult > .bcol { min-width: 96px; flex: none; }
  #bracket > .bcol-center, #koResult > .bcol-center { min-width: 168px; }
  .bslot { font-size: 0.74em; padding: 6px 5px; }
  .bchampion { font-size: 0.82em; }
  .bcol-matches { min-height: 440px; }
  .mobile-hint { display: block; }
}

/* ---- Mejores terceros: tabla ---- */
.thirds-table {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; max-width: 640px;
}
.thirds-head, .thirds-row {
  display: grid;
  grid-template-columns: 48px 1fr 64px 40px;
  align-items: center; gap: 8px; padding: 9px 14px;
}
.thirds-head {
  font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.thirds-row {
  width: 100%; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 0.95em; cursor: pointer; text-align: left;
}
.thirds-row:last-child { border-bottom: none; }
.thirds-row:hover:not(:disabled) { background: var(--surface-2); }
.thirds-row:disabled { cursor: not-allowed; opacity: 0.6; }
.thirds-row.selected { background: rgba(255, 215, 0, 0.1); }
.thirds-pos {
  width: 26px; height: 26px; border-radius: 6px; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85em;
}
.thirds-row.selected .thirds-pos { background: var(--gold); color: #3a2f00; }
.thirds-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.thirds-group {
  justify-self: center; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 9px; font-size: 0.82em; font-weight: 700; color: var(--text-muted);
}
.thirds-check { color: var(--gold); font-weight: 800; text-align: center; }

/* ---- Aciertos en verde por todas partes ---- */
.chip-hit { background: rgba(29, 158, 117, 0.25) !important; border: 1px solid var(--green); }
.team-row.hit { border-color: var(--green); background: rgba(29, 158, 117, 0.12); }
.thirds-check.hit { color: var(--green); font-size: 1.1em; }
.card.match.hit { border-color: var(--green); }
.badge-hit { background: var(--green); color: #06281c; font-weight: 700; padding: 3px 10px; border-radius: 999px; font-size: 0.8em; }
.pitch-slot.hit .pitch-dot { background: var(--green); border-color: #fff; }

/* ---- Etiquetas de puntos ---- */
.pts-tag {
  background: rgba(255, 215, 0, 0.14); border: 1px solid var(--gold);
  color: var(--gold); border-radius: 999px; padding: 1px 9px;
  font-size: 0.78em; font-weight: 700; margin-left: 6px; white-space: nowrap;
}
.bpts { text-align: center; font-size: 0.68em; color: var(--text-muted); margin: -4px 0 6px; }

/* ---- Picker en cascada ---- */
.picker-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.crumb {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--gold);
  border-radius: 999px; padding: 4px 12px; font-size: 0.85em; cursor: pointer;
}
.crumb:hover { border-color: var(--gold); }
.crumb-sep { color: var(--text-muted); }
.picker-list { max-height: 55vh; overflow-y: auto; }
.picker-step { width: 100%; justify-content: space-between; display: flex; }
.award-row .award-pick { flex: 1; text-align: left; }

/* ---- Resultados oficiales: comparación real vs tuya ---- */
.compare-card.pending { opacity: 0.7; }
.compare-head, .compare-row {
  display: grid;
  grid-template-columns: 32px 1fr 1fr;
  gap: 8px; align-items: center;
}
.compare-head {
  font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 2px 4px 6px;
}
.compare-row {
  padding: 7px 4px; border-radius: 8px; font-size: 0.9em;
  border: 1px solid transparent; margin-bottom: 4px;
}
.compare-row.hit { border-color: var(--green); background: rgba(29, 158, 117, 0.12); }
.compare-team, .compare-mine { display: flex; align-items: center; gap: 7px; min-width: 0; }
.compare-mine { color: var(--text-muted); }
.compare-row.hit .compare-mine { color: var(--text); }
.hit-pts {
  background: var(--green); color: #06281c; border-radius: 999px;
  padding: 1px 8px; font-size: 0.78em; font-weight: 800; margin-left: auto;
}
.vs-block { margin-bottom: 14px; }
.vs-block:last-child { margin-bottom: 0; }
.vs-block strong { display: block; margin-bottom: 6px; }
.vs-block .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.compare-real { opacity: 0.75; margin-bottom: 4px; }
.vs-sep { color: var(--text-muted); font-size: 0.85em; }


/* ============ Responsive: tablet y móvil ============ */
@media (max-width: 760px) {
  main.wide { padding-left: 10px; padding-right: 10px; }
  .header-bar { padding-left: 4px; padding-right: 4px; }
}

@media (max-width: 620px) {
  /* Tipografía y toque: inputs a 16px (sin zoom forzado en iOS), dianas amplias */
  input, select, button { font-size: 16px; }
  .btn { padding: 11px 18px; min-height: 42px; }
  .btn-small { min-height: 36px; padding: 8px 12px; }
  nav { padding: 8px 10px; }
  nav a { padding: 8px 12px; font-size: 0.92em; }
  .nav-name { display: none; }

  header { padding: 18px 12px 4px; }
  header h1 { font-size: 1.45em; }
  header p { font-size: 0.92em; }
  main { padding: 6px 10px 70px; }
  h2 { font-size: 1.15em; }

  .card { padding: 14px 12px; }
  .row { padding: 11px 12px; gap: 9px; }
  .chip { font-size: 0.8em; }

  .modal { padding: 16px 12px; max-height: 88vh; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .picker-list { max-height: 62vh; }

  .thirds-head, .thirds-row {
    grid-template-columns: 36px 1fr 52px 30px;
    padding: 8px 10px; font-size: 0.9em; gap: 6px;
  }

  .match-row input { width: 56px; }
  .match-row .btn { flex: 1 1 100%; }

  .pitch-wrap { max-width: 100%; }
  .pitch-slot { width: 74px; }
  .pitch-name { font-size: 0.62em; padding: 2px 5px; }

  .compare-head, .compare-row {
    grid-template-columns: 26px 1fr 1fr;
    gap: 6px; font-size: 0.86em;
  }
  .hit-pts { padding: 1px 6px; font-size: 0.72em; }

  .viewer-group { font-size: 0.92em; }
  .groups-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .groups-grid { grid-template-columns: 1fr; }
  .pitch-slot { width: 66px; }
}


/* ---- Pestañas con descriptor de lo que hacen ---- */
.nav-tabs a {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; padding: 7px 14px; line-height: 1.15;
}
.tab-t { font-weight: 700; }
.tab-s { font-size: 0.66em; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.nav-tabs a.active .tab-s { color: inherit; opacity: 0.85; }
@media (max-width: 620px) {
  .nav-tabs a { padding: 6px 10px; }
  .tab-s { font-size: 0.6em; }
}

/* ---- Página de inicio: guía ---- */
.guide-rules p { margin: 8px 0; }
.guide-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px; margin-top: 14px;
}
.guide-card { display: flex; flex-direction: column; }
.guide-card h2 { margin: 0 0 8px; }
.guide-card p { margin: 0 0 10px; font-size: 0.94em; }
.guide-points { margin-top: auto; }
.guide-cta {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; margin-top: 12px;
}
@media (max-width: 620px) {
  .guide-grid { grid-template-columns: 1fr; }
}

/* ============ Acabado de estadio ============ */

/* Firma: el círculo central del campo bajo cada cabecera */
header:not(.header-bar) { padding-bottom: 30px; }
header:not(.header-bar)::before {
  content: '';
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(460px, 78%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 16%, var(--border) 84%, transparent);
}
header:not(.header-bar)::after {
  content: '';
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--bg), 0 0 14px rgba(255, 210, 85, 0.35);
}

/* Medallas metálicas de verdad (grupos, viewer y terceros) */
.pos-badge.pos-1, .chip.pos-chip-1 {
  background: var(--grad-gold) !important;
  color: #3c2c00 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 2px 8px rgba(255, 210, 85, 0.3);
}
.pos-badge.pos-2, .chip.pos-chip-2 {
  background: linear-gradient(135deg, #f2f5fb, #b9c3d8 55%, #8d99b5) !important;
  color: #232c40 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.pos-badge.pos-3, .chip.pos-chip-3 {
  background: linear-gradient(135deg, #f0b27e, #c97c3e 55%, #9a5a26) !important;
  color: #381f06 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Podio de la clasificación: el raíl codifica el puesto real */
#leaderboard .row:nth-child(1) {
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, rgba(255, 210, 85, 0.09), rgba(255,255,255,0.01) 55%), var(--surface);
}
#leaderboard .row:nth-child(2) {
  border-left: 4px solid #b9c3d8;
  background: linear-gradient(90deg, rgba(185, 195, 216, 0.07), rgba(255,255,255,0.01) 55%), var(--surface);
}
#leaderboard .row:nth-child(3) {
  border-left: 4px solid #c97c3e;
  background: linear-gradient(90deg, rgba(201, 124, 62, 0.08), rgba(255,255,255,0.01) 55%), var(--surface);
}
#leaderboard .row { transition: transform 0.15s, border-color 0.15s; }
#leaderboard .row:hover { transform: translateX(3px); border-color: var(--gold); }

/* La ÚNICA animación de la casa: barrido metálico sobre el campeón */
.bchampion:not(.empty) { position: relative; overflow: hidden; }
.bchampion:not(.empty)::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -75%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: sheen 5.5s ease-in-out infinite;
}
@keyframes sheen {
  0%, 64% { left: -75%; }
  82%, 100% { left: 130%; }
}

/* Marcador de rondas del cuadro */
.bround {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.bround-final {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* Aciertos que brillan en su justa medida */
.chip-hit { box-shadow: 0 0 12px rgba(34, 176, 125, 0.32); }
.team-row.hit, .card.match.hit { box-shadow: inset 0 0 0 1px rgba(34, 176, 125, 0.35), 0 0 16px rgba(34, 176, 125, 0.12); }

/* Campo: huecos rellenos en oro, vacíos invitando */
.pitch-slot.filled .pitch-dot {
  border-style: solid;
  border-color: var(--gold);
  background: radial-gradient(circle at 32% 28%, rgba(255, 233, 163, 0.55), rgba(255, 210, 85, 0.22) 60%);
  box-shadow: 0 0 12px rgba(255, 210, 85, 0.35);
}
.pitch-slot:hover:not(:disabled) .pitch-dot { transform: scale(1.08); }

/* Inputs y foco: suelo de calidad */
input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], select { transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(255, 210, 85, 0.18); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: rgba(255, 210, 85, 0.35); }

/* Barra de scroll a juego */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Landing con presencia */
.landing .btn { padding: 13px 26px; font-size: 1.02em; }
.landing .hero strong { color: var(--gold); }

/* Quien pide calma, calma */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ============ Capa MOLÓN: atmósfera, entradas y recompensas ============ */

/* Atmósfera: tres focos de estadio derivando muy despacio */
body::before {
  content: '';
  position: fixed; inset: -30%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(46% 42% at var(--orb1, 16% 22%), rgba(232, 17, 45, 0.17), transparent 64%),
    radial-gradient(50% 46% at 84% 74%, rgba(255, 210, 85, 0.15), transparent 64%),
    radial-gradient(44% 40% at 56% 4%, rgba(34, 176, 125, 0.12), transparent 64%),
    radial-gradient(60% 30% at 30% 96%, rgba(255, 236, 180, 0.06), transparent 70%);
  filter: blur(14px);
  animation:
    drift 24s ease-in-out infinite alternate,
    aurora 9s ease-in-out infinite;
}
@keyframes drift {
  to { transform: translate3d(6%, 7%, 0) rotate(5deg) scale(1.09); }
}
@keyframes aurora {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Cada página, su atmósfera: el primer foco cambia de sitio y de alma */
.page-grupos::before { --orb1: 16% 22%; }
.page-espana::before {
  background:
    radial-gradient(52% 48% at 24% 18%, rgba(232, 17, 45, 0.24), transparent 64%),
    radial-gradient(50% 46% at 84% 74%, rgba(255, 210, 85, 0.13), transparent 64%),
    radial-gradient(44% 40% at 56% 4%, rgba(255, 236, 180, 0.07), transparent 64%);
  filter: blur(14px);
}
.page-eliminatorias::before, .page-premios::before {
  background:
    radial-gradient(52% 48% at 50% 12%, rgba(255, 210, 85, 0.2), transparent 64%),
    radial-gradient(46% 42% at 12% 78%, rgba(232, 17, 45, 0.13), transparent 64%),
    radial-gradient(44% 40% at 88% 66%, rgba(34, 176, 125, 0.1), transparent 64%);
  filter: blur(14px);
}
.page-grupos::before, .page-resultados::before {
  background:
    radial-gradient(52% 48% at 78% 20%, rgba(34, 176, 125, 0.18), transparent 64%),
    radial-gradient(48% 44% at 14% 70%, rgba(255, 210, 85, 0.14), transparent 64%),
    radial-gradient(44% 40% at 60% 96%, rgba(232, 17, 45, 0.09), transparent 64%);
  filter: blur(14px);
}
header { z-index: 1; }

/* El anillo del círculo central respira */
header:not(.header-bar)::after { animation: ring-pulse 4.2s ease-in-out infinite; }
@keyframes ring-pulse {
  50% { box-shadow: 0 0 0 5px var(--bg), 0 0 24px rgba(255, 210, 85, 0.65); }
}

/* Entrada orquestada: el contenido sube al aparecer, en cascada */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.card, #leaderboard .row {
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
:is(.card, #leaderboard .row):nth-child(2) { animation-delay: 0.06s; }
:is(.card, #leaderboard .row):nth-child(3) { animation-delay: 0.12s; }
:is(.card, #leaderboard .row):nth-child(4) { animation-delay: 0.18s; }
:is(.card, #leaderboard .row):nth-child(5) { animation-delay: 0.24s; }
:is(.card, #leaderboard .row):nth-child(6) { animation-delay: 0.3s; }
:is(.card, #leaderboard .row):nth-child(n+7) { animation-delay: 0.36s; }

/* Modales: el visor entra con presencia */
.modal-overlay:not([hidden]) { animation: overlay-in 0.2s ease-out both; }
.modal-overlay:not([hidden]) .modal { animation: modal-pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes overlay-in { from { opacity: 0; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Recompensas: los aciertos hacen POP al nacer */
@keyframes hit-pop {
  0% { transform: scale(0.82); }
  62% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.chip-hit { animation: rise 0.4s ease-out both, hit-pop 0.45s 0.05s ease-out both; }
.bslot-tick { display: inline-block; animation: hit-pop 0.3s ease-out both; }
.hit-pts { animation: hit-pop 0.4s ease-out both; }

/* La medalla de oro centellea (como el campeón, en pequeño) */
.pos-badge.pos-1, .chip.pos-chip-1 { position: relative; overflow: hidden; }
.pos-badge.pos-1::after, .chip.pos-chip-1::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -80%;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: sheen 6s 1.2s ease-in-out infinite;
}

/* El campo respira oro en los huecos rellenos */
.pitch-slot.filled .pitch-dot { animation: dot-breathe 3.4s ease-in-out infinite; }
@keyframes dot-breathe {
  50% { box-shadow: 0 0 20px rgba(255, 210, 85, 0.6); }
}

/* Botones: el degradado se desplaza bajo el dedo */
.btn { background-size: 170% 100%; background-position: 8% 0; }
.btn:hover:not(:disabled) { background-position: 55% 0; }
.btn { transition: transform 0.15s, box-shadow 0.15s, filter 0.15s, background-position 0.35s; }

/* Toast con rebote */
@keyframes toast-in {
  0% { opacity: 0; transform: translateY(16px) scale(0.92); }
  70% { transform: translateY(-3px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

/* Pestaña activa con halo vivo */
nav a.active { animation: tab-glow 3.6s ease-in-out infinite; }
@keyframes tab-glow {
  50% { box-shadow: 0 6px 22px rgba(232, 17, 45, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
}

/* ============ Pulido fino: estadio en cada detalle (solo estilo) ============ */

/* Grano de transmisión: el toque que quita lo "plano" a cualquier oscuro */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Secciones: la barra ya estaba; ahora la línea que corre hasta el borde */
h2 { display: flex; align-items: center; gap: 12px; }
h2::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent 85%);
}

/* Nav: destello dorado en la línea inferior */
nav::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(255, 210, 85, 0.4), transparent 92%);
}

/* Tarjetas con presencia: respiran al pasar por encima */
.card { transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 210, 85, 0.3);
  box-shadow: var(--shadow-card), 0 14px 36px rgba(0, 0, 0, 0.35);
}
.card.locked:hover { transform: none; border-color: var(--border); }

/* Chips de cristal */
.chip {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Inputs con hondura */
input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], select {
  background: linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0)) , var(--surface-2);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.28);
}

/* Modales de gala: anillo dorado y sombra de palco */
.modal {
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 210, 85, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---- EL CUADRO, vestido de torneo ---- */

/* Cada cruce es una tarjetita con relieve */
.bmatch {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0) 45%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bmatch:hover { border-color: rgba(255, 210, 85, 0.35); }

/* Slots: el elegido se viste de ORO con tinta oscura; el descartado se apaga */
.bslot { border-radius: 7px; transition: background 0.18s, opacity 0.18s, transform 0.12s; }
.bslot:hover:not(:disabled):not(.winner) { background: rgba(255, 255, 255, 0.06); transform: translateX(1px); }
.bslot.winner {
  background: var(--grad-gold);
  border-color: transparent;
  color: #2e2300;
  box-shadow: 0 2px 10px rgba(255, 210, 85, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.bslot.winner .bslot-code { color: #2e2300; font-weight: 800; }
.bslot.winner .bslot-tick { color: #2e2300; }
.bmatch:has(.bslot.winner) .bslot:not(.winner):not(.bslot-empty) { opacity: 0.5; }
.bmatch:has(.bslot.winner) .bslot:not(.winner):hover { opacity: 1; }

/* Huecos por decidir: fantasma con su etiqueta de procedencia */
.bslot-empty {
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 7px;
}
.bslot-label { letter-spacing: 0.08em; font-weight: 700; opacity: 0.55; font-size: 0.92em; }

/* Rótulos de ronda: placa con regla dorada */
.bround {
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(255, 210, 85, 0.45), transparent) 1;
}

/* Etiquetas de puntos: píldoras de oro discretas */
.bpts {
  width: fit-content;
  margin-left: auto; margin-right: auto;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 85, 0.3);
  background: rgba(255, 210, 85, 0.08);
  color: var(--gold);
}

/* La columna de la FINAL bajo su foco */
.bcol-center {
  background: radial-gradient(58% 42% at 50% 26%, rgba(255, 210, 85, 0.1), transparent 72%);
  border-radius: 14px;
}
.bcol-center .bmatch { box-shadow: 0 0 22px rgba(255, 210, 85, 0.16), 0 4px 14px rgba(0, 0, 0, 0.3); }

/* Podio con metal de verdad */
.bchampion {
  border-width: 1.5px;
  background: linear-gradient(180deg, rgba(255, 210, 85, 0.14), rgba(255, 210, 85, 0.04)), var(--surface);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.bchampion.empty { background: var(--surface); box-shadow: none; }

.pitch { box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.4), 0 14px 36px rgba(0, 0, 0, 0.4); }

/* ---- Detalles de cada página ---- */

/* Cabeceras de grupo con su regla */
.group-head { padding-bottom: 6px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: 8px; }

/* Comparativas de resultados: cebra suave para leer en diagonal */
.compare-row:nth-child(even):not(.hit) { background: rgba(255, 255, 255, 0.018); }

/* El aviso de deslizar, como una señal de banda */
.mobile-hint {
  width: fit-content;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

/* Botón fantasma que se enciende */
.btn-ghost { transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s; }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); background: rgba(255, 210, 85, 0.07); }

/* El ACIERTO manda sobre el oro: verde de campeón confirmado */
.bslot.winner.hit {
  background: linear-gradient(135deg, #36d69c, #1a9c6e);
  color: #06281c;
  box-shadow: 0 2px 12px rgba(34, 176, 125, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.bslot.winner.hit .bslot-code, .bslot.winner.hit .bslot-tick { color: #06281c; }


/* ============ Feedback de click: el botón responde al dedo ============ */
:is(button, .guide-cta):not(:disabled):not(.pitch-slot):active {
  transform: scale(0.93);
  transition: transform 0.05s;
}
@keyframes tap-fx {
  0% { transform: scale(0.92); }
  35% { transform: scale(1.06) translateX(-1.5px); }
  58% { transform: scale(0.99) translateX(2px); }
  78% { transform: scale(1.01) translateX(-1px); }
  100% { transform: none; }
}
.tap-fx:not(.pitch-slot) { animation: tap-fx 0.32s cubic-bezier(0.3, 0.9, 0.35, 1.3); }

/* Los huecos del campo se posicionan con transform: vibra el balón, no el hueco */
.pitch-slot:not(:disabled):active .pitch-dot { transform: scale(0.82); transition: transform 0.05s; }
.pitch-slot.tap-fx .pitch-dot { animation: tap-fx 0.32s cubic-bezier(0.3, 0.9, 0.35, 1.3); }

/* El 4º también con su placa (grafito, que medalla no hay) */
.pos-badge.pos-4, .chip.pos-chip-4 {
  background: linear-gradient(135deg, #58627f, #39415c 60%) !important;
  color: #d7ddef !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Visor: cruces A vs B */
.vmatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-top: 6px; }
.vmatch {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.86em;
}
.vside { display: inline-flex; align-items: center; gap: 5px; opacity: 0.55; min-width: 0; }
.vside .fi { flex: none; }
.vmatch .vs { color: var(--text-muted); font-size: 0.78em; font-weight: 700; }
.vpick {
  opacity: 1; font-weight: 800; color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 210, 85, 0.35);
}
.vpick.vhit { color: #4ee3a8; text-shadow: 0 0 14px rgba(34, 176, 125, 0.5); }
.viewer-round strong { display: block; margin-bottom: 2px; }
.podio-tag { margin: 0 2px 0 8px; }
@media (max-width: 620px) {
  .vmatches { grid-template-columns: 1fr; }
}

/* ============ Belleza nivel 3 ============ */

/* Clasificación: el puesto manda — tipografía de marcador y medallas con aura */
#leaderboard .rank {
  font-family: var(--font-display);
  font-size: 1.25em;
  min-width: 44px; text-align: center;
}
#leaderboard .row:nth-child(1) .rank { font-size: 1.5em; filter: drop-shadow(0 0 10px rgba(255, 210, 85, 0.55)); }
#leaderboard .row:nth-child(2) .rank { font-size: 1.4em; filter: drop-shadow(0 0 9px rgba(185, 195, 216, 0.5)); }
#leaderboard .row:nth-child(3) .rank { font-size: 1.4em; filter: drop-shadow(0 0 9px rgba(201, 124, 62, 0.5)); }
#leaderboard .row:nth-child(n+4) .rank {
  background: linear-gradient(180deg, #cdd6ee, #8b97b8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
#leaderboard .name { font-weight: 800; letter-spacing: 0.01em; }

/* Subtítulos de cabecera con aire editorial */
header:not(.header-bar) p {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7em;
  color: rgba(255, 210, 85, 0.72);
}

/* Estados "elegido": oro con tinta, en cualquier lista */
.player.selected, .thirds-row.selected .thirds-check {
  background: var(--grad-gold);
  color: #2e2300;
  border-color: transparent;
  font-weight: 800;
}
.thirds-row.selected {
  box-shadow: inset 3px 0 0 var(--gold);
  background: linear-gradient(90deg, rgba(255, 210, 85, 0.1), transparent 60%);
}

/* Botones: barrido de luz al pasar (una pasada, elegante) */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-160%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.btn:hover:not(:disabled)::after { transform: translateX(280%); }

/* Chips que saludan */
.chip { transition: transform 0.15s, border-color 0.15s; }
.chip:hover { transform: translateY(-1px); border-color: rgba(255, 210, 85, 0.35); }
.chip .hit-pts { font-size: 0.72em; padding: 0 7px; margin-left: 5px; }
.vside .hit-pts { font-size: 0.7em; padding: 0 6px; margin-left: 5px; }

/* Visor: secciones separadas con costura */
.viewer-group + .viewer-group {
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
  padding-top: 11px; margin-top: 11px;
}
.podio-tag.podio-4 {
  font-family: var(--font-display);
  font-size: 0.8em;
  color: var(--text-muted);
}

/* Cruces del visor que responden */
.vmatch { transition: border-color 0.15s, background 0.15s; }
.vmatch:hover { border-color: rgba(255, 210, 85, 0.3); background: rgba(255, 255, 255, 0.05); }

/* Banner del cierre como rótulo de estadio */
.banner:not(:empty) {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}

/* Vacíos con elegancia */
.empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

/* Códigos del cuadro con respiración */
.bslot-code { letter-spacing: 0.07em; }

/* El cursor escribe en oro */
input, select, textarea { caret-color: var(--gold); }
input::placeholder { color: rgba(148, 160, 196, 0.55); font-style: italic; }

/* ============ 1000/10: remates ============ */


/* Sumas de sección del visor: píldoras de botín */
.sec-pts {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.62em;
  vertical-align: middle;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 176, 125, 0.25), rgba(34, 176, 125, 0.1));
  border: 1px solid rgba(34, 176, 125, 0.5);
  color: #5ce8ad;
  letter-spacing: 0.04em;
}
.sec-sub { font-size: 0.7em; color: var(--text-muted); font-weight: 600; margin-left: 4px; }
.viewer-group strong .sec-pts { font-size: 0.72em; padding: 1px 8px; }
#viewerBody h4 { display: flex; align-items: center; gap: 8px; }

/* El visor estrena cabecera de gala */
#viewerModal h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.3em;
  background: linear-gradient(112deg, #fff 35%, var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Acento superior en los modales */
.modal { box-shadow: inset 0 3px 0 var(--red), 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 210, 85, 0.14); }


/* La llamada a la acción de la landing late suave */
.landing .btn:not(.btn-ghost) { animation: cta-breathe 3s ease-in-out infinite; }
@keyframes cta-breathe {
  50% { box-shadow: 0 7px 28px rgba(232, 17, 45, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

/* ---- Autoguardado: el chivato ---- */
.autosave {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 26px; font-size: 0.84em; color: var(--text-muted);
  transition: color 0.2s;
}
.autosave.saving::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  animation: save-pulse 0.9s ease-in-out infinite;
}
@keyframes save-pulse { 50% { opacity: 0.25; transform: scale(0.7); } }
.autosave.saved { color: #5ce8ad; font-weight: 700; }
.autosave.error { color: #ff7b8f; font-weight: 700; }
.autosave.idle { font-style: italic; }


/* ============ Precioso: la pasada final ============ */

/* Halo que late detrás de cada título */
header:not(.header-bar) h1 { position: relative; }
header:not(.header-bar) h1::before {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 130%; height: 220%;
  transform: translate(-50%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 210, 85, 0.16), transparent 70%);
  filter: blur(8px);
  z-index: -1;
  animation: halo 5.5s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* El sol recorre el césped */
.pitch::before {
  content: '';
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 230, 0.09) 48%, transparent 64%);
  background-size: 280% 100%;
  animation: pitch-sun 13s ease-in-out infinite;
}
@keyframes pitch-sun {
  0% { background-position: 120% 0; }
  55%, 100% { background-position: -120% 0; }
}

/* Nav más de cristal */
nav { backdrop-filter: blur(14px) saturate(1.25); background: rgba(11, 14, 25, 0.78); }

/* Enlaces del contenido en oro, con su subrayado fino */
main a:not(.btn):not(.guide-cta):not(.row) {
  color: var(--gold);
  text-decoration-color: rgba(255, 210, 85, 0.45);
  text-underline-offset: 3px;
}
main a:not(.btn):not(.guide-cta):not(.row):hover { text-decoration-color: var(--gold); }

/* ============ La tanda final ============ */

/* Botón "Siguiente" al pie de cada página: navegación de pulgar */
.next-page {
  display: block;
  margin: 26px auto 6px;
  max-width: 420px;
  text-align: center;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 210, 85, 0.35);
  background: linear-gradient(135deg, rgba(255, 210, 85, 0.1), rgba(255, 210, 85, 0.03));
  color: var(--gold) !important;
  font-weight: 800;
  text-decoration: none !important;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.next-page:hover { transform: translateY(-1px); border-color: var(--gold); background: rgba(255, 210, 85, 0.15); }

/* Créditos */
footer.credits {
  position: relative; z-index: 1;
  text-align: center;
  padding: 18px 0 26px;
  color: var(--text-muted);
  font-size: 0.82em;
}
footer.credits a { color: var(--gold); text-underline-offset: 3px; }

/* Progreso en la guía de inicio */
.status-chip {
  display: inline-block;
  font-size: 0.55em;
  vertical-align: middle;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-chip.ok { background: rgba(34, 176, 125, 0.18); border: 1px solid rgba(34, 176, 125, 0.55); color: #5ce8ad; }
.status-chip.todo { background: rgba(255, 180, 60, 0.14); border: 1px solid rgba(255, 180, 60, 0.5); color: #ffc56b; }
.guide-card.guide-ok { box-shadow: inset 3px 0 0 #2cc98a; }
.guide-card.guide-todo { box-shadow: inset 3px 0 0 rgba(255, 180, 60, 0.7); }
.guide-progress { margin-top: -6px; font-variant-numeric: tabular-nums; }

/* El vestuario (chat) */
.chat-card { display: flex; flex-direction: column; }
.chat-list {
  max-height: 56vh; min-height: 280px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 6px 10px 2px;
}
.chat-msg { max-width: 78%; align-self: flex-start; }
.chat-msg.mine { align-self: flex-end; text-align: right; }
.chat-meta { font-size: 0.72em; color: var(--text-muted); margin-bottom: 3px; }
.chat-bubble {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}
.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, rgba(232, 17, 45, 0.3), rgba(232, 17, 45, 0.16));
  border-color: rgba(232, 17, 45, 0.45);
  border-radius: 14px 14px 4px 14px;
}
.chat-compose { display: flex; gap: 8px; margin-top: 12px; }
.chat-compose input { flex: 1; }
.chat-note { margin-bottom: 0; }

/* Picker de selecciones (Zamora) */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.team-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.team-pick:hover { border-color: rgba(255, 210, 85, 0.45); transform: translateY(-1px); }
.team-pick.selected { background: var(--grad-gold); color: #2e2300; font-weight: 800; border-color: transparent; }
.team-pick.team-clear { grid-column: 1 / -1; justify-content: center; color: var(--text-muted); }

/* Panel de visualizaciones del admin */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-box {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}
.stat-num { font-family: var(--font-display); font-size: 1.7em; color: var(--gold); }
.stat-label { font-size: 0.76em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stats-h { margin: 16px 0 8px; font-size: 0.95em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.bars { display: flex; gap: 5px; align-items: flex-end; height: 96px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--grad-gold); box-shadow: 0 0 10px rgba(255, 210, 85, 0.25); }
.bar-label { font-size: 0.66em; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .stats-cols { grid-template-columns: 1fr; } }
.stat-row { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); font-size: 0.9em; }
.live-feed { max-height: 200px; overflow-y: auto; font-size: 0.85em; }
.feed-row { padding: 4px 2px; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.feed-time { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* ---- El cuadro vacío respira a lo ancho ---- */
#bracket > .empty {
  flex: 1 1 100%;
  max-width: 620px;
  margin: 8px auto;
}

/* ---- Chat flotante ---- */
.chat-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--grad-red);
  color: #fff;
  font-size: 1.45em;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 8px 26px rgba(232, 17, 45, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 32px rgba(232, 17, 45, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22); }

.chat-panel {
  position: fixed;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 210, 85, 0.22);
  background: rgba(13, 17, 30, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 3px 0 var(--red), 0 24px 60px rgba(0, 0, 0, 0.65);
  z-index: 160;
  animation: panel-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transform-origin: bottom right;
}
@keyframes panel-pop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
}
.chat-panel[hidden] { display: none; }
.chat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.chat-panel-close { font-size: 1.05em; }
.chat-panel .chat-list { flex: 1; min-height: 0; max-height: none; }
.chat-panel .chat-compose { margin-top: 8px; }
.version { color: rgba(255, 210, 85, 0.55); font-variant-numeric: tabular-nums; }
