:root {
  --bg-dark: #0b0d14;
  --bg-card: #151926;
  --bg-input: #0c0f18;
  --border-color: #2e3752;
  --accent: #ff2a85;
  --accent-grad: linear-gradient(135deg, #ff2a85 0%, #7928ca 100%);
  --text-main: #ffffff;
  --text-muted: #d0d8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  padding-bottom: 56px;
  font-size: 18px;
}

/* Cabecalho (Alta Visibilidade 40+) */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 20, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

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

.mic-icon {
  font-size: 36px;
  line-height: 1;
}

.brand-title h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-title h1 span {
  color: var(--accent);
}

.room-badge {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-nav-btn {
  background: rgba(255, 42, 133, 0.18);
  border: 1.5px solid rgba(255, 42, 133, 0.55);
  color: #fff;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.queue-badge-count {
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
}

/* Barra de Cota */
.quota-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 11px 14px;
}

.quota-info {
  font-size: 17px;
}

.quota-label {
  color: var(--text-muted);
  font-weight: 600;
}

.quota-count {
  margin-left: 6px;
  color: #fff;
  font-weight: 800;
}

.quota-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2b3248;
  border: 1.5px solid #455073;
  transition: all 0.25s ease;
}

.dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  border-color: #ff9ec7;
}

.quota-warning {
  margin-top: 10px;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
}

/* Layout Principal */
.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 16px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.label-row .field-label {
  margin-bottom: 0;
}

.char-counter {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: monospace;
}

.field-label {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 600;
  padding: 14px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.text-input::placeholder {
  color: #7c88ab;
  font-weight: 500;
}

.text-input:focus {
  border-color: var(--accent);
}

/* Busca e Voz (Mesma Linha) */
.search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  padding-right: 52px;
}

.search-input.has-clear {
  padding-right: 100px;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.clear-search-btn {
  position: absolute;
  right: 54px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:active {
  background: rgba(239, 68, 68, 0.35);
  border-color: var(--danger);
}

.voice-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 42, 133, 0.2);
  color: var(--accent);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-btn.listening {
  background: var(--danger);
  color: #fff;
  animation: pulse 1.1s infinite;
}

@keyframes pulse {
  0% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.1); }
  100% { transform: translateY(-50%) scale(1); }
}

.primary-btn {
  background: var(--accent-grad);
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.primary-btn:active {
  transform: scale(0.96);
}

.primary-btn:disabled {
  background: #2c334a;
  color: #6c7696;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 17px;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  color: #ff62a3;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.speech-status {
  margin-top: 10px;
  font-size: 17px;
  color: #ff85b8;
  font-weight: 700;
}

/* Status na TV */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.conn-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--warning);
}

.conn-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.now-playing-box {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-input);
  padding: 13px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}

.my-songs-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-song-pill {
  font-size: 17px;
  font-weight: 600;
  background: rgba(121, 40, 202, 0.2);
  border: 1.5px solid rgba(154, 77, 232, 0.55);
  padding: 11px 12px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.my-song-pill .t {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.my-song-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.my-song-pill .badge {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
}

.cancel-song-btn {
  background: rgba(239, 68, 68, 0.24);
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  color: #fecaca;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Tela Dedicada de Visualizacao da Fila (#queue-view) */
.queue-full-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.queue-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-size: 17px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
}

.queue-view-titles h2 {
  font-size: 21px;
  font-weight: 900;
}

.queue-view-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

.queue-view-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-view-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
}

.queue-view-item.mine {
  background: rgba(255, 42, 133, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(255, 42, 133, 0.2);
}

.queue-pos {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #232a3e;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-view-item.mine .queue-pos {
  background: var(--accent);
}

.queue-item-body {
  flex: 1;
  min-width: 0;
}

.queue-item-singer {
  font-size: 17px;
  font-weight: 800;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.mine-tag {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}

.queue-item-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.queue-empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 17px;
  padding: 26px 14px;
  border: 1.5px dashed var(--border-color);
  border-radius: 12px;
}

/* Lista de Resultados da Busca */
.results-meta {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
}

.song-thumb {
  width: 96px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.song-details {
  flex: 1;
  min-width: 0;
}

.song-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  margin-bottom: 4px;
}

.song-channel {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botao Estreito com Seta para Cima (Enviar para Fila) */
.send-btn {
  flex-shrink: 0;
  width: 48px;
  height: 54px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.send-btn.sent,
.send-btn.sent:disabled {
  background: rgba(16, 185, 129, 0.25);
  border: 1.5px solid var(--success);
  color: #6ee7b7;
}

@media (max-width: 360px) {
  .brand-title h1 {
    font-size: 22px;
  }
  .mic-icon {
    font-size: 30px;
  }
  .queue-nav-btn {
    padding: 0 10px;
    font-size: 15px;
  }
  .primary-btn {
    padding: 12px 14px;
    font-size: 16px;
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-desc {
  font-size: 16px;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e2438;
  color: #fff;
  border: 1.5px solid #4a5785;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 60;
  pointer-events: none;
  text-align: center;
  max-width: 92vw;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}
