:root {
  --bg: #080808;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --surface-3: #222;
  --border: #262626;
  --border-light: #333;
  --text: #fff;
  --text-2: #a3a3a3;
  --text-3: #6b6b6b;
  --yellow: #ffe500;
  --green: #00ff88;
  --red: #ff4d4d;
  --cyan: #00e5ff;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Inter, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main { min-height: 70vh; }

/* Cabecera */
header.top { position: sticky; top: 0; z-index: 30; background: rgba(8,8,8,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
header.top .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; text-decoration: none; }
.logo .mark { width: 28px; height: 28px; border-radius: 7px; background: #fff; color: #000; display: grid; place-items: center; font-size: 15px; }
nav.links { display: flex; gap: 4px; }
nav.links a { text-decoration: none; color: var(--text-2); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
nav.links a:hover, nav.links a.on { color: #000; background: #fff; }
.top-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { nav.links { display: none; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--border-light); background: var(--surface-2); cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.btn.primary:hover { background: #e6e6e6; }
.btn.yellow { background: var(--yellow); color: #000; border-color: var(--yellow); font-weight: 600; }
.btn.danger { color: var(--red); border-color: rgba(255,77,77,.35); background: rgba(255,77,77,.08); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Bloques */
section.block { padding: 64px 0; border-top: 1px solid var(--border); }
section.block.alt { background: #0b0b0b; }
.eyebrow { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--text-3); }
.h1 { font-size: clamp(32px, 6vw, 52px); font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.h2 { font-size: clamp(24px, 4vw, 34px); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; margin-top: 10px; }
.lead { color: var(--text-2); font-size: 17px; max-width: 580px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card.white { background: #fff; color: #000; border-color: #fff; }
.card.white .muted { color: rgba(0,0,0,.6); }
.card.yellow { background: rgba(255,229,0,.06); border-color: rgba(255,229,0,.35); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.games > div { background: var(--surface); padding: 18px 10px; text-align: center; }
.games b { display: block; font-size: 15px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border-light); color: var(--text-2); background: var(--surface-2); text-transform: uppercase; }
.badge.pro { background: #fff; color: #000; border-color: #fff; }
.badge.private { background: var(--yellow); color: #000; border-color: var(--yellow); }
.badge.green { color: var(--green); border-color: rgba(0,255,136,.3); background: rgba(0,255,136,.08); }
.badge.warn { color: var(--yellow); border-color: rgba(255,229,0,.3); background: rgba(255,229,0,.08); }

.league-card { text-decoration: none; display: block; transition: border-color .15s; }
.league-card.row { display: flex; flex-wrap: nowrap; }
.league-card:hover { border-color: var(--border-light); }
.league-card h3 { font-size: 17px; margin: 10px 0 6px; }
.bar { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: #fff; }

/* Formularios */
label.f { display: block; }
label.f > span { display: block; font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); outline: none;
}
textarea { height: auto; padding: 10px 14px; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: rgba(255,255,255,.35); }
input.tiny { width: 70px; height: 34px; padding: 0 8px; text-align: center; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice label { cursor: pointer; }
.choice input { display: none; }
.choice .opt { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); padding: 16px; height: 100%; }
.choice input:checked + .opt { background: #fff; color: #000; border-color: #fff; }
.choice input:checked + .opt .muted { color: rgba(0,0,0,.6); }
.choice input:disabled + .opt { opacity: .4; cursor: not-allowed; }
.price { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr.me td { background: rgba(0,229,255,.07); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { font-weight: 700; width: 46px; }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: #fff; border-bottom-color: #fff; }

/* Pique */
.duel { font-size: 13px; margin-top: 6px; }
.duel .up { color: #ff8a00; }
.duel .down { color: var(--text-3); }
.duel .lead { color: var(--green); font-size: 13px; }

/* Avisos */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #000; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 300; box-shadow: 0 10px 40px rgba(0,0,0,.6); max-width: 90vw; }
.toast.err { background: var(--red); color: #fff; }
.note { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--text-2); }
.note.yellow { border-color: rgba(255,229,0,.3); background: rgba(255,229,0,.07); color: var(--yellow); }

/* Publicidad: el hueco solo se muestra si tiene anuncio */
.ad { display: none; }
.ad.on { display: block; margin: 18px auto; max-width: 1180px; padding: 0 20px; }
.ad.on > .ad-inner { border: 1px dashed var(--border-light); border-radius: 12px; min-height: 90px; display: grid; place-items: center; overflow: hidden; }
.ad-label { font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: .2em; color: var(--text-3); text-transform: uppercase; margin-bottom: 4px; }

footer.bottom { border-top: 1px solid var(--border); padding: 48px 0 90px; margin-top: 40px; }
footer.bottom .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
footer.bottom a { display: block; color: var(--text-2); text-decoration: none; font-size: 14px; margin-top: 8px; }
footer.bottom a:hover { color: #fff; }

.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #101010; border-top: 1px solid var(--border); padding: 14px 0; }
.legal h3 { margin-top: 22px; font-size: 16px; }
.legal p { color: var(--text-2); margin-top: 8px; }
.pending { color: var(--yellow); }
.spinner { width: 22px; height: 22px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.circuits { display: grid; grid-template-columns: 70px 1fr; gap: 8px 12px; align-items: center; }

/* Tablas que en el móvil se convierten en fichas (una por fila) */
@media (max-width: 680px) {
  table.rtable thead { display: none; }
  table.rtable, table.rtable tbody { display: block; }
  table.rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; border-bottom: 1px solid var(--border); }
  table.rtable td { display: block; border: 0; padding: 0; min-width: 0; }
  table.rtable td.wide { grid-column: 1 / -1; }
  table.rtable td[data-l]::before { content: attr(data-l); display: block; font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
  table.rtable input[type=text], table.rtable input[type=number], table.rtable select { width: 100%; }
  table.rtable td.actions { grid-column: 1 / -1; display: flex; gap: 8px; }
  table.rtable td.actions .btn { flex: 1; }
}
.rtable select { min-width: 170px; }
