:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.45);
  --accent-active: #ef4444;
  --text: #e8edf5;
  --muted: #8b9bb4;
  --success: #22c55e;
  --border: #2d3a4f;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: radial-gradient(circle at top, #1e2a3d 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app {
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header {
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.antenna {
  width: 4px;
  height: 28px;
  background: linear-gradient(var(--accent), #b45309);
  border-radius: 2px;
  position: relative;
}

.antenna::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

h1 {
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.subtitle {
  color: var(--muted);
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.hidden {
  display: none !important;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.room-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

input {
  flex: 1;
  background: #0d121a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  padding: 0.85rem 1rem;
  text-transform: uppercase;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  transition: transform 0.1s, opacity 0.15s;
  min-height: 44px;
  min-width: 44px;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111;
}

.btn.secondary {
  background: #243044;
  color: var(--text);
  min-width: 48px;
}

.btn.ghost {
  width: 100%;
  margin-top: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
}

.badge.offline {
  background: #3f1d1d;
  color: #fca5a5;
}

.badge.online {
  background: #14301f;
  color: #86efac;
}

.badge.talking {
  background: #3b1a1a;
  color: #fecaca;
  animation: pulse-badge 0.8s ease-in-out infinite;
}

.room-label {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.radio-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.speaker-grill {
  width: 100%;
  height: 18px;
  border-radius: 6px;
  background: repeating-linear-gradient(
    90deg,
    #111 0 3px,
    #222 3px 7px
  );
  opacity: 0.8;
}

.channel-display {
  width: 100%;
  background: #0a0f16;
  border: 2px inset #2a3548;
  border-radius: 8px;
  padding: 0.65rem;
  text-align: center;
  font-family: "Consolas", monospace;
  font-size: 0.9rem;
  color: #7dd3fc;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vu-meter {
  width: 100%;
  height: 8px;
  background: #0a0f16;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.vu-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--accent), var(--accent-active));
  transition: width 0.05s linear;
}

.ptt-btn {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 4px solid #3d2914;
  background: radial-gradient(circle at 35% 30%, #fcd34d, #b45309 65%, #78350f);
  color: #1a1208;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  box-shadow:
    0 8px 0 #5c2d0a,
    0 16px 32px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.1s, transform 0.1s;
}

.ptt-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: 0 8px 0 #3d2914, 0 12px 24px rgba(0, 0, 0, 0.3);
}

.ptt-btn:not(:disabled):active,
.ptt-btn.transmitting {
  transform: translateY(4px);
  box-shadow:
    0 4px 0 #5c2d0a,
    0 8px 20px rgba(245, 158, 11, 0.35);
  background: radial-gradient(circle at 35% 30%, #fde68a, #ef4444 70%, #991b1b);
}

.ptt-btn.receiving {
  box-shadow:
    0 8px 0 #5c2d0a,
    0 0 28px rgba(34, 197, 94, 0.55);
}

.ptt-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}

.ptt-btn.transmitting .ptt-ring {
  border-color: var(--accent-active);
  animation: ring-pulse 0.6s ease-out infinite;
}

.ptt-btn.receiving .ptt-ring {
  border-color: var(--success);
  animation: ring-pulse 0.6s ease-out infinite;
}

.ptt-label {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ptt-hint {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
}

.tx-status {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2rem;
  text-align: center;
}

.tx-status.active {
  color: var(--accent-active);
  font-weight: 600;
}

.tx-status.receiving {
  color: var(--success);
  font-weight: 600;
}

.footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

@keyframes pulse-badge {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes ring-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.admin-controls {
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
}

.admin-header {
  margin-bottom: 0.75rem;
}

.admin-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.door-control {
  margin-bottom: 1rem;
}

.door-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #111;
  font-weight: 600;
}

.door-btn.closed {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.door-icon {
  font-size: 1.2rem;
}

.users-list {
  margin-top: 0.75rem;
}

.users-header {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.users-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-name {
  font-size: 0.9rem;
  color: var(--text);
}

.user-host-badge {
  font-size: 0.7rem;
  background: var(--accent);
  color: #111;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.kick-btn {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.kick-btn:hover {
  background: #ef4444;
  color: #fff;
}

.kick-btn:active {
  transform: scale(0.95);
}

@media (max-height: 680px) {
  .ptt-btn {
    width: 130px;
    height: 130px;
  }

  h1 {
    font-size: 1.35rem;
  }
}
