/* ============ Tokens ============ */
:root {
  --bg: #060b16;
  --bg-2: #0a1222;
  --surface: #0f1a30;
  --surface-2: #15233f;
  --surface-3: #1c2d4d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef2fb;
  --text-2: #b6c2db;
  --muted: #7f90b0;
  --gold: #e6c14f;
  --gold-2: #f6dd8b;
  --gold-ink: #1b1403;
  --green: #2fd27a;
  --red: #ff6070;
  --blue: #3987e5;      /* serie 1 (validada en oscuro) */
  --orange: #d95926;    /* serie 2 (validada en oscuro) */
  --radius: 20px;
  --radius-s: 14px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Haces de luz de fondo */
.bg-beams { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-beams::before, .bg-beams::after { content: ""; position: absolute; border-radius: 50%; filter: blur(80px); }
.bg-beams::before { width: 120vmax; height: 60vmax; left: 50%; top: -38vmax; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(230, 193, 79, .22), rgba(230, 193, 79, 0)); }
.bg-beams::after { width: 90vmax; height: 50vmax; left: 50%; bottom: -34vmax; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(57, 135, 229, .16), rgba(57, 135, 229, 0)); }

/* ============ Shell ============ */
.app { position: relative; z-index: 1; min-height: 100dvh; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: linear-gradient(to bottom, rgba(6, 11, 22, .92), rgba(6, 11, 22, .72));
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title { font: 600 20px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { display: block; font: 500 11px/1.2 var(--font); letter-spacing: .08em; color: var(--muted); margin-bottom: 3px; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--text-2);
  transition: background .15s, transform .15s; flex: none; }
.iconbtn:active { background: var(--surface-2); transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; object-fit: cover; border-radius: 10px; }

.view {
  padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: 720px; margin: 0 auto; outline: 0;
}
.view.enter { animation: viewIn .32s var(--ease) both; }
.view.enter-back { animation: viewBack .28s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-12px); } }

/* Barra inferior (móvil) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px calc(var(--safe-b) + 8px);
  background: rgba(8, 14, 28, .88);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; border-radius: 16px; color: var(--muted);
  font: 600 10.5px/1 var(--font); letter-spacing: .02em;
  transition: color .2s, transform .15s;
}
.tab svg { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.tab:active { transform: scale(.92); }
.tab[aria-current="page"] { color: var(--gold); }
.tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -9px; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--gold); box-shadow: 0 2px 14px 2px rgba(230, 193, 79, .7);
}
.tab .dot { position: absolute; top: 5px; left: calc(50% + 7px); width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg); }

/* Barra lateral (escritorio) */
.side { display: none; }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 250px 1fr; }
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
    border-right: 1px solid var(--line); background: rgba(8, 14, 28, .6); }
  .side .brand { padding: 4px 10px 22px; font: 700 20px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
  .side .brand img { width: 40px; height: 40px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    color: var(--text-2); font-weight: 600; transition: background .15s, color .15s; }
  .side-link svg { width: 22px; height: 22px; }
  .side-link:hover { background: var(--surface); color: var(--text); }
  .side-link[aria-current="page"] { background: linear-gradient(90deg, rgba(230, 193, 79, .16), rgba(230, 193, 79, .03)); color: var(--gold); }
  .side-sep { flex: 1; }
  .view { padding-bottom: 60px; max-width: 880px; padding-top: 12px; }
  .topbar .brand { display: none; }
}

/* ============ Tipografía ============ */
.h-display { font: 700 34px/1.02 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.h-section { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 2px 12px; }
.h-section h2 { font: 600 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.h-section a, .h-section button { color: var(--gold); font-weight: 600; font-size: 13px; padding: 6px 0; }
.eyebrow { font: 600 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.lead { color: var(--text-2); margin-top: 8px; }

/* ============ Tarjetas con borde luminoso ============ */
.card {
  position: relative; border-radius: var(--radius); padding: 16px;
  background: linear-gradient(180deg, rgba(21, 35, 63, .78), rgba(15, 26, 48, .78));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .7);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(246, 221, 139, .5), rgba(255, 255, 255, .07) 30%, rgba(255, 255, 255, .04) 70%, rgba(57, 135, 229, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card.flat::before { background: var(--line); }
.card.tap { transition: transform .15s var(--ease), background .15s; display: block; }
.card.tap:active { transform: scale(.985); }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Botones ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 15px; font-weight: 700; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text); transition: transform .12s, filter .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink);
  box-shadow: 0 10px 26px -10px rgba(230, 193, 79, .7), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: rgba(255, 96, 112, .14); color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Píldoras y segmentos ============ */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px;
  font: 700 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); }
.pill.gold { background: rgba(230, 193, 79, .16); color: var(--gold); }
.pill.blue { background: rgba(57, 135, 229, .18); color: #8dbaf5; }
.pill.violet { background: rgba(144, 133, 233, .18); color: #b3abf2; }
.pill.green { background: rgba(47, 210, 122, .15); color: var(--green); }
.pill.red { background: rgba(255, 96, 112, .15); color: var(--red); }

.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x proximity; }
.seg::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 16px; border-radius: 99px; font-weight: 600; font-size: 13.5px; color: var(--text-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); scroll-snap-align: start; transition: background .15s, color .15s; }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); box-shadow: none; }

/* ============ Avatar ============ */
.avatar { position: relative; flex: none; width: var(--s, 44px); height: var(--s, 44px); border-radius: 50%;
  background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); overflow: hidden;
  display: grid; place-items: center; font: 700 calc(var(--s, 44px) * .36)/1 var(--display); color: var(--gold);
  box-shadow: 0 0 0 1.5px rgba(230, 193, 79, .35); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.avatar.xl { --s: 96px; box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(230, 193, 79, .3); }
.avatar.lg { --s: 56px; }
.avatar.sm { --s: 34px; }
.avatar.ring-blue { box-shadow: 0 0 0 2px var(--blue); }
.avatar.ring-orange { box-shadow: 0 0 0 2px var(--orange); }

/* ============ Hero (próximo partido) ============ */
.hero { padding: 20px 18px 18px; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(230, 193, 79, .18); box-shadow: 0 0 0 28px rgba(230, 193, 79, .035), 0 0 0 58px rgba(230, 193, 79, .02); }
.hero-title { font: 700 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 10px 0 6px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--gold); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .8s var(--ease); }
.avatars { display: flex; }
.avatars .avatar { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }
.avatars .more { margin-left: -10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); font: 700 12px var(--font); box-shadow: 0 0 0 2px var(--surface); color: var(--text-2); }

/* ============ Marcador ============ */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.score .team { font: 600 13px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.score .goals { font: 700 52px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.score .goals.win { color: var(--gold); text-shadow: 0 0 24px rgba(230, 193, 79, .45); }
.score .sep { font: 500 28px/1 var(--display); color: var(--muted); }
.score.sm .goals { font-size: 34px; }

/* ============ KPI ============ */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 14px; }
.kpi .v { font: 700 36px/1 var(--display); font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.kpi.accent .v { color: var(--gold); }
@media (min-width: 560px) { .kpis.k4 { grid-template-columns: repeat(4, 1fr); } .kpis.k3 { grid-template-columns: repeat(3, 1fr); } }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); }

/* ============ Listas ============ */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
a.li, button.li { width: 100%; text-align: left; border-radius: 12px; }
a.li:active, button.li:active { background: var(--surface-2); }
.li .name { font-weight: 600; }
.li .sub { color: var(--muted); font-size: 12.5px; }
.li .val { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.li .val small { display: block; font: 500 10.5px/1.2 var(--font); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }

/* Posición en ranking */
.pos { width: 30px; flex: none; text-align: center; font: 700 18px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.li.top1 .pos, .li.top2 .pos, .li.top3 .pos { color: var(--gold-ink); background: var(--gold); border-radius: 9px; height: 30px; line-height: 30px; width: 30px; }
.li.top2 .pos { background: #c9d3e6; }
.li.top3 .pos { background: #cd8a55; }
.li.me { background: linear-gradient(90deg, rgba(230, 193, 79, .12), transparent); border-radius: 14px; padding-left: 8px; padding-right: 8px; }

/* Podio */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin: 6px 0 18px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 6px 12px; border-radius: 18px 18px 14px 14px;
  background: linear-gradient(180deg, rgba(21, 35, 63, .8), rgba(15, 26, 48, .5)); box-shadow: inset 0 0 0 1px var(--line); }
.pod.first { padding-top: 22px; background: linear-gradient(180deg, rgba(230, 193, 79, .2), rgba(15, 26, 48, .5)); box-shadow: inset 0 0 0 1px rgba(230, 193, 79, .4), 0 0 40px -10px rgba(230, 193, 79, .35); }
.pod .n { font-weight: 700; font-size: 13.5px; max-width: 100%; }
.pod .p { font: 700 26px/1 var(--display); color: var(--gold); }
.pod .lbl { font-size: 10.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: -4px; }
.crown { color: var(--gold); width: 22px; height: 22px; }

/* ============ Formularios ============ */
.field { display: grid; gap: 7px; }
.field > label, .field > .lab { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; font-size: 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea.input { padding: 12px 16px; min-height: 90px; resize: vertical; }
.input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 193, 79, .2); }
.input::placeholder { color: var(--muted); }
.form-error { color: var(--red); font-size: 13.5px; font-weight: 600; min-height: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Stepper (goles / asistencias) */
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper button { width: 42px; height: 42px; border-radius: 12px; font: 600 22px/1 var(--display); color: var(--gold); }
.stepper button:active { background: var(--surface-3); }
.stepper output { min-width: 26px; text-align: center; font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.stepper.big button { width: 52px; height: 52px; font-size: 28px; }
.stepper.big output { min-width: 44px; font-size: 34px; }

/* Estrellas */
.stars { display: inline-flex; gap: 2px; }
.stars button { width: 40px; height: 44px; display: grid; place-items: center; color: var(--surface-3); transition: transform .12s, color .12s; }
.stars button svg { width: 28px; height: 28px; }
.stars button.on { color: var(--gold); }
.stars button:active { transform: scale(1.2); }

/* ============ Barras (gráficos) ============ */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr 30px; align-items: center; gap: 10px; font-size: 13px; }
.bar .track { height: 10px; border-radius: 0 6px 6px 0; background: transparent; position: relative; }
.bar .fill { display: block; height: 100%; border-radius: 0 6px 6px 0; background: var(--muted); opacity: .55; width: 0; transition: width .8s var(--ease); }
.bar.lead .fill { background: var(--gold); opacity: 1; box-shadow: 0 0 16px rgba(230, 193, 79, .4); }
.bar .v { font: 700 15px/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }

/* Comparador */
.vs { display: grid; gap: 14px; }
.vs-row { display: grid; gap: 6px; }
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 8px; font-weight: 700; }
.vs-head .l { text-align: left; font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.vs-head .r { text-align: right; font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.vs-head .k { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.vs-track { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 8px; }
.vs-track i { display: block; border-radius: 6px; height: 100%; }
.vs-track .a { justify-self: end; background: var(--blue); }
.vs-track .b { justify-self: start; background: var(--orange); }
.legend { display: flex; gap: 16px; font-size: 13px; font-weight: 600; justify-content: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* Forma (V/E/D) */
.form { display: flex; gap: 6px; }
.form i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 700 12px/1 var(--font); font-style: normal; }
.form .W { background: rgba(47, 210, 122, .16); color: var(--green); }
.form .D { background: var(--surface-3); color: var(--text-2); }
.form .L { background: rgba(255, 96, 112, .16); color: var(--red); }

/* Carta de jugador */
.fcard { position: relative; width: min(100%, 300px); margin: 0 auto; aspect-ratio: 3 / 4.2; padding: 18px 20px; border-radius: 26px 26px 40px 40px;
  background: radial-gradient(120% 80% at 30% 0%, #f6dd8b 0%, #e6c14f 38%, #a8841f 100%); color: #1b1403;
  box-shadow: 0 30px 60px -24px rgba(230, 193, 79, .55), inset 0 0 0 2px rgba(255, 255, 255, .35); overflow: hidden; }
.fcard::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .0) 0 14px, rgba(255, 255, 255, .13) 14px 16px); pointer-events: none; }
.fcard .ovr { font: 700 52px/0.9 var(--display); }
.fcard .pos-t { font: 600 15px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.fcard .ph { position: absolute; right: 8px; top: 24px; width: 62%; aspect-ratio: 1; }
.fcard .ph img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.fcard .nm { position: absolute; left: 0; right: 0; top: 56%; text-align: center; font: 700 26px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 0 10px; }
.fcard .nm::after { content: ""; display: block; height: 2px; margin: 10px 26px 0; background: rgba(27, 20, 3, .35); }
.fcard .at { position: absolute; left: 20px; right: 20px; bottom: 22px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 8px; text-align: center; }
.fcard .at b { display: block; font: 700 22px/1 var(--display); }
.fcard .at span { font: 600 10.5px/1 var(--font); letter-spacing: .1em; }

/* ============ Hoja inferior (sheet) ============ */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(2, 5, 12, .62); opacity: 0; transition: opacity .25s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 92dvh; display: flex; flex-direction: column;
  border-radius: 26px 26px 0 0; background: var(--surface); border-top: 1px solid var(--line-2);
  transform: translateY(100%); transition: transform .34s var(--ease);
  padding-bottom: var(--safe-b); box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .8);
}
.sheet.on { transform: none; }
.sheet-grab { width: 42px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 10px auto 4px; flex: none; touch-action: none; }
.sheet-head { padding: 6px 20px 10px; display: flex; align-items: center; gap: 10px; }
.sheet-head h2 { font: 600 20px/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; flex: 1; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 22px; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; width: 520px; margin-left: -260px; bottom: 5dvh; border-radius: 26px; max-height: 88dvh; transform: translateY(120%); }
}

/* ============ Toast ============ */
.toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toast-root { bottom: 24px; } }
.toast { pointer-events: auto; max-width: 440px; padding: 13px 18px; border-radius: 16px; background: #1d2c4a; border: 1px solid var(--line-2);
  font-weight: 600; font-size: 14px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .7); animation: toastIn .3s var(--ease) both; display: flex; gap: 10px; align-items: center; }
.toast.ok { border-color: rgba(47, 210, 122, .5); }
.toast.err { border-color: rgba(255, 96, 112, .6); }
.toast.out { animation: toastOut .25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ============ Estados ============ */
.skel { border-radius: 14px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--surface-3); margin: 0 auto 12px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: linear-gradient(90deg, rgba(230, 193, 79, .18), rgba(230, 193, 79, .05)); box-shadow: inset 0 0 0 1px rgba(230, 193, 79, .35); }
.banner svg { width: 26px; height: 26px; color: var(--gold); flex: none; }
.banner b { display: block; }
.banner span { font-size: 13px; color: var(--text-2); }

/* ============ Login ============ */
.login { min-height: 100dvh; display: grid; align-content: center; justify-items: center; padding: 28px 22px calc(28px + var(--safe-b)); position: relative; z-index: 1; }
.login-card { width: min(100%, 400px); }
.login-logo { display: block; width: 112px; height: 112px; margin: 0 auto 14px; object-fit: cover; border-radius: 28px; filter: drop-shadow(0 10px 30px rgba(230, 193, 79, .35)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.login h1 { font: 700 40px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.login h1 span { color: var(--gold); }
.login .sub { text-align: center; color: var(--muted); letter-spacing: .3em; font-size: 11px; font-weight: 600; margin: 8px 0 28px; text-transform: uppercase; }

/* ============ Misc ============ */
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 600; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 20; margin-top: 18px; }
@media (min-width: 900px) { .sticky-cta { bottom: 16px; } }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.t th { text-align: right; color: var(--muted); font: 600 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 10px 8px; position: sticky; top: 0; background: var(--bg-2); }
table.t td { text-align: right; padding: 11px 8px; border-top: 1px solid var(--line); }
table.t th:first-child, table.t td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-2); z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Ajustes tras revisión visual ---- */
.seg { scroll-padding-left: 16px; scroll-padding-right: 16px; }
.h-section button, .h-section a { display: inline-flex; align-items: center; gap: 6px; }
.h-section svg { width: 18px; height: 18px; }
.sub { color: var(--muted); font-size: 12.5px; }
.chip svg { width: 16px; height: 16px; }
.pill svg { width: 13px; height: 13px; }
.crown { width: 22px; height: 22px; }
.avatar { line-height: 1; }
.val { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.val small { display: block; font: 500 10.5px/1.2 var(--font); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.fcard .ph img { border-radius: 20px; }

/* El login no usa la rejilla de barra lateral + contenido */
.app[data-state="login"] { display: block; }

/* Íconos dentro de filas de lista: tamaño fijo (la flecha se estiraba sin esto) */
.li > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.li > .pill { flex: none; }
button.li { color: inherit; }
button.li .grow, a.li .grow { min-width: 0; }
