/* Tornado Prompter — interface escura de palco, PT-BR, mobile-first.
   Celular < 700px | Tablet 700–1099px | PC >= 1100px. Alvos de toque >= 48px. */
:root {
  --bg: #0b0d12; --card: #141824; --card2: #1b2130; --line: #262d40;
  --txt: #f2f4f8; --muted: #9aa3b5; --accent: #ffb300; --accent2: #ff7847;
  --green: #2ecc71; --red: #e74c3c; --blue: #3498db;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--txt);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh; padding-bottom: 40px;
}
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.hidden { display: none !important; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 10px; font-size: .8rem; color: var(--muted); }

/* ---------- topo ---------- */
#topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: rgba(11,13,18,.96); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.logo span { color: var(--accent); }
#topbar nav { display: flex; gap: 6px; margin-left: auto; }
.navbtn { background: var(--card); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: .95rem; min-height: 48px; cursor: pointer; }
.navbtn.active { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }
.aibadge { font-size: .72rem; font-weight: 800; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.aibadge.demo { background: #3a2b00; color: var(--accent); border: 1px solid var(--accent); }
.aibadge.real { background: #0b3a1e; color: var(--green); border: 1px solid var(--green); }

main { max-width: 1180px; margin: 0 auto; padding: 12px; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.space { justify-content: space-between; } .row.wrap { flex-wrap: wrap; }

/* ---------- botões ---------- */
.btn { background: var(--card2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; font-size: .95rem; min-height: 48px; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 700; }
.btn.big { font-size: 1.05rem; padding: 12px 20px; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: .88rem; }
.btn.rec { border-color: var(--red); color: #ff8a7a; font-weight: 700; }
.btn.danger { border-color: var(--red); color: #ff8a7a; }
.toggle { background: var(--card2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; font-size: .95rem; min-height: 48px; cursor: pointer; }
.toggle.on { background: #0b3a1e; color: var(--green); border-color: var(--green); font-weight: 700; }
.toggle.big { font-size: 1.05rem; padding: 14px 18px; min-height: 56px; }
.toggle.small { min-height: 40px; padding: 8px 12px; font-size: .85rem; }

/* ---------- transporte ---------- */
.transport, .stage-transport { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.tbtn { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 50%;
  background: var(--card2); color: var(--txt); border: 1px solid var(--line); cursor: pointer; }
.tbtn.main { width: 84px; height: 84px; font-size: 2.2rem; background: var(--accent);
  color: #111; border: none; font-weight: 800; }
.tbtn.xl { width: 76px; height: 76px; font-size: 2rem; }
.tbtn.xl.main { width: 104px; height: 104px; font-size: 2.8rem; }

.slider { width: 100%; height: 40px; accent-color: var(--accent); cursor: pointer; }
.timerow { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.np-title { font-size: 1.25rem; font-weight: 800; }
.np-title.big { font-size: clamp(1.4rem, 4.5vw, 2.2rem); }
.np-artist { color: var(--muted); margin-bottom: 4px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.bpmrow { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.bpmbox { background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 16px; text-align: center; min-width: 96px; }
.bpmlabel { display: block; font-size: .72rem; color: var(--muted); }
#bpmval { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.speedrow { margin: 8px 0; } .speedrow label { display: block; margin-bottom: 2px; color: var(--muted); }

/* ---------- mixer ---------- */
.mixer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chan { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.chan h3 { margin: 0 0 6px; font-size: .9rem; }
.chan h3 .demo-tag { display: block; font-size: .68rem; color: var(--accent); font-weight: 400; }
.chan input[type=range] { width: 100%; height: 44px; accent-color: var(--accent); }
.chan .msrow { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.msbtn { width: 48px; height: 44px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-weight: 800; cursor: pointer; }
.msbtn.m.on { background: #3a0b0b; color: var(--red); border-color: var(--red); }
.msbtn.s.on { background: #0b2a3a; color: var(--blue); border-color: var(--blue); }
.masterrow { margin-top: 10px; } .masterrow label { color: var(--muted); }

/* ---------- biblioteca ---------- */
#dropzone { border: 2px dashed var(--line); text-align: center; cursor: pointer; }
#dropzone.over { border-color: var(--accent); background: #1a1405; }
.songlist { display: grid; gap: 10px; }
.song { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.song .stitle { font-weight: 700; font-size: 1.02rem; }
.song .smeta { color: var(--muted); font-size: .85rem; margin: 2px 0 8px; }
.song .sactions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; }
.badge.novo { background: #223; color: var(--muted); }
.badge.processando { background: #3a2b00; color: var(--accent); }
.badge.pronto { background: #0b3a1e; color: var(--green); }
.badge.erro { background: #3a0b0b; color: var(--red); }
#setlists .setlist { background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-top: 10px; }
.setlist h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.setlist ol { margin: 0; padding-left: 22px; }
.setlist li { padding: 8px 4px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#setlistname, #lyrics, input[type=text] { background: #0e1220; color: var(--txt);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 1rem; }
#setlistname { flex: 1; min-height: 48px; }
#lyrics { width: 100%; min-height: 180px; font-size: 1.05rem; line-height: 1.6; resize: vertical; }

/* ---------- palco ---------- */
.stage-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stage-toggles { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tp-card { border-color: var(--accent); }
#teleprompter { background: #000; border-radius: 10px; height: 46dvh; min-height: 280px;
  overflow-y: auto; padding: 24px 20px; margin-top: 8px; scrollbar-width: thin; }
#tptext { font-size: 44px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.recbar { display: flex; gap: 10px; align-items: center; background: #2a0d0d;
  border: 1px solid var(--red); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
  font-weight: 700; }
.recdot { width: 14px; height: 14px; border-radius: 50%; background: var(--red);
  animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- modais ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; }
.check { display: flex; gap: 10px; align-items: center; font-size: 1.02rem;
  padding: 10px 0; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); }
.progress { background: #0e1220; border-radius: 8px; height: 18px; overflow: hidden; margin: 10px 0; }
.progress .bar { height: 100%; width: 0%; background: var(--accent); transition: width .3s; }
.providers { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.providers b { color: var(--txt); }
.tvpair { display: flex; gap: 16px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
#tvqr { width: 180px; height: 180px; border-radius: 12px; background: #fff; }
.tvcode { font-size: 3rem; font-weight: 800; color: var(--accent); letter-spacing: 10px; }

/* ---------- tablet ---------- */
@media (min-width: 700px) {
  main { padding: 18px; }
  .songlist { grid-template-columns: 1fr 1fr; }
  #teleprompter { height: 52dvh; }
  #view-player { display: none; }
  #view-player.active { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; align-items: start; }
  #view-player.active .card { margin-bottom: 0; }
  .stage-transport { gap: 18px; }
}
/* ---------- PC ---------- */
@media (min-width: 1100px) {
  .songlist { grid-template-columns: 1fr 1fr 1fr; }
  #view-player.active { grid-template-columns: 1.4fr 1fr 1fr; }
  #teleprompter { height: 56dvh; }
  #tptext { font-size: 52px; }
  .navbtn { padding: 10px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .recdot { animation: none; } .progress .bar { transition: none; }
}
/* ---------- Exportar / Baixar ---------- */
.exprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #222; flex-wrap: wrap; }
.exprow:last-child { border-bottom: none; }
/* ---------- Mixer: L/R + pan ---------- */
.lrrow { grid-column: 1 / -1; margin-bottom: 4px; }
.panrow { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.panrow input[type=range] { flex: 1; min-width: 0; }
.panbtn { background: #1c1c1c; color: #ffb300; border: 1px solid #333; border-radius: 6px; padding: 4px 7px; font-size: 13px; cursor: pointer; }
.panbtn:active { background: #2a2a2a; }
