/* ========================
   FOOTSIM MANAGER — CSS (FIXED)
   Dark tactical aesthetic
======================== */

:root {
  --green: #00e676;
  --green-dim: #00c853;
  --gold: #ffd600;
  --red: #ff1744;
  --blue: #2979ff;
  --bg: #080c0f;
  --bg2: #0e1318;
  --bg3: #131a21;
  --bg4: #1a242e;
  --border: rgba(255,255,255,0.07);
  --text: #e8edf2;
  --text-dim: #6b7d8e;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Overpass Mono', monospace;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); overflow-x: hidden; }

/* ── SCREENS ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── START ── */
#screen-start { position: relative; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 60%, #0a1a10 0%, var(--bg) 70%); }
.start-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.start-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,230,118,0.04) 1px,transparent 1px), linear-gradient(90deg,rgba(0,230,118,0.04) 1px,transparent 1px); background-size: 40px 40px; animation: gridScroll 20s linear infinite; }
@keyframes gridScroll { to { background-position: 0 40px; } }
.start-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; height: 600px; background: radial-gradient(circle,rgba(0,230,118,0.12) 0%,transparent 65%); border-radius: 50%; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
.start-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; padding: 40px 20px; }
.logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.logo-icon { font-size: 56px; filter: drop-shadow(0 0 20px rgba(0,230,118,.6)); animation: spin3d 6s linear infinite; }
@keyframes spin3d { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }
.logo-title { font-family: var(--font-display); font-size: clamp(72px,12vw,120px); color: var(--text); letter-spacing: 8px; line-height: 1; text-shadow: 0 0 40px rgba(0,230,118,.3); }
.logo-sub { font-family: var(--font-display); font-size: 24px; letter-spacing: 12px; color: var(--green); }
.start-desc { font-size: 16px; color: var(--text-dim); max-width: 340px; line-height: 1.6; }
.start-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── BUTTONS ── */
.btn-primary { background: var(--green); color: #000; border: none; cursor: pointer; font-family: var(--font-display); font-size: 20px; letter-spacing: 3px; padding: 14px 48px; border-radius: 4px; transition: all .2s; box-shadow: 0 0 24px rgba(0,230,118,.3); }
.btn-primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,230,118,.5); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); cursor: pointer; font-family: var(--font-display); font-size: 20px; letter-spacing: 3px; padding: 12px 48px; border-radius: 4px; transition: all .2s; }
.btn-outline:hover { border-color: var(--text-dim); background: rgba(255,255,255,.04); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer; font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 10px 28px; border-radius: 6px; transition: all .2s; }
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-full { width: 100%; font-size: 18px; padding: 14px; }

/* ── AUTH SCREENS ── */
#screen-login, #screen-register, #screen-forgot, #screen-reset {
  background: radial-gradient(ellipse at 50% 30%, #0a1a10 0%, var(--bg) 60%);
  align-items: center; justify-content: center;
}
.auth-wrap { width: 100%; max-width: 420px; padding: 24px 16px; }
.auth-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 36px 32px; }
.auth-logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 22px; letter-spacing: 3px; color: var(--text); margin-bottom: 20px; justify-content: center; }
.auth-logo span { color: var(--green); }
.auth-card h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: 2px; text-align: center; margin-bottom: 20px; }
.auth-desc { font-size: 13px; color: var(--text-dim); text-align: center; margin-bottom: 16px; line-height: 1.5; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.label-hint { font-size: 11px; font-weight: 400; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.form-group input { background: var(--bg3); border: 1px solid var(--border); color: var(--text); font-family: var(--font-body); font-size: 15px; padding: 11px 14px; border-radius: 8px; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: var(--green); }
.form-group input::placeholder { color: var(--text-dim); }
.auth-msg { margin-bottom: 14px; padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.auth-msg.error { background: rgba(255,23,68,.1); border: 1px solid rgba(255,23,68,.3); color: #ff6b8a; }
.auth-msg.success { background: rgba(0,230,118,.08); border: 1px solid rgba(0,230,118,.25); color: var(--green); }
.auth-msg.info { background: rgba(41,121,255,.08); border: 1px solid rgba(41,121,255,.25); color: #82b1ff; }
.hidden { display: none !important; }
.auth-links { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.auth-sep { color: var(--text-dim); font-size: 12px; }
.link-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 13px; font-family: var(--font-body); padding: 2px 4px; transition: color .2s; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--green); }

/* ── TEAM SELECT ── */
#screen-team-select { padding: 0; background: var(--bg); }
.screen-header { text-align: center; padding: 40px 20px 24px; background: linear-gradient(to bottom,var(--bg2),transparent); }
.screen-header h2 { font-family: var(--font-display); font-size: 48px; letter-spacing: 4px; }
.screen-header p { color: var(--text-dim); margin-top: 4px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; padding: 16px 24px 40px; max-width: 1100px; margin: 0 auto; width: 100%; }
.team-card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; transition: all .2s; }
.team-card:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,230,118,.15); }
.team-badge-lg { font-size: 48px; line-height: 1; }
.team-badge-md { font-size: 28px; line-height: 1; }
.team-card-name { font-weight: 600; font-size: 13px; text-align: center; }
.team-card-city { font-size: 11px; color: var(--text-dim); }

/* ── HUB ── */
#screen-hub { background: var(--bg); }
.hub-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.hub-logo { display: flex; align-items: center; gap: 12px; }
.hub-team-name { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }
.hub-season { font-size: 11px; color: var(--text-dim); }
.hub-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer; font-family: var(--font-body); font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 6px; transition: all .2s; }
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--bg4); color: var(--green); }
.hub-stats { display: flex; gap: 8px; align-items: center; }
.stat-pill { background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; font-size: 13px; font-family: var(--font-mono); color: var(--gold); }

/* ── USER MENU ── */
.user-menu { position: relative; }
.user-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 13px; font-family: var(--font-body); padding: 6px 14px; border-radius: 20px; transition: all .2s; }
.user-btn:hover { border-color: var(--text-dim); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; min-width: 200px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.6); z-index: 50; }
.user-dropdown button { width: 100%; background: none; border: none; color: var(--text); cursor: pointer; font-size: 14px; font-family: var(--font-body); padding: 12px 16px; text-align: left; transition: background .15s; display: block; }
.user-dropdown button:hover { background: var(--bg3); }
.user-dropdown .logout-btn { color: var(--red); border-top: 1px solid var(--border); }

/* ── TABS ── */
.tab-content { display: none; padding: 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.tab-content.active { display: block; }

/* ── HOME TAB ── */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-label { font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 16px; }
.next-match-card { grid-column: 1/2; }
.results-card { grid-column: 2/3; }
.form-card { grid-column: 1/-1; }
.next-match-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.nm-team { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.nm-vs { font-family: var(--font-display); font-size: 32px; color: var(--text-dim); }
.nm-info { font-size: 11px; color: var(--text-dim); text-align: center; }
.btn-sim { width: 100%; font-size: 18px; }
.result-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.result-row:last-child { border-bottom: none; }
.result-score { font-family: var(--font-mono); font-weight: 600; background: var(--bg4); padding: 2px 10px; border-radius: 4px; min-width: 60px; text-align: center; }
.result-teams { flex: 1; color: var(--text-dim); }
.form-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.form-pill { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 18px; }
.form-W { background: rgba(0,230,118,.2); color: var(--green); border: 1px solid var(--green); }
.form-D { background: rgba(255,214,0,.15); color: var(--gold); border: 1px solid var(--gold); }
.form-L { background: rgba(255,23,68,.15); color: var(--red); border: 1px solid var(--red); }

/* ══════════════════════════════════════════════════
   PLANTILLA — FORMACIONES + FOTOS + SUPLENTES
══════════════════════════════════════════════════ */

.formation-selector {
  display: flex; align-items: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
}
.form-sel-label { font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-right: 4px; }
.form-sel-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 5px; transition: all .15s; }
.form-sel-btn:hover { border-color: var(--text-dim); color: var(--text); }
.form-sel-btn.active { background: rgba(0,230,118,.1); border-color: var(--green); color: var(--green); }

/* Hint de drag */
.squad-hint {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: .5px;
}

/* Campo */
.pitch-wrap { width: 100%; max-width: 460px; margin: 0 auto; }
.pitch { position: relative; width: 100%; padding-bottom: 148%; background: #1a6b2e; border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.06); box-shadow: inset 0 0 80px rgba(0,0,0,.45), 0 8px 32px rgba(0,0,0,.5); }
.pitch::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0,0,0,.06) 0px, rgba(0,0,0,.06) 7.4%, transparent 7.4%, transparent 14.8%); pointer-events: none; }
.pitch-lines { position: absolute; inset: 0; pointer-events: none; }
.pitch-lines::before { content: ''; position: absolute; top: 3%; left: 5%; right: 5%; bottom: 3%; border: 1.5px solid rgba(255,255,255,.3); border-radius: 3px; }
.pitch-midline { position: absolute; top: 50%; left: 5%; right: 5%; height: 1.5px; background: rgba(255,255,255,.3); }
.pitch-circle { position: absolute; top: 50%; left: 50%; width: 22%; padding-bottom: 22%; transform: translate(-50%, -50%); border: 1.5px solid rgba(255,255,255,.3); border-radius: 50%; }
.pitch-circle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; background: rgba(255,255,255,.5); border-radius: 50%; transform: translate(-50%,-50%); }
.pitch-area { position: absolute; left: 50%; transform: translateX(-50%); width: 54%; height: 17%; border: 1.5px solid rgba(255,255,255,.3); }
.pitch-area.top { top: 3%; border-top: none; }
.pitch-area.bottom { bottom: 3%; border-bottom: none; }
.pitch-small-area { position: absolute; left: 50%; transform: translateX(-50%); width: 27%; height: 7.5%; border: 1.5px solid rgba(255,255,255,.3); }
.pitch-small-area.top { top: 3%; border-top: none; }
.pitch-small-area.bottom { bottom: 3%; border-bottom: none; }
.pitch-players { position: absolute; inset: 0; }

/* Jugadores en el campo */
.pitch-player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 2;
  cursor: grab;
  transition: opacity .15s;
}
.pitch-player:active { cursor: grabbing; }
.pitch-player:hover .pitch-avatar { transform: scale(1.15); box-shadow: 0 0 18px rgba(0,0,0,.7); }
.pitch-avatar { width: 44px; height: 44px; border-radius: 50%; background: rgba(8,12,15,.8); border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 10px rgba(0,0,0,.6); overflow: hidden; }
.pitch-pname { font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.95); white-space: nowrap; background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 3px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; }
.pitch-povr { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.pitch-formation-badge { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 3px 16px; font-family: var(--font-display); font-size: 15px; letter-spacing: 3px; color: rgba(255,255,255,.65); pointer-events: none; z-index: 3; }

/* ── ÁREA DE SUPLENTES ── */
.bench-area {
  margin-top: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.bench-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bench-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
}
/* ← FIX: flex-wrap + scroll horizontal en móvil */
.bench-players {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 90px;
  align-items: flex-start;
  padding: 4px 0;
}

/* Tarjeta de suplente — rediseñada para coincidir con bench-players */
.bench-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: grab;
  transition: transform .15s, opacity .15s;
  min-width: 60px;
  max-width: 68px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg4);
  user-select: none;
}
.bench-player:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: rgba(255,214,0,.04);
}
.bench-player:active { cursor: grabbing; }

/* ← FIX: usar clases del HTML (.bench-avatar, .bench-avatar-img, .bench-num) */
.bench-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: var(--bg);
  overflow: hidden;
  position: relative;
  transition: border-color .15s;
  flex-shrink: 0;
}
.bench-player:hover .bench-avatar { border-color: var(--gold); }
.bench-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.bench-num {
  position: absolute;
  bottom: -1px; right: -1px;
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.bench-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.bench-pos {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
}
.bench-ovr {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* ── DRAG OVER FEEDBACK ── */
.pitch-player.drag-over-target {
  outline: 2px dashed var(--green);
  outline-offset: 4px;
  border-radius: 50%;
}
.bench-player.drag-over-bench {
  border-color: var(--green) !important;
  background: rgba(0,230,118,.06) !important;
}

/* ══════════════════════════════════════════════════
   CLASIFICACIÓN
══════════════════════════════════════════════════ */
.league-table-wrap { overflow-x: auto; }
table.league-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.league-table thead tr { border-bottom: 2px solid var(--border); }
table.league-table th { padding: 8px 10px; text-align: center; font-family: var(--font-display); font-size: 12px; letter-spacing: 1px; color: var(--text-dim); font-weight: 400; }
table.league-table th:nth-child(2) { text-align: left; }
table.league-table td { padding: 10px 10px; text-align: center; border-bottom: 1px solid var(--border); }
table.league-table td:nth-child(2) { text-align: left; font-weight: 600; }
table.league-table .team-cell { display: flex; align-items: center; gap: 8px; }
table.league-table tr.my-row { background: rgba(0,230,118,.06); }
table.league-table tr.my-row td:nth-child(2) { color: var(--green); }
.pts-cell { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.pos-cell { font-family: var(--font-mono); color: var(--text-dim); }
.pos-cell.top3 { color: var(--gold); font-weight: 700; }
.pos-cell.pos4 { color: #4dd0e1; }
.pos-cell.rel { color: var(--red); }

/* ══════════════════════════════════════════════════
   CALENDARIO REAL
══════════════════════════════════════════════════ */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 3px;
  color: var(--text);
}
.cal-nav-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.cal-nav-btn:hover { border-color: var(--green); color: var(--green); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 20px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 0;
  text-transform: uppercase;
}
.cal-cell {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 4px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color .15s;
}
.cal-cell:hover { border-color: rgba(255,255,255,.15); }
.cal-empty { background: transparent !important; border-color: transparent !important; min-height: 0; }
.cal-today { border-color: var(--green) !important; background: rgba(0,230,118,.05); }
.cal-today .cal-day-num { color: var(--green); font-weight: 700; }
.cal-has-match { background: var(--bg4); }

.cal-day-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1;
}
.cal-day-matches {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.cal-dot {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
  border: 1px solid transparent;
  overflow: hidden;
}
.cal-dot:hover { opacity: .85; }
.dot-upcoming { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.dot-w { background: rgba(0,230,118,.15); border-color: rgba(0,230,118,.35); }
.dot-d { background: rgba(255,214,0,.12); border-color: rgba(255,214,0,.3); }
.dot-l { background: rgba(255,23,68,.12); border-color: rgba(255,23,68,.3); }

/* Lista de partidos debajo del grid */
.cal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.cal-list-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.cal-list-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--text-dim);
  border-radius: 10px 0 0 10px;
}
.cal-list-item.played::before { background: var(--green); }
.cal-list-jornada {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text-dim);
  min-width: 30px;
  padding-left: 8px;
  flex-shrink: 0;
}
.cal-list-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.cal-list-team {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.cal-list-team.right { justify-content: flex-end; flex-direction: row-reverse; }
.cal-list-team.my-team-name { color: var(--green); font-weight: 700; }
.cal-list-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 90px;
  flex-shrink: 0;
}
.cal-list-score {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}
.score-w { color: var(--green); }
.score-d { color: var(--gold); }
.score-l { color: var(--red); }
.cal-list-pending {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.cal-no-matches {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 24px 0;
}
.fix-loc-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}
.fix-loc-badge.home { background: rgba(0,230,118,.12); color: var(--green); border: 1px solid rgba(0,230,118,.25); }
.fix-loc-badge.away { background: rgba(107,125,142,.1); color: var(--text-dim); border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════ */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.85); }
.modal-panel { position: relative; z-index: 1; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(0,230,118,.1); }
.modal-panel-sm { max-width: 420px; padding: 28px 24px; gap: 12px; }
.modal-title { font-family: var(--font-display); font-size: 22px; letter-spacing: 2px; }

.saves-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; max-height: 320px; overflow-y: auto; }
.save-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.save-item-info { flex: 1; }
.save-item-name { font-weight: 600; font-size: 14px; }
.save-item-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.save-item-actions { display: flex; gap: 6px; }
.btn-load { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.3); color: var(--green); font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 5px; cursor: pointer; transition: all .15s; }
.btn-load:hover { background: rgba(0,230,118,.22); }
.btn-del { background: rgba(255,23,68,.1); border: 1px solid rgba(255,23,68,.25); color: var(--red); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 5px; cursor: pointer; transition: all .15s; }
.btn-del:hover { background: rgba(255,23,68,.2); }
.saves-empty { color: var(--text-dim); font-size: 14px; text-align: center; padding: 20px 0; }

/* ── MATCH MODAL ── */
.match-header { display: flex; align-items: center; padding: 20px 24px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.match-team { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.home-side { justify-content: flex-start; }
.away-side { justify-content: flex-end; }
.match-scoreboard { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 120px; }
.match-score { font-family: var(--font-display); font-size: 42px; color: var(--text); letter-spacing: 4px; line-height: 1; }
.match-minute { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
.match-status { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--green); }
.commentary-feed { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-height: 280px; max-height: 420px; }
.commentary-feed::-webkit-scrollbar { width: 4px; }
.commentary-feed::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; animation: slideIn .25s ease; padding: 8px 12px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
@keyframes slideIn { from { opacity:0; transform:translateX(-8px); } to { opacity:1; transform:none; } }
.comment-minute { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); min-width: 28px; flex-shrink: 0; }
.comment-text { color: var(--text); }
.comment-item.goal { background: rgba(0,230,118,.08); border-left: 3px solid var(--green); }
.comment-item.goal .comment-text { color: var(--green); font-weight: 600; }
.comment-item.yellow { background: rgba(255,214,0,.06); border-left: 3px solid var(--gold); }
.comment-item.miss { border-left: 3px solid #333; }
.comment-item.kickoff { background: rgba(41,121,255,.07); border-left: 3px solid var(--blue); }
.comment-item.halftime { background: rgba(41,121,255,.07); border-left: 3px solid var(--blue); }
.comment-item.final { background: rgba(0,230,118,.12); border: 1px solid rgba(0,230,118,.3); justify-content: center; font-family: var(--font-display); font-size: 18px; letter-spacing: 2px; color: var(--green); }
.modal-panel > .btn-secondary { margin: 0 20px 16px; }

/* ── RESPONSIVE ── */
@media (max-width:700px) {
  .home-grid { grid-template-columns: 1fr; }
  .next-match-card,.results-card,.form-card { grid-column: 1/-1; }
  .hub-nav { order: 3; width: 100%; overflow-x: auto; }
  .hub-stats { margin-left: auto; }
  .auth-card { padding: 28px 20px; }
  .pitch-avatar { width: 36px; height: 36px; }
  .pitch-pname { font-size: 9px; max-width: 54px; }
  .cal-cell { min-height: 56px; }
  .cal-month-title { font-size: 20px; }
  .bench-players { gap: 8px; }
  .bench-avatar { width: 44px; height: 44px; }
  .cal-list-team span { display: none; }
}

/* ══════════════════════════════════════════════════════════
   FOOTSIM v2 — AÑADIR AL FINAL DE style.css
   Tarjetas de jugador FIFA-style + Modal detalle + Vista lista
══════════════════════════════════════════════════════════ */

/* ── CONTROLES VISTA PLANTILLA ─────────────────────────── */
.squad-view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.squad-view-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 6px;
  transition: all .15s;
  letter-spacing: 1px;
}
.squad-view-btn:hover { border-color: var(--text-dim); color: var(--text); }
.squad-view-btn.active {
  background: rgba(0,230,118,.1);
  border-color: var(--green);
  color: var(--green);
}

/* ── FILTROS DE POSICIÓN ───────────────────────────────── */
.squad-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.squad-filter-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 5px;
  transition: all .15s;
  letter-spacing: 1.5px;
}
.squad-filter-btn:hover { border-color: var(--text-dim); color: var(--text); }
.squad-filter-btn.active {
  background: rgba(0,230,118,.12);
  border-color: var(--green);
  color: var(--green);
}
.squad-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── GRID DE TARJETAS ──────────────────────────────────── */
.squad-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ── TARJETA DE JUGADOR ────────────────────────────────── */
.player-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative;
}
.player-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,230,118,.4);
  box-shadow: 0 12px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(0,230,118,.1);
}

/* Header con foto */
.pc-header {
  position: relative;
  background: linear-gradient(135deg, rgba(0,0,0,.6) 0%, color-mix(in srgb, var(--pos-color) 20%, transparent) 100%);
  padding: 16px 16px 8px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 90px;
}
.pc-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg3) 100%);
  pointer-events: none;
}
.pc-photo-wrap {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2.5px solid var(--pos-color);
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,.6);
}
.pc-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pc-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}
.pc-ovr {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  font-weight: 400;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.pc-pos-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #000;
  z-index: 1;
}

/* Body */
.pc-body {
  padding: 10px 14px 14px;
}
.pc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.pc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.pc-num {
  font-family: var(--font-mono);
  font-weight: 700;
}
.pc-status {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 3px;
}
.pc-status.titular {
  background: rgba(0,230,118,.15);
  color: var(--green);
  border: 1px solid rgba(0,230,118,.3);
}
.pc-status.suplente {
  background: rgba(107,125,142,.1);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Atributos en tarjeta */
.pc-attrs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pc-attr {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pc-attr-icon {
  font-size: 10px;
  width: 14px;
  flex-shrink: 0;
}
.pc-attr-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
}
.pc-attr-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}
.pc-attr-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 22px;
  text-align: right;
}
.pc-attr-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  min-width: 22px;
}

/* ══════════════════════════════════════════════════════════
   MODAL DETALLE DE JUGADOR
══════════════════════════════════════════════════════════ */
.modal-player-panel {
  max-width: 480px;
  padding: 0;
  overflow: hidden;
}
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all .15s;
}
.modal-close-btn:hover { background: rgba(255,23,68,.2); color: var(--red); border-color: var(--red); }

/* Header del modal de jugador */
.mpd-header {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--pos-color) 25%, #0e1318) 0%,
    #0e1318 60%
  );
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.mpd-header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, color-mix(in srgb, var(--pos-color) 30%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.mpd-photo-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--pos-color);
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
  box-shadow: 0 0 24px color-mix(in srgb, var(--pos-color) 40%, transparent);
}
.mpd-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mpd-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
}
.mpd-info {
  flex: 1;
  position: relative;
  z-index: 1;
}
.mpd-name {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}
.mpd-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mpd-nation { font-size: 18px; }
.mpd-pos {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 9px;
  border-radius: 4px;
  color: #000;
}
.mpd-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.mpd-ovr-big {
  font-family: var(--font-display);
  font-size: 52px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.mpd-ovr-big span {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 2px;
}

/* Atributos en el modal */
.mpd-attrs-grid {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.mpd-attr-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mpd-attr-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}
.mpd-attr-icon { font-size: 13px; }
.mpd-attr-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: .5px;
}
.mpd-attr-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  overflow: hidden;
}
.mpd-attr-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.mpd-attr-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

/* Radar chart */
.mpd-radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 24px 24px;
  background: rgba(0,0,0,.2);
}

/* ── RESPONSIVE CARDS ──────────────────────────────────── */
@media (max-width: 700px) {
  .squad-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .pc-photo-wrap { width: 50px; height: 50px; }
  .pc-ovr { font-size: 28px; }
  .mpd-header { padding: 20px 16px; gap: 14px; }
  .mpd-name { font-size: 20px; }
  .mpd-ovr-big { font-size: 40px; }
  .modal-player-panel { max-width: 98vw; }
}
