:root {
  --bg: #12161c;
  --bg2: #171c24;
  --panel: #1b222c;
  --panel2: #232b37;
  --line: #2e3848;
  --text: #e8eef7;
  --muted: #9aa7b8;
  --accent: #3d8bfd;
  --accent2: #245fbf;
  --good: #3ecf8e;
  --warn: #e6b84d;
  --bad: #e35d6a;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0,0,0,.28);
  --font: "Segoe UI", "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --sidebar: 260px;
  --bottom: 64px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2433 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
}
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.app { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: rgba(18,22,28,.94);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display:flex; gap:12px; align-items:center; margin-bottom:18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3d8bfd, #1f4f96);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}
.brand-title { font-weight: 800; letter-spacing: .02em; }
.brand-sub { color: var(--muted); font-size: 12px; }
.nav { display:flex; flex-direction:column; gap:6px; flex:1; overflow:auto; }
.nav-item {
  text-align:left; border:1px solid transparent; background:transparent; color:var(--text);
  padding:12px 12px; border-radius:10px; cursor:pointer; font-weight:600;
}
.nav-item:hover { background: var(--panel); }
.nav-item.active { background: var(--panel2); border-color: var(--line); color:#fff; }
.nav-item.disabled { opacity:.45; cursor:not-allowed; }
.nav-sep { margin:12px 4px 4px; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.sidebar-foot { margin-top:auto; padding-top:12px; border-top:1px solid var(--line); }
.warn-mini { margin-top:8px; font-size:12px; color:var(--warn); }
.shell { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  position: sticky; top:0; z-index:20;
  display:flex; gap:10px; align-items:center;
  padding:12px 16px; background: rgba(18,22,28,.9); backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line);
}
.top-status { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.pill {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:999px; background:var(--panel);
  border:1px solid var(--line); font-size:12px; color:var(--text);
}
.pill.ok { border-color: rgba(62,207,142,.35); color: var(--good); }
.pill.bad { border-color: rgba(227,93,106,.35); color: var(--bad); }
.pill.warn { border-color: rgba(230,184,77,.35); color: var(--warn); }
.game-select select {
  background: var(--panel2); color: var(--text); border:1px solid var(--line);
  border-radius: 999px; padding: 7px 12px;
}
.content { padding: 16px 18px 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.card {
  background: linear-gradient(180deg, rgba(35,43,55,.95), rgba(27,34,44,.95));
  border:1px solid var(--line); border-radius: var(--radius); padding:16px; margin-bottom:14px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin:0 0 10px; }
.grid { display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
.stat {
  background: var(--panel2); border:1px solid var(--line); border-radius:12px; padding:12px;
}
.stat .label { color: var(--muted); font-size:12px; margin-bottom:4px; }
.stat .value { font-size:22px; font-weight:760; }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
button, input, select {
  background: var(--panel2); color: var(--text); border:1px solid var(--line);
  border-radius:10px; padding:10px 12px; font: inherit;
}
button {
  background: linear-gradient(180deg, #4a96ff, var(--accent2));
  color:#fff; font-weight:700; cursor:pointer; border: none;
  min-height: 42px;
}
button.secondary { background: var(--panel2); border:1px solid var(--line); color:var(--text); }
button:disabled { opacity:.5; cursor:not-allowed; }
.icon-btn { min-width:42px; background: var(--panel2); border:1px solid var(--line); }
.warn, .info, .error {
  border-radius:12px; padding:12px; margin:10px 0; border:1px solid var(--line);
}
.warn { background:#2a2618; border-left:4px solid var(--warn); }
.info { background:#182230; border-left:4px solid var(--accent); }
.error { background:#2a171a; border-left:4px solid var(--bad); }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
table { width:100%; border-collapse: collapse; min-width: 640px; }
th, td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; font-size:14px; }
th { color: var(--muted); font-weight:600; background: rgba(0,0,0,.15); position: sticky; top:0; }
.muted { color: var(--muted); }
.small { font-size:12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.empty { padding:28px; text-align:center; color: var(--muted); }
.skeleton-block, .skeleton {
  background: linear-gradient(90deg, #1b222c, #243041, #1b222c);
  background-size: 200% 100%;
  animation: sk 1.2s infinite linear;
  border-radius: 12px; min-height: 28px;
}
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.toast-host { position: fixed; right: 14px; bottom: 84px; z-index: 80; display:flex; flex-direction:column; gap:8px; }
.toast {
  background: var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px 14px;
  min-width: 220px; max-width: 360px; box-shadow: var(--shadow);
}
.toast.ok { border-color: rgba(62,207,142,.4); }
.toast.err { border-color: rgba(227,93,106,.4); }
.num-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap:10px; }
.num-card {
  background: var(--panel2); border:1px solid var(--line); border-radius:12px; padding:12px; cursor:pointer;
}
.num-card:hover { border-color: var(--accent); }
.num-card .n { font-size:24px; font-weight:800; }
.tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }
.tag { font-size:11px; padding:3px 7px; border-radius:999px; background:#2a3342; color:var(--muted); }
.modal-backdrop {
  position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:90;
  display:flex; align-items:flex-end; justify-content:center; padding:12px;
}
.modal {
  width: min(920px, 100%); max-height: 90vh; overflow:auto;
  background: var(--bg2); border:1px solid var(--line); border-radius:16px; padding:16px;
}
.combo { font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.bottom-nav { display:none; }
.only-mobile { display:none; }
.progress {
  height: 8px; background:#2a3342; border-radius:999px; overflow:hidden; margin-top:8px;
}
.progress > span { display:block; height:100%; background: var(--accent); width:0%; }

@media (max-width: 980px) {
  .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
  .sidebar {
    position: fixed; left:0; top:0; bottom:0; z-index:40;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: inline-flex; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(6,1fr); gap:4px;
    position: fixed; left:0; right:0; bottom:0; z-index:50;
    background: rgba(18,22,28,.96); border-top:1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav button {
    background: transparent; border: none; color: var(--muted); font-size:11px;
    min-height: 48px; padding: 6px 2px;
  }
  .bottom-nav button.active { color: #fff; }
  .content { padding-bottom: calc(var(--bottom) + 24px); }
  .toast-host { bottom: calc(var(--bottom) + 16px); }
}
@media (max-width: 360px) {
  .top-status .pill.muted { display:none; }
  .num-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
