/* ═══════════════════════════════════════════════════════════════
   EzShare — painel de transmissão.
   Tinta azul-escura, âmbar de tally light, ciano de telemetria.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* base */
  --ink-0:  #070B14;   /* fundo do palco, atrás do vídeo */
  --ink-1:  #0B1120;   /* fundo geral */
  --ink-2:  #111A2D;   /* painéis */
  --ink-3:  #18243C;   /* elevado */
  --line:   #21304C;
  --line-2: #172236;

  /* tinta */
  --paper:     #E9EEF8;
  --paper-dim: #8493AE;
  --paper-far: #58657E;

  /* sinal */
  --signal:    #FF7A1A;   /* no ar, ação principal */
  --signal-2:  #FFA254;
  --signal-sh: rgba(255, 122, 26, .28);
  --tune:      #4DD8E6;   /* telemetria, conexão direta */
  --alert:     #FF5566;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body:    "Barlow", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--paper);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
.view { min-height: 100%; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────── tally: a assinatura ── */

.tally {
  --size: 9px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #2C3A54;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  flex: 0 0 auto;
  display: block;
  transition: background .25s var(--ease), box-shadow .25s var(--ease);
}

.tally.big { --size: 16px; }

/* Aceso = você está sendo visto. */
.tally.live {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-sh), 0 0 14px var(--signal);
  animation: breathe 2.4s var(--ease) infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px var(--signal-sh), 0 0 14px var(--signal); }
  50%      { box-shadow: 0 0 0 6px transparent,      0 0 22px var(--signal); }
}

/* ══════════════════════════════════════════════════════ entrada ══ */

#view-home {
  display: grid;
  place-items: center;
  padding: 28px 20px;
  background:
    radial-gradient(1100px 620px at 50% -20%, rgba(255, 122, 26, .10), transparent 62%),
    radial-gradient(760px 480px at 12% 108%, rgba(77, 216, 230, .07), transparent 60%),
    var(--ink-1);
}

.tuner {
  width: 100%;
  max-width: 460px;
  display: grid;
  gap: 22px;
}

.tuner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow.muted { color: var(--paper-far); letter-spacing: .12em; }

.display {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(38px, 8vw, 54px);
  line-height: .96;
  letter-spacing: -.005em;
}

.display em {
  font-style: normal;
  color: var(--signal);
  /* sublinhado que lembra a barra de um lower-third de TV */
  box-shadow: inset 0 -.14em 0 var(--signal-sh);
}

.lede { margin: -8px 0 0; color: var(--paper-dim); font-size: 15px; max-width: 40ch; }

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.panel-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.panel-row + .panel-row { border-top: 1px solid var(--line-2); }

.lab {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-far);
}

.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn input { flex: 1; min-width: 0; }

input[type="text"], select {
  background: transparent;
  border: 0;
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  padding: 4px 0;
  width: 100%;
}

input[type="text"]::placeholder { color: var(--paper-far); }
input[type="text"]:focus { outline: none; }
.panel-row:focus-within .lab { color: var(--signal); }

/* botões ------------------------------------------------------- */

.cta {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #1A0C02;
  background: var(--signal);
  border: 0;
  border-radius: var(--r);
  padding: 15px;
  cursor: pointer;
  transition: filter .15s var(--ease), transform .06s var(--ease);
}

.cta:hover { filter: brightness(1.1); }
.cta:active { transform: translateY(1px); }
.cta.sm { font-size: 14px; padding: 9px 16px; letter-spacing: .08em; }

/* Quando você está no ar, o botão vira "parar" e some o âmbar. */
.cta.live {
  background: transparent;
  color: var(--signal);
  box-shadow: inset 0 0 0 1px var(--signal);
}
.cta.live:hover { background: rgba(255, 122, 26, .12); filter: none; }

/* Botão de login: o roxo é do Discord, não da nossa paleta — é o único lugar
   onde a marca deles aparece, justamente para ser reconhecível na hora. */
a.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.cta.discord { background: #5865F2; color: #fff; }
.cta.discord:hover { background: #6b76f5; filter: none; }
.cta.discord svg { width: 22px; height: 17px; fill: currentColor; }

.ident { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ident-avatar { border-radius: 50%; flex: 0 0 auto; background: var(--ink-3); }

.ident-out {
  margin-left: auto;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-far);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.ident-out:hover { color: var(--signal); border-bottom-color: var(--signal); }

.mini {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.mini:hover { color: var(--paper); border-color: var(--paper-far); background: var(--ink-3); }

.alert {
  margin: 0;
  color: var(--signal-2);
  font-size: 13.5px;
  background: rgba(255, 122, 26, .09);
  border-left: 2px solid var(--signal);
  padding: 9px 12px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.fine { margin: 0; color: var(--paper-far); font-size: 13px; }

/* ═════════════════════════════════════════════════════════ sala ══ */

#view-room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--ink-0);
}

.rail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--ink-1);
  border-bottom: 1px solid var(--line-2);
}

.rail-side { display: flex; align-items: center; gap: 10px; }
.rail-side.end { margin-left: auto; }

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.chan {
  display: flex;
  align-items: baseline;
  gap: 9px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  cursor: pointer;
  color: var(--paper-dim);
  font-size: 13px;
  transition: border-color .15s, color .15s;
}

.chan:hover { border-color: var(--signal); color: var(--paper); }

.chan-hint {
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paper-far);
}

/* roster: quem está no canal, sem ocupar o palco ---------------- */

.roster { display: flex; align-items: center; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.roster::-webkit-scrollbar { display: none; }

.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 11px 4px 5px;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  color: var(--paper);
}

/* Chip vira botão quando aquela pessoa está transmitindo: clicar foca a tela. */
button.chip { cursor: pointer; transition: border-color .15s, background .15s; }
button.chip:hover { border-color: var(--signal); background: var(--ink-3); }

.chip.on-air { border-color: var(--signal-sh); background: rgba(255, 122, 26, .08); }

.chip-face {
  width: 21px; height: 21px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-0);
  background: var(--paper-dim);
}

.chip-name { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ordem importa: se você é "me" e está no ar, o âmbar do ar tem que vencer. */
.chip.me .chip-face { background: var(--tune); }
.chip.on-air .chip-face { background: var(--signal); }

.chip-state { width: 5px; height: 5px; border-radius: 50%; background: var(--paper-far); }
.chip-state.ok    { background: var(--tune); }
.chip-state.relay { background: var(--signal-2); }
.chip-state.bad   { background: var(--alert); }

/* palco ---------------------------------------------------------- */

.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  min-height: 0;
  overflow: hidden;
}

/* Área principal: uma tela sozinha ocupa tudo; várias viram grade. */
.main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 0;
}

.main:empty { display: none; }

.main.grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-content: start;
  overflow-y: auto;
}

.main:not(.grid) > .tile { height: 100%; }
.main.grid > .tile { aspect-ratio: 16 / 9; }

/* Fita de miniaturas do modo foco. */
.thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  height: 116px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.empty {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--paper-far);
  padding: 40px 20px;
}

.empty-title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.empty-sub { margin: 0; font-size: 14px; max-width: 38ch; }
.empty-sub strong { color: var(--paper); font-weight: 600; }

.tile {
  position: relative;
  background: #000;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
  min-height: 0;
  animation: tile-in .3s var(--ease);
}

/* Miniatura: clicável, enxuta, sem telemetria competindo por atenção. */
.tile.thumb {
  flex: 0 0 auto;
  width: 186px;
  height: 100%;
  aspect-ratio: auto;
  cursor: pointer;
  opacity: .68;
  transition: opacity .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}

.tile.thumb:hover { opacity: 1; border-color: var(--signal); transform: translateY(-2px); }
.tile.thumb .tile-tele, .tile.thumb .on-air-badge { display: none; }
.tile.thumb .tile-tag { top: 6px; left: 6px; padding: 3px 8px; font-size: 11px; }
.tile.thumb .tile-tools { transform: scale(.82); transform-origin: top right; }

@keyframes tile-in { from { opacity: 0; transform: scale(.985); } }

.tile.mine { border-color: var(--signal-sh); }

.tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.tile-tag {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(7, 11, 20, .7);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 500;
}

.tile-who {
  font-weight: 600;
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.on-air-badge {
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--signal);
}

.tile-tools {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.tile:hover .tile-tools, .tile:focus-within .tile-tools { opacity: 1; transform: none; }

.tile-tools button {
  background: rgba(7, 11, 20, .74);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: var(--r-sm);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}

.tile-tools button:hover { border-color: var(--signal); background: rgba(7, 11, 20, .92); }

.tile-tele {
  position: absolute;
  bottom: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(7, 11, 20, .7);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tune);
  letter-spacing: .02em;
  pointer-events: none;
}

.tile-tele.relay { color: var(--signal-2); }
.tile-tele.bad { color: var(--alert); }

/* rodapé --------------------------------------------------------- */

/* barra das telas ocultas ---------------------------------------- */

.ignored-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  background: var(--ink-1);
  border-top: 1px solid var(--line-2);
}

.ignored-lab {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paper-far);
  flex: 0 0 auto;
}

.ignored-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ignored-list::-webkit-scrollbar { display: none; }

.ghost-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  color: var(--paper-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.ghost-chip:hover { color: var(--paper); border-color: var(--signal); border-style: solid; }

.ghost-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ghost-act {
  font-family: var(--display);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal);
}

.strip {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 16px;
  background: var(--ink-1);
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--paper-far);
  letter-spacing: .03em;
}

#strip-r.hot { color: var(--signal-2); }

.alert.bar { border-radius: 0; border-left: 0; border-bottom: 1px solid var(--signal-sh); }

/* ═══════════════════════════════════════ escolha da fonte ═══════ */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 13, .72);
  backdrop-filter: blur(6px);
  z-index: 50;
  animation: fade .18s var(--ease);
}

@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-width: 760px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  display: grid;
  gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: rise .26s var(--ease);
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.sheet-top h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 25px;
  letter-spacing: .01em;
}

.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.pick {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: start;
  text-align: left;
  padding: 18px 16px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--paper);
  font: inherit;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .1s var(--ease);
}

.pick:hover { border-color: var(--signal); background: var(--ink-3); transform: translateY(-2px); }

.pick svg {
  width: 40px; height: 32px;
  fill: none;
  stroke: var(--paper-dim);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke .16s var(--ease);
}

.pick svg .fill { fill: var(--ink-2); }
.pick:hover svg { stroke: var(--signal); }
.pick:hover svg .fill { fill: var(--ink-3); }

.pick-name { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: .03em; }
.pick-desc { font-size: 13px; color: var(--paper-dim); line-height: 1.4; }

.pick-tag {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-far);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.pick:hover .pick-tag { color: var(--signal); border-color: var(--signal-sh); }

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}

.toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--signal); width: 16px; height: 16px; cursor: pointer; }
.toggle em { font-style: normal; font-size: 12px; color: var(--paper-far); }
.toggle select { width: auto; color: var(--paper); cursor: pointer; font-size: 13px; }
.toggle select option { background: var(--ink-2); }

.note { margin: 0; font-size: 12.5px; color: var(--paper-far); line-height: 1.5; }

/* ══════════════════════════════════════════════════ responsivo ══ */

@media (max-width: 860px) {
  .picks { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 40px 1fr; align-items: center; gap: 6px 14px; padding: 14px; }
  .pick svg { grid-row: span 2; }
  .pick-tag { position: static; justify-self: start; grid-column: 2; }
}

@media (max-width: 720px) {
  .rail { flex-wrap: wrap; gap: 10px; }
  .roster { order: 3; width: 100%; flex: none; }
  .rail-side.end { margin-left: auto; }
  .wordmark, .chan-hint { display: none; }
  .main.grid { grid-template-columns: 1fr; }
  .thumbs { height: 92px; }
  .tile.thumb { width: 150px; }
  .strip { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
