:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #101318;
  color: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #101318;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #1f2937;
  color: #f9fafb;
  padding: 0 16px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #60a5fa;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.is-on {
  border-color: #34d399;
  background: #064e3b;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #0b0f14;
  color: #f9fafb;
  padding: 0 12px;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

#status {
  margin: 0;
  color: #aab4c3;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.join-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #263241;
  border-radius: 8px;
  background: #151a21;
}

.control-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, auto)) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #263241;
  border-radius: 8px;
  background: #151a21;
}

.direction-button {
  min-width: 72px;
  min-height: 38px;
  padding: 0 10px;
  font-weight: 700;
}

#cameraName,
#controlStatus {
  margin: 0;
  color: #aab4c3;
  font-size: 13px;
}

#cameraName {
  text-align: left;
}

#controlStatus {
  text-align: right;
}

label {
  display: grid;
  gap: 8px;
  color: #d2d8e2;
  font-size: 14px;
}

.participants {
  display: grid;
  grid-template-columns: minmax(260px, 960px);
  justify-content: center;
  gap: 16px;
  min-height: 360px;
}

.participant {
  overflow: hidden;
  border: 1px solid #263241;
  border-radius: 8px;
  background: #151a21;
}

.participant.is-speaking {
  border-color: #34d399;
  box-shadow: 0 0 0 1px #34d399;
}

.video-wrap {
  position: relative;
  display: grid;
  min-height: 220px;
  aspect-ratio: 16 / 10;
  background: #070b10;
}

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

.placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #dbeafe;
  background: #182231;
  font-size: 16px;
  font-weight: 600;
}

.participant footer {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-top: 1px solid #263241;
  color: #e5eaf2;
}

.empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed #3c4858;
  border-radius: 8px;
  color: #aab4c3;
  text-align: center;
  padding: 24px;
}

#audioRoot {
  display: none;
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 1180px);
    padding: 10px 0;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .join-panel {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }

  #cameraName,
  #controlStatus {
    grid-column: 1 / -1;
    text-align: left;
  }

  .participants {
    grid-template-columns: 1fr;
  }

  .video-wrap {
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }
}
