:root {
  --bg: #0f1420;
  --card: #171d2e;
  --border: #2a3348;
  --text: #eef1f8;
  --muted: #8a93a8;
  --accent: #5b8cff;
  --accent-2: #34d1a1;
  --danger: #ff5b6e;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #1c2438 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrap {
  width: 100%;
  max-width: 520px;
  padding: 32px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  text-align: center;
  margin-top: 12px;
}

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

.brand p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.role-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}

.role-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.role-card .emoji {
  font-size: 34px;
}

.role-card h2 {
  font-size: 16px;
  margin: 0;
}

.role-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 16px;
}

label:first-child { margin-top: 0; }

select, input[type="text"] {
  width: 100%;
  background: #10162400;
  background-color: #0d1220;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
}

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

input[type="text"].code-input {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  text-align: center;
}

button {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #7aa2ff);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.danger {
  background: linear-gradient(135deg, var(--danger), #ff8a97);
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  min-height: 16px;
}

.hidden { display: none !important; }

.session-code {
  text-align: center;
  padding: 18px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  margin-top: 4px;
}

.session-code .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-code .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 6px 0;
  color: var(--accent-2);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px;
}

.dot.live {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(52, 209, 161, 0.15);
}

.dot.rec {
  background: var(--danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 91, 110, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255, 91, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 91, 110, 0); }
}

.transcript {
  margin-top: 16px;
  min-height: 140px;
  max-height: 320px;
  overflow-y: auto;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 17px;
  line-height: 1.5;
}

.transcript .final { color: var(--text); }
.transcript .interim { color: var(--muted); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 14px;
}

.toggle-row input { width: auto; margin: 0; }

.back-link {
  text-align: center;
  margin-top: 6px;
}

.back-link a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.back-link a:hover { color: var(--text); }

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
