:root {
  --pitch: #3a7d44;
  --pitch-deep: #2a5f33;
  --pitch-darker: #1f4828;
  --pitch-light: #5ba169;
  --pitch-soft: #e8f3ea;
  --pitch-mist: #f4f9f5;
  --chalk: #fafaf7;
  --paper: #ffffff;
  --ink: #0e1a12;
  --ink-soft: #4a5a52;
  --ink-muted: #8a9690;
  --accent: #d4f56a;
  --warm: #f4a261;
  --gold: #e9b949;
  --danger: #c45a4a;
  --danger-soft: #fde8e5;
  --border: #e8ebe9;
  --border-soft: #f0f3f1;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Montserrat', sans-serif; }
html, body {
  background: var(--chalk);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ===== SPLASH ===== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--chalk);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s;
}
.splash.fade { opacity: 0; pointer-events: none; }
.splash-logo {
  display: flex; align-items: center; gap: 14px;
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.5px;
  animation: pulse-logo 1.5s infinite;
}
@keyframes pulse-logo { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

/* ===== LOGO COMÚN ===== */
.logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.5px; color: var(--ink);
  cursor: pointer;
}
.logo-mark {
  width: 88px; height: 88px;
  background-image: url('logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
/* En el splash el mascota se ve enorme */
.splash-logo .logo-mark {
  width: 220px; height: 220px;
}
/* En la cabecera del login también grande */
.auth-header .logo-mark {
  width: 96px; height: 96px;
}
/* Hero del lado derecho del login: mascota gigante flotando */
.auth-hero-mark {
  width: 320px; max-width: 80%;
  margin: 0 auto 24px;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
  animation: float-mascot 4s ease-in-out infinite;
}
@keyframes float-mascot {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ===== BOTONES ===== */
.btn {
  font-weight: 600; font-size: 14px;
  padding: 12px 22px; border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--paper); color: var(--ink);
  border-radius: 100px; letter-spacing: -0.1px;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
}
.btn-primary { background: var(--pitch); color: var(--chalk); border-color: var(--pitch); }
.btn-primary:hover { background: var(--pitch-deep); border-color: var(--pitch-deep); transform: translateY(-1px); }
.btn:hover:not(.btn-primary):not(:disabled) { border-color: var(--ink); color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .arrow { transition: transform 0.2s; }
.btn:hover:not(:disabled) .arrow { transform: translateX(2px); }

/* ===== AUTH VIEW ===== */
.auth-container {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh; max-width: 1280px;
  margin: 0 auto;
}
.auth-card {
  display: flex; flex-direction: column;
  padding: 48px 56px; justify-content: center;
  max-width: 520px; width: 100%;
  margin: 0 auto;
}
.auth-header {
  display: flex; align-items: center;
  gap: 14px; margin-bottom: 40px;
}
.auth-tagline {
  font-size: 13px; color: var(--ink-muted);
  font-weight: 500; padding-left: 12px;
  border-left: 2px solid var(--border);
}
.auth-tabs {
  display: flex; gap: 6px;
  margin-bottom: 28px; padding: 4px;
  background: var(--border-soft);
  border-radius: 100px;
  width: fit-content;
}
.auth-tab {
  background: transparent; border: none;
  padding: 9px 18px; font-size: 13px;
  font-weight: 600; color: var(--ink-muted);
  cursor: pointer; border-radius: 100px;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}
.auth-tab.active { background: var(--paper); color: var(--ink); }
.auth-section { display: none; }
.auth-section.active { display: block; animation: fadeUp 0.3s ease; }
.auth-section h1 {
  font-size: 36px; font-weight: 900;
  letter-spacing: -1.5px; line-height: 1.05;
  margin-bottom: 8px;
}
.auth-section h1 em { color: var(--pitch); font-style: normal; }
.auth-sub {
  color: var(--ink-soft); font-size: 15px;
  margin-bottom: 28px; line-height: 1.4;
}
.auth-error {
  background: var(--danger-soft); color: var(--danger);
  padding: 12px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  margin-top: 16px;
}

.auth-aside {
  background: linear-gradient(135deg, var(--pitch-darker), var(--pitch));
  color: var(--chalk);
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
  position: relative; overflow: hidden;
}
.auth-aside::before, .auth-aside::after {
  content: ''; position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  pointer-events: none;
}
.auth-aside::before {
  top: -150px; right: -150px;
  width: 500px; height: 500px;
}
.auth-aside::after {
  bottom: -100px; left: -100px;
  width: 340px; height: 340px;
}
.auth-aside-content { position: relative; z-index: 1; max-width: 420px; }
.auth-aside h2 {
  font-size: 48px; font-weight: 900;
  line-height: 1; letter-spacing: -2px;
  margin-bottom: 20px;
}
.auth-aside p {
  font-size: 17px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5; margin-bottom: 28px;
}
.auth-features {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.auth-features li {
  font-size: 14px; color: var(--accent);
  font-weight: 600;
}

/* ===== FORM FIELDS ===== */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--ink); margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--chalk);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 13px 16px;
  font-size: 15px; font-weight: 500;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.15s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--pitch);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--pitch-soft);
}
.field small {
  display: block; margin-top: 6px;
  font-size: 11px; color: var(--ink-muted);
}

/* ===== HEADER ===== */
header {
  background: var(--chalk);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; max-width: 1240px; margin: 0 auto;
  gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.back-btn {
  background: var(--paper);
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink);
  transition: all 0.2s;
  flex-shrink: 0;
}
.back-btn:hover { background: var(--border-soft); }
.pool-name {
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  max-width: 50vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pool-subtitle {
  font-size: 12px; color: var(--ink-muted);
  font-weight: 500;
}
.pool-subtitle strong {
  color: var(--ink);
  font-family: monospace; letter-spacing: 1.5px;
  font-weight: 700;
}

.user-badge {
  font-size: 12px; color: var(--ink-soft);
  padding: 7px 14px; background: var(--paper);
  border: 1px solid var(--border); border-radius: 100px;
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.user-badge::before {
  content: ''; width: 6px; height: 6px;
  background: var(--pitch); border-radius: 50%;
}
.user-badge strong { color: var(--ink); font-weight: 700; }

/* ===== DASHBOARD ===== */
.dash-hero {
  padding: 50px 0 40px;
}
.dash-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1; letter-spacing: -2px;
  font-weight: 900; margin-bottom: 8px;
}
.dash-hero h1 em { color: var(--pitch); font-style: normal; }
.dash-hero-sub {
  font-size: 16px; color: var(--ink-soft);
  margin-bottom: 32px;
}
.dash-actions {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin-top: 20px;
}
.dash-action {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex; gap: 16px; align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
  text-align: left;
}
.dash-action:hover {
  border-color: var(--pitch);
  background: var(--pitch-mist);
  transform: translateY(-2px);
}
.dash-action .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900;
  background: var(--pitch); color: var(--chalk);
  flex-shrink: 0;
}
.dash-action.join .icon {
  background: var(--ink); color: var(--accent);
}
.dash-action .text { flex: 1; }
.dash-action .text strong {
  display: block; font-size: 16px;
  font-weight: 700; margin-bottom: 2px;
}
.dash-action .text span {
  font-size: 13px; color: var(--ink-muted);
  font-weight: 500;
}

.dash-section { padding-bottom: 80px; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 30px 0; flex-wrap: wrap; gap: 16px;
}
.section-title {
  font-size: 32px; line-height: 1;
  font-weight: 900; letter-spacing: -1.5px;
}
.section-title em { color: var(--pitch); font-style: normal; }
.section-meta {
  font-size: 12px; color: var(--ink-muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}

.pools-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.pool-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.pool-card:hover {
  border-color: var(--ink-muted);
  transform: translateY(-2px);
}
.pool-card .role-tag {
  position: absolute; top: 16px; right: 16px;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 100px;
  letter-spacing: 1px; text-transform: uppercase;
}
.pool-card .role-tag.creator {
  background: var(--accent); color: var(--ink);
}
.pool-card .role-tag.participant {
  background: var(--border-soft); color: var(--ink-soft);
}
.pool-card h3 {
  font-size: 18px; font-weight: 800;
  margin-bottom: 4px; max-width: 80%;
  letter-spacing: -0.3px;
}
.pool-card .pool-meta {
  font-size: 12px; color: var(--ink-muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.pool-card .pool-code {
  font-family: monospace; color: var(--ink);
  font-weight: 700; letter-spacing: 1.5px;
}
.pool-card .pool-stats {
  display: flex; gap: 16px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}
.pool-card .pool-stat {
  display: flex; flex-direction: column;
}
.pool-card .pool-stat-num {
  font-size: 22px; font-weight: 900;
  line-height: 1; color: var(--pitch);
}
.pool-card .pool-stat-label {
  font-size: 10px; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 600; margin-top: 4px;
}

.empty-state {
  background: var(--paper);
  border: 2px dashed var(--border);
  border-radius: 20px;
  padding: 60px 32px;
  text-align: center;
  grid-column: 1 / -1;
}
.empty-state .empty-icon {
  font-size: 48px; margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state h3 {
  font-size: 20px; font-weight: 800;
  margin-bottom: 6px;
}
.empty-state p {
  color: var(--ink-soft);
  font-size: 14px; max-width: 380px;
  margin: 0 auto;
}

/* ===== POOL VIEW - HERO STATS COMPACT ===== */
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0; gap: 24px;
  margin: 30px 0 0;
}
.hero-stats.compact { padding: 20px 0; margin: 24px 0 0; }
.stat-label {
  font-size: 10px; color: var(--ink-muted);
  margin-bottom: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
}
.stat-num {
  font-size: 36px; line-height: 1;
  font-weight: 800; letter-spacing: -1.5px;
}
.stat-num.accent { color: var(--pitch); }

/* ===== TABS ===== */
.tabs {
  display: flex; gap: 4px;
  margin: 32px 0 28px;
  padding: 4px; background: var(--paper);
  border: 1px solid var(--border); border-radius: 100px;
  overflow-x: auto; width: fit-content; max-width: 100%;
}
.tab {
  font-weight: 600; font-size: 13px;
  padding: 10px 20px; background: transparent; border: none;
  color: var(--ink-muted); cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  border-radius: 100px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Montserrat', sans-serif;
}
.tab.active { background: var(--pitch); color: var(--chalk); }
.tab:hover:not(.active) { color: var(--ink); }
.tab .count {
  font-size: 11px; background: rgba(255,255,255,0.2);
  padding: 1px 7px; border-radius: 100px;
  min-width: 22px; text-align: center; font-weight: 700;
}
.tab:not(.active) .count { background: var(--border-soft); color: var(--ink-muted); }

/* ===== SECTIONS ===== */
.section { display: none; padding-bottom: 100px; }
.section.active { display: block; animation: fadeUp 0.4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== SUB-TABS ===== */
.sub-tabs {
  display: flex; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.sub-tab {
  background: transparent; border: none;
  padding: 14px 4px; margin-right: 24px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-muted); cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 8px;
  font-family: 'Montserrat', sans-serif;
}
.sub-tab.active { color: var(--pitch); border-bottom-color: var(--pitch); }
.sub-tab:hover:not(.active) { color: var(--ink); }
.sub-tab .badge {
  background: var(--border-soft); color: var(--ink-muted);
  font-size: 11px; padding: 2px 8px;
  border-radius: 100px; font-weight: 700;
}
.sub-tab.active .badge { background: var(--pitch-soft); color: var(--pitch); }
.sub-section { display: none; }
.sub-section.active { display: block; animation: fadeUp 0.3s ease; }

/* ===== GROUP CARDS ===== */
.group-pred-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
}
.group-pred-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
}
.group-pred-header {
  background: var(--pitch); color: var(--chalk);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.group-pred-header .label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  opacity: 0.7;
}
.group-pred-header .letter {
  font-size: 22px; font-weight: 900;
  letter-spacing: -0.5px; margin-top: 2px;
}
.group-pred-header .progress {
  font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.15);
  padding: 4px 10px; border-radius: 100px;
}
.mini-table {
  padding: 12px 18px; background: var(--pitch-mist);
  border-bottom: 1px solid var(--border);
}
.mini-table-row {
  display: grid;
  grid-template-columns: 20px 1fr 28px 30px 30px;
  gap: 8px; align-items: center;
  padding: 5px 0; font-size: 12px;
}
.mini-table-row.header {
  color: var(--ink-muted);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 5px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.mini-table-row .pos { font-weight: 700; color: var(--ink); }
.mini-table-row.q1 .pos, .mini-table-row.q2 .pos { color: var(--pitch); }
.mini-table-row .team-mini {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-table-row.q1 .team-mini::before {
  content: ''; width: 3px; height: 14px;
  background: var(--pitch); border-radius: 2px;
}
.mini-table-row.q2 .team-mini::before {
  content: ''; width: 3px; height: 14px;
  background: var(--pitch-light); border-radius: 2px;
}
.mini-table-row .num {
  text-align: center; font-variant-numeric: tabular-nums;
  color: var(--ink-soft); font-weight: 500;
}
.mini-table-row .num.pts { color: var(--ink); font-weight: 700; }

/* ===== MATCH CARD ===== */
.group-matches { padding: 6px 10px 12px; }
.match-card {
  padding: 12px 8px;
  border-bottom: 1px dashed var(--border-soft);
  position: relative;
}
.match-card:last-child { border-bottom: none; }
.match-meta-line {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; color: var(--ink-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 0 4px 8px;
}
.match-meta-line .countdown { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.match-meta-line .countdown.urgent { color: var(--warm); font-weight: 700; }
.match-meta-line .countdown.locked { color: var(--danger); font-weight: 700; }
.match-meta-line .countdown.live { color: var(--danger); font-weight: 700; animation: blink 1s infinite; }
.match-meta-line .countdown.finished { color: var(--pitch); font-weight: 700; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

.match-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 14px;
}
.match-team {
  display: flex; align-items: center; gap: 9px; min-width: 0;
}
.match-team.home { justify-content: flex-end; flex-direction: row-reverse; }
.match-team.away { justify-content: flex-start; }
.flag-circle {
  width: 28px; height: 28px;
  border-radius: 50%; background: var(--chalk);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  overflow: hidden;
}

/* Nuevo escudo circular con bandera SVG/PNG dentro */
.flag-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(14,26,18,0.08);
  transition: transform 0.15s ease;
}
.flag-shield img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.flag-shield:hover { transform: scale(1.08); }

/* Variantes por tamaño */
.flag-shield-sm { width: 20px; height: 20px; border-width: 1px; }
.flag-shield-md { width: 28px; height: 28px; }
.flag-shield-lg { width: 36px; height: 36px; border-width: 2px; }
.flag-shield-xl { width: 56px; height: 56px; border-width: 2px; }
.team-label {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.score-wrap { display: flex; align-items: center; gap: 5px; }
.score-input {
  width: 38px; height: 42px;
  background: var(--chalk);
  border: 1px solid var(--border); color: var(--ink);
  font-size: 18px; font-weight: 700; text-align: center;
  transition: all 0.15s; border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
}
.score-input:focus { outline: none; border-color: var(--pitch); background: var(--paper); }
.score-input.filled { background: var(--pitch-soft); border-color: var(--pitch); color: var(--pitch-deep); }
.score-input:disabled { background: var(--border-soft); color: var(--ink-muted); cursor: not-allowed; }
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.score-sep { color: var(--ink-muted); font-weight: 700; font-size: 14px; }

.real-result-bar {
  margin: 0 -8px 10px;
  padding: 7px 12px;
  background: var(--ink); color: var(--chalk);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; gap: 8px;
}
.real-result-bar .rr-label {
  font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
  font-size: 10px;
}
.real-result-bar .rr-score {
  font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.real-result-bar .rr-points {
  background: var(--accent); color: var(--ink);
  padding: 2px 8px; border-radius: 100px;
  font-weight: 700; font-size: 11px;
}
.real-result-bar .rr-points.zero {
  background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7);
}

.match-card.has-result .score-input { opacity: 0.7; }
.match-card.has-result.points-3 { background: linear-gradient(90deg, var(--pitch-soft) 0%, transparent 100%); border-left: 3px solid var(--pitch); padding-left: 8px; margin-left: -3px; }
.match-card.has-result.points-2 { background: linear-gradient(90deg, var(--pitch-mist) 0%, transparent 100%); border-left: 3px solid var(--pitch-light); padding-left: 8px; margin-left: -3px; }
.match-card.has-result.points-1 { border-left: 3px solid var(--gold); padding-left: 8px; margin-left: -3px; }
.match-card.has-result.points-0 { border-left: 3px solid var(--danger); padding-left: 8px; margin-left: -3px; opacity: 0.75; }

.locked-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--danger-soft); color: var(--danger);
  padding: 6px 12px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  margin: 0 -8px 10px;
}
.locked-banner::before { content: '🔒'; font-size: 14px; }

/* ===== BRACKET ===== */
.bracket-intro {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px; margin-bottom: 24px;
  font-size: 13px; color: var(--ink-soft);
  line-height: 1.5;
}
.bracket-intro strong { color: var(--pitch); font-weight: 700; }

.bracket-scroll {
  overflow-x: auto;
  padding-bottom: 16px;
  margin: 0 -32px;
  padding-left: 32px;
  padding-right: 32px;
}
.bracket-scroll::-webkit-scrollbar { height: 6px; }
.bracket-scroll::-webkit-scrollbar-track { background: var(--border-soft); border-radius: 3px; }
.bracket-scroll::-webkit-scrollbar-thumb { background: var(--ink-muted); border-radius: 3px; }

.bracket {
  display: flex; gap: 16px;
  min-width: 1400px; padding: 8px 0;
}
.bracket-column {
  flex: 1; display: flex;
  flex-direction: column; justify-content: space-around;
  gap: 6px; min-width: 200px;
}
.bracket-col-header {
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--pitch);
}
.bracket-col-header .title {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
}
.bracket-col-header .sub {
  font-size: 10px; color: var(--ink-muted);
  font-weight: 600; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.bracket-match {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  transition: all 0.2s;
}
.bracket-match:hover { border-color: var(--ink-muted); }
.bracket-match.predicted {
  border-color: var(--pitch);
  background: var(--pitch-mist);
}
.bracket-match .bm-meta {
  font-size: 9px; color: var(--ink-muted);
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 2px;
}
.bracket-match .bm-meta .countdown { color: var(--ink-soft); }
.bracket-match .bm-meta .countdown.urgent { color: var(--warm); }
.bracket-match .bm-meta .countdown.locked { color: var(--danger); }
.bracket-match .bm-meta .countdown.live { color: var(--danger); animation: blink 1s infinite; }
.bracket-match .bm-meta .countdown.finished { color: var(--pitch); }
.bracket-team-row {
  display: grid; grid-template-columns: 1fr 32px;
  align-items: center;
  padding: 4px 3px; gap: 6px;
  border-radius: 5px;
}
.bracket-team-row.winner { background: var(--pitch-soft); }
.bracket-team-row.winner .bt-name { color: var(--pitch-deep); font-weight: 800; }
.bracket-team-info { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bracket-team-info .flag-circle { width: 20px; height: 20px; font-size: 13px; }
.bt-name {
  font-size: 11px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bt-name.tbd { color: var(--ink-muted); font-style: italic; font-weight: 500; font-size: 10px; }
.bracket-score {
  width: 32px; height: 28px;
  background: var(--chalk);
  border: 1px solid var(--border); color: var(--ink);
  font-size: 13px; font-weight: 700; text-align: center;
  border-radius: 5px;
  font-family: 'Montserrat', sans-serif;
}
.bracket-score:focus { outline: none; border-color: var(--pitch); background: var(--paper); }
.bracket-score.filled { background: var(--paper); border-color: var(--pitch); color: var(--pitch-deep); }
.bracket-score::-webkit-inner-spin-button,
.bracket-score::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bracket-score:disabled { background: var(--border-soft); color: var(--ink-muted); cursor: not-allowed; border-style: dashed; }

.bracket-real-result {
  background: var(--ink); color: var(--chalk);
  border-radius: 5px;
  padding: 4px 6px; margin-bottom: 5px;
  font-size: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.bracket-real-result .label { color: var(--accent); font-weight: 700; letter-spacing: 0.5px; }
.bracket-real-result .score { font-weight: 800; font-size: 12px; }
.bracket-real-result .pts { background: var(--accent); color: var(--ink); padding: 1px 5px; border-radius: 100px; font-weight: 700; font-size: 9px; }
.bracket-real-result .pts.zero { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.6); }

.bracket-column.final .bracket-match {
  background: linear-gradient(135deg, var(--pitch) 0%, var(--pitch-deep) 100%);
  border-color: var(--pitch-deep); color: var(--chalk);
}
.bracket-column.final .bm-meta { color: rgba(255,255,255,0.6); }
.bracket-column.final .bt-name { color: var(--chalk); }
.bracket-column.final .bt-name.tbd { color: rgba(255,255,255,0.4); }
.bracket-column.final .bracket-team-row.winner { background: rgba(255,255,255,0.15); }
.bracket-column.final .bracket-team-row.winner .bt-name { color: var(--accent); }
.bracket-column.final .flag-circle { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.bracket-column.final .bracket-score { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: var(--chalk); }
.bracket-column.final .bracket-score.filled { background: var(--accent); border-color: var(--accent); color: var(--pitch-darker); }

.champion-card {
  background: linear-gradient(135deg, var(--pitch-darker), var(--pitch));
  border-radius: 16px;
  padding: 24px; margin-top: 20px;
  text-align: center; color: var(--chalk);
  position: relative; overflow: hidden;
}
.champion-card::before {
  content: '🏆'; position: absolute;
  font-size: 200px; opacity: 0.08;
  right: -30px; top: -50px;
}
.champion-card .label {
  font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 8px;
}
.champion-card .name {
  font-size: 28px; font-weight: 900;
  letter-spacing: -1px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.champion-card .name.tbd {
  color: rgba(255,255,255,0.4);
  font-style: italic; font-weight: 500; font-size: 20px;
}

/* ===== GROUPS PREVIEW ===== */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.group-card {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 22px; border-radius: 16px;
}
.group-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.group-letter {
  font-size: 26px; font-weight: 900;
  letter-spacing: -1px;
}
.group-letter em { color: var(--pitch); font-style: normal; }
.group-tag {
  font-size: 10px; color: var(--ink-muted);
  padding: 3px 9px;
  background: var(--border-soft);
  border-radius: 100px; font-weight: 600;
}
.group-team {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; font-size: 14px;
  color: var(--ink); font-weight: 500;
}

/* ===== RANKING ===== */
.ranking-list {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
}
.rank-row {
  display: grid; grid-template-columns: 50px 1fr 70px 90px 100px;
  align-items: center; padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.2s;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--pitch-mist); }
.rank-row.you { background: var(--pitch-soft); }
.rank-pos { font-size: 20px; line-height: 1; font-weight: 800; color: var(--ink-muted); }
.rank-row.podium-1 .rank-pos { color: var(--gold); }
.rank-row.podium-2 .rank-pos { color: var(--ink); }
.rank-row.podium-3 .rank-pos { color: var(--warm); }
.rank-name {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.you-tag {
  font-size: 10px; background: var(--pitch); color: var(--chalk);
  padding: 3px 9px; border-radius: 100px; font-weight: 700;
}
.rank-stat {
  font-size: 13px; text-align: right;
  color: var(--ink-soft); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.rank-points {
  color: var(--pitch); font-size: 22px;
  text-align: right; line-height: 1;
  font-weight: 900; font-variant-numeric: tabular-nums;
}
.rank-header {
  display: grid; grid-template-columns: 50px 1fr 70px 90px 100px;
  padding: 14px 22px; background: var(--chalk);
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--ink-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.rank-header div:nth-child(3),
.rank-header div:nth-child(4),
.rank-header div:nth-child(5) { text-align: right; }

/* ===== MODALES ===== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(14,26,18,0.6);
  backdrop-filter: blur(12px);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-bg.active { display: flex; animation: fadeUp 0.2s ease; }
.modal {
  background: var(--paper);
  padding: 36px; max-width: 460px;
  width: 100%; border-radius: 24px;
  animation: modalUp 0.3s ease;
  margin: auto;
}
@keyframes modalUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 {
  font-size: 28px; line-height: 1.1;
  margin-bottom: 10px; font-weight: 900;
  letter-spacing: -0.5px;
}
.modal h2 em { color: var(--pitch); font-style: normal; }
.modal p {
  color: var(--ink-soft); margin-bottom: 22px;
  line-height: 1.55; font-size: 14px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 8px;
}
.invite-code-display {
  background: linear-gradient(135deg, var(--pitch), var(--pitch-deep));
  color: var(--chalk);
  border-radius: 16px;
  padding: 24px; margin-bottom: 20px;
  text-align: center;
}
.invite-code-display .invite-label {
  font-size: 11px; opacity: 0.7;
  letter-spacing: 2px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 8px;
}
.invite-code-display .invite-code {
  font-size: 44px; font-weight: 900;
  letter-spacing: 8px; font-family: monospace;
  color: var(--accent);
}
.share-buttons {
  display: flex; gap: 8px; margin: 16px 0;
  flex-wrap: wrap;
}
.share-btn {
  flex: 1; min-width: 0;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--border);
  padding: 11px 14px; font-weight: 600;
  cursor: pointer; font-size: 13px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s;
}
.share-btn:hover { background: var(--pitch); color: var(--chalk); border-color: var(--pitch); }

/* ===== DATA UPDATE BANNER ===== */
.data-update-banner {
  background: var(--ink); color: var(--chalk);
  padding: 14px 22px; border-radius: 12px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px;
}
.data-update-banner .icon {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink);
}
.data-update-banner .info { flex: 1; min-width: 200px; }
.data-update-banner .info strong { display: block; color: var(--accent); margin-bottom: 2px; }
.data-update-banner .info span { color: rgba(255,255,255,0.7); }
.data-update-banner button {
  background: var(--accent); color: var(--ink);
  border: none; padding: 8px 16px;
  font-weight: 700; font-size: 12px;
  border-radius: 100px; cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
.data-update-banner button:hover { background: var(--chalk); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: var(--chalk);
  padding: 12px 20px; font-weight: 600; font-size: 13px;
  border-radius: 100px; transition: transform 0.3s ease;
  z-index: 300; display: flex; align-items: center; gap: 8px;
  max-width: 92vw;
}
.toast::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error::before { background: var(--danger); }

/* ===== SAVE BANNER ===== */
.save-banner {
  position: sticky; bottom: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 12px 22px;
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; border-radius: 100px;
  box-shadow: 0 8px 24px rgba(14,26,18,0.08);
  z-index: 50;
}
.save-status {
  font-size: 12px; color: var(--ink-muted);
  display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.save-status::before {
  content: ''; width: 6px; height: 6px;
  background: var(--pitch); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.save-status strong { color: var(--ink); font-weight: 700; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .auth-container { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card { padding: 40px 24px; max-width: 100%; }
}
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 12px 16px; gap: 8px; }
  .pool-name { font-size: 15px; max-width: 40vw; }
  .dash-actions { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stat-num { font-size: 28px; }
  .rank-row, .rank-header { grid-template-columns: 36px 1fr 60px 90px; }
  .rank-row .rank-stat:first-of-type, .rank-header div:nth-child(3) { display: none; }
  .modal { padding: 26px; }
  .section-title { font-size: 26px; }
  .group-pred-grid { grid-template-columns: 1fr; }
  .bracket-scroll { margin: 0 -16px; padding: 0 16px 16px; }
  .score-input { width: 34px; height: 38px; font-size: 16px; }
  .auth-section h1 { font-size: 28px; }
}

/* ============================================================
   PLANTILLAS DE REGLAS (selector en crear polla)
============================================================ */
.modal-wide { max-width: 720px; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.template-card {
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.template-card:hover {
  border-color: var(--tpl-color, var(--ink-muted));
  transform: translateY(-2px);
}
.template-card.selected {
  border-color: var(--tpl-color, var(--pitch));
  background: linear-gradient(180deg, var(--paper), color-mix(in srgb, var(--tpl-color, var(--pitch)) 6%, transparent));
}
.template-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px; right: 12px;
  background: var(--tpl-color, var(--pitch));
  color: var(--chalk);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.template-emoji {
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1;
}
.template-name {
  font-size: 18px; font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 2px;
}
.template-tagline {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--tpl-color, var(--ink-soft));
  margin-bottom: 10px;
}
.template-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}
.template-highlights {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.template-highlights span {
  background: var(--chalk);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ============================================================
   COMODINES (jokers) en match cards
============================================================ */
.joker-row {
  display: flex; justify-content: flex-end;
  padding: 6px 8px 0;
}
.joker-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--ink-muted);
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s;
}
.joker-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(233, 185, 73, 0.08);
}
.joker-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  border-style: solid;
}
.joker-locked {
  font-size: 10px;
  background: var(--gold);
  color: var(--ink);
  padding: 4px 10px;
  margin: 6px 8px 0;
  border-radius: 100px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.match-card.has-joker {
  background: linear-gradient(90deg, rgba(233, 185, 73, 0.08), transparent 40%);
}

/* ============================================================
   VISTA: REGLAS
============================================================ */
.rules-template-header {
  background: linear-gradient(135deg, var(--tpl-color, var(--pitch)), color-mix(in srgb, var(--tpl-color, var(--pitch)) 75%, black));
  color: var(--chalk);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}
.rules-template-emoji {
  font-size: 56px;
  line-height: 1;
}
.rules-template-info h3 {
  font-size: 28px; font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.rules-template-info p {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  max-width: 500px;
}

.rules-section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 14px;
}
.rules-section h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rule-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s;
}
.rule-item:hover { background: var(--pitch-mist); }
.rule-item.rule-neutral { opacity: 0.5; }
.rule-icon {
  font-size: 16px; text-align: center;
}
.rule-label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.rule-points {
  font-size: 14px;
  font-weight: 800;
  color: var(--pitch);
  background: var(--pitch-soft);
  padding: 3px 10px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}
.rule-item.rule-neutral .rule-points {
  background: var(--border-soft);
  color: var(--ink-muted);
}

/* ============================================================
   VISTA: TORNEO (pronósticos especiales)
============================================================ */
.tournament-intro {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 22px;
  margin-bottom: 24px;
}
.tournament-intro p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.tournament-section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 14px;
}
.tournament-section h3 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
  color: var(--ink);
}
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tournament-field, .tournament-field-large {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tournament-field-large {
  margin-top: 16px;
}
.tournament-field label, .tournament-field-large label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.tournament-points {
  background: var(--pitch-soft);
  color: var(--pitch);
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.tournament-field select,
.tournament-field-large select,
.tournament-field-large input[type="number"] {
  width: 100%;
  background: var(--chalk);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
}
.tournament-field select:focus,
.tournament-field-large select:focus,
.tournament-field-large input:focus {
  outline: none;
  border-color: var(--pitch);
  background: var(--paper);
}
.tournament-field-large small {
  font-size: 11px;
  color: var(--ink-muted);
}
.tournament-multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--chalk);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.tournament-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--paper);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s;
  user-select: none;
}
.tournament-chip input { display: none; }
.tournament-chip:hover { border-color: var(--ink-muted); }
.tournament-chip.selected {
  background: var(--pitch);
  border-color: var(--pitch);
  color: var(--chalk);
}

.locked-banner-large {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .template-grid { grid-template-columns: 1fr; }
  .modal-wide { max-width: 95vw; }
  .rules-template-header { flex-direction: column; text-align: center; gap: 12px; }
  .rules-template-emoji { font-size: 48px; }
}

.forgot-link-wrap {
  text-align: center;
  margin-top: 14px;
}
.forgot-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.forgot-link:hover {
  color: var(--pitch);
}

/* ============================================================
   BOTÓN INVITAR (header de polla)
============================================================ */
.btn-invite {
  background: linear-gradient(135deg, var(--pitch), var(--pitch-deep));
  color: var(--chalk);
  border: none;
  font-weight: 700;
  padding: 10px 20px;
  box-shadow:
    0 4px 14px rgba(58, 125, 68, 0.35),
    0 2px 4px rgba(58, 125, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-invite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.18) 50%, transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-invite:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px rgba(58, 125, 68, 0.45),
    0 3px 8px rgba(58, 125, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-invite:hover::before {
  opacity: 1;
}

.btn-invite:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(58, 125, 68, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-invite .invite-icon {
  font-size: 14px;
  opacity: 0.95;
}

/* Variante para mobile: un poco más compacto */
@media (max-width: 768px) {
  .btn-invite {
    padding: 9px 16px;
    font-size: 12px;
  }
  .btn-invite .invite-icon {
    font-size: 13px;
  }
}

/* ============================================================
   PASSWORD TOGGLE (mostrar/ocultar contraseña)
============================================================ */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 48px; /* deja espacio para el botón del ojo */
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  transition: all 0.15s ease;
  font-family: 'Montserrat', sans-serif;
}

.password-toggle:hover {
  color: var(--pitch);
  background: var(--pitch-soft);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.92);
}

.password-toggle .eye-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}


/* ============================================================
   AJUSTE 2: BADGE DE PLANTILLA EN CARDS DE POLLAS
============================================================ */
.pool-template-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--tpl-color, var(--pitch)) 12%, white);
  border: 1px solid color-mix(in srgb, var(--tpl-color, var(--pitch)) 35%, transparent);
}
.pool-template-badge .ptb-emoji {
  font-size: 14px;
  line-height: 1;
}
.pool-template-badge .ptb-name {
  font-size: 11px;
  font-weight: 700;
  color: color-mix(in srgb, var(--tpl-color, var(--pitch)) 70%, black);
  letter-spacing: 0.3px;
}

/* ============================================================
   AJUSTE 3: GUARDAR/BLOQUEAR TORNEO
============================================================ */
.tournament-warning {
  background: color-mix(in srgb, var(--warm) 12%, white);
  border: 1px solid color-mix(in srgb, var(--warm) 40%, transparent);
  color: color-mix(in srgb, var(--warm) 60%, black);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}
.tournament-warning strong { font-weight: 800; }

.tournament-save-bar {
  margin-top: 8px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}
.tournament-save-bar .btn {
  font-size: 15px;
  padding: 14px 22px;
}
.tournament-save-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 10px 0 0;
  line-height: 1.4;
}

/* ============================================================
   AJUSTE 1: MODAL "¿CÓMO FUNCIONA?"
============================================================ */
.how-it-works-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent), #c2e85a);
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(212, 245, 106, 0.5);
  animation: hiw-pulse 2.5s ease-in-out infinite;
}
.how-it-works-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 245, 106, 0.7);
  animation: none;
}
@keyframes hiw-pulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(212, 245, 106, 0.5); }
  50% { box-shadow: 0 3px 16px rgba(212, 245, 106, 0.85); }
}

.label-with-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hiw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.hiw-card {
  border: 2px solid color-mix(in srgb, var(--tpl-color, var(--pitch)) 30%, transparent);
  border-radius: 14px;
  padding: 18px;
  background: var(--paper);
}
.hiw-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.hiw-emoji { font-size: 30px; line-height: 1; }
.hiw-name {
  font-size: 18px; font-weight: 900;
  color: var(--ink); letter-spacing: -0.3px;
}
.hiw-tagline {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--tpl-color, var(--ink-soft));
}
.hiw-desc {
  font-size: 12.5px; color: var(--ink-soft);
  line-height: 1.5; margin-bottom: 14px;
}
.hiw-block { margin-bottom: 12px; }
.hiw-block h5 {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--ink-muted); margin-bottom: 6px;
}
.hiw-block ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.hiw-block li, .hiw-block p {
  font-size: 13px; color: var(--ink);
  line-height: 1.45;
}
.hiw-block li::before {
  content: '•'; color: var(--tpl-color, var(--pitch));
  font-weight: 900; margin-right: 8px;
}
.hiw-example {
  background: var(--chalk);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  border-left: 3px solid var(--tpl-color, var(--pitch));
}
.hiw-example-label {
  display: block;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--tpl-color, var(--pitch));
  margin-bottom: 4px;
}
.hiw-example strong { color: var(--ink); font-weight: 800; }

.modal-xwide { max-width: 920px; }

@media (max-width: 768px) {
  .hiw-grid { grid-template-columns: 1fr; }
  .modal-xwide { max-width: 95vw; }
}
