/* AimSix · web de torneos CS2 — tema oscuro */
:root {
  --bg: #07090e;
  --bg2: #0d1119;
  --panel: #121824;
  --panel2: #182031;
  --line: #243049;
  --text: #e6ebf5;
  --muted: #8a96ad;
  --accent: #ff9f1c;
  --accent2: #2ee6a6;
  --ct: #5aa9ff;
  --t: #f2b53a;
  --win: #2ee6a6;
  --lose: #ff5d73;
  --draw: #a0a8ba;
  --radius: 10px;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 500px at 70% -200px, #1b2742 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; text-transform: uppercase; color: var(--muted); letter-spacing: .12em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* cabecera */
.top { position: sticky; top: 0; z-index: 10; background: rgba(7, 9, 14, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; }
.brand b { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.on { color: var(--bg); background: var(--accent); }
.nav a.live-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lose); margin-right: 6px; vertical-align: 1px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

main.wrap { padding-top: 22px; padding-bottom: 60px; }
.foot { color: var(--muted); font-size: .8rem; text-align: center; padding: 24px 16px 40px; }

/* paneles */
.panel { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .panel { margin-bottom: 0; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; border: 1px solid var(--line); color: var(--muted); vertical-align: 2px; }
.tag.ct { color: var(--ct); border-color: color-mix(in srgb, var(--ct) 50%, transparent); }
.tag.t { color: var(--t); border-color: color-mix(in srgb, var(--t) 50%, transparent); }
.tag.live { color: #fff; background: var(--lose); border-color: var(--lose); }
.tag.win { color: var(--win); border-color: var(--win); }
.tag.prueba { color: #c9a3ff; border-color: #c9a3ff; }

/* botones y formularios */
.btn { display: inline-block; background: var(--accent); color: #111; font-weight: 700; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: .9rem; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.sec { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--lose); color: #fff; }
.btn.ok { background: var(--accent2); color: #062; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 8px 0 4px; }

/* tablas */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 7px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; user-select: none; }
th.sort { cursor: pointer; }
th.sort:hover { color: var(--text); }
th.sorted { color: var(--accent); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
td.num, td { font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255, 255, 255, .025); }
td.pos { color: var(--muted); width: 1%; }
.player { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.player img { width: 22px; height: 22px; border-radius: 4px; flex: none; }
.player span { overflow: hidden; text-overflow: ellipsis; }
tr.dead td { opacity: .45; }
tr.team-a td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.team-b td:first-child { box-shadow: inset 3px 0 0 var(--accent2); }

/* marcador en vivo */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.score .team { min-width: 0; }
.score .tname { font-size: 1.35rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score .num { font: 800 3.6rem/1 var(--mono); letter-spacing: -.02em; }
.score .num.ct { color: var(--ct); }
.score .num.t { color: var(--t); }
.score .mid { color: var(--muted); font-size: .85rem; }
.score .mid b { display: block; color: var(--text); font-size: 1.1rem; }
.score.small .num { font-size: 2.2rem; }
.score.small .tname { font-size: 1rem; }
@media (max-width: 520px) {
  .score { gap: 6px; }
  .score .num { font-size: 2.6rem; }
  .score .tname { font-size: 1rem; }
}
.strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; justify-content: center; }
.strip .r { width: 22px; height: 26px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); font: 700 .68rem/24px var(--mono); text-align: center; color: var(--muted); }
.strip .r.a { background: color-mix(in srgb, var(--accent) 30%, var(--panel2)); border-color: var(--accent); color: var(--text); }
.strip .r.b { background: color-mix(in srgb, var(--accent2) 25%, var(--panel2)); border-color: var(--accent2); color: var(--text); }
.strip .half { width: 2px; background: var(--line); margin: 0 3px; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: .78rem; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend i.a { background: var(--accent); }
.legend i.b { background: var(--accent2); }

/* kill feed */
.feed { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.feed li { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; background: rgba(0, 0, 0, .25); margin-bottom: 4px; flex-wrap: wrap; }
.feed .ct { color: var(--ct); font-weight: 700; }
.feed .t { color: var(--t); font-weight: 700; }
.feed .w { color: var(--muted); font-family: var(--mono); font-size: .8rem; padding: 0 4px; }
.feed .hs { color: var(--lose); font-weight: 800; font-size: .72rem; }
.feed .ro { color: var(--muted); font-size: .72rem; margin-left: auto; }

/* listas de partidas */
.mlist { list-style: none; margin: 0; padding: 0; }
.mlist li { border-bottom: 1px solid var(--line); }
.mlist li:last-child { border-bottom: 0; }
.mlist a { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 10px 4px; color: var(--text); }
.mlist a:hover { background: rgba(255, 255, 255, .03); text-decoration: none; }
.mlist .ta { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mlist .tb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mlist .res { font: 800 1.05rem var(--mono); text-align: center; min-width: 64px; }
.mlist .meta { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: .75rem; margin-top: -6px; }
.mlist .won { color: var(--win); }

/* llaves */
.bracket { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 8px; }
.bracket .col { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; min-width: 200px; }
.bracket .col h3 { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; text-align: center; margin-bottom: 0; }
.bm { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: block; color: var(--text); }
.bm:hover { text-decoration: none; border-color: var(--accent); }
.bm .row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; }
.bm .row + .row { border-top: 1px solid var(--line); }
.bm .row.win { background: color-mix(in srgb, var(--win) 14%, transparent); font-weight: 700; }
.bm .row .s { font-family: var(--mono); }
.bm .row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm .st { font-size: .7rem; color: var(--muted); padding: 2px 10px 5px; }
.bm.live { border-color: var(--lose); }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero h1 { margin: 0; }
.msg-page { padding-top: 60px; text-align: center; }
.notice { border-left: 3px solid var(--accent); background: var(--panel); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.notice.err { border-color: var(--lose); }
details summary { cursor: pointer; color: var(--muted); padding: 6px 0; }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.admin-grid .panel { margin-bottom: 0; }
.row-f { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row-f > * { flex: 1 1 140px; min-width: 0; }
.row-f > .btn { flex: 0 0 auto; }
.checks { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--bg2); }
.checks label { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 4px 0; font-size: .88rem; }
.checks input { width: auto; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn { padding: 5px 9px; font-size: .8rem; }
.toast { position: fixed; right: 16px; bottom: 16px; left: 16px; max-width: 420px; margin-left: auto; background: var(--panel2); border: 1px solid var(--accent); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.toast.err { border-color: var(--lose); }
.status-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
