:root {
  --bg: #0d0f12;
  --surface: #16191e;
  --surface-2: #23272e;
  --text: #e8eaed;
  --text-dim: #9aa0a6;
  --accent: #5b9cff;
  --online: #42d77d;
  --offline: #ff5d6c;
  --radius: 10px;
  --radius-sm: 6px;
  --space: 16px;
  --max: 1080px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--space) * 2) var(--space);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.5);
}

.input {
  background: var(--surface-2);
  border: 1px solid #2a2f37;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  width: 100%;
  font: inherit;
}
.input:focus { outline: 2px solid var(--accent); }

.btn {
  background: var(--accent);
  color: #0b1320;
  border: 0;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-dim);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
.pill.online .dot { background: var(--online); }
.pill.offline .dot { background: var(--offline); }

.error {
  color: var(--offline);
  margin-top: 8px;
  min-height: 1em;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space);
  margin-top: calc(var(--space) * 1.5);
}

.game-tile {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space);
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 120ms;
}
.game-tile:hover { border-color: var(--accent); }
.game-tile h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--space) * 1.5);
}

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.5);
  max-width: 420px;
  width: 90%;
}
.modal-title { margin: 0 0 8px; font-size: 18px; }
.modal-body { margin: 0 0 var(--space); color: var(--text-dim); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
