/* LiveSquad — página do convidado */

body { overflow: hidden; }

/* ---------------- lobby ---------------- */

.lobby {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.lobby__card {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}

.lobby__brand { margin-bottom: 22px; }
.lobby__brand h1 { font-size: 26px; margin: 12px 0 6px; }
.lobby__sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.field { display: block; }
.field .label { display: block; margin-bottom: 6px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { min-width: 0; }

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-lo);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

.preview__meter {
  position: absolute;
  left: 10px;
  bottom: 10px;
  height: 62px;
  display: flex;
  align-items: flex-end;
}

.preview__meter .led-ladder { height: 100%; justify-content: flex-start; }

.preview__hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 12px;
  background: linear-gradient(0deg, rgba(14,16,21,.92), transparent);
  text-align: right;
}

.lobby__note { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.lobby__note.error { color: var(--alert); }

/* ---------------- sala ---------------- */

.room {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.room__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-lo));
  flex-wrap: wrap;
}

.room__body {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

.room__body:has(.chat:not(.hide)) { grid-template-columns: 1fr 320px; }

.tiles {
  display: grid;
  gap: 12px;
  padding: 16px;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  overflow-y: auto;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-lo);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}

.tile.speaking {
  border-color: var(--signal);
  box-shadow: 0 0 0 1px var(--signal), 0 0 26px rgba(94, 242, 160, .22);
}

.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0b0d12; }
.tile.self video { transform: scaleX(-1); }
.tile.sharing video { object-fit: contain; }
.tile.sharing.self video { transform: none; }

.tile__plate {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 3px;
  background: rgba(11, 13, 18, .78);
  backdrop-filter: blur(6px);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  font-weight: 600;
}

.tile__plate .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.tile__plate .dot.on { background: var(--signal); }
.tile__plate .dot.off { background: var(--alert); }

.tile__badge {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(255, 194, 102, .16);
  border: 1px solid rgba(255, 194, 102, .4);
  color: var(--warn);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
}

/* ---------------- chat ---------------- */

.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  min-height: 0;
}

.chat__log { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }

.chat__msg { font-size: 13px; line-height: 1.5; }
.chat__msg b {
  display: block;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  color: var(--patch);
  margin-bottom: 2px;
}
.chat__msg.host b { color: var(--warn); }
.chat__msg span { color: var(--ink-dim); overflow-wrap: anywhere; }

.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-soft); }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: var(--radius);
  background: var(--panel-hi);
  border: 1px solid var(--line);
  font-size: 13px;
  z-index: 20;
}

.toast.error { border-color: var(--alert); color: #ffc7cd; }

@media (max-width: 720px) {
  .room__bar { padding: 8px 10px; gap: 8px; }
  .room__bar button { padding: 8px 10px; font-size: 12px; }
  .room__body:has(.chat:not(.hide)) { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .chat { border-left: 0; border-top: 1px solid var(--line); max-height: 46vh; }
  .tiles { grid-template-columns: 1fr; padding: 10px; }
}
