:root {
  --ink: #eef2f7;
  --muted: #9aa6b5;
  --panel: rgba(12, 16, 22, 0.72);
  --accent: #5ad19a;
  --danger: #ff7a7a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; }
#view { display: block; width: 100vw; height: 100vh; touch-action: none; }

#join {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(20, 28, 40, 0.6), rgba(5, 8, 12, 0.92));
}
#join .card {
  width: min(360px, calc(100vw - 32px)); padding: 28px; border-radius: 12px;
  background: var(--panel); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: grid; gap: 12px; text-align: center;
}
#join h1 { margin: 0; font-size: 26px; letter-spacing: 0.5px; }
#join .tagline { margin: 0 0 6px; color: var(--muted); }
#join input, #chat-input {
  font: inherit; color: var(--ink); background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; padding: 10px 12px;
}
#join button {
  font: inherit; font-weight: 600; padding: 10px; border: 0; border-radius: 8px;
  background: var(--accent); color: #062014; cursor: pointer;
}
#join button:disabled { opacity: 0.6; cursor: progress; }
#join .hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.error { margin: 0; min-height: 1em; color: var(--danger); font-size: 14px; }

#hud {
  position: fixed; top: 12px; left: 12px; display: grid; gap: 4px;
  font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: none;
}
#hud-status[data-state="offline"] { color: var(--danger); }

#chat {
  position: fixed; left: 12px; bottom: 12px; width: min(380px, calc(100vw - 24px));
  display: grid; gap: 6px; font-size: 14px;
}
#chat-log {
  list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
#chat-log b { font-weight: 600; }
#chat-log .system { color: var(--muted); font-style: italic; }
#chat-input { opacity: 0.35; }
#chat-input:focus { opacity: 1; outline: none; border-color: var(--accent); }
