:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #1a1d24;
  --text: #f2f3f5;
  --muted: #9aa0ac;
  --accent: #5b8cff;
  --danger: #ff5b6e;
}

* { box-sizing: border-box; }

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

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 40px;
  min-height: 100vh;
}

h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1rem; margin: 20px 0 8px; color: var(--muted); }

.code {
  font-size: 2rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  text-align: center;
  margin: 8px 0 20px;
}

button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.4; }

input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #333;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
}

input[hidden] { display: none; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
}
.checkbox input { width: auto; margin: 0; }

.lobby-list li { padding: 0; }
.lobby-list a {
  flex: 1;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
}
.lobby-list .meta { color: var(--muted); }

.players { list-style: none; padding: 0; margin: 0 0 16px; }
.players li {
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.players li button { width: auto; padding: 8px 12px; font-size: 0.85rem; }
.players li button.danger { background: var(--danger); }

.current-speaker {
  padding: 22px;
  border-radius: 14px;
  background: var(--surface);
  outline: 2px solid var(--accent);
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.role-banner {
  padding: 22px;
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.role-banner.imposter { background: var(--danger); }

.event-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.host-controls { display: flex; gap: 8px; margin-top: 12px; }

.hint { color: var(--muted); text-align: center; font-size: 0.9rem; }

#host-panel {
  margin-top: 24px;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 14px;
}
#host-panel summary { color: var(--muted); cursor: pointer; }
#host-panel[open] .players { margin-top: 10px; }

.toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  max-width: calc(100% - 32px);
  text-align: center;
}
