:root {
  --bg: #0f1115;
  --card: #181b22;
  --fg: #e8eaed;
  --muted: #9aa0aa;
  --accent: #5b8cff;
  --danger: #ff5b6e;
  --ok: #43d17a;
  --border: #262a33;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 800px at 50% -10%, #1b2030, var(--bg));
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.app {
  width: min(92vw, 460px);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="text"] {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1218;
  color: var(--fg);
  font-size: 16px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  padding: 14px 16px;
  border-radius: 12px;
  border: 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, filter 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

#join-btn {
  background: var(--accent);
  color: white;
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.warn {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 184, 76, 0.1);
  border: 1px solid rgba(255, 184, 76, 0.35);
  color: #ffce8a;
  font-size: 13px;
}

.enable-audio {
  width: 100%;
  margin-bottom: 16px;
  background: var(--accent);
  color: white;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

.room-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.status.live {
  color: var(--ok);
}

.roster {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #0f1218;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.dot.speaking {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(67, 209, 122, 0.18);
}

.roster .me {
  color: var(--accent);
  font-weight: 600;
  margin-left: auto;
  font-size: 12px;
}

.controls {
  display: flex;
  gap: 12px;
}

.mute {
  flex: 1;
  background: #222734;
  color: var(--fg);
}

.mute[aria-pressed="true"] {
  background: var(--danger);
  color: white;
}

.leave {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

#audio-sink {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
