/* ============================================================
   Quiniela Mundial 2026 — estilo premium dark
   ============================================================ */
:root {
  --bg: #0a0e1a;
  --bg-2: #0e1424;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #9aa6c0;
  --faint: #6b7793;
  --grass: #14b86a;
  --grass-2: #0a7d57;
  --gold: #ffc83d;
  --magenta: #ff2d78;
  --sky: #38bdf8;
  --danger: #ff5d6c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(20, 184, 106, 0.12), transparent 60%),
    radial-gradient(1000px 700px at -10% 10%, rgba(255, 45, 120, 0.1), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sky); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(20, 184, 106, 0.35); }

/* ---------- boot ---------- */
.boot { display: grid; place-items: center; min-height: 100dvh; gap: 14px; color: var(--muted); }
.boot-ball { font-size: 54px; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 0 16px 120px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.92), rgba(10, 14, 26, 0.7));
  border-bottom: 1px solid var(--stroke);
}
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand .t1 { font-size: 16px; line-height: 1; }
.brand .t2 { font-size: 11px; color: var(--gold); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar-spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--stroke); font-size: 13px; font-weight: 600; color: var(--text);
}
.pill b { color: var(--gold); }

.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--stroke); background: var(--panel); color: var(--text); font-size: 18px;
  transition: 0.15s;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--stroke-2); }
.badge-dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------- nav ---------- */
.nav { display: flex; gap: 6px; margin: 18px 0 8px; padding: 5px; background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; overflow-x: auto; }
.nav button {
  flex: 1; min-width: max-content; border: 0; background: transparent; color: var(--muted);
  padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: 0.15s;
}
.nav button.active { background: linear-gradient(135deg, var(--grass), var(--grass-2)); color: #04150d; box-shadow: 0 8px 20px rgba(20, 184, 106, 0.25); }
.nav button:not(.active):hover { color: var(--text); background: var(--panel-2); }

/* ---------- cards & sections ---------- */
.card { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 18px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); font-weight: 800; margin: 22px 4px 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--stroke-2);
  background: var(--panel-2); color: var(--text); padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; transition: 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--grass), var(--grass-2)); color: #04150d; border: 0; box-shadow: 0 10px 26px rgba(20, 184, 106, 0.3); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #f0a800); color: #2a1c00; border: 0; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- inputs ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--stroke-2);
  background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 15px; font-family: inherit; outline: none; transition: 0.15s;
}
.input:focus { border-color: var(--grass); box-shadow: 0 0 0 3px rgba(20, 184, 106, 0.18); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 0.9fr; }
.auth-hero {
  padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background:
    radial-gradient(700px 500px at 20% 10%, rgba(20, 184, 106, 0.18), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(255, 45, 120, 0.14), transparent 60%);
  border-right: 1px solid var(--stroke);
}
.auth-hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 0; letter-spacing: -0.03em; }
.auth-hero h1 .hl { background: linear-gradient(135deg, var(--gold), var(--grass)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: var(--muted); font-size: 16px; max-width: 44ch; line-height: 1.5; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hero-stat { background: var(--panel); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px 18px; }
.hero-stat b { display: block; font-size: 24px; color: var(--gold); }
.hero-stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-tabs { display: flex; background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 9px; font-weight: 700; }
.auth-tabs button.active { background: var(--panel-2); color: var(--text); }

@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { border-right: 0; border-bottom: 1px solid var(--stroke); padding: 32px 24px; }
}

/* ---------- match cards ---------- */
.match-grid { display: grid; gap: 12px; }
.match {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 16px; transition: 0.18s; position: relative; overflow: hidden;
}
.match:hover { border-color: var(--stroke-2); }
.match.hl { border-color: rgba(255, 200, 61, 0.4); background: linear-gradient(180deg, rgba(255, 200, 61, 0.07), var(--panel)); }
.match.locked { opacity: 0.97; }
.match-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 7px; letter-spacing: 0.04em; text-transform: uppercase; }
.tag-stage { background: var(--panel-2); color: var(--muted); border: 1px solid var(--stroke); }
.tag-hl { background: rgba(255, 200, 61, 0.16); color: var(--gold); border: 1px solid rgba(255, 200, 61, 0.3); }
.tag-live { background: rgba(255, 45, 120, 0.16); color: var(--magenta); border: 1px solid rgba(255, 45, 120, 0.3); }
.tag-final { background: rgba(20, 184, 106, 0.16); color: var(--grass); border: 1px solid rgba(20, 184, 106, 0.3); }
.match-when { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: right; }
.match-when .cd { color: var(--gold); }

.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team.away { flex-direction: row-reverse; text-align: right; }
.flag { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); flex-shrink: 0; }
.team-name { font-weight: 700; font-size: 15px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.team-sub { font-size: 11px; color: var(--faint); }

.score-box { display: flex; align-items: center; gap: 8px; }
.score-input {
  width: 52px; height: 52px; text-align: center; font-size: 24px; font-weight: 800;
  border-radius: 12px; border: 1px solid var(--stroke-2); background: rgba(0, 0, 0, 0.3); color: var(--text);
  outline: none; transition: 0.15s; -moz-appearance: textfield;
}
.score-input::-webkit-outer-spin-button, .score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:focus { border-color: var(--grass); box-shadow: 0 0 0 3px rgba(20, 184, 106, 0.18); }
.score-input:disabled { opacity: 0.8; }
.score-dash { color: var(--faint); font-weight: 800; }
.score-final { font-size: 26px; font-weight: 900; min-width: 44px; text-align: center; }
.score-final.win { color: var(--grass); }

.match-foot { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mypred { font-size: 12.5px; color: var(--muted); }
.mypred b { color: var(--text); }
.pts {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: 13px;
  background: rgba(20, 184, 106, 0.16); color: var(--grass); border: 1px solid rgba(20, 184, 106, 0.3);
}
.pts.zero { background: var(--panel-2); color: var(--muted); border-color: var(--stroke); }
.pts.max { background: rgba(255, 200, 61, 0.18); color: var(--gold); border-color: rgba(255, 200, 61, 0.35); }
.foot-spacer { flex: 1; }
.save-hint { font-size: 12px; color: var(--gold); display: inline-flex; align-items: center; gap: 5px; }

/* reactions */
.reacts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.react {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--stroke); font-size: 14px; transition: 0.12s;
}
.react:hover { background: rgba(255, 255, 255, 0.1); }
.react.mine { background: rgba(56, 189, 248, 0.18); border-color: rgba(56, 189, 248, 0.4); }
.react .c { font-size: 12px; font-weight: 800; color: var(--muted); }
.react-add { color: var(--muted); font-weight: 800; }
.react-picker { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; background: var(--bg-2); border: 1px solid var(--stroke-2); border-radius: 12px; }
.react-picker button { font-size: 20px; background: transparent; border: 0; padding: 4px 6px; border-radius: 8px; }
.react-picker button:hover { background: var(--panel-2); transform: scale(1.15); }

/* ---------- leaderboard ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin-bottom: 16px; }
.pod { background: var(--panel); border: 1px solid var(--stroke); border-radius: 16px; padding: 16px 12px; text-align: center; }
.pod .medal { font-size: 30px; }
.pod .pname { font-weight: 800; font-size: 14px; margin: 6px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .ppts { color: var(--gold); font-weight: 900; font-size: 20px; }
.pod .pprize { font-size: 12px; color: var(--grass); font-weight: 700; }
.pod.p1 { border-color: rgba(255, 200, 61, 0.45); background: linear-gradient(180deg, rgba(255, 200, 61, 0.12), var(--panel)); transform: translateY(-6px); }
.pod.p2 { border-color: rgba(190, 200, 220, 0.3); }
.pod.p3 { border-color: rgba(205, 127, 50, 0.35); }

.lb { width: 100%; border-collapse: collapse; }
.lb th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 10px 10px; font-weight: 800; }
.lb td { padding: 12px 10px; border-top: 1px solid var(--stroke); font-size: 14px; }
.lb tr.me td { background: rgba(56, 189, 248, 0.08); }
.lb .rank { font-weight: 900; color: var(--muted); width: 42px; }
.lb .rank.top { color: var(--gold); }
.lb .nm { font-weight: 700; }
.lb .nm .you { font-size: 11px; color: var(--sky); font-weight: 800; margin-left: 6px; }
.lb .p { font-weight: 900; color: var(--gold); text-align: right; }
.lb .prize { color: var(--grass); font-weight: 800; text-align: right; white-space: nowrap; }
.lb .badge-unpaid { font-size: 10px; color: var(--danger); border: 1px solid rgba(255, 93, 108, 0.4); border-radius: 6px; padding: 1px 5px; margin-left: 6px; }
.lb .badge-free { font-size: 10px; color: var(--grass); border: 1px solid rgba(20, 184, 106, 0.4); border-radius: 6px; padding: 1px 5px; margin-left: 6px; }

/* ---------- notifications panel ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 60; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(420px, 100%); z-index: 61;
  background: var(--bg-2); border-left: 1px solid var(--stroke); box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: slidein 0.2s ease;
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { padding: 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--stroke); }
.drawer-head h3 { margin: 0; font-size: 16px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px; }
.notif { display: flex; gap: 11px; padding: 12px; border-radius: 12px; transition: 0.12s; }
.notif:hover { background: var(--panel); }
.notif.unread { background: rgba(20, 184, 106, 0.07); }
.notif .nic { font-size: 20px; flex-shrink: 0; }
.notif .ntitle { font-weight: 700; font-size: 14px; }
.notif .nbody { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif .ntime { font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 70; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { width: min(520px, 100%); max-height: 86dvh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--stroke-2); border-radius: 18px; box-shadow: var(--shadow); }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--stroke); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 18px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(440px, calc(100% - 24px)); }
.toast { width: 100%; background: var(--bg-2); border: 1px solid var(--stroke-2); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: pop 0.2s ease; font-size: 14px; }
.toast.ok { border-color: rgba(20, 184, 106, 0.4); }
.toast.err { border-color: rgba(255, 93, 108, 0.4); }
.toast .ti { font-size: 18px; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }

/* ---------- loader overlay premium ---------- */
.loader-overlay {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center;
  background: rgba(6, 9, 17, 0.5); backdrop-filter: blur(7px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.loader-overlay.show { opacity: 1; pointer-events: auto; }
.loader-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  transform: translateY(6px) scale(0.96); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.loader-overlay.show .loader-card { transform: translateY(0) scale(1); }
.loader-spin { position: relative; width: 68px; height: 68px; }
.loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 90deg, transparent 0deg, rgba(20, 184, 106, 0.12) 90deg, var(--grass) 270deg, var(--gold) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
  animation: spin 0.85s linear infinite;
}
.loader-ball { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; animation: loader-pulse 1.1s ease-in-out infinite; }
@keyframes loader-pulse { 0%, 100% { transform: scale(0.86); opacity: 0.85; } 50% { transform: scale(1.12); opacity: 1; } }
.loader-msg {
  font-weight: 700; font-size: 14px; letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--faint), #fff, var(--faint));
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: loader-shimmer 1.6s linear infinite;
}
@keyframes loader-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .loader-ring { animation-duration: 1.6s; }
  .loader-ball, .loader-msg { animation: none; }
  .loader-card { transition: none; }
}

/* ---------- misc ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.center { text-align: center; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .e-ic { font-size: 44px; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; }
.chip.active { background: var(--panel-2); color: var(--text); border-color: var(--stroke-2); }
.banner { border-radius: 14px; padding: 14px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.banner.warn { background: rgba(255, 200, 61, 0.1); border: 1px solid rgba(255, 200, 61, 0.3); color: #ffe2a0; }
.banner.info { background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); color: #bfe9ff; }
.rules h3 { margin: 20px 0 8px; font-size: 17px; }
.rules p, .rules li { color: var(--muted); line-height: 1.6; }
.rules .ex { background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.prize-bars { display: grid; gap: 8px; }
.prize-bar { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 10px; }
.prize-bar .pl { font-weight: 800; }
.prize-bar .track { height: 12px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.prize-bar .fill { height: 100%; background: linear-gradient(90deg, var(--grass), var(--gold)); }

@media (max-width: 560px) {
  .team-name { font-size: 14px; }
  .score-input { width: 46px; height: 46px; font-size: 21px; }
  .hero-stat b { font-size: 20px; }
  .lb .hide-sm { display: none; }
}
