/* -------------------------------------------------------------------------
   mBot-S Live — dark theme
   ------------------------------------------------------------------------- */

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

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --border:      #2e3347;
  --text:        #e2e8f0;
  --text-muted:  #6b7280;
  --accent:      #3b82f6;
  --live-color:  #22c55e;
  --standby-color: #f59e0b;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  gap: 1.5rem;
}

/* --- Header --- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Status badge --- */
.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-badge.live .status-dot {
  background: var(--live-color);
  animation: pulse 1.8s ease-in-out infinite;
}

.status-badge.standby .status-dot {
  background: var(--standby-color);
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* --- Stream --- */
main {
  flex: 1;
}

.stream-wrapper {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcamFeed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 23, 0.75);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stream-overlay.visible {
  display: flex;
}

/* --- Message control --- */
.message-control {
  display: flex;
  gap: 0.5rem;
}

.message-control input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.message-control input:focus {
  border-color: var(--accent);
}

.message-control input::placeholder {
  color: var(--text-muted);
}

.message-control button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.message-control button:hover {
  opacity: 0.85;
}

/* --- Footer --- */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 480px) {
  h1 { font-size: 1.2rem; }
}
