/* ===== MYBOOK · NFL Survivor Pool — paleta oficial (Opción Azul) =====
   midnight navy #0A1128 · electric blue #135BFF · silver #C0C6D1 · gold #FFC400 */
:root {
  --bg: #060B1D;
  --bg2: #0A1128;
  --card: #0D1633;
  --card2: #122045;
  --line: #1D2C58;
  --text: #F2F5FC;
  --muted: #98A3C0;
  --silver: #C0C6D1;
  --blue: #135BFF;
  --blue2: #2F71FF;
  --accent: #22c55e;
  --accent2: #135BFF;
  --gold: #FFC400;
  --danger: #ef4444;
  --info: #2F71FF;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #10214f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--info); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---- layout ---- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
header.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 15, 28, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .shield { font-size: 26px; }
.brand img.brand-logo { height: 44px; width: auto; display: block; }
.brand h1 { font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.userchip b { color: var(--text); }

/* ---- tabs ---- */
nav.tabs { display: flex; gap: 4px; margin: 14px 0 18px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
nav.tabs button.active { background: rgba(19,91,255,0.18); color: var(--text); border-color: var(--blue); }

/* ---- cards ---- */
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }

/* ---- status hero ---- */
.hero { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .stat {
  flex: 1 1 140px; background: var(--card2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.hero .stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.hero .stat .value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.hero .stat .value.small { font-size: 16px; }
.alive { color: var(--accent); }
.dead { color: var(--danger); }
.gold { color: var(--gold); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.badge.alive { background: rgba(34,197,94,0.15); color: var(--accent); border: 1px solid rgba(34,197,94,0.4); }
.badge.dead { background: rgba(239,68,68,0.12); color: var(--danger); border: 1px solid rgba(239,68,68,0.4); }
.badge.paid { background: rgba(255,196,0,0.12); color: var(--gold); border: 1px solid rgba(255,196,0,0.45); }
.badge.unpaid { background: rgba(139,151,181,0.12); color: var(--muted); border: 1px solid var(--line); }
.badge.live { background: rgba(56,189,248,0.14); color: var(--info); border: 1px solid rgba(56,189,248,0.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---- countdown ---- */
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 22px; }

/* ---- game cards ---- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.game {
  background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; position: relative;
}
.game.locked { opacity: 0.62; }
.game .when { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.matchup { display: flex; flex-direction: column; gap: 8px; }
.teamrow {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  width: 100%; color: var(--text); font-size: 14px; font-weight: 600; text-align: left;
}
button.teamrow:not(:disabled):hover { border-color: var(--blue2); }
.teamrow:disabled { cursor: not-allowed; opacity: 0.55; }
.teamrow.selected { border-color: var(--blue); background: rgba(19,91,255,0.16); box-shadow: 0 0 0 1px var(--blue); }
.teamrow.winner { border-color: var(--accent); }
.teamrow.loser { opacity: 0.5; }
.teamrow .logo { width: 28px; height: 28px; flex-shrink: 0; }
.teamrow .score { margin-left: auto; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.teamrow .note { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; }
.logo-fallback {
  width: 28px; height: 28px; border-radius: 50%; background: var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; flex-shrink: 0;
}

/* ---- mypick banner ---- */
.mypick {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: rgba(19,91,255,0.10); border: 1px solid rgba(19,91,255,0.45); border-radius: var(--radius);
  margin-bottom: 14px;
}
.mypick img { width: 44px; height: 44px; }
.mypick .t { font-size: 18px; font-weight: 800; }
.mypick .d { font-size: 13px; color: var(--muted); }

/* ---- tables ---- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); position: sticky; top: 0; background: var(--card); }
tr.me td { background: rgba(56,189,248,0.06); }
td.center, th.center { text-align: center; }

.cell-pick { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.cell-pick img { width: 18px; height: 18px; }
.cell-pick.win { background: rgba(34,197,94,0.15); color: var(--accent); }
.cell-pick.loss { background: rgba(239,68,68,0.15); color: var(--danger); }
.cell-pick.tie { background: rgba(251,191,36,0.15); color: var(--gold); }
.cell-pick.pending { background: rgba(56,189,248,0.1); color: var(--info); }
.cell-hidden { color: var(--muted); }

/* ---- forms ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--info); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: none; font-size: 15px; font-weight: 700;
  background: var(--accent2); color: #fff;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.full { width: 100%; }

/* ---- login ---- */
.login-box { max-width: 440px; margin: 4vh auto 0; padding: 0 16px; }
.login-box .shield-big { text-align: center; font-size: 56px; margin-bottom: 8px; }
.login-logo {
  background: linear-gradient(180deg, #f4f6fa 0%, #e6eaf2 100%);
  border-radius: var(--radius); padding: 10px 18px 2px; margin-bottom: 22px;
  box-shadow: 0 12px 40px rgba(19,91,255,0.25);
}
.login-logo img { width: 100%; height: auto; display: block; }
.login-box h1 { text-align: center; font-size: 22px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }

/* ---- misc ---- */
.error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.4); color: #86efac; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mb0 { margin-bottom: 0; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- rules ---- */
.rules ol { padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.55; }
.rules b { color: var(--gold); }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,7,15,0.75); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 17px; }
.temp-pass { font-size: 26px; font-weight: 800; letter-spacing: 0.2em; text-align: center; background: var(--bg2); border: 1px dashed var(--gold); color: var(--gold); border-radius: 10px; padding: 14px; margin: 12px 0; user-select: all; }

/* ---- champion banner ---- */
.champion {
  text-align: center; padding: 26px; border-radius: var(--radius); margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255,196,0,0.16), rgba(19,91,255,0.08));
  border: 1px solid rgba(255,196,0,0.5);
}
.champion .trophy { font-size: 44px; }
.champion .name { font-size: 24px; font-weight: 800; color: var(--gold); margin-top: 6px; }

/* ---- landing pública ---- */
.hero-landing {
  padding: 56px 16px 48px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(19,91,255,0.22) 0%, transparent 60%),
    radial-gradient(600px 300px at 85% 20%, rgba(255,196,0,0.07) 0%, transparent 55%);
  text-align: center;
}
.hero-bigword {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(90px, 17vw, 260px); font-weight: 900; letter-spacing: 0.04em;
  white-space: nowrap; user-select: none; pointer-events: none;
  color: transparent; -webkit-text-stroke: 2px rgba(19,91,255,0.30);
  text-shadow: 0 0 90px rgba(19,91,255,0.28);
  transform: rotate(-4deg) translateY(-10%);
  animation: bigword-pulse 5s ease-in-out infinite;
}
@keyframes bigword-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.5; }
}
.hero-inner { max-width: 820px; margin: 0 auto; position: relative; z-index: 1; }
.hero-logo {
  max-width: 560px; margin: 0 auto 28px;
  box-shadow: 0 24px 90px rgba(19,91,255,0.45);
}
.hero-landing h1 {
  font-size: clamp(30px, 6vw, 52px); line-height: 1.08; letter-spacing: 0.02em;
  font-weight: 900; text-transform: uppercase; margin-bottom: 16px;
}
.hero-landing h1 .grad {
  background: linear-gradient(90deg, var(--blue2), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 600px; margin: 0 auto 26px; }
.btn.big { padding: 15px 28px; font-size: 17px; border-radius: 12px; }
.countdown-strip {
  margin: 34px auto 0; display: inline-block; padding: 16px 30px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(19,91,255,0.18);
}
.cd-label { font-size: 11px; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 6px; }
.cd-timer { font-size: clamp(26px, 5vw, 40px); font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold); }

.landing-section { padding: 54px 16px; max-width: 1020px; margin: 0 auto; scroll-margin-top: 76px; }
.landing-section.alt { background: rgba(19,91,255,0.04); max-width: none; }
.landing-section.alt > * { max-width: 1020px; margin-left: auto; margin-right: auto; }
.landing-title {
  text-align: center; font-size: clamp(22px, 4vw, 30px); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 900; margin-bottom: 30px;
}
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-n {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--blue2)); font-weight: 900; font-size: 19px; margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(19,91,255,0.45);
}
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.55; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .f-ico { font-size: 26px; margin-bottom: 10px; }
.feature b { display: block; margin-bottom: 6px; font-size: 15px; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.5; }

.teamstrip { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 900px; margin: 0 auto; }
.teamstrip img { width: 52px; height: 52px; transition: transform .15s; opacity: .92; }
.teamstrip img:hover { transform: scale(1.22); opacity: 1; }

.landing-footer { text-align: center; padding: 44px 16px 60px; border-top: 1px solid var(--line); }
.landing-footer p { margin-top: 10px; font-size: 14px; }

/* ---- chips de jugador / avatares ---- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: 0.02em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.playerchip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px 5px 5px; font-size: 13px; font-weight: 600;
}
.playerchip.me { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.playerchip.out { opacity: 0.62; }
.playerchip.out .avatar { filter: grayscale(0.8); }
.playerchip .why { font-size: 11px; color: var(--muted); }
.poolgroup { margin-bottom: 20px; }
.poolhead { display: flex; align-items: center; gap: 8px; font-size: 15px; }

/* ---- historia semana a semana ---- */
.weekstory {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px; background: var(--card2);
}
.weekstory.champweek { border-color: rgba(255,196,0,0.55); background: linear-gradient(135deg, rgba(255,196,0,0.08), var(--card2)); }
.ws-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ws-title { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.ws-count { font-size: 17px; font-variant-numeric: tabular-nums; }
.ws-count .arrow { color: var(--muted); margin: 0 2px; }
.ws-bar { height: 8px; background: var(--bg2); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.ws-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--blue2)); box-shadow: 0 0 10px rgba(19,91,255,0.5); }
.ws-champ { margin-top: 12px; font-size: 15px; font-weight: 800; color: var(--gold); }
.ws-fallen { margin-top: 10px; }

/* ---- confetti ---- */
.confetti {
  position: fixed; top: -12px; z-index: 200; border-radius: 2px; pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.7; }
}

/* ---- barras de supervivencia (admin) ---- */
.weekbars { display: flex; gap: 6px; align-items: flex-end; overflow-x: auto; padding-bottom: 4px; min-height: 120px; }
.weekbar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 42px; flex: 1; }
.weekbar .bar {
  width: 100%; max-width: 46px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--blue2), var(--blue));
  box-shadow: 0 0 12px rgba(19,91,255,0.35);
  transition: height .3s;
}
.weekbar.zero .bar { background: var(--card2); box-shadow: none; }
.weekbar .n { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.weekbar .wk { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* columna fija en tablas grandes */
table.sticky-first th:first-child, table.sticky-first td:first-child {
  position: sticky; left: 0; background: var(--card); z-index: 2;
}

/* ---- calendario de temporada ---- */
.cal-week { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.cal-week > button.cal-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: var(--card2); color: var(--text); border: none; padding: 13px 16px;
  font-size: 14px; font-weight: 700;
}
.cal-week > button.cal-head:hover { background: rgba(19,91,255,0.12); }
.cal-week.current > button.cal-head { border-left: 3px solid var(--blue); }
.cal-body { padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.cal-game {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
}
.cal-game img { width: 22px; height: 22px; }
.cal-game .vs { color: var(--muted); font-size: 11px; }
.cal-game .when { margin-left: auto; color: var(--muted); font-size: 11px; text-align: right; }
.cal-game .final { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-game .w { color: var(--accent); }

@media (max-width: 560px) {
  .brand .sub { display: none; }
  .brand h1 { font-size: 15px; }
  .userchip { font-size: 12px; gap: 6px; }
  .userchip b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #user-status-badge { display: none; }
  .hero .stat .value { font-size: 20px; }
  .games { grid-template-columns: 1fr; }
}
