.lobbies-page {
  padding-top: 40px;
  padding-bottom: 80px;
}

.lobbies-header {
  margin-bottom: 32px;
}

.rooms-list-container {
  min-width: 0;
}

.lobby-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.task-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.lobby-room-wrapper {
  width: 380px;
  min-width: 320px;
  flex: 0 0 auto;
}

.task-card-inner {
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

.lobbies-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 992px) {
  .lobbies-grid {
    grid-template-columns: 1fr;
  }
  .create-sidebar {
    order: -1;
  }

  .lobby-layout {
    flex-direction: column-reverse;
  }

  .lobby-room-wrapper,
  .task-wrapper {
    width: 100%;
    min-width: 0;
  }
}

.create-sidebar {
  border: 1px solid var(--border, #EBEDEF);
  border-radius: 24px;
  padding: 24px;
  background: var(--bg, #fff);
}

.create-sidebar .sidebar-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--main-black, #2A1C14);
}

.radio-flex {
  display: flex;
  gap: 16px;
  margin: 16px 0 24px;
}

.lobby-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border: 1px solid var(--border, #EBEDEF);
  border-radius: 20px;
  background: var(--bg, #fff);
  margin-bottom: 12px;
  transition: all 0.4s ease;
}

.lobby-item:hover {
  border-color: var(--orange, #F85628);
  box-shadow: 0 4px 12px rgba(248, 86, 40, 0.08);
}

/* Разделение списка: ожидающие сверху, занятые снизу */
.lobbies-section-title {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray, #666667);
}

.lobbies-divider {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--border, #EBEDEF);
}

.lobby-item--busy {
  background: #F7F8F9;
}

.lobby-item--busy:hover {
  border-color: var(--border, #EBEDEF);
  box-shadow: none;
}

.lobby-item--busy .lobby-item-title {
  color: var(--gray, #666667);
}

.lobby-busy-badge,
.lobby-own-badge {
  flex-shrink: 0;
}

.lobby-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-item-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--main-black, #2A1C14);
}

.lobby-item-topic {
  font-weight: 400;
  color: var(--gray, #666667);
}

.lobby-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  color: var(--muted, #666);
}

.badge {
  background: var(--light-orange, #FFE5D0);
  color: var(--orange, #F85628);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.btn-join {
  --btn-height: 44px;
  --btn-padding: 0 24px;
  --btn-font-size: 15px;
}

.call-view-card {
  border: 1px solid var(--border, #EBEDEF);
  border-radius: 24px;
  padding: 40px;
  background: var(--bg, #fff);
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.call-avatars {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin: 40px 0;
}

.avatar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #F3F3F3;
  border: 4px solid var(--border, #EBEDEF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--muted, #999);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.avatar-circle.is-speaking {
  border-color: #2bc947;
  box-shadow: 0 0 20px rgba(43, 201, 71, 0.4);
  transform: scale(1.08);
  color: #2bc947;
}

.lobby-consent-modal__dialog {
  max-width: 520px;
  padding: 24px;
  background: #ffffff;
  border-radius: 24px;
}

.lobby-consent-modal__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 14px;
}

.lobby-consent-modal__text {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 20px;
}

.lobby-consent-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lobby-consent-modal__actions .primary-btn {
  flex: 1 1 180px;
  --btn-height: 48px;
}

.lobby-consent-modal__decline {
  --btn-background: #F3F3F3;
  --btn-color: var(--main-black, #2A1C14);
}

.lobby-consent-modal__decline:hover {
  --btn-background: #E5E5E5;
}

@media (max-width: 600px) {
  .lobby-consent-modal__dialog {
    padding: 20px 16px;
  }

  .lobby-consent-modal__title {
    font-size: 18px;
  }
}

.own-lobby {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--light-orange, #FFE5D0);
  border-radius: 16px;
  background: #FFF9F5;
}

.own-lobby-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.own-lobby-title {
  font-weight: 600;
  color: var(--main-black, #2A1C14);
}

.own-lobby-pulse {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #16a34a;
  animation: own-lobby-pulse 1.6s ease-in-out infinite;
}

@keyframes own-lobby-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

.own-lobby-topic {
  font-weight: 700;
  word-break: break-word;
}

.own-lobby-time,
.own-lobby-hint {
  color: var(--muted, #6b7280);
}

/* Someone asks to join: the title says so and the waiting texts make way for the request. */
.own-lobby-title-request,
.own-lobby.has-requests .own-lobby-title-waiting,
.own-lobby.has-requests .own-lobby-time,
.own-lobby.has-requests .own-lobby-hint {
  display: none;
}

.own-lobby.has-requests .own-lobby-title-request {
  display: inline;
}

.own-lobby .btn-leave {
  --btn-height: 44px;
}

#btn-create:disabled {
  opacity: 0.5;
  cursor: default;
}

.call-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.call-actions .primary-btn {
  width: 100%;
  max-width: 260px;
}

.avatar-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--main-black, #2A1C14);
}

.call-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--light-orange, #FFE5D0);
  color: var(--orange, #F85628);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  margin-bottom: 30px;
  font-size: 15px;
}

.call-status-indicator.active {
  background: var(--green-hover, #D5F5E3);
  color: #16a34a;
}

.btn-leave {
  --btn-background: var(--action-red, #FF1D1D);
  --btn-height: 48px;
}

.btn-leave:hover {
  --btn-background: #dc2626;
}

.hidden {
  display: none !important;
}

.lobbies-header {
  margin-bottom: 40px;
}

.lobbies-loading {
  color: var(--muted);
  padding: 20px 0;
}

.btn-full-width {
  width: 100%;
}

.room-title {
  --title-fs: 28px;
  margin-bottom: 12px;
}

.room-subtitle {
  color: var(--gray);
}

.room-active-title-text {
  color: var(--main-black);
}

.room-info {
  justify-content: center;
  margin-bottom: 16px;
}

.private-share-block {
  background: #F3F3F3;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.share-label {
  display: block;
  color: var(--gray);
  margin-bottom: 8px;
}

.share-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.share-input {
  background: #fff;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  flex: 1;
}

.share-copy-btn {
  --btn-height: 44px;
  --btn-padding: 0 18px;
  flex-shrink: 0;
}

.btn-center {
  margin: 0 auto;
}

.call-timer {
  margin: -16px 0 24px;
  font-size: 15px;
  color: var(--muted, #6b7280);
}

.lobby-result-card {
  text-align: left;
}

.lobby-result-card .room-title,
.lobby-result-card .room-subtitle {
  text-align: center;
}

.lobby-result-card .call-status-indicator {
  display: flex;
  justify-content: center;
  text-align: center;
}

/* Пока разговор расшифровывается и оценивается */
.lobby-result-status.is-processing {
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 24px;
  border-radius: 16px;
  line-height: 1.4;
}

.lobby-spinner {
  display: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 4px solid rgba(248, 86, 40, 0.2);
  border-top-color: var(--orange, #F85628);
  border-radius: 50%;
  animation: lobby-spin 0.9s linear infinite;
}

.lobby-result-status.is-processing .lobby-spinner {
  display: block;
}

@keyframes lobby-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lobby-spinner {
    animation-duration: 2.4s;
  }
}

/* Оценка разговора: итог, категории экзамена, взаимодействие, ошибки */
.lobby-result-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 24px;
}

.lobby-result-body:empty {
  display: none;
}

.lobby-result-duration {
  margin: 4px 0 -16px;
  text-align: center;
  color: var(--gray, #666667);
}

.lobby-result-note {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--light-orange, #FFE5D0);
  line-height: 1.4;
}

.lobby-result-overview {
  --result-color: #58B338;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 20px;
  border-radius: 16px;
  background: #F8F9FA;
  text-align: center;
}

.lobby-result-overview.is-failed {
  --result-color: #FF1D1D;
}

.lobby-result-overview__label {
  font-weight: 500;
  color: var(--gray, #666667);
}

.lobby-result-overview__score {
  font-size: 20px;
  font-weight: 600;
}

.lobby-result-overview__score b {
  font-size: 40px;
  line-height: 1;
  color: var(--result-color);
}

.lobby-result-overview__status {
  font-weight: 600;
  color: var(--result-color);
}

.lobby-result-overview__text {
  align-self: stretch;
  margin: 10px 0 0;
  text-align: left;
  line-height: 1.4;
}

.lobby-result-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-result-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.lobby-result-subheading {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.lobby-result-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lobby-result-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.lobby-result-item:not(:last-child) {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #EBEDEF);
}

/* Как .result-box__item .level на странице упражнения */
.lobby-result-item__level {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--orange, #F85628);
  font-size: 16px;
  font-weight: 600;
  color: var(--bg, #fff);
}

.lobby-result-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-result-item__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.lobby-result-item__title {
  font-weight: 500;
}

.lobby-result-item__points {
  flex-shrink: 0;
  font-weight: 600;
}

.lobby-result-item__text {
  margin: 0;
  line-height: 1.4;
}

.lobby-result-item__advice {
  color: var(--gray, #666667);
}

.lobby-result-bar,
.lobby-result-share__bar {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #EBEDEF;
  overflow: hidden;
}

.lobby-result-bar > span,
.lobby-result-share__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange, #F85628);
}

.lobby-result-share {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-result-share__labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--gray, #666667);
}

.lobby-result-share__labels span:first-child {
  font-weight: 600;
  color: var(--orange, #F85628);
}

.lobby-result-share__bar {
  height: 10px;
  background: #D7DADE;
}

.lobby-result-share__bar > span {
  border-radius: 0;
}

.lobby-result-stats {
  width: 100%;
  border-collapse: collapse;
}

.lobby-result-stats th,
.lobby-result-stats td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border, #EBEDEF);
}

.lobby-result-stats thead th {
  font-weight: 600;
}

.lobby-result-stats tbody th {
  padding-left: 0;
  text-align: left;
  font-weight: 400;
  color: var(--gray, #666667);
}

.lobby-result-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lobby-result-points li,
.lobby-result-agreement {
  position: relative;
  margin: 0;
  padding-left: 30px;
  line-height: 20px;
}

.lobby-result-points li::before,
.lobby-result-agreement::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.lobby-result-points .is-done::before,
.lobby-result-agreement.is-done::before {
  content: "✓";
  background: #58B338;
}

.lobby-result-points .is-missed::before,
.lobby-result-agreement.is-missed::before {
  content: "✕";
  background: #A7A8A8;
}

.lobby-result-agreement {
  font-weight: 600;
}

/* Как .errors-table на странице упражнения */
.lobby-result-errors {
  width: 100%;
  border: 1px solid var(--border, #EBEDEF);
  border-radius: 12px;
  border-spacing: 0;
  table-layout: fixed;
  overflow: hidden;
}

.lobby-result-errors th,
.lobby-result-errors td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border, #EBEDEF);
  overflow-wrap: anywhere;
}

.lobby-result-errors thead th {
  background: #F8F9FA;
  font-weight: 500;
}

.lobby-result-errors tbody tr:last-child td {
  border-bottom: 0;
}

.lobby-result-errors th:first-child {
  width: 92px;
}

.lobby-result-errors th:first-child,
.lobby-result-errors__time {
  white-space: nowrap;
}

.lobby-result-errors__time {
  color: var(--gray, #666667);
}

.lobby-result-errors__wrong {
  color: #D93025;
}

.lobby-result-errors__correct {
  color: #2E8B2E;
}

.lobby-result-transcript {
  margin-bottom: 24px;
}

.lobby-result-transcript summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Как .result-conversation__list: свои реплики справа */
.lobby-result-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  background: #F8F9FA;
}

.lobby-result-line {
  max-width: 85%;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #EBEDEF;
}

.lobby-result-line.is-me {
  align-self: flex-end;
  background: #F9ECE9;
}

.lobby-result-line__meta {
  font-size: 12px;
  color: var(--gray, #666667);
}

.lobby-result-line__text {
  line-height: 1.4;
}

@media (max-width: 600px) {
  .lobby-result-card {
    padding: 20px 16px;
  }
}

/* Форма создания лобби */
.lobby-create-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-create-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #EBEDEF);
}

.lobby-create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.lobby-create-field .select {
  min-width: 0;
}

.lobby-create-label {
  padding-left: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray, #6B6B6B);
}

.lobby-create-field .select__header {
  height: 48px;
  border-color: var(--border, #EBEDEF);
  min-width: 0;
  text-align: left;
}

.lobby-create-field .select__header__text {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--main-black, #111);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-create-field .select__header > svg {
  flex: 0 0 20px;
}

.lobby-create-field .select:not(.has-value) .select__header__text {
  color: #A7A8A8;
}

.lobby-create-field .select__header:disabled {
  cursor: not-allowed;
  color: #A7A8A8;
  background-color: #F7F8F9;
  opacity: .75;
}

.lobby-create-field .dropdown-result {
  z-index: 20;
}

.lobby-create-field .dropdown-result__container {
  max-height: 260px;
}

/* Подтверждение участников хостом */
.join-requests {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.join-requests-title {
  color: var(--gray);
}

.join-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--light-orange, #FFE5D0);
  border-radius: 12px;
}

.join-request-actions {
  display: flex;
  gap: 8px;
}

.join-request-actions .join-request-btn {
  --btn-height: 40px;
  --btn-padding: 0 14px;
  width: auto;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.join-request-btn--secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--orange, #F85628);
  background: #fff;
  color: var(--orange, #F85628);
  font-family: var(--font-onest);
  font-weight: 500;
  white-space: nowrap;
  transition: all .4s ease;
}

.join-request-btn--secondary:hover {
  background: var(--light-orange, #FFF1EC);
  color: var(--orange, #F85628);
}
