*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3e;
  --text: #e8eaf0;
  --muted: #6b7280;
  --green: #22c55e;
  --green-dim: #166534;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}

.card + .card { margin-top: 1rem; }

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  margin-top: 0.5rem;
}

input:focus { outline: 2px solid var(--blue); border-color: transparent; }

label { font-size: 0.875rem; color: var(--muted); display: block; margin-top: 1rem; }
label:first-child { margin-top: 0; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}

button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 0.8rem 1.5rem;
  width: 100%;
  margin-top: 1.5rem;
}

.btn-speak {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-speak.active {
  background: var(--green-dim);
  border-color: var(--green);
  box-shadow: 0 0 32px rgba(34, 197, 94, 0.4);
  color: var(--green);
}

.btn-speak.blocked {
  border-color: var(--red);
  color: var(--red);
}

.btn-hand {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 0.75rem 2rem;
  border-radius: 999px;
  font-size: 1rem;
  margin-top: 1.5rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-hand.raised {
  background: rgba(245,158,11,0.15);
  border-color: var(--amber);
  color: var(--amber);
}

.status-bar {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  text-align: center;
}

.slot-indicator {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.75rem;
}

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

.slot-dot.occupied { background: var(--green); }

/* Moderator */
.speaker-list, .hand-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.speaker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

.speaker-item .name { font-weight: 600; color: var(--green); }

.hand-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
}

.hand-item .name { font-weight: 500; }

.btn-mute {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-admit {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.empty-hint { color: var(--muted); font-size: 0.875rem; margin-top: 0.5rem; }

.slot-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.slot-control button {
  background: var(--border);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
}

.slot-control span { font-size: 1rem; font-weight: 600; min-width: 1.5rem; text-align: center; }

.qr-section img { width: 100%; border-radius: 8px; margin-top: 0.75rem; }
.qr-url { font-size: 0.75rem; color: var(--muted); word-break: break-all; margin-top: 0.5rem; }

.warning {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--amber);
  margin-top: 1rem;
}

.badge {
  display: inline-block;
  background: var(--green-dim);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#setup, #main { width: 100%; max-width: 420px; }
#main { display: none; }

.center { text-align: center; }

.icon { font-size: 2.5rem; }
