/* ==========================================================================
   Setlink — identidade visual v1
   Ink Black #111113 · Warm Ivory #F4F0E8 · Acid Lime #D6FA3C · Muted Steel #9696A1
   Tipografia: Neue Haas Grotesk (se estiver instalada / licenciada) e, como
   alternativa livre, Inter Tight. Rótulos em mono, como no quadro da marca.
   ========================================================================== */

/* Fontes livres (SIL OFL) servidas pelo próprio servidor. Se a Neue Haas Grotesk
   licenciada estiver instalada no aparelho, ela tem prioridade (veja --display/--font). */
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url('/fonts/inter-tight-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url('/fonts/inter-tight-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url('/fonts/inter-tight-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 700; font-display: swap; src: url('/fonts/inter-tight-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-weight: 800; font-display: swap; src: url('/fonts/inter-tight-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-display: swap; src: url('/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-display: swap; src: url('/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); }

/* Tema claro e escuro: o próprio app escolhe (data-modo no <html>, veja /js/modo.js).
   Por isso o navegador não deve escurecer nem inverter as telas por conta própria. */
:root { color-scheme: light; }
:root[data-modo='escuro'] { color-scheme: dark; }

:root {
  --ink: #111113;
  --ivory: #f4f0e8;
  --lime: #d6fa3c;
  --steel: #9696a1;

  --ink-2: #1b1b1e;
  --ink-3: #26262a;
  --ink-line: #35353b;
  --ivory-2: #fbf9f4;
  --ivory-3: #ebe6db;
  --ivory-line: #dcd6ca;
  --danger: #f0472b;

  --display: 'Neue Haas Grotesk Display Pro', 'NHaasGroteskDSPro', 'Neue Haas Grotesk Display', 'Inter Tight',
    'Helvetica Neue', Arial, sans-serif;
  --font: 'Neue Haas Grotesk Text Pro', 'NHaasGroteskTXPro', 'Neue Haas Grotesk Text', 'Inter Tight',
    'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 12px;

  /* superfície clara (padrão) */
  --bg: var(--ivory);
  --surface: var(--ivory-2);
  --surface-2: var(--ivory-3);
  --line: var(--ivory-line);
  --text: var(--ink);
  --muted: #64646d;
  --hi: var(--ink); /* destaque em texto: no claro é preto, no escuro é lime */
  --folha: var(--ivory); /* fundo da folha de conteúdo e das janelas */
  --forte: var(--ink); /* preenchimento forte: botão escuro, chip, aba ativa */
  --sobre-forte: var(--ivory);
  --largura: 1720px; /* largura máxima do conteúdo no computador */
}

/* tema escuro: a folha e os cards ficam grafite; a marca (ink, lime) continua igual */
:root[data-modo='escuro'],
:root[data-modo='escuro'] .on-light {
  --bg: #161618;
  --folha: #161618;
  --surface: #1e1e21;
  --surface-2: #28282c;
  --line: #35353b;
  --text: var(--ivory);
  --muted: var(--steel);
  --hi: var(--lime);
  --forte: var(--ivory);
  --sobre-forte: var(--ink);
}

/* superfície escura: qualquer bloco com .on-dark herda estes tokens */
.on-dark {
  --bg: var(--ink);
  --surface: var(--ink-2);
  --surface-2: var(--ink-3);
  --line: var(--ink-line);
  --text: var(--ivory);
  --muted: var(--steel);
  --hi: var(--lime);
  --forte: var(--ivory);
  --sobre-forte: var(--ink);
  color: var(--text);
}

/* blocos claros dentro de telas escuras (folha de conteúdo, gaveta) voltam aos tokens claros */
.on-light {
  --bg: var(--ivory);
  --surface: var(--ivory-2);
  --surface-2: var(--ivory-3);
  --line: var(--ivory-line);
  --text: var(--ink);
  --muted: #64646d;
  --hi: var(--ink);
  --folha: var(--ivory);
  --forte: var(--ink);
  --sobre-forte: var(--ivory);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.on-dark { background: var(--ink); }

a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--lime); }
.sheet :focus-visible,
.panel-main :focus-visible,
dialog.on-light :focus-visible { outline-color: var(--hi); }

.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* Rótulo mono em caixa alta — linguagem do quadro da marca */
.label,
h2 {
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
h2 { margin-bottom: 12px; }
.sub-mono {
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ------------------------------------------------------------ marca */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font: 700 21px/1 var(--display);
  letter-spacing: -0.04em;
}
.brand svg { width: 24px; height: 24px; }

/* ------------------------------------------------------------ botões */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn-primary:hover { border-color: var(--forte); }
.on-dark .btn-primary:hover { border-color: var(--ivory); }
.btn-dark { background: var(--forte); color: var(--sobre-forte); border-color: var(--forte); }
.btn-live { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn-big { padding: 15px 18px; font-size: 16px; width: 100%; border-radius: 14px; }
.btn-icon { width: 46px; height: 46px; padding: 0; border-radius: 50%; flex: none; }

/* ------------------------------------------------------------ pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--line);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.pill.live::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.warn { color: var(--danger); border-color: currentColor; }
.pill.ok { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.pill-sm { padding: 3px 9px; font-size: 10px; margin-left: 6px; vertical-align: 1px; }
@keyframes pulse { 50% { opacity: 0.25; } }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font: 700 10px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font: 600 10px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------ formulários */

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type='text'], input[type='password'], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { border-color: var(--hi); }
input[type='range'] { width: 100%; accent-color: var(--lime); }

.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > select { flex: 1; min-width: 0; }

.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
code {
  font: 12px var(--mono);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
}

.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; margin: 12px 0 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.on-dark .check input, [data-modo='escuro'] .check input { accent-color: var(--lime); }

details.howto { margin-top: 12px; border-top: 1.5px dashed var(--line); padding-top: 10px; }
details.howto summary { cursor: pointer; font-size: 13px; font-weight: 700; }
details.howto ol { padding-left: 18px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
details.howto li { margin-bottom: 4px; }

/* ------------------------------------------------------------ listas */

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1.5px solid var(--line);
  min-width: 0;
}
.list li:last-child { border-bottom: 0; }
.list li.empty { color: var(--muted); font-size: 14px; }
.list time { font: 12px var(--mono); color: var(--muted); flex: none; }
.list .grow, .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .by { display: block; font-size: 12px; color: var(--muted); }
.history { max-height: 320px; overflow-y: auto; }

.vote {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 5px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: 700 13px var(--mono);
  cursor: pointer;
}
.vote.on { color: var(--ink); background: var(--lime); border-color: var(--lime); }
.votes-static { flex: none; min-width: 36px; text-align: center; font: 700 16px var(--mono); }

/* ------------------------------------------------------------ chat */

.chat-msg { display: block !important; padding: 6px 0 !important; border: 0 !important; }
.chat-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.chat-meta strong { color: var(--text); font-size: 13px; }
.chat-meta time { color: var(--muted); font: 11px var(--mono); }
.chat-text { display: block; overflow-wrap: anywhere; }
.from-dj .chat-meta strong { background: var(--lime); color: var(--ink); padding: 0 5px; border-radius: 4px; }

/* ------------------------------------------------------------ reações flutuando */

#reaction-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.float-emoji {
  position: absolute;
  bottom: -40px;
  font-size: 34px;
  animation: float-up var(--dur, 3s) ease-out forwards;
  will-change: transform, opacity;
}
@keyframes float-up {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10% { opacity: 1; transform: translate(0, -40px) scale(1.1); }
  100% { transform: translate(var(--drift, 0), -70vh) scale(1); opacity: 0; }
}
.reaction-btn {
  font-size: 22px;
  line-height: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.08s ease;
}
.reaction-btn:active { transform: scale(0.85); }
.reactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ------------------------------------------------------------ "Que som é esse?" */

.id-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  font-size: 14px;
}
.id-kicker { color: var(--muted); }
.moment-title { display: block; font-weight: 700; }
.moment-title.pending { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
.moment.top .moment-title { font-size: 16px; }
.list li.moment { align-items: flex-start; }
.list li.moment time { padding-top: 3px; }
.id-count {
  flex: none;
  align-self: flex-start;
  min-width: 40px;
  text-align: center;
  font: 700 24px/1.1 var(--mono);
}
.moment.resolved .id-count { color: var(--muted); }
.moment-state { color: var(--text) !important; margin-top: 2px; }
.moment-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.h2-count {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
}
.h2-count:empty { display: none; }
.reveal-panel { margin-bottom: 12px; padding: 12px; border-radius: var(--radius-sm); border: 1.5px dashed var(--forte); }

/* ==========================================================================
   App do público (Ao vivo, Na pista): coluna de celular
   ========================================================================== */

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.app-header { padding: 16px 18px 22px; }
.app-bar { display: flex; align-items: center; gap: 12px; }
.app-bar .spacer { flex: 1; }
.app-bar .count { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--mono); color: var(--ivory); }

.screen-title { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.screen-title h1 {
  font: 700 clamp(36px, 10vw, 46px) / 0.95 var(--display);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.title-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}
.title-icon .icon { width: 24px; height: 24px; }

.sheet {
  flex: 1;
  background: var(--folha);
  color: var(--text);
  border-radius: 28px 28px 0 0;
  padding: 20px 16px 110px;
}
.sheet-section + .sheet-section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h3 { font: 700 19px/1.1 var(--display); letter-spacing: -0.02em; }

/* navegação inferior */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--ink);
  border-top: 1px solid var(--ink-line);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
}
.bottom-nav a, .bottom-nav span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font: 600 11px var(--font);
  color: var(--steel);
  text-decoration: none;
  padding: 4px 0;
}
.bottom-nav .icon { width: 22px; height: 22px; }
.bottom-nav .active { color: var(--lime); }
.bottom-nav .soon { opacity: 0.45; }
.bottom-nav .soon small { font: 500 9px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* Padrão "offset bracket" do quadro da marca, em lime sobre fundo escuro */
.pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cdefs%3E%3Cg id='m'%3E%3Cg fill='none' stroke='%23D6FA3C' stroke-width='19' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M79 21H43L21 43V59'/%3E%3Cpath d='M21 79H57L79 57V41'/%3E%3C/g%3E%3Crect x='41' y='41' width='18' height='18' fill='%23D6FA3C'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23m' transform='translate(4 4) scale(.5)'/%3E%3Cuse href='%23m' transform='translate(64 64) scale(.5) rotate(90 50 50)'/%3E%3C/svg%3E");
  background-size: 88px 88px;
}

/* ------------------------------------------------------------ Ao vivo */

.feature {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: var(--ink);
  color: var(--ivory);
  text-decoration: none;
  min-height: 260px;
  padding: 16px;
}
.feature .pattern {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  /* o padrão some perto do título, para não brigar com a leitura */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 40%, transparent 72%);
}
.feature-top { position: relative; display: flex; gap: 8px; align-items: center; }
.feature-top .viewers {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font: 700 12px var(--mono);
  background: rgba(17, 17, 19, 0.7);
  padding: 4px 9px;
  border-radius: 999px;
}
.feature-body { position: absolute; left: 16px; right: 80px; bottom: 16px; }
.feature-title {
  font: 700 clamp(30px, 9vw, 42px) / 0.98 var(--display);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.feature-meta { margin-top: 10px; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--steel); }
.feature-play {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--lime);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.feature-play .icon { width: 26px; height: 26px; }

.live-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.live-card {
  flex: 0 0 150px;
  scroll-snap-align: start;
  text-decoration: none;
  color: var(--text);
}
.live-card .thumb {
  position: relative;
  height: 104px;
  border-radius: 14px;
  background: var(--ink);
  overflow: hidden;
  color: var(--lime);
}
.live-card .thumb .pattern { position: absolute; inset: 0; opacity: 0.22; }
.live-card .thumb .who {
  position: absolute;
  left: 8px;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font: 700 12px var(--font);
  color: var(--ink);
  background: var(--lime);
  border-radius: 8px;
  padding: 4px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-card .thumb .who .icon { width: 14px; height: 14px; }
.live-card .meta { margin-top: 6px; font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.empty-state {
  border: 1.5px dashed var(--line);
  border-radius: 22px;
  padding: 28px 20px;
  text-align: center;
}
.empty-state .icon { width: 40px; height: 40px; }
.empty-state h3 { font: 700 22px/1.1 var(--display); letter-spacing: -0.03em; margin: 10px 0 6px; }
.empty-state p { color: var(--muted); margin: 0; }

.card-ivory {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card-ivory form > * + * { margin-top: 12px; }
.linkbox + .linkbox { margin-top: 12px; }
.linkbox .row input { font: 12px var(--mono); }
.warn-text { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

/* ------------------------------------------------------------ Na pista */

.room-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.room-sub .dj { font: 600 14px var(--font); color: var(--ivory); }
.room-sub .tag { color: var(--steel); }

.stage {
  position: relative;
  margin: 0 14px;
  height: min(58vw, 300px);
  min-height: 230px;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(214, 250, 60, 0.12), transparent 60%),
    var(--ink-2);
  border: 1px solid var(--ink-line);
  overflow: hidden;
}
.stage canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 45%; opacity: 0.9; }
.stage-mark {
  position: absolute;
  top: 36%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  color: var(--lime);
  filter: drop-shadow(0 0 18px rgba(214, 250, 60, 0.35));
}
.np-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 84px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
  background: rgba(17, 17, 19, 0.85);
  border: 1.5px solid var(--ivory);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.np-pill .np-text { flex: 1; min-width: 0; }
.np-pill .np-who { font: 700 14px/1.2 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-pill .now-track { font: 500 12px/1.3 var(--font); color: var(--steel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-pill .now-track.empty { font-style: normal; }
.np-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  border: 1.5px solid var(--ivory);
  background: transparent;
  color: var(--ivory);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.np-btn .icon { width: 18px; height: 18px; }
.count-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(17, 17, 19, 0.85);
  border: 1.5px solid var(--ink-line);
  font: 700 13px var(--mono);
  z-index: 2;
}
.count-badge .icon { width: 16px; height: 16px; }

/* a pista: bonecos ancorados pelos pés */
.floor { position: absolute; left: 10px; right: 10px; top: 46%; bottom: 6%; }
.avatar {
  position: absolute;
  transform: translate(-50%, -100%);
  animation: bob 1.9s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.avatar img { display: block; height: clamp(46px, 13vw, 66px); width: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.avatar .me-tag {
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
  background: var(--lime);
  color: var(--ink);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.floor .more {
  position: absolute;
  right: 0;
  bottom: 0;
  font: 700 11px var(--mono);
  color: var(--steel);
}
@keyframes bob { 50% { transform: translate(-50%, calc(-100% - 3px)); } }

/* escolha do boneco */
.look-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.look-field legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; padding: 0; }
.look-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.look-option {
  appearance: none;
  border: 2px solid var(--ivory-line);
  border-radius: 14px;
  background: var(--ink);
  padding: 6px 2px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font: 600 10px var(--font);
  color: var(--steel);
}
.look-option img { height: 64px; width: auto; display: block; }
.look-option[aria-checked='true'] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--lime); color: var(--lime); }

.reaction-strip { display: flex; justify-content: space-between; gap: 6px; padding: 8px 14px 4px; }
.reaction-strip .reaction-btn { width: 46px; height: 46px; background: var(--ink-2); border-color: var(--ink-line); }

.wave-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 4px;
  font: 600 12px var(--mono);
  color: var(--steel);
}
.wave-row .elapsed { color: var(--ivory); min-width: 44px; }
.wave-row .conn { flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.room-body { padding: 4px 14px 84px; display: flex; flex-direction: column; gap: 12px; }
.room-dock {
  position: sticky;
  bottom: calc(66px + env(safe-area-inset-bottom));
  background: var(--ink);
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

.chat-feed { max-height: 34vh; min-height: 120px; overflow-y: auto; padding: 4px 4px 0; }
.chat-feed .chat-msg { display: flex !important; gap: 10px; align-items: flex-start; padding: 5px 0 !important; }
.chat-feed .chat-meta { flex: none; }
.chat-feed .chat-meta time { display: none; }
.chat-feed .chat-text { color: var(--ivory); }

.btn-id {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 0;
  background: var(--lime);
  color: var(--ink);
  font: 700 18px/1 var(--display);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn-id .icon { width: 22px; height: 22px; }
.btn-id:active { transform: scale(0.98); }
.btn-id:disabled { background: var(--ink-3); color: var(--steel); cursor: not-allowed; }
.btn-id.tapped { background: var(--ivory); }
.id-box { display: flex; flex-direction: column; gap: 10px; }

.composer { display: flex; gap: 8px; align-items: center; }
.composer input { border-radius: 999px; padding: 12px 16px; }
.composer .btn-icon { background: var(--ink-2); border-color: var(--ink-line); color: var(--ivory); }
.composer .send { background: transparent; border: 0; color: var(--ivory); }

/* gaveta (pedidos, IDs, já tocou, salvas) */
dialog.drawer {
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--folha);
  color: var(--text);
}
dialog.drawer::backdrop { background: rgba(17, 17, 19, 0.6); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.drawer-head h3 { font: 700 22px/1 var(--display); letter-spacing: -0.03em; }
.drawer-body { padding: 0 16px 24px; overflow-y: auto; max-height: calc(86vh - 120px); }
.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
  margin: 0 16px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}
.segmented button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 9px 4px;
  font: 600 13px var(--font);
  color: var(--text);
  cursor: pointer;
}
.segmented button[aria-selected='true'] { background: var(--lime); color: var(--ink); }
.tab-panel[hidden] { display: none; }
.player-row { display: flex; gap: 12px; align-items: center; }
.player-row input[type='range'] { flex: 1; }

/* entrada na sala */
.join-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; }
.join-card form > * + * { margin-top: 12px; }

/* ==========================================================================
   Painel do DJ (desktop)
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .room-name { font: 600 15px var(--font); color: var(--steel); }
.spacer { flex: 1; }
.count { font: 600 13px var(--mono); color: var(--muted); }
.count strong { color: var(--text); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 960px) { .grid > * { grid-column: span 12; } }
.stack { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

/* "Tocando agora" no painel: cartaz escuro */
.now {
  position: relative;
  overflow: hidden;
  padding: 20px 18px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 0;
}
.now-label { font: 600 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lime); }
.now .now-track {
  font: 700 clamp(26px, 3.4vw, 40px) / 0.98 var(--display);
  letter-spacing: -0.045em;
  color: var(--lime);
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.now .now-track.empty { color: var(--steel); }
.now-since { color: var(--steel); font: 500 12px var(--mono); margin-top: 6px; }

/* medidores */
.meters { display: grid; gap: 6px; margin: 14px 0 4px; }
.meter { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; font: 700 11px var(--mono); color: var(--muted); }
.meter-bar { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1.5px solid var(--line); overflow: hidden; position: relative; }
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--steel) 0%, var(--lime) 62%, #f2c230 88%, var(--danger) 100%);
  transition: width 0.05s linear;
}
.meter-peak { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); left: 0; }
.clip { color: var(--danger); font: 800 12px var(--mono); visibility: hidden; }
.clip.on { visibility: visible; }

.chat { display: flex; flex-direction: column; height: 460px; }
.chat .list-scroll { flex: 1; overflow-y: auto; margin-bottom: 10px; padding-right: 4px; }

.peer-state { font: 11px var(--mono); color: var(--muted); }
.peer-state.ok { color: var(--ink); background: var(--lime); padding: 1px 6px; border-radius: 5px; }
.peer-state.bad { color: var(--danger); }

/* painel do DJ em passos */
.step-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font: 700 13px/1 var(--mono);
  vertical-align: 2px;
}
.col-head { margin: 2px 0 12px; font-size: 18px; }
.step.is-done .step-n { background: var(--lime); color: var(--ink); }
.onair-line { margin: 14px 0 10px; font-weight: 600; }
#lineup li { gap: 8px; }
#lineup .by { display: block; }

/* aviso do sistema no chat (troca de DJ etc.) */
.from-system .chat-meta { display: none; }
.from-system .chat-text {
  color: var(--muted);
  font: 600 12px var(--mono);
  letter-spacing: 0.02em;
}
.from-system .chat-text::before { content: '— '; }
.chat-feed .from-system .chat-text { color: var(--steel); }

/* ------------------------------------------------------------ toast e utilidades */

#toast {
  position: fixed;
  left: 50%;
  top: 72px;
  bottom: auto;
  transform: translate(-50%, -12px);
  background: var(--ink);
  color: var(--ivory);
  border: 1.5px solid var(--lime);
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .float-emoji { animation-duration: 0.8s; }
  .pill.live::before, .avatar { animation: none; }
}

/* ==========================================================================
   Telas com os componentes do design system (Pista, bonecos, provador)
   Celular primeiro; a partir de 960px, computador.
   ========================================================================== */

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* navegação no topo (computador) */
.top-nav { display: none; align-items: center; gap: 4px; }
.top-nav a, .top-nav span {
  padding: 8px 12px;
  border-radius: 999px;
  font: 600 14px/1 var(--font);
  color: var(--steel);
  text-decoration: none;
  white-space: nowrap;
}
.top-nav a:hover { color: var(--ivory); }
.top-nav .active { color: var(--ink); background: var(--lime); }
.top-nav .soon { opacity: 0.5; }
.top-nav small { font: 500 9px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; margin-left: 4px; }
.app-bar .pill { flex: none; }

/* ------------------------------------------------------------ Ao vivo */

.home-grid { display: flex; flex-direction: column; gap: 26px; }

.feature.has-photo {
  background-color: var(--ink);
  background-size: cover;
  background-position: center 40%;
  min-height: 300px;
}
/* escurece só a parte de baixo, onde fica o título (ivory sobre ink) */
.feature.has-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(17, 17, 19, 0.15) 0%, rgba(17, 17, 19, 0.2) 35%, rgba(17, 17, 19, 0.92) 78%);
}
.feature.has-photo .feature-top { z-index: 1; }
.feature.has-photo .feature-meta { color: var(--ivory); opacity: 0.8; }
.feature-track { margin-top: 6px; font: 500 13px/1.3 var(--font); color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.live-card .thumb.has-photo { background-size: cover; background-position: center 40%; }

.empty-state { padding: 14px 14px 22px; }
.empty-state .empty-stage { margin-bottom: 14px; text-align: left; }

.created-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.created-thumb { flex: none; width: 76px; height: 54px; border-radius: 10px; background: var(--ink) center/cover; }
.created-title { font: 700 24px/1 var(--display); letter-spacing: -0.03em; }
.room-dot { flex: none; width: 44px; height: 32px; border-radius: 8px; background: var(--ink) center/cover; }

/* ------------------------------------------------------------ Na pista: entrada */

.join-grid { display: flex; flex-direction: column; gap: 16px; }
.join-form { display: flex; flex-direction: column; gap: 16px; }
.join-form > .join-card > * + * { margin-top: 12px; }
.join-title { font: 700 26px/1.05 var(--display); letter-spacing: -0.03em; }
.join-subtitle { font: 700 19px/1.1 var(--display); letter-spacing: -0.02em; margin-bottom: 12px; }
.join-look { padding-bottom: 20px; }
.btn-entrar { padding: 10px 18px; min-height: 60px; }
.btn-entrar .pulseira {
  width: 40px;
  height: 40px;
  flex: none;
  background: url('/ds/img/utilitarios.webp') no-repeat 100% 0% / 300% 200%;
}
.look-field legend { margin-bottom: 10px; }

/* ------------------------------------------------------------ Na pista: dentro */

.room-main { padding: 0 14px calc(84px + env(safe-area-inset-bottom)); }
.room-grid { display: flex; flex-direction: column; gap: 12px; }
.room-stage-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.room-stage .sl-reacao { width: 50px; height: 50px; }
.room-stage-col .wave-row { padding: 2px 4px; }
.room-side-col { min-width: 0; }
.room-chat { display: flex; flex-direction: column; gap: 8px; }
.room-chat-title {
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 6px 4px 0;
}
.room-chat .chat-feed { min-height: 160px; }
.room-chat .room-dock { bottom: calc(66px + env(safe-area-inset-bottom)); }
.drawer-sub { font: 700 17px/1.1 var(--display); letter-spacing: -0.02em; margin: 22px 0 10px; }

/* reações com os desenhos 3D (painel do DJ) */
.reaction-btn { display: inline-grid; place-items: center; padding: 3px; }
.reaction-art { display: block; width: 100%; height: 100%; background-repeat: no-repeat; }

/* ------------------------------------------------------------ Painel do DJ */

.topbar.on-dark { background: var(--ink); }
.topbar-pista { color: var(--steel); }
.card-stage { background: var(--ink); border-color: var(--ink); margin-bottom: 16px; padding: 14px; }
.card-stage-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.card-stage-head h2 { color: var(--ivory); margin: 0; }
.card-stage .hint { color: var(--steel); }
#pista-card .sl-seletor-caixa { container-type: inline-size; }

@media (max-width: 640px) {
  .topbar { gap: 8px 10px; padding: 10px 14px; }
  .topbar .room-name { order: 1; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ivory); }
  .topbar .spacer { display: none; }
  .topbar-pista { order: 2; }
  .topbar #status-pill { order: 3; }
  .topbar .count { order: 4; margin-left: auto; }
  .topbar #copy-link { order: 5; width: 100%; }
  .wrap { padding: 14px 12px 32px; }
}

/* celular: a pista fica mais alta para caber a galera */
@media (max-width: 600px) {
  .room-stage, .join-stage, .empty-stage, #dj-stage { --sl-pista-proporcao: 4 / 3; }
}

/* ------------------------------------------------------------ computador */

@media (min-width: 960px) {
  .app-shell { max-width: 1240px; }
  .app-header { padding: 18px 32px 26px; }
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .sheet { margin: 0 24px 32px; border-radius: 28px; padding: 28px 28px 32px; }

  /* Ao vivo: vitrine à esquerda, abrir pista à direita */
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .home-grid .sheet-section + .sheet-section { margin-top: 0; }
  .feature.has-photo { min-height: 420px; }
  .live-row { flex-wrap: wrap; overflow: visible; }
  .live-card { flex: 0 0 calc(50% - 5px); }
  .live-card .thumb { height: 150px; }

  /* Entrada: pista e boneco à esquerda, look à direita */
  .join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto 1fr auto; gap: 24px; align-items: start; }
  .join-stage { grid-column: 1; grid-row: 1; }
  .join-form { display: contents; }
  .join-form > .join-card:first-child { grid-column: 1; grid-row: 2; }
  .join-look { grid-column: 2; grid-row: 1 / span 2; }
  .btn-entrar { grid-column: 1 / -1; grid-row: 3; max-width: 520px; justify-self: center; width: 100%; }

  /* Dentro da pista: palco grande à esquerda, chat à direita */
  .room-main { padding: 0 32px 32px; }
  .room-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
  .room-side-col { position: sticky; top: 16px; }
  .room-chat {
    height: calc(100vh - 32px);
    max-height: 760px;
    padding: 12px;
    border-radius: 22px;
    background: var(--ink-2);
    border: 1px solid var(--ink-line);
  }
  .room-chat .chat-feed { flex: 1; max-height: none; }
  .room-chat .room-dock { position: static; background: transparent; padding: 0; }

  /* gaveta vira janela no centro */
  dialog.drawer { margin: auto; border-radius: 26px; max-width: 720px; }
}


/* ---- Conta: login e chip do usuário ---- */
.auth-section { max-width: 440px; margin: 0 auto; }
.captcha { display: flex; justify-content: center; min-height: 65px; margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-2); }
.auth-tabs button {
  flex: 1; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent;
  font: 600 14px var(--font, inherit); color: var(--muted); cursor: pointer;
}
.auth-tabs button.active { background: var(--forte); color: var(--sobre-forte); }
.me-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ivory); }
.me-chip strong { font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip button {
  padding: 6px 10px; border: 1px solid rgba(244, 240, 232, 0.35); border-radius: 999px;
  background: transparent; color: var(--ivory); font: 600 12px var(--font, inherit); cursor: pointer;
}
.me-chip button:hover { border-color: var(--lime); color: var(--lime); }



/* ---- Etiquetas (gêneros): digita, Enter vira caixinha ---- */
.chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); cursor: text;
}
.chips:focus-within { border-color: var(--hi); }
.chips .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 11px; border-radius: 999px;
  background: var(--forte); color: var(--sobre-forte); font: 600 13px var(--font);
}
.chips .chip button {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(244, 240, 232, 0.18); color: inherit; font-size: 13px; line-height: 1; cursor: pointer;
}
.chips .chip button:hover { background: var(--lime); color: var(--ink); }
.chips input[type='text'] { flex: 1; min-width: 120px; width: auto; padding: 6px 4px; border: 0; background: transparent; }


/* ==========================================================================
   Tema claro e escuro · cartão da pista e janela das 19 · layout largo no computador
   ========================================================================== */

/* botão do tema: fica no topo, que é escuro nos dois temas */
.modo-btn {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(244, 240, 232, 0.35);
  background: transparent;
  color: var(--ivory);
  cursor: pointer;
}
.modo-btn:hover { border-color: var(--lime); color: var(--lime); }
.modo-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modo-sol { display: none; }
[data-modo='escuro'] .modo-sol { display: block; }
[data-modo='escuro'] .modo-lua { display: none; }
.topbar .modo-btn { width: 32px; height: 32px; }

/* tema escuro: onde o claro usava o preto como contraste */
[data-modo='escuro'] .sheet { border: 1px solid #232327; }
[data-modo='escuro'] .card-stage { border-color: var(--ink-line); }
[data-modo='escuro'] .step-n { box-shadow: inset 0 0 0 1.5px var(--ink-line); }
[data-modo='escuro'] .chips .chip button { background: rgba(17, 17, 19, 0.14); }
[data-modo='escuro'] dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

/* ------------------------------------------------------------ cartão da pista escolhida */

.pista-atual { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; }
.pista-atual-foto {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ink) center / cover no-repeat;
}
.pista-atual-texto { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pista-atual-nome { font: 700 18px/1.1 var(--display); letter-spacing: -0.02em; }
.pista-atual-clima { font-size: 13px; line-height: 1.4; color: var(--muted); }
.pista-atual-traje {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font: 600 10px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pista-atual-traje i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; }
.pista-atual-traje span { margin-left: 3px; }
.pista-atual-btn, .pista-atual-nota { grid-column: 1 / -1; }
.pista-atual-btn { width: 100%; }
.pista-atual-nota { margin: 0; }

/* ------------------------------------------------------------ janela com as 19 pistas */

dialog.janela {
  width: min(calc(100vw - 32px), 1280px);
  max-width: none;
  max-height: min(88vh, 980px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--folha);
  color: var(--text);
  overflow: hidden;
}
dialog.janela[open] { display: flex; flex-direction: column; }
dialog.janela::backdrop { background: rgba(17, 17, 19, 0.6); }
.janela-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.janela-titulo { font: 700 24px/1 var(--display); letter-spacing: -0.03em; }
.janela-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; }
.janela-seletor { padding: 4px; } /* folga para o anel da escolha */
.janela-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1.5px solid var(--line); }
.janela-escolha { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  dialog.janela { width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .janela-head { padding: 16px 16px 6px; }
  .janela-body { padding: 4px 12px 12px; }
  .janela-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
  .janela-escolha { display: none; }
  .janela-foot .btn { flex: 1; }
}

/* celular: o botão do tema entra na fila do topo do painel */
@media (max-width: 640px) {
  .topbar .modo-btn { order: 5; }
  .topbar #copy-link { order: 6; }
}

/* ------------------------------------------------------------ computador: usa a largura da tela */

@media (min-width: 960px) {
  .app-shell { max-width: none; }
  .app-header { width: min(calc(100% - 64px), var(--largura)); margin: 0 auto; padding: 18px 0 24px; }
  .app-bar { gap: 14px; }
  .top-nav { margin-left: 20px; }
  .sheet { width: min(calc(100% - 64px), var(--largura)); margin: 0 auto 32px; padding: 32px; }

  /* entrar / criar conta: folha estreita, no centro */
  .app-shell-auth .app-header, .app-shell-auth .sheet { width: min(calc(100% - 64px), 560px); }

  /* Ao vivo: a vitrine ocupa a largura; abrir pista numa coluna fixa à direita */
  .home-grid { grid-template-columns: minmax(0, 1fr) clamp(360px, 27vw, 460px); gap: 32px; }
  .feature.has-photo { min-height: 0; aspect-ratio: 16 / 9; }
  .feature-title { font-size: clamp(36px, 3vw, 56px); }
  .live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; overflow: visible; padding: 0; }
  .live-grid .live-card { flex: none; }
  .live-grid .live-card .thumb { height: auto; aspect-ratio: 16 / 9; }

  /* Na pista: cabeçalho compacto, pista grande, faixa de baixo em uma linha, chat ao lado */
  .room-main { width: min(calc(100% - 64px), var(--largura)); margin: 0 auto; padding: 0 0 32px; }
  .app-shell-room .app-header { padding-bottom: 16px; }
  .app-shell-room .screen-title { margin-top: 12px; }
  .app-shell-room .screen-title h1 { font-size: 34px; }
  .room-grid { grid-template-columns: minmax(0, 1fr) clamp(320px, 25vw, 420px); gap: 24px; }
  .room-stage-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 12px 16px; align-items: center; }
  .room-stage-col > .room-stage, .room-stage-col > .audio-gate { grid-column: 1 / -1; }
  /* a pista inteira cabe na altura da janela */
  .room-stage-col > .room-stage { width: 100%; max-width: max(560px, calc((100vh - 250px) * 1672 / 941)); justify-self: center; }
  .room-stage-col > .wave-row { grid-column: 1; padding: 0 4px; }
  .room-stage-col > .id-box { grid-column: 2; }
  .room-chat { height: calc(100vh - 48px); max-height: 920px; }

  /* Entrada: pista e boneco à esquerda, look à direita, com mais respiro */
  .join-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }

  /* Painel do DJ: topo e conteúdo alinhados na mesma largura */
  .topbar { padding: 12px max(24px, calc((100% - var(--largura)) / 2)); }
  .wrap { max-width: none; width: min(calc(100% - 48px), var(--largura)); padding: 20px 0 40px; }
}

/* Painel do DJ em três colunas: controles | a pista e a noite | chat e quem está na pista */
@media (min-width: 1280px) {
  #main.grid {
    grid-template-columns: clamp(320px, 22vw, 380px) minmax(0, 1fr) clamp(320px, 22vw, 400px);
    grid-template-areas:
      'ctrl head lado'
      'ctrl palco lado'
      'ctrl info lado';
    grid-template-rows: auto auto 1fr;
    gap: 16px 20px;
    align-items: start;
  }
  #main > .dj-ctrl { grid-area: ctrl; }
  #main .dj-centro, #main .dj-sub { display: contents; }
  #main .dj-head { grid-area: head; margin: 0; }
  #main .dj-palco { grid-area: palco; margin-bottom: 0; }
  #main .dj-info {
    grid-area: info;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  #main .dj-info > .now, #main .dj-info > section:last-child { grid-column: 1 / -1; }
  #main .dj-lado { grid-area: lado; position: sticky; top: 72px; height: calc(100vh - 88px); }
  #main .dj-lado .chat { height: auto; flex: 1 1 0; min-height: 320px; }
  #main .dj-lado > section:last-child { flex: none; max-height: 32vh; overflow-y: auto; }
}

/* ---- Pista encerrada na lista "Suas pistas" ---- */
#my-rooms-list li.closed .grow, #my-rooms-list li.closed .room-dot { opacity: 0.55; }

/* ---- Janela de confirmação (no lugar do confirm() do navegador) ---- */
dialog.modal-confirmar {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 26px 24px 22px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: var(--folha);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  animation: modal-entra 160ms ease-out;
}
dialog.modal-confirmar::backdrop { background: rgba(17, 17, 19, 0.62); backdrop-filter: blur(5px); }
dialog.modal-confirmar h3 { margin: 0 0 10px; font: 700 22px/1.15 var(--display); letter-spacing: -0.03em; text-transform: none; }
dialog.modal-confirmar p { margin: 0 0 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal-acoes .btn { padding-inline: 18px; }
@keyframes modal-entra { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.modal-confirmar { animation: none; } }
@media (max-width: 480px) {
  .modal-acoes { flex-direction: column-reverse; }
  .modal-acoes .btn { width: 100%; }
}

/* ---- Provador: categoria "em breve" (Utilitários) ---- */
.sl-segmentado button.is-em-breve { opacity: 0.55; cursor: default; }
.sl-segmentado button.is-em-breve small { margin-left: 6px; font: 700 9px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
