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

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(68, 129, 255, 0.22), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(21, 211, 150, 0.13), transparent 28rem),
    #080b12;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  max-width: 840px;
  margin-bottom: 28px;
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: #88f0d0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.description {
  max-width: 680px;
  color: #c4cad8;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  line-height: 1.65;
}

.room-card,
.controls,
.status-card,
.caption-card,
.transcript-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: rgba(13, 18, 30, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.room-card {
  padding: 22px;
  margin-bottom: 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 16px;
}

.room-setup,
.room-ready {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.room-setup .small-text,
.room-ready .small-text {
  grid-column: 1 / -1;
}

.room-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #c4cad8;
}

.room-meta code {
  color: #f7f8fb;
}

.field {
  display: grid;
  gap: 8px;
  color: #c4cad8;
  font-size: 0.92rem;
}

.field.wide {
  grid-column: 1 / -1;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  outline: none;
}

.field input:focus {
  border-color: rgba(105, 240, 199, 0.75);
  box-shadow: 0 0 0 4px rgba(105, 240, 199, 0.12);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #c4cad8;
  font-size: 0.86rem;
}

.pill.ready {
  background: rgba(105, 240, 199, 0.13);
  color: #88f0d0;
}

.small-text {
  margin: 0;
  color: #9fa8ba;
  line-height: 1.5;
}

button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

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

button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #69f0c7, #66a6ff);
  color: #061018;
  font-weight: 800;
}

.toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  color: #dce2ee;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: #69f0c7;
}

.status-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 16px;
  color: #dce2ee;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #71788a;
}

.dot.connecting {
  background: #ffd166;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.65);
}

.dot.live {
  background: #69f0c7;
  box-shadow: 0 0 22px rgba(105, 240, 199, 0.65);
}

.dot.error {
  background: #ff5f6d;
  box-shadow: 0 0 22px rgba(255, 95, 109, 0.65);
}

.caption-card,
.transcript-card {
  padding: clamp(20px, 4vw, 34px);
}

.caption-card {
  min-height: 310px;
  margin-bottom: 16px;
}

.transcript-card {
  min-height: 180px;
}

.caption-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.caption-header h2 {
  margin: 0;
  color: #dce2ee;
  font-size: 1rem;
  font-weight: 700;
}

.subtitles,
.source-transcript {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.subtitles {
  font-size: clamp(2rem, 7vw, 5rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.source-transcript {
  color: #c4cad8;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  line-height: 1.35;
}

.subtitles:empty::before,
.source-transcript:empty::before {
  color: #71788a;
  content: "Пока нет текста";
}

audio {
  display: none;
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 1120px);
    padding: 28px 0;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  button,
  .toggle {
    width: 100%;
    justify-content: center;
  }

  .caption-header {
    display: block;
  }

  .room-setup,
  .room-ready {
    grid-template-columns: 1fr;
  }
}
