:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --shot: #1f6feb;
  --goal: #2ea043;
  --minus: #b62324;
  --warn: #d29922;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: #fff;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button:active { transform: scale(0.97); filter: brightness(1.2); }
button:disabled { opacity: 0.4; }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--minus);
}
.status.online::before { background: var(--goal); }
.status.connecting::before { background: var(--warn); }

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.overlay h1 { margin: 0 0 4px; font-size: 24px; }
.overlay p { margin: 0; color: var(--muted); }
.overlay .error { color: #ff7b72; min-height: 1.2em; }
.overlay button[type=submit] { background: var(--shot); padding: 14px; font-size: 18px; }
.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { opacity: 1; }
