:root {
  --bg: #0b0e12;
  --bg-2: #11151b;
  --card: #151a21;
  --card-2: #1b212a;
  --line: #262e39;
  --line-2: #323c4a;
  --text: #e8edf3;
  --muted: #8b97a7;
  --faint: #5d6877;
  --accent: #b9f35d;
  --accent-ink: #14200a;
  --live: #ff4d4f;
  --warn: #f5b84a;
  --ok: #4ade80;
  --info: #6cb6ff;
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }

/* ---------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); cursor: pointer;
  text-decoration: none; font-weight: 550; font-size: 14px; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.btn:hover { background: #222a35; border-color: #3d4858; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: #c9f77e; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8a8a; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 48px; font-size: 15px; }

/* ---------- inputs */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input { height: 46px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2);
  padding: 0 14px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; width: 100%; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185, 243, 93, .15); }
.code-input { font-size: 30px; letter-spacing: .45em; text-align: center; height: 64px; font-weight: 650;
  padding-left: .45em; font-variant-numeric: tabular-nums; }

.msg { font-size: 14px; min-height: 20px; }
.msg.err { color: #ff8a8a; }
.msg.ok { color: var(--ok); }

/* ---------- pills */
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .02em; background: var(--card-2); border: 1px solid var(--line-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.live { background: rgba(255, 77, 79, .12); border-color: rgba(255, 77, 79, .45); color: #ff8587; }
.pill.live .dot { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.pill.off .dot { background: #5d6877; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, .6); } 50% { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0); } }
@media (prefers-reduced-motion: reduce) { .pill.live .dot { animation: none; } }

/* ---------- auth / portada */
.center-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px; display: grid; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand small { color: var(--muted); font-weight: 500; }
.auth-card h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.auth-card p { margin: 0; color: var(--muted); }
.step { display: grid; gap: 14px; }
.foot-note { font-size: 12.5px; color: var(--faint); text-align: center; }

/* ---------- dashboard */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 14, 18, .85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 550; background: none; border: 0; cursor: pointer;
  white-space: nowrap; }
.nav a:hover, .nav button:hover { color: var(--text); background: var(--card-2); }
main.dash { max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; }
.hello { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h1 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1020px) { .span-4, .span-5, .span-7 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 720px) { .grid > .card { grid-column: span 12; } .top-in { padding: 10px 16px; }
  main.dash { padding: 18px 16px 48px; } .hello h1 { font-size: 22px; } }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-h h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.card-f { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .val { font-variant-numeric: tabular-nums; color: var(--muted); }
.rank { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.rank-row .bar { grid-column: 1 / -1; height: 6px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .cols-2 { grid-template-columns: 1fr; } }
.sub-h { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.sdot.bad { background: var(--live); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 20px; }
.err-box { font-size: 13px; color: #ff9b9b; background: rgba(255, 77, 79, .08); border: 1px solid rgba(255, 77, 79, .25);
  border-radius: 10px; padding: 10px 12px; }
.lotto { display: flex; align-items: center; gap: 14px; }
.ball { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; font-variant-numeric: tabular-nums; }
.ball.alt { background: var(--card-2); color: var(--text); border: 1px solid var(--line-2); }
.guest { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.guest:last-child { border-bottom: 0; }
.guest .who { flex: 1; min-width: 0; }
.guest .who b { display: block; font-weight: 600; }
.guest .who span { font-size: 12.5px; color: var(--muted); }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.on { color: var(--ok); border-color: rgba(74, 222, 128, .4); }
.tag.watch { color: #ff8587; border-color: rgba(255, 77, 79, .45); }
.skeleton { color: transparent !important; background: linear-gradient(90deg, var(--card-2), #222a35, var(--card-2));
  background-size: 200% 100%; animation: sk 1.4s ease infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- modal */
dialog { border: 1px solid var(--line-2); background: var(--card); color: var(--text); border-radius: 18px; padding: 0;
  width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
.modal-in { padding: 24px; display: grid; gap: 16px; }
.modal-in h3 { margin: 0; font-size: 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2);
  cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.cred { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 14px 16px;
  white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.cred-big { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.cred-big b { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 17px; letter-spacing: .02em; }

/* ---------- TV */
.tv-hero { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.tv-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; max-width: 1100px; width: 100%; margin: 0 auto; }
.tv-main { display: grid; place-items: center; padding: 16px; }
.tv-panel { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 820px) { .tv-panel { grid-template-columns: 1fr; } }
.screen { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); min-height: 320px; min-width: 0;
  background: radial-gradient(120% 90% at 30% 20%, #1f2a1a 0%, #10151b 55%, #0b0e12 100%); display: grid; place-items: center; }
.screen.live { background: radial-gradient(120% 90% at 30% 20%, #3a1416 0%, #15101a 55%, #0b0e12 100%); }
.screen .noise { position: absolute; inset: 0; opacity: .07;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px); }
.screen-in { position: relative; text-align: center; display: grid; gap: 14px; justify-items: center; padding: 24px; }
.screen-in h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.03em; line-height: 1.1; }
.screen-in p { margin: 0; color: var(--muted); max-width: 34ch; }
.tv-foot { text-align: center; padding: 18px; font-size: 12.5px; color: var(--faint); }
.player-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 32px; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: radial-gradient(120% 90% at 30% 20%, #1f2a1a 0%, #10151b 55%, #0b0e12 100%); }
.player .overlay p { color: var(--muted); margin: 8px 0 0; }
