:root {
  --c-bg: #0c1018;
  --c-panel: linear-gradient(168deg, rgba(18, 24, 34, 0.98) 0%, rgba(12, 16, 24, 0.98) 100%);
  --c-card: rgba(255, 255, 255, 0.05);
  --c-text: #f0ece4;
  --c-muted: rgba(240, 236, 228, 0.62);
  --c-line: rgba(255, 255, 255, 0.1);
  --c-primary: #00d1ff;
  --c-primary-dim: rgba(0, 209, 255, 0.16);
  --c-danger: #ff6b8a;
  --radius: 0.5rem;
  --font: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 169, 176, 0.38) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(0, 169, 176, 0.38);
  border-radius: 999px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(0, 209, 255, 0.08), transparent 55%),
    linear-gradient(168deg, #121822 0%, #0c1018 100%);
  color: var(--c-text);
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-panel);
  flex-wrap: wrap;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__accent {
  width: 3px;
  height: 40px;
  border-radius: 999px;
  background: var(--c-primary);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 209, 255, 0.35);
}

.header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.header__sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--c-muted);
}

.header__nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--c-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
  color: var(--c-primary);
  background: var(--c-primary-dim);
  border-color: rgba(0, 209, 255, 0.35);
}

.header__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-user {
  font-size: 0.85rem;
  color: var(--c-primary);
  font-weight: 500;
}

.status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-primary);
  text-align: right;
  max-width: 420px;
}

.status--error {
  color: var(--c-danger);
}

.app {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Não forçar flex no .layout — precisa continuar em grid (sidebar | main) */
.shell-content.rooms-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.rooms-status {
  display: none;
  flex-shrink: 0;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rooms-status.is-live {
  display: block;
}

.rooms-status.status--error {
  color: var(--c-danger);
}

.shell-content.rooms-shell > .layout {
  flex: 1;
  min-height: 0;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.layout--lobby {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--c-line);
  background: rgba(0, 0, 0, 0.22);
  overflow-y: auto;
  padding: 10px 12px 14px;
}

#roomPanel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar:has(#roomPanel:not(.hidden)) {
  height: 100%;
  overflow: hidden;
  padding: 10px 0 0;
}

#roomPanel .participants {
  flex: 1 1 auto;
  min-height: 54px;
  max-height: none;
  overflow-y: auto;
}

#roomPanel > :not(.share-box) {
  margin-left: 12px;
  margin-right: 12px;
}

#roomPanel > .btn--block {
  width: auto;
  align-self: stretch;
}

#roomPanel .share-box {
  margin-top: auto;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  padding: 10px 12px 12px;
  box-sizing: border-box;
  background: rgba(12, 16, 24, 0.96);
}

.panel__title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.panel__subtitle {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.share-box {
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--c-line);
}

.field--compact {
  margin-bottom: 0;
  gap: 3px;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.share-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.share-grid .field,
.share-box {
  min-width: 0;
}

.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  color: var(--c-muted);
  cursor: pointer;
  user-select: none;
}

.share-toggle:has(input:checked) {
  border-color: rgba(0, 209, 255, 0.4);
  background: rgba(0, 209, 255, 0.1);
  color: var(--c-text);
}

.share-toggle input {
  width: auto;
  margin: 0;
  accent-color: var(--c-primary);
}

.share-help {
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 8px;
}

.share-help summary {
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--c-muted);
  padding: 4px 0;
  list-style: none;
}

.share-help summary::-webkit-details-marker {
  display: none;
}

.share-help p {
  margin: 0 0 6px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--c-muted);
}

.share-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.share-extra:not(:has(button:not(.hidden))) {
  display: none;
}

.lobby-side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
}

.lobby-side-tabs.hidden {
  display: none;
}

.lobby-side-tab {
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.lobby-side-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--c-text);
}

.lobby-side-tab.is-active {
  color: var(--c-text);
  border-color: rgba(0, 209, 255, 0.45);
  background: rgba(0, 209, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--c-primary);
}

.lobby-side-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-side-panel.hidden {
  display: none;
}

.lobby-side-panel .field {
  margin-bottom: 0;
}

.lobby-side-hint {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--c-muted);
}

.create-fixed {
  align-self: flex-start;
}

.room-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.room-bar__id {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  padding: 6px 8px;
  border-radius: 0.35rem;
  border: 1px solid var(--c-line);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-secret {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 0.35rem;
  border: 1px solid rgba(0, 209, 255, 0.35);
  background: rgba(0, 209, 255, 0.08);
}

.room-secret.hidden {
  display: none;
}

.room-secret__label {
  font-size: 0.68rem;
  color: var(--c-muted, rgba(255, 255, 255, 0.62));
}

.room-secret__value {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--c-text, #f4f1ea);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-secret__note {
  margin: -4px 0 8px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--c-muted, rgba(255, 255, 255, 0.62));
}

.room-secret__note.hidden {
  display: none;
}

.room-secret-form {
  margin: 0 0 8px;
}

.room-secret-form.hidden {
  display: none;
}

.room-secret-form .field {
  margin-bottom: 6px;
}

.room-password__actions {
  display: flex;
  gap: 6px;
}

.room-password__actions .btn {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.field--row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field--row input[type="checkbox"] {
  width: auto;
  accent-color: var(--c-primary);
}

.field__label {
  font-size: 0.75rem;
  color: var(--c-muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  padding: 10px 12px;
  font-size: 0.9rem;
  background: #121822;
  color: var(--c-text);
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #121822;
  color: #f0ece4;
}

select option:checked {
  background-color: #0a6f8a;
  color: #f0ece4;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(0, 209, 255, 0.55);
}

input[type="number"] {
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
}

.btn {
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  padding: 10px 14px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.15s;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--c-primary-dim);
  border-color: rgba(0, 209, 255, 0.5);
}

.btn--primary:hover:not(:disabled) {
  background: rgba(0, 209, 255, 0.34);
}

.btn--ghost {
  background: transparent;
}

.btn--danger {
  background: rgba(255, 107, 138, 0.12);
  border-color: rgba(255, 107, 138, 0.45);
  color: #ffb3c3;
}

.btn--danger:hover:not(:disabled) {
  background: rgba(255, 107, 138, 0.22);
}

.btn--sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

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

.actions {
  margin-bottom: 12px;
}

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

.actions--row .btn {
  flex: 1;
}

.sep {
  border: none;
  border-top: 1px solid var(--c-line);
  margin: 16px 0;
}

.subpanel {
  margin-top: 20px;
}

.subpanel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 6px;
}

.subpanel h3 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.78rem;
}

.muted--sm {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.room-badge {
  margin-bottom: 12px;
}

.room-badge code {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  font-size: 0.85rem;
  word-break: break-all;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--c-primary-dim);
  border: 1px solid rgba(0, 209, 255, 0.35);
  color: var(--c-primary);
}

.room-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  transition: border-color 0.15s, background 0.15s;
}

.room-list li:hover {
  border-color: rgba(0, 209, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.room-list__info {
  min-width: 0;
  flex: 1;
}

.room-list__id {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-list__meta {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--c-muted);
}

/* Lobby browser — área principal */
.lobby-browser {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 14px 16px 18px;
  overflow: hidden;
}

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

.lobby-browser__eyebrow {
  display: none;
}

.lobby-browser__head h2 {
  margin: 0 0 2px;
  font-size: 1.1rem;
}

.lobby-browser__head .muted {
  margin: 0;
  max-width: 36rem;
}

.lobby-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.lobby-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lobby-step:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--c-text);
}

.lobby-step.is-active {
  color: var(--c-text);
  border-color: rgba(0, 209, 255, 0.45);
  background: rgba(0, 209, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--c-primary);
}

.lobby-step__num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-primary);
}

.lobby-step.is-active .lobby-step__num {
  background: rgba(0, 209, 255, 0.22);
}

.lobby-step__count {
  margin-left: 2px;
  min-width: 1.4em;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-muted);
}

.lobby-step.is-active .lobby-step__count {
  background: rgba(0, 209, 255, 0.18);
  color: var(--c-primary);
}

.lobby-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.lobby-panel {
  display: none;
}

.lobby-panel.is-active {
  display: block;
}

.lobby-empty {
  margin: 24px 0 0;
  color: var(--c-muted);
  font-size: 0.9rem;
}

.room-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.room-grid li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-line);
  transition: border-color 0.15s, background 0.15s;
  min-height: 0;
}

.room-grid li:hover {
  border-color: rgba(0, 209, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.room-grid .room-list__info {
  flex: 1;
}

.room-grid .room-list__id {
  font-size: 1rem;
  font-weight: 600;
  white-space: normal;
  word-break: break-all;
}

.room-grid .room-list__meta {
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.room-grid .btn {
  align-self: flex-start;
}

.participants {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(34vh, 300px);
  overflow-y: auto;
  padding-right: 3px;
}

.participants li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  font-size: 0.85rem;
}

.participants li.is-you {
  border-color: rgba(0, 209, 255, 0.35);
}

.participant__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.participant__status {
  font-size: 0.72rem;
  color: var(--c-muted);
}

.participant__status.is-live {
  color: var(--c-primary);
}

.participant__kick {
  padding: 2px 8px;
  font-size: 0.72rem;
}

.main {
  overflow-y: auto;
  padding: 12px 14px 16px;
  min-width: 0;
}

.main-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-empty__card {
  max-width: 460px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
}

.main-empty__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c-primary);
}

.main-empty__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
  font-weight: 600;
}

.main-empty__card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
}

.main-empty__card p {
  margin: 0;
  line-height: 1.55;
  color: var(--c-muted);
}

.main-room__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.main-room__head h2 {
  margin: 0;
  font-size: 0.95rem;
}

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.videos-empty {
  padding: 28px 16px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--c-line);
  color: var(--c-muted);
  font-size: 0.85rem;
}

.relay-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border-radius: calc(var(--radius) - 2px);
}

.relay-invite__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px dashed var(--c-line);
}

.videos.has-focus .video-card:not(.is-focused) {
  display: none;
}

.video-card.is-focused {
  grid-column: 1 / -1;
}

.video-card.is-focused .video-card__media video,
.video-card.is-focused .relay-canvas {
  max-height: 85vh;
}

.video-card:fullscreen,
.video-card:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: #000;
}

.video-card:fullscreen .video-card__media,
.video-card:-webkit-full-screen .video-card__media {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-card:fullscreen .video-card__media video,
.video-card:-webkit-full-screen .video-card__media video {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}

.video-card:fullscreen .relay-canvas,
.video-card:-webkit-full-screen .relay-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.video-card {
  cursor: pointer;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.video-card:hover {
  border-color: rgba(0, 209, 255, 0.28);
}

.video-card.is-local {
  border-color: rgba(0, 209, 255, 0.35);
}

.video-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-line);
}

.video-card__head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.video-card__tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-primary-dim);
  color: var(--c-primary);
}

.video-card__pip {
  padding: 4px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.video-card__fullscreen {
  padding: 4px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.video-card video,
.video-card__media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}

/* —— Hydra dialog —— */
.hydra-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.hydra-dialog__panel {
  width: min(400px, 100%);
  background: linear-gradient(168deg, rgba(18, 24, 34, 0.98) 0%, #0c1018 100%);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.hydra-dialog__accent {
  height: 3px;
  background: var(--c-primary);
}

.hydra-dialog__head {
  padding: 18px 20px 0;
  position: relative;
}

.hydra-dialog__eyebrow {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.hydra-dialog__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  padding-right: 28px;
}

.hydra-dialog__subtitle {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--c-muted);
  line-height: 1.45;
}

.hydra-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.hydra-dialog__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--c-text);
}

.hydra-dialog__body {
  padding: 16px 20px;
}

.hydra-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 18px;
}

.hydra-btn {
  border-radius: var(--radius);
  border: 1px solid var(--c-line);
  padding: 10px 16px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--c-text);
  background: transparent;
}

.hydra-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hydra-btn--primary {
  background: var(--c-primary-dim);
  border-color: rgba(0, 209, 255, 0.5);
}

.hydra-btn--primary:hover {
  background: rgba(0, 209, 255, 0.34);
}

.dialog-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--c-danger);
}

/* —— Board stub —— */
.board-stub {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.board-stub__card {
  max-width: 440px;
  padding: 36px 32px;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-line);
  position: relative;
  overflow: hidden;
}

.board-stub__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c-primary);
}

.board-stub__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
  font-weight: 600;
}

.board-stub__card h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.board-stub__card p {
  margin: 0 0 20px;
  color: var(--c-muted);
  line-height: 1.55;
}

@media (max-width: 860px) {
  .layout,
  .layout--lobby {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  /* Lista de salas primeiro; form Entrar embaixo e compacto */
  .layout--lobby:has(#lobbyPanel:not(.hidden)) {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .layout--lobby:has(#lobbyPanel:not(.hidden)) .main {
    order: -1;
    min-height: 0;
  }

  .layout--lobby:has(#lobbyPanel:not(.hidden)) .sidebar {
    order: 0;
    max-height: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--c-line);
    padding: 10px 12px 12px;
    overflow: visible;
  }

  .layout--lobby:has(#roomPanel:not(.hidden)) {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .layout--lobby:has(#roomPanel:not(.hidden)) .sidebar {
    order: 0;
    max-height: min(38vh, 280px);
    border-right: none;
    border-bottom: 1px solid var(--c-line);
    overflow-y: auto;
  }

  .layout--lobby:has(#roomPanel:not(.hidden)) .main {
    order: 0;
  }

  #lobbyPanel.panel {
    padding: 0;
    border: 0;
    background: transparent;
  }

  #lobbyPanel .panel__title {
    margin-bottom: 8px;
  }

  #lobbyPanel .lobby-side-panel {
    gap: 8px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header__nav {
    margin-left: 0;
  }

  .header__actions {
    align-items: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .status {
    text-align: left;
    max-width: none;
  }

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

  .lobby-browser {
    padding: 12px 12px 8px;
  }

  .lobby-browser__head {
    margin-bottom: 8px;
  }

  .lobby-steps {
    margin-bottom: 10px;
    gap: 6px;
  }

  .lobby-step {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 8px;
  }

  .room-grid {
    gap: 8px;
  }

  .room-grid li {
    padding: 10px 12px;
  }
}
