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

html, body {
  height: 100%;
  background: #000;
  color: #33ff33;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* Landing page */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  gap: 1.5rem;
}

.landing h1 {
  font-size: 2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing .subtitle {
  color: #1a9e1a;
  font-size: 0.85rem;
}

.token-input {
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 1rem;
  background: #111;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  outline: none;
}

.token-input::placeholder {
  color: #1a6e1a;
}

.btn {
  display: block;
  width: 100%;
  max-width: 320px;
  padding: 1.25rem;
  background: #111;
  border: 2px solid #33ff33;
  color: #33ff33;
  font-family: inherit;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn:active,
.btn:hover {
  background: #33ff33;
  color: #000;
}

.btn-secondary {
  border-color: #1a9e1a;
  color: #1a9e1a;
}

.btn-secondary:active,
.btn-secondary:hover {
  background: #1a9e1a;
  color: #000;
}

/* Status bar */
.status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.8rem;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  background: #555;
}

.status-dot.connected { background: #33ff33; }
.status-dot.connecting { background: #ffaa00; }
.status-dot.failed { background: #ff3333; }

/* Video containers */
.video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Controls overlay */
.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 100;
}

.controls .bitrate {
  font-size: 0.75rem;
  color: #1a9e1a;
}

/* Tap to unmute overlay */
.unmute-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: pointer;
}

.unmute-overlay span {
  font-size: 1.5rem;
  text-transform: uppercase;
}

/* Detection overlay canvas */
.detection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Audio meter (vertical bar, right edge) */
.audio-meter {
  position: fixed;
  top: 2rem;
  right: 0.5rem;
  width: 30px;
  height: 40%;
  z-index: 100;
  border: 1px solid #333;
  border-radius: 3px;
}

/* Audio classification result */
.audio-class-result {
  position: fixed;
  bottom: 4rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: #1a9e1a;
  z-index: 100;
  padding: 0.25rem;
}

.audio-class-result.cry-alert {
  color: #ff3333;
  font-weight: bold;
  font-size: 1rem;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

/* Alert banner */
.alert-banner {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #ff3333;
  color: #000;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  z-index: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

/* Receiver controls (toggle row) */
.receiver-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  z-index: 100;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: #1a9e1a;
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  accent-color: #33ff33;
  width: 16px;
  height: 16px;
}

/* Status bar extras */
.status-right {
  display: flex;
  gap: 0.75rem;
}

.detection-status {
  font-size: 0.7rem;
  color: #1a9e1a;
}

.hidden { display: none !important; }
