@font-face { font-family: 'Bebas Neue'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/bebas-neue-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/jetbrains-mono-latin-600-normal.woff2) format('woff2'); }

:root {
  --bg: hsl(260 30% 4%);
  --card: hsl(258 22% 8%);
  --surface: hsl(256 18% 12%);
  --surface-3: hsl(256 16% 17%);
  --text: hsl(240 20% 98%);
  --ink-2: hsl(250 15% 78%);
  --muted: hsl(255 10% 56%);
  --hair: rgba(255, 255, 255, 0.08);
  --hair-strong: rgba(255, 255, 255, 0.15);
  --primary: hsl(267 90% 68%);
  --accent: hsl(317 100% 66%);
  --good: hsl(150 58% 50%);
  --bad: hsl(358 80% 62%);
  --warn: hsl(40 88% 58%);
  --grad: linear-gradient(120deg, var(--primary), var(--accent));
  --display: 'Bebas Neue', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 4px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -8%, hsl(267 90% 68% / 0.10), transparent 70%),
    radial-gradient(700px 380px at 96% 4%, hsl(317 100% 66% / 0.07), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.top, main, .foot-bar, .banner { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.mark {
  width: 38px;
  height: 38px;
  flex: none;
  padding: 7px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  background: var(--card);
}

.mark path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

h1 {
  margin: 0;
  font: 400 34px/0.9 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-state='live'] .dot { background: var(--good); box-shadow: 0 0 0 0 hsl(150 58% 50% / 0.6); animation: pulse 2s infinite; }
.status[data-state='stale'] .dot { background: var(--warn); }
.status[data-state='error'] .dot { background: var(--bad); }
.status[data-state='error'] { color: var(--bad); border-color: hsl(358 80% 62% / 0.4); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 hsl(150 58% 50% / 0.55); }
  70% { box-shadow: 0 0 0 8px hsl(150 58% 50% / 0); }
  100% { box-shadow: 0 0 0 0 hsl(150 58% 50% / 0); }
}

.banner {
  margin: 0 auto 14px;
  padding: 11px 14px;
  border: 1px solid hsl(358 80% 62% / 0.35);
  border-radius: var(--r);
  background: hsl(358 80% 62% / 0.08);
  color: hsl(358 90% 80%);
  font-size: 13px;
  width: calc(100% - 48px);
}

main { padding: 0 24px; display: grid; gap: 14px; }

.card {
  background: linear-gradient(180deg, hsl(258 22% 9%), var(--card));
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 18px 20px;
  min-width: 0;
}

.eyebrow, .lbl, dt, .hint, .chart-foot, .foot {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.n { color: var(--accent); margin-right: 8px; font-family: var(--mono); font-weight: 600; letter-spacing: 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; padding: 24px; }

.big {
  margin: 10px 0 18px;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color 0.3s;
  overflow-wrap: anywhere;
}

.pos { color: var(--good); }
.neg { color: var(--bad); }

.deltas { display: flex; flex-wrap: wrap; border-top: 1px solid var(--hair); }

.delta { flex: 1 1 120px; padding: 12px 16px 0 0; display: grid; gap: 4px; }
.delta + .delta { padding-left: 16px; border-left: 1px solid var(--hair); }
.delta b { font-size: 17px; font-weight: 600; }

.hero-side { margin: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: start; border-left: 1px solid var(--hair); padding-left: 24px; }
.hero-side > div { padding: 12px 0; border-bottom: 1px solid var(--hair); display: grid; gap: 4px; }
.hero-side > div:nth-child(odd) { padding-right: 14px; }
.hero-side > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--hair); }
.hero-side > div:nth-last-child(-n + 2) { border-bottom: 0; }
dd { margin: 0; font-size: 17px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { display: grid; gap: 6px; padding: 16px; }
.kpi b { font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.kpi .foot { font-size: 10px; letter-spacing: 0.1em; min-height: 14px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

h2 { margin: 0; font: 400 26px/1 var(--display); letter-spacing: 0.03em; text-transform: uppercase; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: var(--r); overflow: hidden; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--hair);
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); background: var(--surface); }
.seg button.on { color: #fff; background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--accent); }
.seg button:focus-visible, th:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart.live { height: 320px; }
.chart.daily { height: 240px; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.tip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  padding: 8px 10px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  background: hsl(258 24% 6% / 0.94);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 2;
}
.tip.on { opacity: 1; }
.tip .t { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px; }
.tip .v { font-family: var(--mono); font-weight: 600; font-size: 14px; }

.chart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 10px; }
.chart-foot b { font-family: var(--mono); letter-spacing: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }

.banner[data-kind='info'] { border-color: var(--hair-strong); background: var(--card); color: var(--ink-2); }

tr.hit td { animation: rowhit 1.4s ease-out; }
@keyframes rowhit { from { background: hsl(267 90% 68% / 0.16); } to { background: transparent; } }

.feed-card { display: flex; flex-direction: column; min-height: 0; }
.feed { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 288px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: slide 0.5s ease-out; }
.feed li.big { background: linear-gradient(90deg, hsl(358 80% 62% / 0.10), transparent 70%); padding-left: 8px; border-left: 2px solid var(--bad); }
.feed li.big.up { background: linear-gradient(90deg, hsl(150 58% 50% / 0.10), transparent 70%); border-left-color: var(--good); }
.feed .g { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .s { font-family: var(--mono); font-weight: 600; text-align: right; }
.feed .m { color: var(--muted); font-size: 12px; }
.feed .ago { color: var(--muted); font-size: 11px; text-align: right; font-family: var(--mono); }
.feed .empty { display: block; color: var(--muted); border: 0; padding: 18px 0; }

@keyframes slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: right;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--hair-strong);
  user-select: none;
}
.games th { cursor: pointer; }
.games th:hover { color: var(--text); }
th.sorted { color: var(--text); }
th.sorted::after { content: ' ↓'; color: var(--accent); }
th.sorted.asc::after { content: ' ↑'; }
td { padding: 10px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
th.l, td.l { text-align: left; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:hover td { background: hsl(256 18% 12% / 0.5); }
td.dim { color: var(--muted); }

.game { display: flex; align-items: center; gap: 12px; font-family: var(--sans); min-width: 200px; }
.thumb { width: 40px; height: 40px; flex: none; border-radius: var(--r); object-fit: cover; background: var(--surface); border: 1px solid var(--hair); }
.thumb.ph { display: grid; place-items: center; font: 400 18px/1 var(--display); color: var(--ink-2); }
.game .nm { font-weight: 600; }
.game .meta { display: flex; gap: 6px; margin-top: 3px; }
.chip {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--hair-strong);
  border-radius: 2px;
  color: var(--muted);
  font: 600 9px/1.3 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chip.live { color: var(--good); border-color: hsl(150 58% 50% / 0.4); }
.chip.on { color: #fff; border-color: transparent; background: var(--grad); }
.bar { height: 3px; margin-top: 5px; border-radius: 2px; background: var(--surface); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }

.pay tr.current td { background: hsl(267 90% 68% / 0.06); }
.st { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.st.complete { color: var(--good); }
.st.carried { color: var(--warn); }
.st.live { color: var(--accent); }

.flash-up { animation: fu 1s ease-out; }
.flash-down { animation: fd 1s ease-out; }
@keyframes fu { 0% { text-shadow: 0 0 18px hsl(150 58% 50% / 0.9); } 100% { text-shadow: none; } }
@keyframes fd { 0% { text-shadow: 0 0 18px hsl(358 80% 62% / 0.9); } 100% { text-shadow: none; } }

.foot-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px 28px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .feed { max-height: 320px; }
}

@media (max-width: 760px) {
  .top { padding: 16px 16px 14px; }
  .brand .sub { display: none; }
  h1 { font-size: 28px; }
  main { padding: 0 16px; gap: 12px; }
  .banner { width: calc(100% - 32px); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px 16px; }
  .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi b { font-size: 18px; }
  .chart.live { height: 260px; }
  .chart.daily { height: 210px; }
  .delta { flex-basis: 33%; padding-right: 10px; }
  .delta + .delta { padding-left: 10px; }
  .delta b { font-size: 15px; }
  .foot-bar { padding: 18px 16px 24px; }
  .controls { width: 100%; flex-direction: column; gap: 8px; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1 1 auto; padding: 8px 4px; letter-spacing: 0.04em; }
}

@media (max-width: 380px) {
  .seg button { font-size: 10px; padding: 8px 2px; letter-spacing: 0.02em; }
}

@media (max-width: 960px) {
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .games thead, .pay thead { display: none; }
  .games tr, .pay tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .games td:nth-child(2) { display: none; }
  .games tr:last-child, .pay tr:last-child { border-bottom: 0; }
  .games td, .pay td { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; border: 0; text-align: left; white-space: normal; background: none; }
  .games td::before, .pay td::before { content: attr(data-label); font: 600 10px/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
  .games td:first-child, .pay td:first-child { grid-column: 1 / -1; }
  .games td:first-child::before, .pay td:first-child::before { content: none; }
  .pay td:first-child { font: 600 15px/1.2 var(--sans); }
  .games td .bar { align-self: stretch; }
  tr.hit td { animation: none; }
  tr.hit { animation: rowhit 1.4s ease-out; border-radius: var(--r); }
  .game { min-width: 0; }
  tbody tr:hover td { background: none; }
  .pay tr.current { background: hsl(267 90% 68% / 0.06); border-radius: var(--r); padding: 14px 12px; }
  .pay tr.current td { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
