:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --text: #e8eef5;
  --muted: #8b9aab;
  --line: #2a3542;
  --accent: #5b8def;
  --on: #3ecf8e;
  --off: #e35d6a;
  --warn: #f0a35e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 1rem; }
.top {
  border-bottom: 1px solid var(--line);
  background: #121820;
  padding: 1rem 0 0.9rem;
  margin-bottom: 1.25rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.tagline { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.lang { display: flex; gap: 0.25rem; flex-shrink: 0; }
.lang a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.lang a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.foot { color: var(--muted); font-size: 0.85rem; padding: 2rem 1rem 2.5rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.search { display: flex; gap: 0.4rem; }
.search input {
  background: #0f1419;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  min-width: 220px;
}
.search button, .sorts a {
  background: #243041;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.sorts { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.sorts a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.err { color: var(--warn); }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap table {
  width: max-content;
  min-width: 100%;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table-wrap th,
.table-wrap td {
  white-space: nowrap;
}
.table-wrap .tiny {
  display: inline;
  margin-left: 0.4rem;
}
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.player { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text); font-weight: 600; }
.dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; }
.badge {
  display: inline-block;
  background: #2a3340;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.82rem;
}
.badge.on { background: rgba(62, 207, 142, 0.15); color: var(--on); }
.muted { color: var(--muted); font-weight: 400; }
.tiny { font-size: 0.78rem; margin-top: 0.1rem; }
code.id {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  background: #121820;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
}
.stats-grid > div {
  background: #121820;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stats-grid strong {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}
.empty { color: var(--muted); padding: 1rem 0; }
.back { margin: 0 0 0.75rem; }
.player-head { display: flex; gap: 1rem; align-items: center; }
.avatar {
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff;
}
.player-head h1 { margin: 0; font-size: 1.4rem; }
.sub { margin: 0.25rem 0 0; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; }
.legend { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.75rem; }
.swatch {
  width: 0.7rem; height: 0.7rem; border-radius: 2px; display: inline-block;
}
.swatch.on { background: var(--on); }
.swatch.off { background: var(--off); }
.swatch.unk { background: #2a3340; }
.day-charts { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.85rem; }
.day-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.65rem;
  align-items: center;
}
.day-label { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.day-row.today .day-label { color: var(--text); font-weight: 600; }
.day-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f1419;
}
.seg { min-width: 0; height: 100%; }
.seg.online { background: var(--on); }
.seg.offline { background: var(--off); }
.seg.unknown { background: #1c2430; }
.hour-scale {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.65rem;
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.hour-scale .hours {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}
.blocks ul { list-style: none; padding: 0; margin: 0; }
.blocks li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
h2, h3 { margin: 0 0 0.5rem; }
@media (max-width: 700px) {
  .search input { min-width: 0; width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .day-row, .hour-scale { grid-template-columns: 4.2rem 1fr; gap: 0.4rem; }
  .day-label { font-size: 0.78rem; }
}
