/* ============================================================
   Slakun 7 — juego del Mundial (estilo 7 a 0) · skin SlakunTV
   Paleta charcoal #232122 · dorado #EAD98B→#BEA879 · neumorfismo
   ============================================================ */

:root {
  --font-display: "Anton", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, sans-serif;

  --bg-a: #232122;
  --surface: #3a3a3a;
  --surface-lo: #323232;
  --shadow-dark: #141314;

  --text: #f4f2f3;
  --text-dim: #a8a4a6;
  --live: #ff4d5e;
  --win: #3ddc84;
  --gold: #d9c389;
  --gold-hi: #ead98b;
  --gold-lo: #bea879;
  --gold-grad: linear-gradient(115deg, var(--gold-hi), var(--gold-lo));
  --white: #fafafa;

  --neu-out: 9px 9px 18px var(--shadow-dark);
  --neu-out-sm: 5px 5px 10px var(--shadow-dark);
  --neu-in: inset 6px 6px 12px var(--shadow-dark);
  --neu-in-sm: inset 3px 3px 7px var(--shadow-dark);

  /* color por posición */
  --pos-gk: #f0b429;
  --pos-def: #4f9dde;
  --pos-mid: #3ddc84;
  --pos-fwd: #ff4d5e;

  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 64px;
  --max-w: 1120px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-a);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.5px; }
.gold { color: var(--gold); }

.neu-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--neu-out); }

/* ===== Botones ===== */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.94rem;
  padding: 14px 30px;
  border-radius: 99px;
  transition: box-shadow 0.18s, transform 0.18s, color 0.18s, opacity 0.18s;
}
.btn-primary { background: var(--gold-grad); color: #1c1c1c; box-shadow: var(--neu-out); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 12px 12px 22px var(--shadow-dark); }
.btn-primary:active { transform: none; box-shadow: var(--neu-in-sm); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--neu-out); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: var(--neu-out-sm); }
.btn-ghost:hover { color: var(--gold); transform: translateY(-2px); }
.btn-ghost:active { box-shadow: var(--neu-in-sm); transform: none; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg-a) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.header-inner { max-width: var(--max-w); margin: 0 auto; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { height: 38px; width: auto; filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.5)); }
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.9rem; line-height: 1;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.4));
}
.header-right { display: flex; align-items: center; gap: 10px; }
.btn-back {
  color: var(--text-dim); font-size: 0.8rem; font-weight: 700; text-decoration: none;
  padding: 7px 12px; border-radius: 99px; white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.btn-back:hover { color: var(--gold); background: var(--surface); }

.btn-help {
  background: var(--surface); color: var(--gold); border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 0.8rem;
  padding: 9px 16px; border-radius: 99px; box-shadow: var(--neu-out-sm);
  transition: color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn-help:hover { color: var(--gold-hi); transform: translateY(-1px); }
.btn-help:active { box-shadow: var(--neu-in-sm); transform: none; }
.host-gradient-bar { height: 4px; background: var(--gold-grad); }

/* ===== Pantallas ===== */
.screen { max-width: var(--max-w); margin: 0 auto; padding: clamp(24px, 5vw, 48px) 20px 40px; animation: fadeUp 0.4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===== Setup ===== */
.setup-hero { text-align: center; max-width: 680px; margin: 0 auto clamp(22px, 4vw, 38px); }
.kicker { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 3px; color: var(--text-dim); margin: 0 0 14px; }
.setup-title { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.02; text-transform: uppercase; margin: 0 0 16px; color: var(--white); text-shadow: 2px 2px 0 var(--shadow-dark); }
.setup-sub { color: var(--text-dim); font-size: 1.02rem; margin: 0; }
.setup-sub strong { color: var(--text); }

.setup-card { padding: clamp(20px, 4vw, 34px); max-width: 760px; margin: 0 auto; }
.setup-h2 { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin: 0 0 14px; font-family: var(--font-body); }
.setup-h2:not(:first-child) { margin-top: 28px; }

/* Grilla de formaciones */
.formation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.formation-chip {
  background: var(--surface); box-shadow: var(--neu-out-sm); border: 2px solid transparent;
  border-radius: var(--radius-sm); padding: 12px 8px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.formation-chip:hover { transform: translateY(-2px); }
.formation-chip.active { border-color: var(--gold); box-shadow: var(--neu-in-sm); }
.fc-mini { width: 46px; height: 60px; position: relative; background: #2c322c; border-radius: 5px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(234,217,139,0.18); }
.fc-mini i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); transform: translate(-50%, -50%); }
.fc-name { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 1px; color: var(--white); }
.formation-chip.active .fc-name { color: var(--gold); }

/* Segmented controls (estilo/modo) */
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-btn {
  flex: 1 1 auto; min-width: 120px;
  background: var(--surface); box-shadow: var(--neu-out-sm); border: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-body); font-weight: 700; font-size: 0.84rem;
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: color 0.15s, box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.seg-btn small { font-weight: 600; font-size: 0.66rem; color: var(--text-dim); opacity: 0.8; }
.seg-btn:hover { color: var(--text); transform: translateY(-1px); }
.seg-btn.active { border-color: var(--gold); box-shadow: var(--neu-in-sm); color: var(--white); }
.seg-btn.active small { color: var(--gold); opacity: 1; }

.btn-start { width: 100%; margin-top: 30px; font-size: 1.05rem; padding: 16px; }

/* ===== Draft ===== */
.draft-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) {
  .draft-layout { grid-template-columns: 1fr; }
  /* En una columna, la acción (dado + plantel) va arriba; la cancha es feedback abajo */
  .draft-draw-col { order: -1; }
}

.draft-pitch-col { display: flex; flex-direction: column; align-items: center; }
.draft-status { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ds-stat, .ds-team-rating { display: flex; align-items: baseline; gap: 7px; }
.ds-num { font-family: var(--font-display); font-size: 1.7rem; color: var(--white); line-height: 1; }
.ds-num.gold { color: var(--gold); }
.ds-lbl { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.ds-skips { display: flex; align-items: center; gap: 8px; }
.skips-dots { display: inline-flex; gap: 5px; }
.skip-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold-grad); box-shadow: var(--neu-out-sm); }
.skip-dot.used { background: var(--surface-lo); box-shadow: var(--neu-in-sm); }

/* Cancha (reutilizada del KV de SlakunTV) */
.pitch-wrap { width: 100%; display: flex; justify-content: center; }
.pitch {
  position: relative; width: min(360px, 92vw); margin: 0 auto;
  aspect-ratio: 68 / 100; background: linear-gradient(180deg, #313a31, #2a302a);
  border-radius: var(--radius-sm); box-shadow: var(--neu-in-sm); overflow: hidden;
}
.pitch::before { content: ''; position: absolute; inset: 4%; border: 1.5px solid rgba(234,217,139,0.32); border-radius: 4px; }
.pitch::after { content: ''; position: absolute; left: 4%; right: 4%; top: 50%; border-top: 1.5px solid rgba(234,217,139,0.32); }
.pitch .center-circle { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; border: 1.5px solid rgba(234,217,139,0.32); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch .area-top, .pitch .area-bottom { position: absolute; left: 28%; right: 28%; height: 11%; border: 1.5px solid rgba(234,217,139,0.32); }
.pitch .area-top { top: 4%; border-top: none; }
.pitch .area-bottom { bottom: 4%; border-bottom: none; }

.pitch-dot {
  position: absolute; transform: translate(-50%, -50%);
  width: 10.5%; aspect-ratio: 1; border-radius: 50%; border: none;
  font-family: var(--font-display); font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center; cursor: default; padding: 0;
  transition: transform 0.15s, box-shadow 0.15s; z-index: 1;
}
.pitch[data-rows="5"] .pitch-dot { width: 9%; font-size: 0.66rem; }
.pitch-dot::after {
  content: attr(data-last); position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  display: block; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-body); font-size: 8px; font-weight: 700; letter-spacing: 0.2px;
  color: #f4f2f3; text-shadow: 0 1px 3px rgba(0,0,0,0.9); pointer-events: none;
}
.pitch-dot.filled { color: #1c1c1c; box-shadow: 2px 3px 6px rgba(0,0,0,0.5); }
.pitch-dot.filled.pos-GK { background: var(--pos-gk); }
.pitch-dot.filled.pos-DEF { background: var(--pos-def); }
.pitch-dot.filled.pos-MID { background: var(--pos-mid); }
.pitch-dot.filled.pos-FWD { background: var(--pos-fwd); }
.pitch-dot.filled.pop { animation: dotPop 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes dotPop { from { transform: translate(-50%,-50%) scale(0.2); opacity: 0; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
.pitch-dot.empty { background: rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.18); color: var(--text-dim); font-family: var(--font-body); font-weight: 800; font-size: 0.56rem; }
.pitch-dot.empty.target { box-shadow: inset 0 0 0 2px var(--gold); color: var(--gold); animation: targetPulse 1.2s ease-in-out infinite; }
.pitch-dot.empty.placeable { cursor: pointer; }
.pitch-dot.empty.placeable:hover { box-shadow: inset 0 0 0 2px var(--gold-hi); color: var(--gold-hi); transform: translate(-50%, -50%) scale(1.22); }
@keyframes targetPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.12); } }

.pitch-hint { text-align: center; font-size: 0.72rem; color: var(--text-dim); margin: 12px 0 0; min-height: 1em; }

.btn-sim { width: min(360px, 92vw); margin-top: 18px; }
.btn-restart { margin-top: 12px; padding: 9px 22px; font-size: 0.8rem; }

/* Columna del dado / plantel sorteado */
.draw-card { padding: 18px 18px 8px; position: sticky; top: calc(var(--header-h) + 16px); }
.draw-head { display: flex; align-items: center; gap: 12px; }
.draw-flag-wrap { width: 56px; height: 38px; border-radius: 6px; overflow: hidden; box-shadow: var(--neu-out-sm); background: var(--surface-lo); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.draw-flag { width: 56px; height: 38px; object-fit: cover; }
.draw-flag[src=""] , .draw-flag:not([src]) { display: none; }
.draw-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.draw-nation { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); line-height: 1.05; }
.draw-meta { font-size: 0.76rem; color: var(--text-dim); font-weight: 600; }
.dice-btn {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--gold-grad); box-shadow: var(--neu-out-sm); font-size: 1.7rem; line-height: 1;
  transition: transform 0.2s, box-shadow 0.15s;
}
.dice-btn:hover { transform: translateY(-2px) rotate(-6deg); }
.dice-btn:active { box-shadow: var(--neu-in-sm); transform: none; }
.dice-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dice-btn.rolling { animation: diceRoll 0.5s ease; }
@keyframes diceRoll { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }

/* Estado "tirá el dado" */
.roll-prompt { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 26px 16px; text-align: center; }
.dice-big { width: 72px; height: 72px; font-size: 2.3rem; border-radius: 18px; }
.roll-text { margin: 0; font-size: 0.95rem; color: var(--text-dim); font-weight: 700; text-wrap: balance; }

/* Botones cambiar año / selección */
.change-row { display: flex; gap: 8px; margin: 14px 0 4px; }
.change-btn {
  flex: 1; background: var(--surface-lo); color: var(--text); border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 0.76rem; padding: 9px 8px; border-radius: 99px;
  box-shadow: var(--neu-out-sm); transition: color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.change-btn:hover:not(:disabled) { color: var(--gold); }
.change-btn:active:not(:disabled) { box-shadow: var(--neu-in-sm); }
.change-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.draw-need { margin: 14px 0 6px; font-size: 0.74rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.6px; min-height: 1em; }

.squad-pick-list { list-style: none; margin: 0; padding: 0 0 10px; max-height: 52vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-lo) transparent; }
.squad-pick-list::-webkit-scrollbar { width: 7px; }
.squad-pick-list::-webkit-scrollbar-thumb { background: var(--surface-lo); border-radius: 99px; }
.sp-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface-lo); border: none; border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 7px; cursor: pointer; text-align: left;
  font-family: var(--font-body); color: var(--text); box-shadow: var(--neu-out-sm);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.sp-row:hover:not(:disabled) { transform: translateX(3px); }
.sp-row:active:not(:disabled) { box-shadow: var(--neu-in-sm); }
.sp-row:disabled { opacity: 0.34; cursor: not-allowed; }
.sp-row.selected { box-shadow: var(--neu-in-sm), inset 0 0 0 2px var(--gold); }
.sp-row.selected .sp-name { color: var(--gold); }
.sp-pos { flex: 0 0 auto; width: 34px; text-align: center; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.5px; padding: 3px 0; border-radius: 6px; color: #1c1c1c; }
.sp-pos.pos-GK { background: var(--pos-gk); }
.sp-pos.pos-DEF { background: var(--pos-def); }
.sp-pos.pos-MID { background: var(--pos-mid); }
.sp-pos.pos-FWD { background: var(--pos-fwd); }
.sp-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-name .used-tag { font-size: 0.62rem; color: var(--text-dim); font-weight: 600; }
.sp-rating { flex: 0 0 auto; font-family: var(--font-display); font-size: 1.15rem; color: var(--gold); min-width: 28px; text-align: right; }
.sp-rating.hidden-rating { color: var(--text-dim); }

/* ===== Resultado / Simulación ===== */
.result-wrap { max-width: 720px; margin: 0 auto; }
.sim-head { text-align: center; margin-bottom: 22px; }
.sim-head .kicker { margin-bottom: 8px; }
.sim-team-name { font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.4rem); color: var(--white); margin: 0; text-transform: uppercase; }
.sim-team-meta { color: var(--text-dim); font-size: 0.84rem; margin: 6px 0 0; }
.sim-team-meta b { color: var(--gold); font-family: var(--font-display); font-size: 1.05rem; }

.match-list { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; }
.match-row {
  background: var(--surface); box-shadow: var(--neu-out-sm); border-radius: var(--radius-sm);
  padding: 13px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center;
  animation: matchIn 0.45s cubic-bezier(0.16,1,0.3,1) both; position: relative; overflow: hidden;
}
@keyframes matchIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.match-round { grid-row: 1 / 3; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; opacity: 0.85; }
.mr-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mr-teams { font-weight: 700; font-size: 0.95rem; }
.mr-teams .me { color: var(--white); }
.mr-teams .opp { color: var(--text-dim); }
.mr-score { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); white-space: nowrap; }
.mr-score .pens { font-family: var(--font-body); font-size: 0.66rem; color: var(--text-dim); font-weight: 700; }
.mr-detail { grid-column: 2 / 4; font-size: 0.74rem; color: var(--text-dim); }
.mr-detail .scorer { color: var(--gold); }
.match-row.win { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--win); }
.match-row.draw { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--gold); }
.match-row.loss { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--live); }
.mr-result-tag { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 3px 9px; border-radius: 99px; }
.mr-result-tag.win { background: rgba(61,220,132,0.18); color: var(--win); }
.mr-result-tag.draw { background: rgba(217,195,137,0.18); color: var(--gold); }
.mr-result-tag.loss { background: rgba(255,77,94,0.16); color: var(--live); }

/* Verdicto final */
.verdict {
  text-align: center; padding: 26px 22px; border-radius: var(--radius); margin: 0 0 22px;
  background: var(--surface); box-shadow: var(--neu-out); position: relative; overflow: hidden;
}
.verdict.champ { box-shadow: var(--neu-out), 0 0 0 2px var(--gold); }
.verdict-emoji { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.verdict-title { font-family: var(--font-display); font-size: clamp(1.8rem, 6vw, 2.8rem); text-transform: uppercase; margin: 0 0 6px; color: var(--white); }
.verdict.champ .verdict-title { color: var(--gold); }
.verdict-sub { color: var(--text-dim); font-size: 0.92rem; margin: 0; }
.perfect-badge {
  display: inline-block; margin-top: 14px; font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 2px;
  background: var(--gold-grad); color: #1c1c1c; padding: 8px 22px; border-radius: 99px; box-shadow: var(--neu-out-sm);
}

.result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* Mini formación final */
.final-xi { margin: 0 0 22px; }
.final-xi-title { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin: 0 0 12px; text-align: center; }
.xi-lines { display: flex; flex-direction: column; gap: 6px; }
.xi-line { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.xi-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); box-shadow: var(--neu-out-sm); border-radius: 99px; padding: 5px 12px 5px 6px; font-size: 0.78rem; font-weight: 700; }
.xi-chip .xc-pos { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.xi-chip .xc-pos.pos-GK { background: var(--pos-gk); }
.xi-chip .xc-pos.pos-DEF { background: var(--pos-def); }
.xi-chip .xc-pos.pos-MID { background: var(--pos-mid); }
.xi-chip .xc-pos.pos-FWD { background: var(--pos-fwd); }
.xi-chip small { color: var(--text-dim); font-weight: 600; }

/* Confeti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; opacity: 0.9; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 1; } }

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(12,11,12,0.82); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal { width: min(680px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; position: relative; animation: modalIn 0.28s cubic-bezier(0.16,1,0.3,1); }
.modal-sm { width: min(460px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--surface); box-shadow: var(--neu-out-sm); color: var(--text); font-size: 0.9rem; cursor: pointer; transition: color 0.15s, box-shadow 0.15s; }
.modal-close:hover { color: var(--live); }
.modal-close:active { box-shadow: var(--neu-in-sm); }
.help-body { padding: 26px 24px 24px; overflow-y: auto; }
.help-body h3 { margin: 0 0 16px; font-size: 1.4rem; text-transform: uppercase; color: var(--white); }
.help-steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.help-steps li { font-size: 0.9rem; color: var(--text-dim); }
.help-steps strong { color: var(--text); }
.help-foot { font-size: 0.84rem; color: var(--text-dim); margin: 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); }
.help-foot strong { color: var(--gold); }

/* ===== Footer ===== */
.site-footer { margin-top: 70px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 34px 20px 40px; text-align: center; }
.footer-logo { height: 44px; width: auto; margin: 0 auto 16px; opacity: 0.95; }
.footer-brand {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
}
.fb-part { white-space: nowrap; }
.fb-sep { color: var(--text-dim); opacity: 0.6; }
.footer-brand a { color: var(--gold); text-decoration: none; }
.footer-brand a:hover { text-decoration: underline; }
/* en mobile cada parte va en su propia línea, centrada, sin el separador */
@media (max-width: 480px) {
  .footer-brand { gap: 4px; }
  .fb-sep { display: none; }
  .fb-part { flex: 1 0 100%; text-align: center; }
}

/* ===== Match center (jugar partido por partido) ===== */
.match-center { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.mc-card { background: var(--surface); box-shadow: var(--neu-out-sm); border-radius: var(--radius-sm); padding: 14px 16px; animation: matchIn 0.4s cubic-bezier(0.16,1,0.3,1) both; }
.mc-card.win { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--win); }
.mc-card.loss { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--live); }
.mc-card.draw { box-shadow: var(--neu-out-sm), inset 4px 0 0 var(--gold); }
.mc-card.playing { box-shadow: var(--neu-out-sm), 0 0 0 1.5px var(--gold); }
.mc-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.mc-round { font-size: 0.62rem; font-weight: 800; letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; min-width: 56px; }
.mc-vs { display: inline-flex; align-items: center; gap: 7px; font-size: 1rem; font-weight: 700; color: var(--text-dim); flex: 1; min-width: 0; }
.mc-vs b { color: var(--white); font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; letter-spacing: 0.5px; }
.mc-flag { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 1px 1px 3px var(--shadow-dark); flex: 0 0 auto; }
.mc-year { color: var(--gold); font-weight: 800; font-size: 0.9rem; flex: 0 0 auto; }
.mc-score { font-family: var(--font-display); font-size: 1.55rem; color: var(--win); white-space: nowrap; }
.mc-card.loss .mc-score { color: var(--live); }
.mc-card.draw .mc-score, .mc-card.pending .mc-score, .mc-card.playing .mc-score { color: var(--white); }
.mc-score i { font-style: normal; color: var(--text-dim); margin: 0 1px; }
.mc-score .mc-pens { font-family: var(--font-body); font-size: 0.6rem; color: var(--text-dim); font-weight: 700; }
.mc-min { font-family: var(--font-display); font-size: 0.82rem; color: #1c1c1c; background: var(--live); padding: 3px 9px; border-radius: 99px; min-width: 40px; text-align: center; animation: pulseMin 1s ease-in-out infinite; }
@keyframes pulseMin { 50% { opacity: 0.55; } }
.mc-mark { font-size: 1.2rem; font-weight: 800; width: 26px; text-align: center; }
.mc-mark.win { color: var(--win); }
.mc-mark.loss { color: var(--live); }
.mc-mark.draw { color: var(--gold); }
.mc-play { padding: 9px 18px; font-size: 0.82rem; }
.mc-events { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.mc-card.done .mc-events { margin-top: 8px; font-size: 0.78rem; }
.mc-ev { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; animation: evIn 0.3s ease both; }
@keyframes evIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.mc-ev-min { font-family: var(--font-display); color: var(--gold); min-width: 30px; }
.mc-ev-dot { color: var(--text-dim); }
.mc-ev.me .mc-ev-scorer { color: var(--white); font-weight: 700; }
.mc-ev.opp .mc-ev-scorer, .mc-ev.opp .mc-ev-min { color: var(--text-dim); }
.mc-events .gs-label { font-size: 0.6rem; font-weight: 800; letter-spacing: 1px; color: var(--text-dim); }
.gs-me { color: var(--text); font-weight: 700; }
.gs-opp { color: var(--text-dim); }
.gs-sep { color: var(--gold); opacity: 0.6; margin: 0 3px; }
.mc-next { align-self: center; margin: 2px 0 6px; }

/* ===== Tabla del grupo ===== */
.group-table { background: var(--bg-a); box-shadow: var(--neu-in-sm); border-radius: var(--radius-sm); padding: 14px 16px; animation: matchIn 0.4s cubic-bezier(0.16,1,0.3,1) both; }
.gt-title { margin: 0 0 10px; font-size: 0.66rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.gt { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.gt td { padding: 7px 6px; border-top: 1px solid rgba(255,255,255,0.05); }
.gt tr:first-child td { border-top: none; }
.gt-pos { width: 22px; color: var(--text-dim); font-family: var(--font-display); text-align: center; }
.gt-team { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.gt-flag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; flex: 0 0 auto; }
.gt-dg { text-align: center; color: var(--text-dim); font-variant-numeric: tabular-nums; width: 44px; }
.gt-pts { text-align: right; font-family: var(--font-display); color: var(--white); width: 32px; font-size: 1rem; }
.gt tr.gt-q .gt-pos { color: var(--win); }
.gt tr.gt-q td:first-child { box-shadow: inset 3px 0 0 var(--win); }
.gt tr.gt-me td { background: rgba(234,217,139,0.09); }
.gt tr.gt-me .gt-team { color: var(--gold); }
.gt-verdict { margin: 10px 0 0; font-size: 0.78rem; font-weight: 800; }
.gt-verdict.ok { color: var(--win); }
.gt-verdict.no { color: var(--live); }

/* ===== Stats de campaña ===== */
.camp-stats { background: var(--bg-a); box-shadow: var(--neu-in-sm); border-radius: var(--radius); padding: 20px 22px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 18px 0; }
.cs-record { display: flex; flex-direction: column; align-items: center; padding-right: 22px; border-right: 1px solid rgba(255,255,255,0.08); }
.cs-big { font-family: var(--font-display); font-size: 3.2rem; line-height: 0.9; color: var(--white); text-shadow: 2px 3px 0 var(--shadow-dark); }
.cs-big i { font-style: normal; color: var(--gold); }
.cs-rlabel { font-size: 0.6rem; font-weight: 800; letter-spacing: 2px; color: var(--text-dim); margin-top: 6px; }
.cs-grid { display: flex; gap: 22px; flex: 1; flex-wrap: wrap; }
.cs-box { display: flex; flex-direction: column; gap: 2px; }
.cs-num { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold); line-height: 1; }
.cs-lbl { font-size: 0.6rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }

/* ===== Card del plantel ===== */
.card-body { padding: 24px 22px 22px; overflow-y: auto; }
.card-body h3 { margin: 0 0 4px; font-size: 1.3rem; text-transform: uppercase; color: var(--white); }
.card-sub { margin: 0 0 14px; font-size: 0.74rem; color: var(--text-dim); }
.card-list { list-style: none; margin: 0; padding: 0; }
.card-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid rgba(255,255,255,0.05); }
.card-row.top { background: rgba(234,217,139,0.09); border-radius: 8px; }
.card-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name small { color: var(--text-dim); font-weight: 600; }
.card-rating { font-family: var(--font-display); color: var(--text-dim); font-size: 1rem; min-width: 24px; text-align: right; }
.card-goals { min-width: 48px; text-align: right; font-weight: 800; font-size: 0.84rem; color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 560px) {
  .header-inner { padding: 0 14px; }
  .draw-card { position: static; }
  .squad-pick-list { max-height: 44vh; }
  .setup-card { padding: 18px 14px; }
  .cs-record { border-right: none; padding-right: 0; }
  .cs-big { font-size: 2.7rem; }
  .camp-stats { gap: 16px; }
  /* Match center mobile: fila 1 = ronda + marcador; fila 2 = rival (nombre completo, sin pisarse); fila 3 = botón */
  .mc-head { gap: 4px 10px; }
  .mc-round { order: 1; }
  .mc-score { order: 2; margin-left: auto; }
  .mc-min, .mc-mark { order: 3; }
  .mc-vs { order: 4; flex: 1 0 100%; min-width: 0; font-size: 0.92rem; }
  .mc-vs b { font-size: 1.1rem; }
  .mc-play { order: 5; flex: 1 0 100%; margin-top: 8px; }
  .mc-next { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .screen, .match-row, .pitch-dot.filled.pop, .dice-btn.rolling, .confetti i { animation: none !important; }
  .pitch-dot.empty.target { animation: none; }
}
