* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input { -webkit-user-select: text; user-select: text; }

body {
  margin: 0;
  font-family: -apple-system, Roboto, Segoe UI, sans-serif;
  background: #0f1115;
  color: #eee;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen { min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card {
  background: #1a1d24;
  padding: 30px 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.card h1 { margin: 0 0 8px; font-size: 24px; }
.room-label { color: #9aa0ab; margin-bottom: 20px; }
#name-input, #code-input {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #2c313c;
  background: #12141a;
  color: #fff;
  font-size: 16px;
  margin-bottom: 14px;
}
#join-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #2e7dff;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
#join-btn:active { background: #1f5fd0; }
#join-btn:disabled { opacity: .6; }
.error { color: #ff6767; min-height: 20px; font-size: 14px; }
.hint { color: #9aa0ab; font-size: 13px; margin-bottom: 0; }

/* ---------- Main ---------- */
#main-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
header h2 { font-size: 18px; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.me { color: #9aa0ab; font-size: 13px; }
.leave-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #2c313c;
  background: transparent;
  color: #9aa0ab;
  font-size: 13px;
}

.status {
  text-align: center;
  font-size: 13px;
  color: #9aa0ab;
  margin-bottom: 16px;
}

.incoming {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  background: #143a28;
  color: #7df0b4;
  margin-bottom: 16px;
}
.incoming.private { background: #4a3710; color: #ffd27a; }
.unlock-audio {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #ffb020;
  color: #1a1d24;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.participants-section h3 {
  font-size: 14px;
  color: #9aa0ab;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 8px 0;
}
.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.participant-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #2c313c;
  background: #1a1d24;
  color: #eee;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.participant-btn.selected {
  background: #2e7dff;
  border-color: #2e7dff;
}
.participant-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a6170;
}
.participant-btn.connecting .dot { background: #ffb020; }
.participant-btn.unreachable .dot { background: #ff4d4d; }
.participant-btn.speaking .dot {
  background: #29d17b;
  box-shadow: 0 0 6px #29d17b;
}

.ptt-section {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 12px;
}
.ptt-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, #2e7dff, #1c4fb0);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(46,125,255,.4);
  font-size: 14px;
  padding: 10px;
  touch-action: none;
}
.ptt-btn #ptt-icon { font-size: 44px; }
.ptt-btn.private {
  background: radial-gradient(circle at 30% 30%, #ffb020, #b37400);
  box-shadow: 0 8px 24px rgba(255,176,32,.4);
}
.ptt-btn.active {
  background: radial-gradient(circle at 30% 30%, #ff4d4d, #b02020);
  box-shadow: 0 8px 30px rgba(255,77,77,.55);
  transform: scale(1.04);
}
.talking-to {
  margin-top: 14px;
  font-size: 13px;
  color: #9aa0ab;
  min-height: 18px;
  text-align: center;
}
.keep-screen {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9aa0ab;
  padding-bottom: env(safe-area-inset-bottom);
}
