/* Radiola de Ficha — visual de festa: escuro, âmbar de válvula, botões grandes. */
:root {
  --bg: #15110e;
  --surface: #211a15;
  --surface-2: #2c231c;
  --line: #3b3027;
  --text: #f7efe5;
  --muted: #b9aa98;
  --accent: #f2a93b;
  --accent-ink: #241703;
  --like: #4cc38a;
  --dislike: #ef6b5b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* senão .votes{display:grid} venceria o hidden */
html, body { background: var(--bg); color: var(--text); }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
  padding-block: 12px 32px;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.15; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.wrap { max-width: 1100px; margin: 0 auto; }
.narrow { max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
section + section { margin-top: 1.25rem; }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .02em; }
.brand img { width: 34px; height: 34px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .15em; font-weight: 700; color: var(--accent); }

/* Formulários e botões */
label { display: block; font-weight: 600; margin-bottom: .35rem; }
input[type=text], input[type=search], input[type=password], select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; min-height: 48px;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: .8rem 1.1rem;
  min-height: 48px; cursor: pointer; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: .4rem;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.danger { background: transparent; color: var(--dislike); border-color: var(--dislike); }
.ghost { background: transparent; }
.block { width: 100%; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; }

/* Estilos (chips) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .55rem .9rem; min-height: 42px; border-radius: 999px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.chip[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.badge.accent { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* Tocando agora */
.now { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: center; }
.now img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--surface-2); max-width: 100%; }
.now .title { font-size: 1.15rem; font-weight: 800; }
.votes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.vote { font-size: 1.05rem; min-height: 56px; }
.vote.like[aria-pressed=true] { background: var(--like); color: #062213; border-color: var(--like); }
.vote.dislike[aria-pressed=true] { background: var(--dislike); color: #2a0703; border-color: var(--dislike); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .6rem; }
.meter > i { display: block; height: 100%; width: 0; background: var(--dislike); transition: width .3s; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 72px 1fr auto; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.list .t { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.list li.mine .t::before { content: "★ "; color: var(--accent); }
.empty { color: var(--muted); padding: .75rem 0; }

/* Diálogo simples */
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .65); display: grid; place-items: end center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none !important; }
.modal .sheet { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; max-height: 90vh; overflow: auto; margin-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 700px) { .modal { place-items: center; } }

/* Avisos */
#conn { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; background: #6b4b12; color: #fff3dc; text-align: center; padding: .5rem; border-radius: 10px; margin-bottom: .75rem; font-weight: 600; }
#conn.conn-error { background: #7a2219; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; gap: .5rem; width: min(92vw, 480px); }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: .75rem 1rem; border-radius: 10px; transition: opacity .4s; box-shadow: 0 6px 24px rgb(0 0 0 / .4); }
.toast-error { border-left-color: var(--dislike); }
.toast-ok { border-left-color: var(--like); }
.toast.out { opacity: 0; }

/* Anfitrião */
.host-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .host-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.player-box { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box iframe, .player-box #player { position: absolute; inset: 0; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1rem; background: rgb(10 8 6 / .88); z-index: 5; }
.overlay[hidden] { display: none !important; }
.overlay button { font-size: 1.25rem; padding: 1rem 1.6rem; }
.wake-warn { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; text-align: center; background: rgb(122 34 25 / .96); padding: 24px; }
.wake-warn[hidden] { display: none !important; }
.wake-warn strong { display: block; font-size: clamp(1.6rem, 6vw, 3rem); margin-bottom: 1rem; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 100%; max-width: 260px; aspect-ratio: 1; }
.golden { border: 1px dashed var(--accent); color: var(--muted); border-radius: 12px; padding: .7rem .9rem; font-size: .9rem; }

/* Telão */
.tela { min-height: calc(100vh - 44px); display: grid; gap: 2vw; grid-template-columns: 1fr; }
@media (min-width: 900px) { .tela { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.tela .big-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 18px; background: var(--surface-2); max-width: 100%; }
.tela .big-title { font-size: clamp(1.6rem, 3.4vw, 3.2rem); font-weight: 850; line-height: 1.1; margin-top: 1rem; }
.tela .who { font-size: clamp(1rem, 1.8vw, 1.6rem); color: var(--muted); margin-top: .4rem; }
.score { display: flex; gap: 1.2rem; font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 800; margin-top: 1rem; flex-wrap: wrap; }
.score .l { color: var(--like); } .score .d { color: var(--dislike); }
.tela .qr { max-width: 320px; }
.tela .join-url { font-size: clamp(1rem, 1.6vw, 1.4rem); word-break: break-all; }
