:root {
  color-scheme: dark;
  --bg: #12151a;
  --panel: #1b1f27;
  --panel-2: #232833;
  --accent: #e63946;
  --accent-2: #2a9d4a;
  --text: #e8e9ec;
  --text-dim: #9aa0ac;
  --border: #2d3340;
}

* { box-sizing: border-box; }
button { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at top, #1a1e26, var(--bg) 70%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.hidden { display: none !important; }

/* ---- Tela de entrada ---- */
.join-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.join-card h1 { margin: 0 0 4px; font-size: 1.6rem; }
.subtitle { color: var(--text-dim); margin: 0 0 24px; font-size: 0.9rem; }

#join-form { display: flex; flex-direction: column; gap: 6px; }
#join-form label { font-size: 0.8rem; color: var(--text-dim); margin-top: 10px; }
#join-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
#join-form input:focus { border-color: var(--accent); }

#join-form button[type="submit"] {
  margin-top: 20px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: filter 0.15s;
}
#join-form button[type="submit"]:hover { filter: brightness(1.1); }

/* ---- Tela do rádio ---- */
#screen-radio { flex-direction: column; gap: 20px; max-width: 640px; margin: 0 auto; }

.radio-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
}
.channel-info { display: flex; flex-direction: column; }
.channel-info .label { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.1em; }
.channel-name { font-size: 1.3rem; font-weight: 700; color: var(--accent); }

.leave-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.leave-btn:hover { border-color: var(--accent); color: var(--text); }

.radio-body {
  width: 100%;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.users-panel {
  flex: 1;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.users-panel h3 { margin: 0 0 10px; font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
#user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#user-list li { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
#user-list li::before { content: "●"; color: var(--accent-2); font-size: 0.7rem; }
#user-list li.speaking { color: var(--accent); font-weight: 600; }
#user-list li.speaking::before { color: var(--accent); }

.ptt-panel {
  flex: 2;
  min-width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.status-indicator.transmitting { background: var(--accent); color: white; border-color: var(--accent); }
.status-indicator.receiving { background: var(--accent-2); color: white; border-color: var(--accent-2); }

.ptt-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 6px solid #3a4150;
  background: linear-gradient(145deg, #3a3f4a, #23272e);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.ptt-btn .ptt-icon { font-size: 2.4rem; }
.ptt-btn .ptt-text { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; color: var(--text-dim); }

.ptt-btn.active {
  border-color: var(--accent);
  background: radial-gradient(circle, #4a2226, #2a1416);
  transform: scale(0.97);
  box-shadow: 0 0 0 8px rgba(230, 57, 70, 0.15), 0 8px 20px rgba(0,0,0,0.4);
}
.ptt-btn.active .ptt-text { color: var(--accent); }

.hint { font-size: 0.8rem; color: var(--text-dim); text-align: center; margin: 0; }

.log-panel {
  width: 100%;
  max-height: 140px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
#log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#log-list li { font-size: 0.8rem; color: var(--text-dim); }

@media (max-width: 480px) {
  .ptt-btn { width: 130px; height: 130px; }
}
