/* --- modal de confirmação centralizado (ex: Deletar) --- */
.modal-card.centered {
  text-align: center;
  padding: 32px 24px 24px;
}

.modal-card.centered h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.modal-card.centered .modal-sub {
  margin-bottom: 28px;
  font-size: 14px;
}

.modal-actions-stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.modal-btn-full {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.modal-btn-full:active {
  transform: scale(0.97);
}

.modal-btn-full:disabled {
  opacity: 0.5;
  cursor: default;
}

.modal-btn-full.is-red {
  background: rgba(255, 107, 107, 0.1); /* Fundo vermelho bem escuro */
  color: #ff6b6b;
}

.modal-btn-full.is-red:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.15);
}

/* Ações de confirmação ("Salvar", "Fechar", "Entrar") em branco sólido com
   texto preto. É o contraste mais alto que a tela tem, então elas se
   destacam de tudo sem precisar de cor — e a cor fica reservada pro que
   é destrutivo (vermelho). */
.modal-btn-full.is-white,
.modal-btn-full.is-secondary,
.modal-btn-full.is-primary {
  background: #ffffff;
  color: #101010;
}

.modal-btn-full.is-white:hover:not(:disabled),
.modal-btn-full.is-secondary:hover:not(:disabled),
.modal-btn-full.is-primary:hover:not(:disabled) {
  background: #e6e6e6;
}

/* "Cancelar"/"Fechar" dos modais que não destroem nada: nesses, o botão
   sólido é a ação principal (Entrar, Salvar) e o de baixo precisa ficar
   mais discreto que ela. */
.modal-btn-full.is-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.modal-btn-full.is-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* nos modais centralizados, campo e erro seguem o alinhamento do card */
.modal-card.centered .modal-field {
  text-align: center;
}
.modal-card.centered .code-field { text-align: left; }

.modal-card.centered .modal-error {
  text-align: center;
}

.modal-card.centered .modal-error:empty {
  min-height: 10px;
}

.topbar.home-topbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 560px) minmax(190px, 1fr);
  grid-template-areas: "brand search actions";
  align-items: start;
  column-gap: 24px;
  height: auto;
  min-height: 108px;
  /* The shared header mask would fade out the filters inside this header. */
  -webkit-mask-image: none;
  mask-image: none;
}
.home-topbar > .logo { grid-area: brand; margin-top: 10px; white-space: nowrap; }
.home-topbar > .topbar-actions { grid-area: actions; justify-self: end; margin-top: 4px; }
.home-topbar > .home-search-close { grid-area: actions; justify-self: end; margin-top: 4px; }
.home-search { grid-area: search; width: 100%; min-width: 0; margin: 0; }
.home-search-row { display: flex; gap: 12px; align-items: center; }
.home-search-field {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  background: #202020; border: 1px solid transparent; border-radius: 16px;
  padding: 0 16px; color: #ddd;
}
.home-search-field:focus-within { border-color: #777; }
.home-search-field input {
  width: 100%; min-width: 0; height: 48px; background: transparent;
  border: 0; outline: 0; color: #fff; font: inherit; font-size: 14px;
}
.home-search-field svg { flex-shrink: 0; }
.home-search-close {
  flex-shrink: 0;
  padding: 14px 16px; border: 0; border-radius: 14px;
  background: #242424; color: #ddd; cursor: pointer; font: inherit; font-size: 13px;
}
.home-genre-filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 0 5px;
}
.home-genre-chip {
  flex-shrink: 0; padding: 8px 15px; border: 1px solid transparent;
  border-radius: 999px; background: #2d2939; color: #eee;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.home-genre-chip:hover { background: #40394f; }
.home-genre-chip[aria-pressed="true"] { color: #19171d; background: #f3eefc; }
.home-search-count { margin: 10px 0 0; font-size: 12px; text-align: center; color: var(--text-dim); }
@media (max-width: 760px) {
  .topbar.home-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "search search";
    gap: 16px 12px;
  }
  .home-topbar > .logo { font-size: 18px; }
  .home-topbar > .topbar-actions { gap: 6px; }
  .home-topbar .icon-btn { width: 32px; height: 36px; }
  .home-search { max-width: 560px; justify-self: center; }
}
@media (max-width: 640px) {
  .topbar.home-topbar { margin: -24px -24px 32px; padding: 24px 24px 20px; }
}
a.floating-player-info { text-decoration: none; color: inherit; border-radius: 6px; }
a.floating-player-info:hover .floating-player-title { text-decoration: underline; }
a.floating-player-info:focus-visible { outline: 2px solid #ddd; outline-offset: 5px; }

/* Menus and settings appear/disappear immediately. */
.room-menu, .volume-popover, .queue-popover, .modal-overlay,
.modal-overlay .modal-card, .modal-tab-content,
.room-menu.is-closing, .volume-popover.is-closing, .queue-popover.is-closing,
.modal-overlay.is-closing, .modal-overlay.is-closing .modal-card {
  animation: none !important;
}
.modal-card {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.room-menu, .notif-panel {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 600px) {
  .modal-overlay { padding: 12px; }
  .modal-card { max-height: calc(100dvh - 24px); padding: 22px 18px; }
  .control-toast { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .control-toast > span { min-width: 0; flex: 1 1 160px; }
  .topbar { gap: 8px; }
  .topbar > .logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { flex-shrink: 0; gap: 6px; }
  .topbar-actions .icon-btn { min-width: 40px; }
  .modal-field, .modal-card select { font-size: 16px; }
  .room-menu button { min-height: 44px; white-space: normal; }
}

