:root {
  color-scheme: dark;
  --bg: #020617;
  --surface: #0b1220;
  --surface-2: #111c2e;
  --surface-3: #18253a;
  --line: #263750;
  --text: #f8fafc;
  --muted: #9baac0;
  --subtle: #6f8099;
  --blue: #4da3ff;
  --green: #35d07f;
  --purple: #a78bfa;
  --amber: #f5b94c;
  --red: #ff7272;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% -20%, #142545 0, transparent 42%), var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.shell { width: min(1440px, 100%); margin: 0 auto; padding: 30px clamp(16px, 4vw, 56px) 22px; }
.login-card { width: min(420px, 100%); margin: 9vh auto 0; padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(17, 28, 46, .96), rgba(5, 12, 24, .96)); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(77,163,255,.45); border-radius: 14px; background: rgba(77,163,255,.11); color: var(--blue); }
.brand-mark svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark.compact { width: 42px; height: 42px; border-radius: 11px; }
.brand-mark.compact svg { width: 26px; height: 26px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.03em; }
h1 span, h2 span { color: var(--muted); font-size: .46em; font-weight: 500; letter-spacing: .02em; margin-left: 8px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 9px; margin-top: 28px; }
.login-form label { margin-top: 8px; color: var(--text); font-size: 13px; font-weight: 600; }
.login-form label span { color: var(--subtle); font-weight: 400; margin-left: 5px; }
.login-form input { width: 100%; padding: 12px 13px; color: var(--text); border: 1px solid var(--line); border-radius: 9px; background: #07101e; transition: border-color .2s, box-shadow .2s; }
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,163,255,.14); outline: 0; }
.primary-button, .ghost-button { border-radius: 9px; font-weight: 700; transition: background .2s, border-color .2s, color .2s; }
.primary-button { margin-top: 13px; padding: 13px 16px; border: 1px solid #63b1ff; color: #031120; background: var(--blue); }
.primary-button:hover { background: #78bdff; }
.primary-button span, .ghost-button span { margin-left: 6px; font-size: 11px; font-weight: 500; opacity: .76; }
.form-error { margin: 5px 0 0; color: var(--red); font-size: 13px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0 28px; border-bottom: 1px solid var(--line); }
.title-group, .topbar-actions, .connection-pill { display: flex; align-items: center; }
.title-group { gap: 13px; }
.title-group h1 { margin: 0; font-size: clamp(22px, 3vw, 32px); }
.topbar-actions { gap: 11px; }
.connection-pill { gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }
.connection-pill.online { border-color: rgba(53,208,127,.42); color: var(--green); background: rgba(53,208,127,.08); }
.connection-pill.warning { border-color: rgba(245,185,76,.42); color: var(--amber); background: rgba(245,185,76,.08); }
.connection-pill.offline { color: var(--red); background: rgba(255,114,114,.06); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px currentColor; opacity: .8; }
.online .status-dot { animation: pulse 2s ease-in-out infinite; }
.ghost-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); color: var(--muted); background: transparent; }
.ghost-button:hover { border-color: var(--blue); color: var(--text); background: rgba(77,163,255,.08); }
.banner { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.banner svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stale-banner { border: 1px solid rgba(245,185,76,.35); color: var(--amber); background: rgba(245,185,76,.09); }
.error-banner { border: 1px solid rgba(255,114,114,.35); color: var(--red); background: rgba(255,114,114,.09); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 22px; }
.metric-card { display: flex; gap: 12px; min-height: 124px; padding: 17px; border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--radius); background: linear-gradient(150deg, rgba(17,28,46,.94), rgba(7,15,28,.94)); }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.metric-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.metric-card p { margin: 1px 0 6px; color: var(--muted); font-size: 12px; }
.metric-card p span { display: block; margin-top: 2px; color: var(--subtle); font-size: 10px; }
.metric-card strong { display: block; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 9px; color: var(--subtle); font-size: 11px; }
.accent-blue { --accent: var(--blue); } .accent-green { --accent: var(--green); } .accent-purple { --accent: var(--purple); } .accent-amber { --accent: var(--amber); }
.server-strip { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 12px; margin-top: 13px; padding: 14px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11,18,32,.72); }
.server-strip > div { min-width: 0; } .label { display: block; color: var(--subtle); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.server-strip strong { display: block; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.stats-panel { margin-top: 13px; }
.stats-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 0 17px 14px; border-bottom: 1px solid rgba(38,55,80,.62); }
.stats-range-buttons { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(2,6,23,.48); }
.stats-range-button { min-height: 30px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; }
.stats-range-button:hover, .stats-range-button.active { color: var(--text); background: rgba(77,163,255,.2); }
.stats-date-field { display: inline-flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 11px; }
.stats-date-field input { min-height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #07101e; font-size: 11px; }
.stats-date-field input:focus { border-color: var(--blue); outline: 0; }
.stats-date-separator { color: var(--subtle); }
.stats-refresh-button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.stats-timezone { margin-left: auto; color: var(--subtle); font-size: 10px; letter-spacing: .05em; }
.fixed-trend-content { padding: 14px 17px 0; }
.fixed-trend-panel { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(24,37,58,.24); }
.fixed-trend-scroll { overflow-x: auto; }
.fixed-trend-svg { display: block; width: 100%; min-width: 620px; height: auto; }
.trend-grid-line { stroke: rgba(155,170,192,.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-axis-label { fill: var(--subtle); font-size: 10px; }
.trend-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trend-line.pvp { stroke: var(--blue); fill: none; }
.trend-line.ai { stroke: var(--purple); fill: none; }
.trend-point { fill: transparent; stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-point.pvp { stroke: var(--blue); }
.trend-point.ai { stroke: var(--purple); }
.stats-content { padding: 0 17px 17px; }
.stats-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats-summary-card { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(24,37,58,.52); }
.stats-summary-card strong { display: block; margin-top: 5px; font-size: 23px; color: var(--text); }
.stats-summary-card small { display: block; margin-top: 5px; color: var(--subtle); font-size: 11px; }
.stats-summary-card.pvp strong { color: var(--blue); }
.stats-summary-card.ai strong { color: var(--purple); }
.stats-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 13px; }
.stats-rank-grid h3 { margin: 0; padding: 13px 13px 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stats-rank-grid h3 span { margin-left: 5px; color: var(--subtle); font-size: 10px; font-weight: 500; }
.stats-rank-grid table { min-width: 0; }
.stats-rank-grid th, .stats-rank-grid td { padding: 8px 13px; }
.stats-rank-grid td:last-child, .stats-rank-grid th:last-child { text-align: right; }
.daily-stats-content { padding: 0 17px 17px; }
.daily-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.daily-summary-card { padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(24,37,58,.34); }
.daily-summary-card strong { display: block; margin-top: 5px; color: var(--text); font-size: 20px; }
.daily-summary-card small { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; }
.daily-summary-card.pvp strong { color: var(--blue); }
.daily-summary-card.ai strong { color: var(--purple); }
.daily-summary-card.peak strong { color: var(--amber); }
.daily-chart-panel { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(24,37,58,.24); }
.daily-chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.daily-chart-heading h3 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.daily-legend { display: flex; gap: 12px; color: var(--subtle); font-size: 10px; }
.daily-legend span::before { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; content: ""; }
.daily-legend .legend-pvp::before { background: var(--blue); }
.daily-legend .legend-ai::before { background: var(--purple); }
.daily-chart-scroll { overflow-x: auto; padding-bottom: 3px; }
.daily-chart { display: flex; align-items: stretch; gap: 5px; min-width: 560px; height: 190px; padding: 0 3px; border-bottom: 1px solid var(--line); }
.daily-column { display: flex; flex: 1 1 0; min-width: 12px; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 5px; }
.daily-stack { display: flex; min-height: 2px; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; overflow: hidden; background: rgba(38,55,80,.22); }
.daily-segment { min-height: 0; transition: height .2s ease; }
.daily-segment.pvp { background: var(--blue); }
.daily-segment.ai { background: var(--purple); }
.daily-column:hover .daily-stack { outline: 1px solid rgba(248,250,252,.75); outline-offset: 1px; }
.daily-column-label { overflow: hidden; height: 15px; color: var(--subtle); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.daily-table { margin-top: 13px; }
.daily-table table { min-width: 380px; }
.daily-table td:not(:first-child), .daily-table th:not(:first-child) { text-align: right; }
.daily-table .pvp-value { color: var(--blue); }
.daily-table .ai-value { color: var(--purple); }
.section-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 13px; margin-top: 13px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11,18,32,.82); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 17px 13px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.count-badge { min-width: 30px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; text-align: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 500px; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 13px; border-top: 1px solid rgba(38,55,80,.62); vertical-align: middle; }
th { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { color: var(--muted); font-size: 12px; }
tbody tr:hover { background: rgba(77,163,255,.045); }
.empty-state { padding: 28px 13px; color: var(--subtle); text-align: center; }
.player-name { color: var(--text); font-weight: 600; } .secondary { display: block; margin-top: 3px; color: var(--subtle); font-size: 10px; }
.state, .kind, .health { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.state::before, .kind::before, .health::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.state-running, .health-good { color: var(--green); } .state-starting, .state-waiting { color: var(--amber); } .state-recovering { color: var(--purple); } .state-reserved { color: var(--blue); } .state-ended, .health-bad { color: var(--red); }
.kind-human { color: var(--blue); } .kind-ai { color: var(--purple); }
.workers-panel { margin-top: 13px; } .footer { display: flex; justify-content: space-between; gap: 12px; padding: 18px 2px 0; color: var(--subtle); font-size: 11px; }

@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 1000px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .section-grid, .stats-rank-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .shell { padding-top: 16px; } .login-card { margin-top: 4vh; padding: 25px; } .topbar { align-items: flex-start; flex-direction: column; padding-bottom: 20px; } .topbar-actions { width: 100%; justify-content: space-between; } .metric-grid { gap: 9px; } .metric-card { min-height: 112px; padding: 13px; } .metric-icon { width: 30px; height: 30px; } .metric-card strong { font-size: 24px; } .server-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-summary, .daily-summary { grid-template-columns: 1fr 1fr; } .stats-toolbar { align-items: stretch; } .stats-range-buttons { width: 100%; } .stats-range-button { flex: 1 1 0; } .stats-date-field { flex: 1 1 auto; justify-content: space-between; } .stats-date-field input { flex: 1 1 auto; } .stats-timezone { width: 100%; margin-left: 0; } .footer { flex-direction: column; } }
@media (max-width: 390px) { .metric-grid { grid-template-columns: 1fr; } .server-strip { grid-template-columns: 1fr; } h1 span, h2 span { display: block; margin: 3px 0 0; font-size: .48em; } }
