/* LETRAS SHOW — visual escuro, alto contraste, alvos de toque grandes. */

@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url('/fonts/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 700; font-display: swap; src: url('/fonts/open-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 800; font-display: swap; src: url('/fonts/open-sans-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #000;
  --panel: #111;
  --panel2: #1a1a1a;
  --line: #2a2a2a;
  --text: #fff;
  --muted: #9b9b9b;
  --gold: #d9a52b;
  --gold-ink: #1a1816;
  --navy: #1f3a5f;
  --danger: #e0574b;
  --ok: #5cc98a;
  --r: 14px;
  --tap: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }
.muted { color: var(--muted); font-size: 15px; }
.center { text-align: center; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel2);
  font-weight: 800; font-size: 16px; letter-spacing: .03em; white-space: nowrap;
  text-decoration: none; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger-text { color: var(--danger); border-color: transparent; }
.btn.wide { width: 100%; }
.btn.big { min-height: 64px; font-size: 20px; }
.btn.sq { width: var(--tap); padding: 0; font-size: 18px; }
.btn.file { cursor: pointer; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: var(--r); border: 0; background: transparent; font-size: 20px;
}
.icon-btn:active { background: var(--panel2); }

/* ---------- páginas ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: calc(var(--safe-t) + 8px) 16px calc(var(--safe-b) + 40px); }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  min-height: 72px; padding: calc(var(--safe-t) + 8px) 0 8px; margin-top: calc(-1 * var(--safe-t) - 8px);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: .06em; color: var(--gold); }
.brand .ic { width: 28px; height: 28px; }
.st { flex: 1; display: flex; justify-content: flex-end; }
.ttl { flex: 1; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .03em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttl-input { flex: 1; min-width: 0; min-height: var(--tap); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font-weight: 800; font-size: 20px; text-transform: uppercase; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--panel2); color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .03em; border: 0; }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--gold); }
.pill .ic { width: 16px; height: 16px; }

/* busca */
.searchbox {
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 18px; margin: 6px 0 14px;
  min-height: 64px; border-radius: 18px; background: var(--panel); border: 2px solid var(--line);
}
.searchbox:focus-within { border-color: var(--gold); }
.searchbox .ic { color: var(--muted); width: 24px; height: 24px; }
.searchbox input { flex: 1; min-width: 0; height: 60px; border: 0; outline: 0; background: transparent; font-size: 20px; font-weight: 700; }
.searchbox input::placeholder { color: #6d6d6d; font-weight: 700; font-size: 16px; letter-spacing: .03em; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox.inbar { flex: 1; margin: 0; min-height: var(--tap); }
.searchbox.inbar input { height: 52px; }

/* adicionar letra */
.add { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.add input {
  flex: 1 1 320px; min-width: 0; min-height: var(--tap); padding: 0 16px; border-radius: var(--r);
  border: 1px dashed #444; background: transparent; font-size: 16px;
}
.add input:focus { outline: 0; border-color: var(--gold); border-style: solid; }

/* abas */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted);
  font-weight: 800; font-size: 16px; letter-spacing: .04em; white-space: nowrap;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs .ic { width: 18px; height: 18px; }

/* grade de artistas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 76px; padding: 12px 18px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); text-align: left;
}
.tile:active { background: var(--panel2); border-color: var(--gold); }
.tile-name { font-weight: 800; font-size: 18px; letter-spacing: .02em; line-height: 1.2; }
.tile-count { flex: none; min-width: 34px; padding: 4px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }

/* listas */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 8px 10px 18px;
  border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); cursor: pointer;
}
.row:active { background: var(--panel2); border-color: var(--gold); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 800; font-size: 19px; letter-spacing: .02em; line-height: 1.25; }
.row-sub { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: .03em; margin-top: 2px; }
.row-snip { color: var(--gold); font-size: 14px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r); background: none; color: #555; }
.star-btn.on { color: var(--gold); }
.star-btn .ic { width: 26px; height: 26px; }
.row .play { min-height: 48px; padding: 0 16px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-weight: 700; letter-spacing: .03em; line-height: 1.7; }
#newset { margin-bottom: 12px; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.login .logo { color: var(--gold); }
.login .logo .ic { width: 72px; height: 72px; }
.login h1 { margin: 0 0 10px; font-weight: 800; letter-spacing: .1em; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login input { min-height: 64px; padding: 0 18px; border-radius: var(--r); border: 2px solid var(--line); background: var(--panel); font-size: 22px; text-align: center; }
.login input:focus { outline: 0; border-color: var(--gold); }
.err { color: var(--danger); min-height: 1.4em; margin: 0; font-weight: 700; }

/* ---------- editor ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.form input, .form textarea {
  min-height: var(--tap); padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--panel); font-size: 18px; font-weight: 700; color: var(--text);
}
.form input:focus, .form textarea:focus { outline: 0; border-color: var(--gold); }
.form textarea { min-height: 50vh; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-weight: 400; font-size: 17px; line-height: 1.55; resize: vertical; }
.row2 { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid #5a4516; background: transparent; color: var(--gold); font-weight: 800; font-size: 14px; }
.chip:active { background: #2a2110; }
.banner { padding: 14px 18px; border-radius: var(--r); margin: 4px 0 14px; font-weight: 700; }
.banner.warn { background: #2a2110; color: var(--gold); border: 1px solid #5a4516; }
.banner.ok { background: #102a1c; color: var(--ok); border: 1px solid #1d5236; }
.link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); font-weight: 700; text-decoration: none; }

/* ---------- ajustes ---------- */
.card { padding: 18px; margin-bottom: 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.card h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .08em; color: var(--gold); }
.card p { margin: 0; }
.setrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.setrow > span:first-child { min-width: 240px; }
.setrow b { min-width: 40px; text-align: center; font-size: 20px; }
.setrow select { min-height: var(--tap); padding: 0 14px; border-radius: var(--r); background: var(--panel2); border: 1px solid var(--line); font-weight: 800; }
.setrow.check { font-size: 15px; cursor: pointer; }
.setrow.check span { min-width: 0 !important; }
.setrow.check input { width: 28px; height: 28px; accent-color: var(--gold); }

/* ---------- setlist ---------- */
.set-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.set-meta label { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--muted); }
.set-meta input { min-height: 48px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font-weight: 700; color-scheme: dark; }
.set-meta .danger-text { margin-left: auto; }
.set-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.colh { font-size: 14px; font-weight: 800; letter-spacing: .08em; color: var(--gold); margin: 0 0 10px; }
.colh small { color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.colh .ic { width: 14px; height: 14px; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 6px; min-height: 68px; padding: 6px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.item.dragging { position: relative; z-index: 3; border-color: var(--gold); background: var(--panel2); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.handle { display: grid; place-items: center; width: 48px; height: 56px; color: var(--muted); touch-action: none; cursor: grab; }
.handle .ic { width: 24px; height: 24px; }
.num { width: 30px; text-align: center; font-weight: 800; color: var(--gold); }
.item .row-main { cursor: pointer; padding: 4px 0; }
.item .row-title { font-size: 17px; }
.picker .list { max-height: 70vh; overflow: auto; margin-top: 10px; }
.picker .row { min-height: 60px; }
.picker .row.added .badge { color: var(--ok); }
.badge { display: grid; place-items: center; width: 44px; height: 44px; color: var(--gold); }

/* ---------- tela da letra ---------- */
.reader { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: #000; }
.rbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #000; flex: none; }
.rtop { padding-top: calc(var(--safe-t) + 6px); border-bottom: 1px solid #161616; }
.rbot { padding-bottom: calc(var(--safe-b) + 6px); border-top: 1px solid #161616; flex-wrap: wrap; justify-content: space-between; }
.rb {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 52px; height: 52px; padding: 0 12px; border-radius: 12px; border: 1px solid #262626;
  background: #0d0d0d; color: #cfcfcf; font-weight: 800; font-size: 16px; letter-spacing: .03em; user-select: none; -webkit-user-select: none;
}
.rb:active { background: #1c1c1c; }
.rb:disabled { opacity: .3; }
.rb.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.rb.big { height: 60px; min-width: 72px; }
.rb.big .ic { width: 30px; height: 30px; }
.rb.sm { min-width: 44px; height: 44px; padding: 0; }
.rb .ic { width: 22px; height: 22px; }
.rb.star-btn { color: #555; }
.rb.star-btn.on { color: var(--gold); }
.rtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 8px; line-height: 1.15; }
.rtitle b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtitle span { font-size: 13px; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsz { min-width: 30px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.grp { display: flex; align-items: center; gap: 6px; }
.spd { min-width: 44px; text-align: center; font-weight: 800; color: #cfcfcf; }
.pos { min-width: 50px; text-align: center; color: var(--muted); font-weight: 800; }
.nextb { max-width: 42vw; }
.nextlbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 3px; background: #0d0d0d; flex: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); opacity: .7; }

.scroller { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: 0; }
.lyrics {
  max-width: 1400px; margin: 0 auto; padding: .6em 4vw 0;
  font-weight: 700; line-height: 1.38; letter-spacing: .01em; text-transform: uppercase; color: #fff;
  overflow-wrap: anywhere;
}
.lyrics .ln { padding: .02em 0; }
.lyrics .gap { height: .7em; }
.lyrics .sec { margin: .5em 0 .15em; font-size: .62em; font-weight: 800; letter-spacing: .08em; color: var(--gold); }
.lyrics .meta { display: inline-block; margin-bottom: .5em; padding: .2em .6em; border-radius: .3em; font-size: .5em; font-weight: 800; color: var(--gold-ink); background: var(--gold); letter-spacing: .05em; }
.song-head { margin-bottom: .6em; }
.sh-title { font-size: .72em; font-weight: 800; color: #fff; opacity: .55; }
.sh-artist { font-size: .45em; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.lyrics .end { margin-top: 1.2em; font-size: .45em; color: #555; letter-spacing: .2em; text-align: center; }
.endnext {
  display: flex; align-items: center; justify-content: center; gap: .4em; width: 100%; margin-top: .8em; padding: .5em;
  border-radius: .4em; border: 2px solid var(--gold); background: transparent; color: var(--gold);
  font-size: .6em; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.endnext .ic { width: 1em; height: 1em; }
.lyrics .tail { height: 45vh; }

/* modo show: só o essencial */
.reader .only-show { display: none; }
.reader.show .only-show { display: inline-flex; }
.reader.show .hide-show { display: none; }
.reader.show .rtop { border-bottom-color: #0c0c0c; }
.reader.show .rtop .rb:not(.gold) { background: transparent; border-color: #1a1a1a; color: #8a8a8a; }
.reader.show .rbot .rb { background: #080808; }

/* trava de toque */
.lock-layer { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; background: transparent; touch-action: none; }
.unlock {
  position: absolute; top: calc(var(--safe-t) + 8px); right: 12px; display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid #333; background: rgba(0,0,0,.85); color: #8a8a8a;
  font-weight: 800; font-size: 13px; letter-spacing: .05em; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background-image: linear-gradient(var(--gold), var(--gold)); background-size: 0 100%; background-repeat: no-repeat;
}
.unlock.holding { background-size: 100% 100%; transition: background-size .9s linear; color: var(--gold-ink); }

/* pedido (tocar agora) */
.modal { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; background: rgba(0,0,0,.92); display: flex; justify-content: center; padding: calc(var(--safe-t) + 16px) 16px 16px; }
.modal-box { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.modal-head { display: flex; gap: 10px; }
.modal .list { overflow: auto; }

/* avisos */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 90px); z-index: 50; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 14px; background: #222; color: #fff; border: 1px solid #333;
  font-weight: 800; font-size: 15px; letter-spacing: .03em; text-align: center; opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.update {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 10px); z-index: 60; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 99px; border: 0; background: var(--gold); color: var(--gold-ink); font-weight: 800; font-size: 14px;
}

/* ---------- telas menores ---------- */
@media (max-width: 900px) {
  .set-cols { grid-template-columns: 1fr; }
  .picker .list { max-height: none; }
}
@media (max-width: 760px) {
  .rb .lbl, .fsz { display: none; }
  .rb { min-width: 46px; height: 48px; padding: 0 10px; }
  .rb.big { height: 52px; min-width: 56px; }
  .rbar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .nextb { max-width: 36vw; }
  .rtitle b { font-size: 14px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .add .btn { flex: 1; }
  .grid { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 64px; padding: 10px 12px; }
  .tile-name { font-size: 15px; }
  .row-title { font-size: 17px; }
  .setrow > span:first-child { min-width: 0; width: 100%; }
  .rbot .grp.setnav { width: 100%; justify-content: space-between; order: -1; }
  .nextb { max-width: none; flex: 1; }
  .topbar .btn { padding: 0 12px; }
  .ttl { font-size: 17px; }
  .tabs button { padding: 0 12px; font-size: 15px; }
  .rtop .rtitle { display: none; }
  .rtop { justify-content: space-between; }
  .rtop .rb { min-width: 42px; padding: 0 8px; }
  .reader:not(.show) .rtop [data-act=home] { display: none; }
}

/* botão atualizar */
.btn.refresh { min-height: 48px; padding: 0 14px; font-size: 14px; color: var(--gold); border-color: #5a4516; }
.btn.refresh .ic { width: 20px; height: 20px; }
.btn.refresh.spinning .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .btn.refresh span { display: none; } .btn.refresh { width: 48px; padding: 0; } }

/* ---------- erro ao iniciar ---------- */
.fatal { padding: 24px; font-size: 18px; color: #fff; }
.fatal h2 { color: #d9a52b; margin: 0 0 12px; }
.fatal .small { color: #bbb; font-size: 14px; word-break: break-all; }
.fatal button { font-size: 18px; padding: 12px 20px; }

/* ---------- navegadores antigos (sem "gap" em flexbox, ex.: Chrome < 84) ---------- */
@supports not (aspect-ratio: 1 / 1) {
  .topbar > * + *, .rbar > * + *, .grp > * + *, .add > * + *, .tabs > * + *, .row > * + *, .item > * + *,
  .setrow > * + *, .modal-head > * + *, .brand > * + *, .btn > * + *, .rb > * + *, .pill > * + *,
  .searchbox > * + *, .set-meta > * + *, .chips > * + *, .tabs button > * + *, .endnext > * + *, .unlock > * + * { margin-left: 8px; }
  .list > * + *, .items > * + *, .form > * + *, .card > * + *, .login-card > * + *, .login form > * + *, .modal-box > * + * { margin-top: 8px; }
  .add > *, .chips > *, .rbot > * { margin-bottom: 8px; }
}
