:root {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #1a2338;
  --card-border: #2a3654;
  --text: #e6ebf5;
  --text-dim: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --accent: #3b82f6;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
  padding-bottom: 40px;
}

[hidden] { display: none !important; }

header.topbar {
  padding: 20px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.topbar h1 {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}
.status-pill.ok { background: rgba(34,197,94,0.15); color: var(--green); }
.status-pill.blocked { background: rgba(239,68,68,0.15); color: var(--red); }
.status-pill.offline { background: rgba(148,163,184,0.15); color: var(--text-dim); }

.big-status {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 6px 0 4px;
}
.big-status.ok { color: var(--green); }
.big-status.blocked { color: var(--red); }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #0d1526;
  overflow: hidden;
  margin: 10px 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
}
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-dim); font-size: 0.85rem; }

button {
  font: inherit;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}
button.primary { background: var(--accent); color: white; width: 100%; }
button.secondary { background: #263252; color: var(--text); }
button.danger { background: rgba(239,68,68,0.15); color: var(--red); }
button.ghost { background: transparent; color: var(--text-dim); text-decoration: underline; padding: 8px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.small { padding: 8px 12px; font-size: 0.85rem; }

input, select {
  font: inherit;
  background: #0d1526;
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
}
label { display: block; font-size: 0.85rem; color: var(--text-dim); margin: 12px 0 4px; }

.game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}
.game-item:last-child { border-bottom: none; }
.game-item .name { font-weight: 600; }
.game-item .process { color: var(--text-dim); font-size: 0.8rem; font-family: monospace; }

.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row button { flex: 1; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-card .logo { font-size: 2.5rem; margin-bottom: 8px; }
.error-text { color: var(--red); font-size: 0.85rem; margin-top: 10px; min-height: 1em; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #263252;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 50;
}
.toast.show { opacity: 1; }

code.token {
  display: block;
  word-break: break-all;
  background: #0d1526;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  margin: 8px 0;
}
