:root {
  --tb: 32px;
  --bg0: #111214;
  --bg1: #17181c;
  --bg2: #1e2025;
  --bg3: #262930;
  --bg4: #30343c;
  --line: #2c2f36;
  --text: #eceef2;
  --muted: #9aa0ab;
  --faint: #6b717c;
  --accent: #7b61ff;
  --accent-2: #9580ff;
  --live: #f0384b;
  --ok: #2fd27a;
  --warn: #f2b33d;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg1); color: var(--text); font-size: 14px; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0 10px; }
.error { color: #ff7a85; font-size: 13px; margin: 12px 0 0; text-align: center; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600;
  transition: background .15s, transform .05s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.secondary { background: var(--bg4); }
.btn.secondary:hover { background: #3a3f48; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--bg3); }
.btn.danger { background: var(--live); color: #fff; }
.btn.danger:hover { background: #ff5263; }
.btn.big { width: 100%; padding: 12px; font-size: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }
.icon-btn.danger:hover { color: var(--live); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.link-btn { margin-left: auto; background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field.small { margin-bottom: 10px; }
input:not([type=checkbox]):not([type=range]), select {
  background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 8px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }

/* ---------- telas ---------- */
.screen { display: none; height: calc(100vh - var(--tb)); }
.screen.active { display: flex; }

#home { align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% -10%, #2a2160 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #3a1530 0%, transparent 55%), var(--bg1); }
.home-card { width: 400px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.logo { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.logo-mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #e8467c); }
.logo-mark svg { width: 28px; height: 28px; color: #fff; }
.logo h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.logo p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-row { display: flex; gap: 8px; }
.join-row input { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.home-foot { margin: 20px 0 0; text-align: center; color: var(--faint); font-size: 12px; }
.home-foot a { color: var(--muted); }

#connecting { flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--bg4); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.small { width: 22px; height: 22px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sala ---------- */
#room { background: var(--bg1); }
.sidebar { width: 260px; flex: none; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.room-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.room-label { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .08em; }
.room-code { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; background: none; border: 0; padding: 0; cursor: pointer; font-size: 22px; font-weight: 800; letter-spacing: .12em; }
.room-code svg { color: var(--faint); width: 16px; height: 16px; }
.room-code:hover svg { color: var(--text); }
.conn-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.conn-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn-status.warn i { background: var(--warn); animation: blink 1s infinite; }
.conn-status.bad i { background: var(--live); }
@keyframes blink { 50% { opacity: .3; } }

.section-title { padding: 16px 16px 6px; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .06em; }
.members { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; min-height: 0; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.member:hover { background: var(--bg3); }
.member .info { flex: 1; min-width: 0; }
.member .name { font-weight: 600; }
.member .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.member .sub.live { color: var(--live); font-weight: 600; }
.member .watch { flex: none; padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 14px; position: relative; }
.avatar.live::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--live); }
.live-badge { align-self: flex-start; display: inline-block; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }

.me-panel { border-top: 1px solid var(--line); padding: 12px; background: #1a1c20; }
.stream-btn { width: 100%; margin-bottom: 10px; }
.stream-btn.live { background: var(--live); }
.stream-btn.live:hover { background: #ff5263; }
.me-row { display: flex; align-items: center; gap: 8px; }
.me-name { flex: 1; min-width: 0; font-weight: 600; }

.stage-wrap { flex: 1; min-width: 0; position: relative; display: flex; background: var(--bg0); }
.stage { flex: 1; display: grid; gap: 10px; padding: 10px; align-content: center; min-height: 0; }
.stage.n1 { grid-template-columns: 1fr; }
.stage.n2 { grid-template-columns: 1fr 1fr; }
.stage.n3, .stage.n4 { grid-template-columns: 1fr 1fr; }
.stage.n5, .stage.n6 { grid-template-columns: 1fr 1fr 1fr; }

.stage-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); }
.stage-empty h2 { color: var(--text); margin: 18px 0 8px; font-size: 20px; }
.stage-empty p { line-height: 1.6; margin: 0 0 18px; }
.empty-art { width: 84px; height: 84px; border-radius: 24px; background: var(--bg3); display: grid; place-items: center; }
.empty-art svg { width: 40px; height: 40px; color: var(--accent-2); }

.tile { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--tb) - 20px); width: 100%; justify-self: center; }
.stage.n1 .tile, .stage.focus .tile { max-width: calc((100vh - var(--tb) - 20px) * 16 / 9); }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
/* borda verde: alguns decodificadores deixam 1 px colorido na beira da imagem quando o vídeo é
   esticado para um tamanho quebrado; o vídeo passa 1 px de cada lado e a beira fica escondida */
.tile > video { width: calc(100% + 2px); height: calc(100% + 2px); margin: -1px; }
#mini video#mini-video { width: calc(100% + 2px); height: calc(100% + 2px); margin: -1px; }
.tile:fullscreen { border-radius: 0; max-height: none; max-width: none; }
.tile-status { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--muted); background: rgba(0,0,0,.6); text-align: center; padding: 20px; }
.tile-status .btn { margin-top: 4px; }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 24px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .2s; }
.tile:hover .tile-bar, .tile.show-bar .tile-bar { opacity: 1; }
.tile-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; text-shadow: 0 1px 2px #000; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.tile-actions { display: flex; align-items: center; gap: 2px; }
.tile-actions .icon-btn { color: #ddd; }
.tile-actions .icon-btn:hover { background: rgba(255,255,255,.12); }
.vol { width: 80px; accent-color: var(--accent); }
.tile-stats { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.7); border-radius: 6px; padding: 6px 9px; font: 12px/1.5 ui-monospace, Consolas, monospace; color: #cfe; pointer-events: none; white-space: pre; }

/* ---------- chat ---------- */
.chat { width: 290px; flex: none; background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 16px; font-weight: 700; border-bottom: 1px solid var(--line); }
.chat-head svg { color: var(--muted); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.msg { display: flex; gap: 9px; }
.msg .avatar { width: 28px; height: 28px; font-size: 12px; }
.msg .body { min-width: 0; }
.msg .who { font-weight: 700; font-size: 13px; }
.msg .who time { font-weight: 400; color: var(--faint); font-size: 11px; margin-left: 6px; }
.msg .text { word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.4; color: #dcdfe5; user-select: text; }
.msg.cont { margin-top: -6px; padding-left: 37px; }
.sys { color: var(--faint); font-size: 12.5px; text-align: center; }
.chat-form { display: flex; gap: 6px; padding: 12px; border-top: 1px solid var(--line); align-items: center; }
.chat-form input { flex: 1; }

/* ---------- modais ---------- */
.modal { position: fixed; inset: var(--tb) 0 0 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; width: min(760px, calc(100vw - 40px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.settings-card { width: min(520px, calc(100vw - 40px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 4px 18px 10px; align-items: center; }
.tab { background: none; border: 0; padding: 7px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--bg4); color: var(--text); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 4px 18px 12px; overflow-y: auto; min-height: 180px; max-height: 46vh; }
.source { background: var(--bg3); border: 2px solid transparent; border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; }
.source:hover { border-color: var(--bg4); }
.source.selected { border-color: var(--accent); background: #2a2742; }
.source .thumb { aspect-ratio: 16/9; background: #000 center/contain no-repeat; border-radius: 6px; }
.source .label { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; }
.source .label img { width: 16px; height: 16px; }
.picker-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }
.picker-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 8px 18px 0; border-top: 1px solid var(--line); }
.picker-opts .check { grid-column: 1 / -1; margin-top: 0; }
#picker-hint { padding: 0 18px; margin-top: 0; }
.settings-body { padding: 0 18px 10px; overflow-y: auto; }
.settings-body h4 { margin: 14px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }


/* ---------- avisos ---------- */
.toasts { position: fixed; top: calc(var(--tb) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; align-items: center; gap: 12px; animation: drop .2s; max-width: 520px; }
.toast.err { border-color: #6b2630; }
.toast .btn { padding: 5px 10px; font-size: 12.5px; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1100px) { .chat { width: 240px; } .sidebar { width: 230px; } }

.turn-test { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; }
.turn-test .btn { padding: 6px 12px; font-size: 13px; }
.turn-test .ok { color: var(--ok); }
.turn-test .bad { color: #ff7a85; }
.relay-badge { flex: none; font-size: 10.5px; font-weight: 700; color: #1a1300; background: var(--warn); padding: 1px 6px; border-radius: 4px; letter-spacing: .02em; }

.my-stream-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.my-stream-row .link-btn { margin-left: 0; flex: none; font-size: 12px; }
.tile.pointing video { cursor: crosshair; }
.tile.pointing { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile-actions .act-pointer.active { color: #fff; background: var(--accent); }
.pointer-grant { flex: none; }
.pointer-grant.active { color: #fff; background: var(--accent); }
.pointer-grant.active:hover { background: var(--accent-2); color: #fff; }
#my-stream-label { min-width: 0; }

/* ---------- câmera ---------- */
.stream-row { display: flex; gap: 8px; margin-bottom: 10px; }
.stream-row .stream-btn { flex: 1; margin-bottom: 0; }
.cam-btn { width: 44px; padding: 0; flex: none; }
.cam-btn.on { background: var(--ok); color: #06210f; }
.cam-btn.on:hover { background: #4fe08f; }
.my-cam { position: relative; margin-bottom: 10px; border-radius: 8px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.my-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-cam .icon-btn { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff; }
.mirrored { transform: scaleX(-1); }

.studio-card { width: min(1080px, calc(100vw - 40px)); }
.studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; padding: 4px 18px 12px; min-height: 0; overflow: hidden; }
.studio-preview { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; align-self: start; }
.studio-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.studio-status { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--muted); background: rgba(0,0,0,.6); text-align: center; padding: 20px; }
.studio-preview-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.studio-preview-bar .meta { background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; color: #ddd; }
.studio-side { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 200px); }
.studio-tabs { padding: 0 0 10px; flex-wrap: wrap; }
.ctab { overflow-y: auto; padding-right: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg3); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin: 8px 0 10px; }
.slider label { font-size: 12.5px; color: var(--muted); }
.slider output { font: 12px ui-monospace, Consolas, monospace; color: var(--faint); }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.slider.disabled { opacity: .4; pointer-events: none; }
.modal-foot .spacer { flex: 1; }
.modal-foot { align-items: center; }
.bg-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.bg-mode { display: flex; flex-direction: column; gap: 3px; text-align: left; background: var(--bg3); border: 2px solid transparent; border-radius: 10px; padding: 10px; cursor: pointer; }
.bg-mode span { font-size: 12px; color: var(--muted); }
.bg-mode.active { border-color: var(--accent); background: #2a2742; }
.bg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bg-thumb { width: 72px; height: 41px; border-radius: 6px; border: 2px solid transparent; background: #000 center/cover no-repeat; cursor: pointer; padding: 0; }
.bg-thumb.active { border-color: var(--accent); }
.file-btn { display: inline-flex; cursor: pointer; font-size: 13px; padding: 7px 12px; }
.corner-pick { position: relative; width: 160px; aspect-ratio: 16 / 9; background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; }
.corner-pick button { position: absolute; width: 34px; height: 22px; border-radius: 5px; border: 2px solid var(--bg4); background: var(--bg3); cursor: pointer; }
.corner-pick button[data-corner="tl"] { left: 6px; top: 6px; }
.corner-pick button[data-corner="tr"] { right: 6px; top: 6px; }
.corner-pick button[data-corner="bl"] { left: 6px; bottom: 6px; }
.corner-pick button[data-corner="br"] { right: 6px; bottom: 6px; }
.corner-pick button.active { background: var(--accent); border-color: var(--accent); }
.hw-mode { display: flex; gap: 6px; margin: 4px 0 10px; }

/* câmera dos amigos */
.cam-tile .cam-name { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 6px; font-weight: 600; font-size: 12.5px; }
.cam-tile video { object-fit: cover; }
.cam-bubble { position: absolute; z-index: 3; overflow: hidden; background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.85); }
.cam-bubble video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-bubble .cam-name { display: none; }
.cam-bubble.shape-circle { border-radius: 50%; aspect-ratio: 1; }
.cam-bubble.shape-rounded { border-radius: 18%; aspect-ratio: 1; }
.cam-bubble.shape-rect { border-radius: 10px; aspect-ratio: 16 / 9; }
.cam-bubble.size-s { width: 15%; }
.cam-bubble.size-m { width: 21%; }
.cam-bubble.size-l { width: 29%; }
.cam-bubble.shape-rect.size-s { width: 20%; }
.cam-bubble.shape-rect.size-m { width: 28%; }
.cam-bubble.shape-rect.size-l { width: 38%; }
.cam-bubble.corner-tl { left: 2.5%; top: 3.5%; }
.cam-bubble.corner-tr { right: 2.5%; top: 3.5%; }
.cam-bubble.corner-bl { left: 2.5%; bottom: 3.5%; }
.cam-bubble.corner-br { right: 2.5%; bottom: 3.5%; }
.member .cam-ind { flex: none; color: var(--ok); }
.member .cam-ind.off { color: var(--faint); }

@media (max-width: 960px) { .studio { grid-template-columns: 1fr; } }
/* controles da transmissão sempre por cima da bolinha da câmera */
.tile-bar, .tile-stats, .tile-status { z-index: 5; }

/* ---------- barra de título (estilo Discord) ---------- */
body { padding-top: var(--tb); }
#titlebar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--tb); z-index: 200;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--bg0); color: var(--muted); -webkit-app-region: drag; user-select: none;
}
.tb-left { display: flex; align-items: center; gap: 8px; padding-left: 12px; min-width: 0; }
.tb-logo { width: 18px; height: 18px; border-radius: 5px; }
.tb-app { font-weight: 700; font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.tb-center { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 0; }
.tb-center .tb-ico { width: 16px; height: 16px; color: var(--muted); }
#tb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tb-live { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(240,56,75,.25); }
.tb-right { display: flex; align-items: stretch; justify-content: flex-end; height: 100%; }
.tb-btn, .tb-win { -webkit-app-region: no-drag; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.tb-btn { width: 32px; margin: 4px 2px; border-radius: 6px; }
.tb-btn svg { width: 18px; height: 18px; }
.tb-btn:hover { background: var(--bg3); color: var(--text); }
.tb-gap { width: 10px; }
.tb-win { width: 46px; height: 100%; }
.tb-win svg { width: 11px; height: 11px; }
.tb-win:hover { background: rgba(255,255,255,.08); color: var(--text); }
.tb-close:hover { background: #e81123; color: #fff; }
body.maximized { /* sem diferença visual, só troca o ícone */ }

/* ---------- câmera: painel rápido ---------- */
.popover {
  position: fixed; left: calc(var(--rail) + 12px); bottom: 70px; width: 300px; z-index: 60;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 10px; animation: drop .15s;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; }
.pop-preview { position: relative; border-radius: 9px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.pop-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop-preview .studio-status { font-size: 12.5px; }
.popover .btn.big { padding: 10px; font-size: 14px; }
.pop-link { display: flex; align-items: center; justify-content: center; gap: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px; }
.pop-link svg { width: 15px; height: 15px; }
.pop-link:hover { color: var(--text); }

.self-cam .self-cam-gear { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity .15s; }
.self-cam:hover .self-cam-gear { opacity: 1; }
.self-cam .cam-name { background: rgba(123,97,255,.85); }


/* sua própria transmissão */
.self-stream-bar { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center; max-width: calc(100% - 16px); background: rgba(0,0,0,.6); padding: 4px 8px; border-radius: 6px; font-weight: 600; font-size: 12.5px; z-index: 5; }
.self-paused { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--muted); background: rgba(10,10,12,.72); font-size: 13px; z-index: 4; }
.self-stream.is-paused .self-paused { display: flex; }
.my-stream-row { flex-wrap: wrap; row-gap: 1px; column-gap: 10px; }
.my-stream-row #my-stream-label { flex-basis: 100%; }

/* ===== v1.9: olhinho, cartão "Assistir transmissão", "A transmissão terminou" ===== */
.eye { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); border-radius: 999px; padding: 2px 8px 2px 6px; cursor: default; flex: none; line-height: 1.4; }
.eye svg { width: 14px; height: 14px; }
.eye[hidden] { display: none; }
.eye:hover { background: rgba(0,0,0,.8); }
.eye.mini { background: none; color: inherit; padding: 0 0 0 6px; font-size: 11px; gap: 3px; vertical-align: -2px; }
.eye.mini svg { width: 12px; height: 12px; }
.my-stream-top { display: flex; align-items: center; gap: 8px; }
.my-stream-top .eye { background: var(--bg2, rgba(255,255,255,.08)); color: var(--text); padding: 1px 7px 1px 5px; font-size: 11px; }
.self-stream-bar .eye { background: rgba(255,255,255,.12); }
.tile-top { position: absolute; top: 8px; right: 8px; z-index: 5; display: flex; gap: 6px; }
.tile.ended .tile-top, .tile.ended .tile-bar, .tile.ended .tile-stats { display: none; }
.eye-pop { position: fixed; z-index: 9999; min-width: 150px; max-width: 240px; background: #111214; color: #f2f3f5; border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 13px; pointer-events: none; }
.eye-pop[hidden] { display: none; }
.eye-pop-title { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #b5bac1; margin-bottom: 4px; }
.eye-pop-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.avatar.big { width: 72px; height: 72px; font-size: 30px; box-shadow: 0 0 0 4px rgba(0,0,0,.35); }

.live-card { cursor: default; background: #0b0b0d; isolation: isolate; }
.live-card .lc-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(22px) brightness(.55) saturate(1.2); opacity: .9; }
.live-card .lc-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .55; transition: opacity .3s; }
.live-card:hover .lc-thumb { opacity: .75; }
.live-card .lc-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.7)); }
.live-card .lc-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; z-index: 3; pointer-events: none; }
.live-card .lc-top .eye { pointer-events: auto; }
.live-card .lc-top .eye { margin-left: auto; }
.lc-live { background: var(--live); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 7px; border-radius: 4px; }
.lc-q { background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 4px; }
.live-card .lc-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; z-index: 2; padding: 40px 20px 20px; text-align: center; }
.lc-name { font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); margin-top: 6px; }
.lc-sub { font-size: 13px; color: #dbdee1; max-width: 90%; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.lc-watch { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 14px; font-weight: 700; }
.lc-watch svg { width: 18px; height: 18px; }
.lc-also { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #b5bac1; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 4px; }
.stage.n3 .lc-name, .stage.n4 .lc-name, .stage.n5 .lc-name, .stage.n6 .lc-name { font-size: 15px; }
.stage.n3 .avatar.big, .stage.n4 .avatar.big, .stage.n5 .avatar.big, .stage.n6 .avatar.big { width: 52px; height: 52px; font-size: 22px; }

.tile.ended { background: #0b0b0d; }
.tile.ended video { opacity: 0; }
.ended-box { background: radial-gradient(ellipse at center, #1e1f22, #0b0b0d) !important; color: #dbdee1; gap: 8px !important; }
.ended-title { font-size: 20px; font-weight: 800; color: #fff; margin-top: 8px; }
.ended-sub { font-size: 13px; color: #b5bac1; }
.ended-close { margin-top: 10px; min-width: 110px; }

.my-stream-warn { margin-top: 4px; font-size: 11.5px; font-weight: 700; color: var(--warn, #f0b232); cursor: help; }
.my-stream-warn[hidden] { display: none; }

/* ===== destaque com fileira embaixo (v1.9.3) ===== */
.stage.focus { --strip: clamp(96px, 19vh, 170px); display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: flex-start; gap: 0 10px; overflow: hidden; }
.stage.focus > .tile { display: block; }
.stage.focus > .tile.focused { order: -1; flex: 0 0 100%; width: 100%; height: calc(100% - var(--strip) - 10px); aspect-ratio: auto; max-width: none; max-height: none; }
.stage.focus > .tile:not(.focused) { order: 0; flex: 0 0 auto; margin-top: 10px; width: min(calc(var(--strip) * 16 / 9), calc((100% - (var(--strip-n) - 1) * 10px) / var(--strip-n))); height: auto; aspect-ratio: 16 / 9; max-height: var(--strip); align-self: center; cursor: pointer; border-radius: 10px; outline: 2px solid transparent; transition: outline-color .15s; }
.stage.focus > .tile:not(.focused):hover { outline-color: var(--accent); }
.stage.focus > .tile:not(.focused) .tile-stats,
.stage.focus > .tile:not(.focused) .vol,
.stage.focus > .tile:not(.focused) .act-stats,
.stage.focus > .tile:not(.focused) .act-pointer,
.stage.focus > .tile:not(.focused) .relay-badge,
.stage.focus > .tile:not(.focused) .self-paused { display: none !important; }
.stage.focus > .tile:not(.focused) .tile-bar { padding: 14px 6px 4px; }
.stage.focus > .tile:not(.focused) .tile-name { font-size: 11.5px; }
.stage.focus > .tile:not(.focused) .tile-top { top: 4px; right: 4px; }
.stage.focus > .tile:not(.focused) .eye { font-size: 10.5px; padding: 1px 6px 1px 4px; }
.stage.focus > .live-card:not(.focused) .avatar.big,
.stage.focus > .live-card:not(.focused) .lc-sub,
.stage.focus > .live-card:not(.focused) .lc-also,
.stage.focus > .live-card:not(.focused) .lc-q { display: none; }
.stage.focus > .live-card:not(.focused) .lc-mid { padding: 22px 6px 6px; gap: 4px; }
.stage.focus > .live-card:not(.focused) .lc-name { font-size: 12px; margin: 0; }
.stage.focus > .live-card:not(.focused) .lc-watch { margin-top: 2px; padding: 5px 10px; font-size: 12px; }
.stage.focus > .live-card:not(.focused) .lc-top { top: 5px; left: 5px; right: 5px; }
.stage.focus > .live-card:not(.focused) .lc-live { font-size: 9px; padding: 2px 5px; }
.stage.focus > .self-stream:not(.focused) .self-stream-bar { left: 4px; bottom: 4px; padding: 2px 6px; font-size: 11px; }
.stage.focus > .cam-tile:not(.focused) .cam-name { left: 4px; bottom: 4px; font-size: 11px; }

/* ===== gravação (v1.9.5) ===== */
.rec-card { width: min(520px, calc(100vw - 40px)); }
.rec-card .modal-body { padding: 14px 18px 4px; }
.rec-dir-row { display: flex; gap: 8px; }
.rec-dir-row input { flex: 1; min-width: 0; }
.my-stream-actions { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.mini-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; background: var(--bg3, rgba(255,255,255,.07)); border: 1px solid var(--line, rgba(255,255,255,.1)); color: var(--text); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.rec-btn { color: #ff8a92; }
.mini-btn.rec-btn.recording { background: rgba(255,71,87,.14); border-color: rgba(255,71,87,.5); }
.rec-dot.static { animation: none; width: 7px; height: 7px; }
.mini-btn.rec-btn.recording .rec-dot.static { border-radius: 2px; }
.my-rec { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .05em; color: #ff6b75; }
.my-rec[hidden] { display: none; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4757; animation: recblink 1.2s ease-in-out infinite; }
@keyframes recblink { 50% { opacity: .25; } }

.hint-inline { color: var(--muted); font-size: 11.5px; }
#rec-cam-row { margin: 4px 0 6px; align-items: flex-start; }
.advanced .adv-title { margin-top: 14px; }

/* ===== foto de perfil (v1.10) ===== */
.avatar.has-photo { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }
.profile-row { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.profile-row .avatar.big { width: 64px; height: 64px; font-size: 26px; box-shadow: none; }
.profile-actions { flex: 1; min-width: 0; }
.profile-btns { display: flex; gap: 8px; }
.profile-actions .hint { margin: 6px 0 0; }
#me-avatar { cursor: pointer; }
/* ===== zoom na live ===== */
.tile video { transform-origin: 0 0; will-change: auto; }
.tile.zoomed { cursor: grab; }
.tile.zoomed.dragging { cursor: grabbing; }
.tile.zoomed.dragging video { transition: none !important; }
.zoom-chip { position: absolute; left: 50%; transform: translateX(-50%); top: 8px; z-index: 6; background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.zoom-chip:hover { background: rgba(0,0,0,.85); }
.zoom-chip[hidden] { display: none; }
/* ===== reações ===== */
.act-react .react-ico { font-size: 15px; line-height: 1; filter: grayscale(.2); }
.react-pop { position: absolute; right: 10px; bottom: 48px; z-index: 7; display: grid; grid-template-columns: repeat(4, 38px); gap: 4px; padding: 6px; background: #111214; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.react-pop[hidden] { display: none; }
.react-opt { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; font-size: 22px; cursor: pointer; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; transition: transform .1s, background .1s; }
.react-opt:hover { background: rgba(255,255,255,.1); transform: scale(1.15); }
.react-opt:active { transform: scale(.95); }
.stage.focus > .tile:not(.focused) .act-react, .stage.focus > .tile:not(.focused) .react-pop { display: none !important; }
/* ===== dono da sala / remover ===== */
.owner-crown { font-size: 12px; margin-right: 4px; vertical-align: 1px; }
.member { position: relative; flex-wrap: wrap; }
.member .kick-btn { opacity: 0; transition: opacity .15s; color: #ff8a92; }
.member:hover .kick-btn, .member .kick-btn:focus-visible { opacity: 1; }
.kick-confirm { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px; border-radius: 8px; background: var(--bg3); font-size: 12.5px; cursor: default; }
.kick-confirm .kc-q { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kick-confirm .kc-row { display: flex; gap: 6px; }
.kick-confirm .kc-row .btn { flex: 1; padding: 6px 4px; font-size: 12px; white-space: nowrap; }
.kick-confirm .kc-row .kc-no { flex: 0 0 auto; padding: 6px 8px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: var(--live, #f23f43); color: #fff; }

/* ===== cartão AO VIVO (v1.10.1): sem miniatura, mais limpo ===== */
.my-stream { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; padding: 10px 12px 12px; background: var(--bg3); border: 1px solid rgba(242,63,67,.28); border-radius: 10px; box-shadow: inset 3px 0 0 var(--live); }
.my-stream[hidden] { display: none; }
.ms-head { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.ms-head .live-badge { align-self: center; }
.ms-time { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-rec { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: #ff6b75; font-variant-numeric: tabular-nums; }
.ms-rec[hidden] { display: none; }
.ms-spacer { flex: 1; }
.ms-head .eye { background: rgba(255,255,255,.08); color: var(--text); padding: 2px 8px 2px 6px; font-size: 11.5px; }
.ms-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 700; font-size: 13.5px; color: var(--text); }
.ms-ico { width: 15px; height: 15px; flex: none; color: var(--muted); }
#my-stream-label { min-width: 0; flex: 1; }
.ms-meta { font-size: 12px; line-height: 1.35; color: var(--muted); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-meta:empty { display: none; }
.my-stream .my-stream-warn { margin-top: 0; }
.ms-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.ms-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; border-radius: 7px; border: 1px solid var(--line, rgba(255,255,255,.1)); background: rgba(255,255,255,.05); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
.ms-btn svg { width: 16px; height: 16px; }
.ms-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.ms-btn.rec-btn { color: #ff8a92; }
.ms-btn.rec-btn:hover { background: rgba(255,71,87,.12); border-color: rgba(255,71,87,.45); }
.ms-btn.rec-btn.recording { background: rgba(255,71,87,.16); border-color: rgba(255,71,87,.55); color: #ffb3b9; }
.ms-btn .rec-dot.static { width: 9px; height: 9px; }
.ms-btn.rec-btn.recording .rec-dot.static { border-radius: 2px; }
.ms-head > * { flex: none; white-space: nowrap; }
.ms-head .ms-spacer { flex: 1; }
.ms-head { gap: 7px; }

/* REC dentro do botão Parar (v1.11) */
.ms-actions.recording { grid-template-columns: 40px minmax(0, 1fr); }
.ms-actions.recording #btn-switch { padding: 0; }
.ms-actions.recording #btn-switch span { display: none; }
.ms-actions .ms-btn { min-width: 0; overflow: hidden; }
.ms-btn .ms-rec { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: #ff6b75; font-variant-numeric: tabular-nums; }
.ms-btn .ms-rec[hidden] { display: none; }
.rec-sep { width: 1px; height: 14px; background: rgba(255,107,117,.4); margin: 0 3px 0 1px; }
.ms-btn.rec-btn.recording .rec-dot.static { animation: recblink 1.2s ease-in-out infinite; border-radius: 50%; }

/* ===== áudio da gravação (v1.11) ===== */
.rec-audio { margin: 6px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.rec-audio-title { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.mix-row { display: grid; grid-template-columns: 120px 1fr 46px; align-items: center; gap: 4px 10px; margin-bottom: 10px; }
.mix-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.mix-label svg { width: 16px; height: 16px; color: var(--muted); }
.mix-row input[type=range] { width: 100%; accent-color: var(--accent); }
.mix-val { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.vu { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.vu-bar { height: 100%; width: 0%; border-radius: 3px; background: linear-gradient(90deg, #23a55a 0%, #23a55a 65%, #f0b232 80%, #f23f43 95%); background-size: 260px 100%; transition: width .06s linear; }
.rec-mic-check { margin-top: 2px; }
.rec-mic-opts { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.rec-mic-opts[hidden] { display: none; }
.rec-mic-flags { display: flex; gap: 16px; flex-wrap: wrap; }
.rec-mic-opts .hint { margin: 6px 0 0; }
.ms-actions.recording.with-mic { grid-template-columns: 40px 40px minmax(0, 1fr); }
.ms-btn.mic-btn { padding: 0; }
.ms-btn.mic-btn[hidden] { display: none; }
.ms-btn.mic-btn.muted { color: #ff8a92; background: rgba(255,71,87,.12); border-color: rgba(255,71,87,.45); }
.mix-row.off { opacity: .45; }

/* ---------- recorte da foto ---------- */
.crop-modal { z-index: 58; }
.crop-card { width: min(640px, calc(100vw - 40px)); }
.crop-body { display: flex; gap: 22px; padding: 10px 18px 16px; align-items: center; }
.crop-stage { position: relative; width: 300px; height: 300px; flex: none; border-radius: 12px; overflow: hidden; background: #0b0b0d; cursor: grab; touch-action: none; user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.crop-prevs { display: flex; gap: 18px; align-items: flex-end; }
.crop-prev-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.crop-prev { border-radius: 50%; background: #000; box-shadow: 0 0 0 2px var(--line); }
.crop-prev.big { width: 96px; height: 96px; }
.crop-prev.small { width: 36px; height: 36px; }
.crop-modal.square .crop-prev { border-radius: 28%; }
.crop-zoom { display: flex; align-items: center; gap: 6px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-zoom .icon-btn svg { width: 18px; height: 18px; }
.crop-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.crop-tools .btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; }
.crop-tools svg { width: 16px; height: 16px; }
.crop-side .hint { margin: 0; }
@media (max-width: 620px) { .crop-body { flex-direction: column; } }

/* ---------- turmas: barra da esquerda (igual servidores do Discord) ---------- */
:root { --rail: 68px; }
.rail { position: fixed; top: var(--tb); left: 0; bottom: 0; width: var(--rail); background: var(--bg0); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 8px; z-index: 20; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.screen { margin-left: var(--rail); }
.rail-home, .rail-item, .rail-add { position: relative; width: 46px; height: 46px; flex: none; border: 0; padding: 0; cursor: pointer; background: none; display: grid; place-items: center; }
.rail-home img { width: 46px; height: 46px; border-radius: 50%; background: var(--bg3); padding: 9px; transition: border-radius .18s, background .18s; box-sizing: border-box; }
.rail-home:hover img, .rail-home.active img { border-radius: 15px; background: var(--accent); }
.rail-sep { width: 30px; height: 2px; border-radius: 1px; background: var(--line); flex: none; }
.rail-list { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.turma-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; background-size: cover; background-position: center; flex: none; transition: border-radius .18s; overflow: hidden; user-select: none; }
.rail-item:hover .turma-ico, .rail-item.active .turma-ico { border-radius: 15px; }
.rail-item::before, .rail-home::before { content: ""; position: absolute; left: -11px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); transition: height .18s; }
.rail-item:hover::before, .rail-home:hover::before { height: 18px; }
.rail-item.active::before, .rail-home.active::before { height: 36px; }
.rail-live { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; background: var(--live); border: 3px solid var(--bg0); }
.rail-add { border-radius: 50%; background: var(--bg3); color: var(--ok); transition: border-radius .18s, background .18s, color .18s; }
.rail-add svg { width: 22px; height: 22px; }
.rail-add:hover { border-radius: 15px; background: var(--ok); color: #fff; }

/* cabeçalho da turma na lateral */
.turma-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; padding: 6px; margin-left: -6px; margin-right: -6px; border-radius: 10px; cursor: pointer; min-width: 0; }
.turma-head:hover { background: var(--bg3); }
.turma-head .turma-ico { width: 36px; height: 36px; font-size: 13px; border-radius: 11px; }
.turma-head-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; line-height: 1.25; }
.turma-head .icon-btn { flex: none; color: var(--muted); }
.turma-head .icon-btn:hover { color: var(--text); }
.turma-head-gear { width: 16px; height: 16px; color: var(--faint); flex: none; }
.turma-head:hover .turma-head-gear { color: var(--text); }

/* membros offline */
.members-sep { list-style: none; padding: 14px 8px 6px; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .06em; }
.member.offline { opacity: .45; filter: grayscale(.85); }
.member.offline:hover { opacity: .7; }

/* tela inicial */
.home-turma-hint { margin: 8px 2px 12px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.4; }
#btn-create { width: 100%; }

/* janelas das turmas */
.turma-card { width: min(520px, calc(100vw - 40px)); }
.turma-card .modal-body { padding: 4px 18px 14px; overflow-y: auto; }
.tn-tabs { padding: 0 18px 8px; }
.tn-row { display: flex; gap: 16px; align-items: flex-start; margin: 6px 0 10px; }
.tn-field { flex: 1; min-width: 0; }
.tn-field .hint { margin-top: -6px; }
.turma-ico.big { width: 76px; height: 76px; font-size: 26px; border-radius: 22px; }
.turma-ico.pick { border: 0; cursor: pointer; position: relative; }
.turma-ico.pick:disabled { cursor: default; }
.turma-ico.pick.empty { background: var(--bg3) !important; color: var(--muted); border: 2px dashed var(--bg4); }
.turma-ico.pick.empty svg { width: 28px; height: 28px; }
.turma-ico.pick.empty:hover { color: var(--text); border-color: var(--accent); }
.turma-ico.pick.editable::after, .turma-ico.pick:not(.empty):not(:disabled)::after { content: "Trocar"; position: absolute; inset: auto 0 0 0; padding: 3px 0; background: rgba(0,0,0,.6); font-size: 10.5px; font-weight: 700; color: #fff; opacity: 0; transition: opacity .15s; }
.turma-ico.pick:hover::after { opacity: 1; }
.tn-points { margin: 4px 0 6px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tn-points li { margin: 3px 0; }
.tn-points b { color: var(--text); }
#tn-err { text-align: left; margin-top: 6px; }
.ts-block { margin-top: 14px; }
.ts-label { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.ts-code-row { display: flex; gap: 8px; align-items: center; }
.ts-code { flex: 1; min-width: 0; background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; letter-spacing: .08em; overflow: hidden; text-overflow: ellipsis; user-select: all; }
.ts-code-row .btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ts-code-row .btn svg { width: 15px; height: 15px; }
.ts-bans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ts-bans li { display: flex; align-items: center; gap: 8px; background: var(--bg3); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.ts-bans li span { flex: 1; min-width: 0; }
.ts-danger { border-top: 1px solid var(--line); padding-top: 12px; }
.ts-leave { color: #ff7a85; display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; }
.ts-leave svg { width: 16px; height: 16px; }
.ts-leave:hover { color: #fff; background: rgba(240,56,75,.18); }
.ts-leave-confirm { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ts-leave-confirm span { flex: 1; color: var(--muted); }

/* ---------- configurações em seções que recolhem ---------- */
.set-tools { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 2px 0 6px; background: var(--bg2); }
.set-tools .btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.set-tools .btn svg { width: 15px; height: 15px; }
.set-sec { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg1); overflow: hidden; }
.set-sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; user-select: none; }
.set-sec > summary::-webkit-details-marker { display: none; }
.set-sec > summary:hover { background: var(--bg3); }
.set-sec-ico { width: 18px; height: 18px; color: var(--accent-2); flex: none; }
.set-sec-name { font-weight: 700; font-size: 14px; flex: none; }
.set-sec-desc { flex: 1; min-width: 0; color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-sec-chev { width: 18px; height: 18px; color: var(--muted); flex: none; transition: transform .18s; transform: rotate(-90deg); }
.set-sec[open] > summary .set-sec-chev { transform: none; }
.set-sec[open] > summary .set-sec-desc { opacity: 0; }
.set-sec-body { padding: 4px 14px 10px; border-top: 1px solid var(--line); }
.set-sec-body > .field:first-child, .set-sec-body > .profile-row:first-child { margin-top: 10px; }
.set-sec-body > .check:first-child { margin-top: 8px; }
.set-sec.advanced .adv-title:first-of-type { margin-top: 10px; }

/* ---------- mini player ---------- */
#mini { position: fixed; width: 256px; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; z-index: 45; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); cursor: grab; touch-action: none; user-select: none; animation: mini-in .18s ease-out; }
@keyframes mini-in { from { opacity: 0; transform: scale(.94); } }
#mini.tl { top: calc(var(--tb) + 16px); left: calc(var(--rail) + 16px); }
#mini.tr { top: calc(var(--tb) + 16px); right: 16px; }
#mini.bl { bottom: 16px; left: calc(var(--rail) + 16px); }
#mini.br { bottom: 16px; right: 16px; }
#mini.dragging { cursor: grabbing; box-shadow: 0 24px 70px rgba(0,0,0,.75), 0 0 0 2px var(--accent); }
#mini.snapping { transition: left .18s ease-out, top .18s ease-out; }
#mini video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.mini-top, .mini-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; opacity: 0; transition: opacity .15s; }
.mini-top { top: 0; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.mini-bottom { bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-size: 12.5px; font-weight: 600; }
#mini:hover .mini-top, #mini:hover .mini-bottom, #mini.dragging .mini-top, #mini.dragging .mini-bottom { opacity: 1; }
.mini-top .live-badge { opacity: 1; }
.mini-more { font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.18); border-radius: 6px; padding: 1px 6px; }
.mini-btn { margin-left: auto; width: 26px; height: 26px; border: 0; border-radius: 7px; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mini-btn:hover { background: rgba(255,255,255,.2); }
.mini-btn svg { width: 14px; height: 14px; }
.mini-bottom span:first-child { flex: 1; min-width: 0; }
.mini-back { flex: none; color: var(--accent-2); }

/* rail: conectado mas vendo o início */
.rail-item.connected::before { height: 8px; }

/* ---------- início ---------- */
.home-conn { display: flex; align-items: center; gap: 10px; background: rgba(47,210,122,.08); border: 1px solid rgba(47,210,122,.35); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; }
.home-conn .turma-ico { width: 38px; height: 38px; font-size: 13px; border-radius: 11px; }
.home-conn-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-conn-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-conn-txt span { font-size: 12px; color: var(--ok); }
.home-section { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin: 2px 0 8px; }
.home-section span { font-weight: 500; letter-spacing: 0; color: var(--faint); }
.home-turma-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px; }
.home-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 14px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg3); color: var(--text); cursor: pointer; text-align: left; transition: background .15s, border-color .15s, transform .05s; }
.home-choice:active { transform: translateY(1px); }
.home-choice svg { width: 22px; height: 22px; margin-bottom: 6px; padding: 7px; box-sizing: content-box; border-radius: 10px; }
.home-choice b { font-size: 14px; }
.home-choice small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.home-choice.create svg { background: var(--accent); color: #fff; }
.home-choice.join svg { background: rgba(47,210,122,.18); color: var(--ok); }
.home-choice.create:hover { border-color: var(--accent); background: rgba(123,97,255,.12); }
.home-choice.join:hover { border-color: var(--ok); background: rgba(47,210,122,.08); }
.quick-create { width: 100%; margin-top: 6px; font-size: 13px; }

/* foto da turma: botões */
.ts-icon-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.ts-icon-btns { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.ts-icon-btns .btn { width: 100%; }
.ts-icon-cap { font-size: 11.5px; color: var(--faint); }

#mini .mini-cam { border-width: 1.5px; box-shadow: 0 4px 12px rgba(0,0,0,.5); pointer-events: none; z-index: 1; }
#mini .mini-cam[hidden] { display: none; }
#mini .mini-cam video { object-fit: cover; pointer-events: none; }
#mini .mini-top, #mini .mini-bottom { z-index: 2; }

/* ---------- menu do botão direito (turmas) ---------- */
.ctx-menu { position: fixed; z-index: 70; min-width: 220px; max-width: 280px; background: #111214; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.55); animation: fade .1s; }
.ctx-head { display: flex; align-items: center; gap: 9px; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ctx-head .turma-ico { width: 28px; height: 28px; font-size: 11px; border-radius: 9px; }
.ctx-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.ctx-head small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.ctx-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; color: var(--text); padding: 8px 9px; border-radius: 6px; cursor: pointer; font-size: 13.5px; text-align: left; }
.ctx-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.ctx-item:hover { background: var(--accent); color: #fff; }
.ctx-item:hover svg { color: #fff; }
.ctx-item.danger { color: #ff7a85; }
.ctx-item.danger svg { color: #ff7a85; }
.ctx-item.danger:hover { background: var(--live); color: #fff; }
.ctx-item.danger:hover svg { color: #fff; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.confirm-modal { z-index: 60; }
.confirm-card { width: min(470px, calc(100vw - 40px)); }
.confirm-card .modal-body { padding: 4px 18px 12px; }
.confirm-text { margin: 0 0 6px; color: var(--muted); line-height: 1.5; font-size: 13.5px; }
.confirm-text b { color: var(--text); }
.transfer-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.transfer-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; background: var(--bg3); }
.transfer-list li:hover { border-color: var(--bg4); }
.transfer-list li.sel { border-color: var(--accent); background: rgba(123,97,255,.14); }
.transfer-list .avatar { width: 30px; height: 30px; font-size: 12px; }
.transfer-list .t-name { flex: 1; min-width: 0; font-weight: 600; }
.transfer-list .t-sub { font-size: 12px; color: var(--muted); }
.transfer-list .t-sub.on { color: var(--ok); }

/* ---------- Mac: bolinhas do sistema (fechar/minimizar) no lugar dos botões ---------- */
body.mac .tb-win, body.mac .tb-gap { display: none; }
body.mac .tb-left { padding-left: 78px; }
body.mac .tb-right { padding-right: 8px; }

/* ---------- ocultar o chat ---------- */
#room { position: relative; }
.chat-toggle { position: absolute; top: 50%; right: 290px; transform: translate(50%, -50%); z-index: 15; width: 22px; height: 52px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg3); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: background .15s, color .15s, right .2s; }
.chat-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.chat-toggle svg { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .2s; }
#room.chat-hidden .chat { display: none; }
#room.chat-hidden .stage-wrap { margin-right: 30px; }
#room.chat-hidden::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 30px; background: var(--bg2); border-left: 1px solid var(--line); pointer-events: none; }
#room.chat-hidden .chat-toggle { right: 4px; transform: translate(0, -50%); width: 22px; }
#room.chat-hidden .chat-toggle svg { transform: rotate(90deg); }
.chat-unread { position: absolute; top: -8px; left: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--live); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg1); }
.chat-unread[hidden] { display: none; }

/* ---------- volume no mini player ---------- */
#mini .mini-vol { display: flex; align-items: center; gap: 4px; flex: none; }
#mini .mini-vol .mini-btn { margin: 0; width: 24px; height: 24px; }
#mini .mini-vol input { width: 64px; accent-color: var(--accent); cursor: pointer; margin: 0; }
#mini .mini-bottom #mini-name { flex: 1; min-width: 0; }

/* ---------- chat novo ---------- */
.chat { position: relative; }
.chat-input-wrap { flex: 1; min-width: 0; display: flex; align-items: center; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 0 4px; }
.chat-input-wrap:focus-within { border-color: var(--accent); }
.chat-input-wrap input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 4px; outline: none; }
.chat-in-btn { flex: none; width: 28px; height: 28px; border: 0; background: none; color: var(--muted); border-radius: 7px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chat-in-btn:hover { background: var(--bg3); color: var(--text); }
.chat-in-btn svg { width: 18px; height: 18px; }
.chat-in-btn.emoji { font-size: 17px; filter: grayscale(1); opacity: .75; }
.chat-in-btn.emoji:hover, .chat-in-btn.emoji.on { filter: none; opacity: 1; }
.chat-reply, .chat-attach { display: flex; align-items: center; gap: 8px; margin: 0 12px -4px; padding: 7px 8px 7px 10px; border-radius: 9px 9px 0 0; background: var(--bg3); font-size: 12.5px; color: var(--muted); min-width: 0; }
.chat-reply[hidden], .chat-attach[hidden] { display: none; }
.chat-reply svg { width: 15px; height: 15px; flex: none; color: var(--accent-2); }
.chat-reply > span { flex: 1; min-width: 0; }
.chat-reply b { color: var(--text); }
.chat-attach img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.chat-attach span { flex: 1; min-width: 0; }
.chat-mini-x { flex: none; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.chat-mini-x:hover { background: var(--bg4); color: var(--text); }
.chat-mini-x svg { width: 12px; height: 12px; }
.emoji-pop { position: absolute; right: 12px; bottom: 64px; z-index: 30; width: 266px; max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: #111214; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.emoji-pop[hidden] { display: none; }
.emoji-pop button { border: 0; background: none; font-size: 20px; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; padding: 0; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.emoji-pop button:hover { background: var(--bg4); transform: scale(1.15); }
.emoji-pop .emoji-sec { grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .05em; padding: 6px 2px 2px; }
.mention-pop { position: absolute; left: 12px; right: 12px; bottom: 64px; z-index: 30; background: #111214; border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.mention-pop[hidden] { display: none; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; text-align: left; }
.mention-pop button.sel, .mention-pop button:hover { background: var(--accent); color: #fff; }
.mention-pop .avatar { width: 22px; height: 22px; font-size: 10px; }
.mention-pop small { margin-left: auto; color: var(--faint); font-size: 11px; }
.mention-pop button.sel small, .mention-pop button:hover small { color: #fff; }
/* mensagens */
.msg { position: relative; border-radius: 8px; padding: 2px 4px; margin: 0 -4px; }
.msg:hover { background: rgba(255,255,255,.035); }
.msg.mention { background: rgba(240,183,58,.09); box-shadow: inset 2px 0 0 #f0b73a; }
.msg .mention-tag { color: #c9b8ff; background: rgba(123,97,255,.22); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.msg .mention-tag.me { color: #ffd98a; background: rgba(240,183,58,.22); }
.msg-quote { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin: 1px 0 3px; cursor: pointer; min-width: 0; }
.msg-quote::before { content: ""; width: 14px; height: 9px; flex: none; border-left: 2px solid var(--bg4); border-top: 2px solid var(--bg4); border-top-left-radius: 6px; margin-top: 6px; }
.msg-quote b { color: var(--text); font-weight: 600; flex: none; }
.msg-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.flash { animation: msgflash 1.2s; }
@keyframes msgflash { 0%, 40% { background: rgba(123,97,255,.25); } }
.msg-img { display: block; margin-top: 4px; max-width: 100%; max-height: 220px; border-radius: 8px; cursor: zoom-in; background: var(--bg3); }
.msg-img.loading { width: 180px; height: 110px; display: grid; place-items: center; font-size: 12px; color: var(--faint); cursor: default; }
.msg-tools { position: absolute; top: -12px; right: 4px; display: none; gap: 1px; padding: 2px; background: #111214; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 2; }
.msg:hover .msg-tools { display: flex; }
.msg-tools button { border: 0; background: none; width: 26px; height: 24px; border-radius: 5px; cursor: pointer; font-size: 14px; padding: 0; display: grid; place-items: center; color: var(--muted); font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.msg-tools button:hover { background: var(--bg4); color: var(--text); }
.msg-tools svg { width: 15px; height: 15px; }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-reacts button { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--bg3); color: var(--text); border-radius: 999px; padding: 1px 7px; font-size: 12px; cursor: pointer; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", inherit; }
.msg-reacts button.mine { border-color: var(--accent); background: rgba(123,97,255,.18); }
.msg-reacts button b { font-family: inherit; font-weight: 600; font-size: 11.5px; }
.chat-log.dragover { outline: 2px dashed var(--accent); outline-offset: -8px; }
.img-view { position: fixed; inset: var(--tb) 0 0 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; animation: fade .12s; cursor: zoom-out; }
.img-view[hidden] { display: none; }
.img-view img { max-width: calc(100vw - 80px); max-height: calc(100vh - 100px); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.img-view .icon-btn { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.1); }

/* ---------- tela de transmitir: modos + personalizar ---------- */
.picker-card { max-height: calc(100vh - var(--tb) - 24px); overflow-y: auto; }
.picker-opts { grid-template-columns: 1fr; }
.q-title { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 0 8px; }
.q-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg3); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.q-card:hover { border-color: var(--bg4); background: #2b2e36; }
.q-card > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.q-card .q-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-card b { font-size: 14px; }
.q-card small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.q-radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg4); position: relative; }
.q-card.sel { border-color: var(--accent); background: rgba(123,97,255,.12); }
.q-card.sel > svg { color: var(--accent-2); }
.q-card.sel .q-radio { border-color: var(--accent); }
.q-card.sel .q-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.q-custom { margin: 10px 0 4px; }
.q-custom > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; user-select: none; }
.q-custom > summary::-webkit-details-marker { display: none; }
.q-custom > summary svg { width: 15px; height: 15px; transform: rotate(-90deg); transition: transform .15s; color: var(--muted); }
.q-custom[open] > summary svg { transform: none; }
.q-custom > summary small { color: var(--faint); font-weight: 500; }
.q-sum { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent-2); }
.q-row { margin: 10px 0 0; }
.q-lab { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.q-chips { display: flex; gap: 4px; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.q-chips button { flex: 1; border: 0; background: none; color: var(--muted); padding: 7px 6px; border-radius: 7px; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.q-chips button svg { width: 16px; height: 16px; }
.q-chips button:hover { color: var(--text); background: var(--bg3); }
.q-chips button.sel { background: var(--accent); color: #fff; }
.q-note { margin: 8px 0 0; }
.q-note:empty { display: none; }
@media (max-width: 760px) { .q-presets { grid-template-columns: 1fr; } }

/* ---- 1.13: lista da turma mais compacta, versão antiga, apagar mensagens ---- */
.member .watch { padding: 5px 9px; }
.member .watch.is-watching { width: 30px; height: 28px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.member .watch.is-watching svg { width: 16px; height: 16px; }
.member .watch.is-watching:hover { color: var(--text, #fff); }
.member .sub .ver-old { flex: none; font-size: 10px; font-weight: 700; color: #f0b232; background: rgba(240, 178, 50, .14); border-radius: 4px; padding: 1px 5px; letter-spacing: .02em; }
.msg-tools button.del { color: var(--muted); }
.msg-tools button.del:hover { color: #f23f43; }
.msg-quote.gone span { font-style: italic; opacity: .7; }
.member .sub .ver-old.short { padding: 0 4px; font-size: 11px; }
.upd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg3); }
.upd-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upd-row small { color: var(--muted); font-size: 12px; }
.upd-row small.ok { color: #23a55a; }
.upd-row small.err { color: #f23f43; }
.upd-row .btn { flex: none; }
.my-stream-auto { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: help; }
.my-stream-auto[hidden] { display: none; }
.msg-edited { color: var(--muted); font-size: 11px; cursor: default; }
.msg.editing { background: rgba(255,255,255,.03); }
.msg.editing .msg-tools { display: none !important; }
.msg-edit textarea { width: 100%; resize: none; box-sizing: border-box; background: var(--bg3); color: var(--text); border: 1px solid var(--accent, #7c5cff); border-radius: 6px; padding: 6px 8px; font: inherit; line-height: 1.4; outline: none; }
.msg-edit-hint { margin-top: 3px; font-size: 11px; color: var(--muted); }
.msg-edit-hint b { color: var(--text); font-weight: 600; }
.msg-tools button.edit:hover { color: var(--text); }
.confirm-card .modal-foot .btn { white-space: nowrap; }
/* expulsar quem está offline: a pergunta aparece normal (sem o cinza da linha) */
.member.offline:has(.kick-confirm) { opacity: 1; filter: none; }

/* ---- 1.15: chat compacto e alinhado ---- */
.chat-log { gap: 0; }
.chat-log > .msg { margin-top: 10px; }
.chat-log > .msg:first-child { margin-top: 0; }
.chat-log > .msg.cont { margin-top: 0; padding-left: 41px; } /* 4 (borda) + 28 (foto) + 9 (espaço): alinha com a primeira */
.msg-reacts:empty { display: none; }
.msg .who { line-height: 1.35; }
/* mensagem seguida: a hora aparece no cantinho ao passar o mouse */
.msg.cont::before { content: attr(data-time); position: absolute; left: 0; width: 41px; top: 4px; text-align: center; font-size: 10px; color: var(--faint); opacity: 0; pointer-events: none; }
.msg.cont:hover::before { opacity: 1; }
/* ---- 1.15: "Reconectando…" com o último quadro desfocado (sem tela preta) ---- */
.freeze-frame { position: absolute; pointer-events: none; transition: opacity .25s; }
.freeze-frame.frozen { filter: blur(12px) brightness(.5) saturate(.8); }
.freeze-frame.out { opacity: 0; }
.tile-status.soft { background: transparent; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8); font-weight: 600; }
.tile.is-reconnecting > video { visibility: hidden; }
/* ---- 1.15: tela cheia limpa — os controles somem 2 s depois de parar o mouse ---- */
.tile:fullscreen .tile-bar, .tile:fullscreen .tile-top { opacity: 0; transition: opacity .3s; }
.tile:fullscreen.awake .tile-bar, .tile:fullscreen.awake .tile-top, .tile:fullscreen .tile-bar:hover { opacity: 1; }
.tile:fullscreen:not(.awake):not(.pointing) { cursor: none; }
/* ---- 1.15: Novidades depois de atualizar ---- */
.news { position: fixed; left: 84px; bottom: 18px; z-index: 70; width: min(380px, calc(100vw - 110px)); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; animation: newsIn .25s ease-out; }
.news[hidden] { display: none; }
@keyframes newsIn { from { opacity: 0; transform: translateY(10px); } }
.news-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.news-spark { font-size: 16px; }
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; }
.news-list li { display: flex; gap: 9px; font-size: 13px; line-height: 1.4; color: #dcdfe5; }
.news-ico { flex: none; width: 20px; text-align: center; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.news .btn { align-self: flex-end; }
.upd-news { font-size: 12px; color: var(--accent, #9b87ff); text-decoration: none; margin-top: 2px; }
.upd-news:hover { text-decoration: underline; }

/* ---- 1.15: tela "Transmitir tela" limpa ---- */
.picker-card { width: min(720px, calc(100vw - 40px)); overflow: hidden; }
.picker-tabs { justify-content: space-between; padding: 2px 18px 10px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; }
.seg .tab { padding: 6px 14px; border-radius: 7px; font-size: 13px; }
.seg .tab.active { background: var(--bg4); }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; flex: 1 1 auto; min-height: 150px; max-height: 360px; }
.source { padding: 6px; border-width: 2px; }
.source .label { margin-top: 6px; }
.picker-opts { display: flex; flex-direction: column; gap: 10px; padding: 12px 18px 4px; border-top: 1px solid var(--line); }
.po-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.po-lab { flex: none; width: 70px; font-size: 12px; font-weight: 700; color: var(--muted); }
/* qualidade: uma faixa só, com os 4 modos lado a lado */
.picker-opts .q-presets { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 3px; background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; }
.picker-opts .q-card { flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 4px; border: 0; border-radius: 7px; background: none; text-align: center; color: var(--muted); }
.picker-opts .q-card:hover { background: var(--bg3); color: var(--text); }
.picker-opts .q-card b { font-size: 13px; color: inherit; }
.picker-opts .q-card small { font-size: 11px; color: var(--faint); }
.picker-opts .q-card.sel { background: var(--accent); color: #fff; }
.picker-opts .q-card.sel small { color: rgba(255,255,255,.8); }
/* personalizar: linha discreta embaixo da qualidade */
.picker-opts .q-custom { margin: -4px 0 0 82px; }
.picker-opts .q-custom > summary { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.picker-opts .q-custom > summary:hover { color: var(--text); }
.picker-opts .q-custom.on > summary { color: var(--text); }
.picker-opts .q-sum { margin-left: 8px; }
.q-grid { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; margin-top: 8px; }
.q-grid .q-lab { margin: 0; font-size: 11.5px; }
.q-grid .q-chips button { padding: 5px 6px; font-size: 12.5px; }
/* som: chaves pequenas numa linha */
.po-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill-toggle { position: relative; cursor: pointer; }
.pill-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pill-toggle span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg3); color: var(--muted); font-size: 12.5px; font-weight: 600; user-select: none; }
.pill-toggle span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bg4); }
.pill-toggle span svg { width: 14px; height: 14px; }
.pill-toggle input:checked + span { color: var(--text); border-color: rgba(123,97,255,.55); background: rgba(123,97,255,.14); }
.pill-toggle input:checked + span::before { background: #23a55a; box-shadow: 0 0 6px rgba(35,165,90,.7); }
.pill-toggle input:disabled + span { opacity: .45; cursor: default; }
.pill-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.po-select select { background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: 12.5px; }
.po-select[hidden], .pill-toggle[hidden] { display: none; }
.picker-opts .q-note { margin: 0 0 0 82px; font-size: 12px; }
/* rodapé: dica à esquerda, botões à direita */
.picker-foot { align-items: center; }
.picker-foot #picker-hint { flex: 1; margin: 0; padding: 0; font-size: 12px; line-height: 1.35; }
.picker-foot #picker-hint:empty { display: none; }
@media (max-width: 640px) { .po-row { flex-direction: column; align-items: stretch; } .po-lab { width: auto; } .picker-opts .q-custom, .picker-opts .q-note { margin-left: 0; } }
.news { left: 50%; transform: translateX(-50%); bottom: 22px; width: min(420px, calc(100vw - 40px)); }
@keyframes newsIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* ---- 1.16: expulsar/banir mais limpo ---- */
.member.asking .kick-btn { opacity: 1; color: #fff; background: rgba(242,63,67,.25); }
.ts-bans li span { display: flex; flex-direction: column; gap: 1px; }
.ts-bans li small { color: var(--muted); font-size: 11.5px; }
.ts-bans-empty { margin: 0; font-size: 12px; }
.ts-bans-empty[hidden] { display: none; }
/* ---- 1.16: botão "+" do chat (foto e GIF) ---- */
.chat-in-btn.plus svg { width: 17px; height: 17px; transition: transform .15s; }
.chat-in-btn.plus.on { background: var(--bg3); color: var(--text); }
.chat-in-btn.plus.on svg { transform: rotate(45deg); }
.plus-pop { position: absolute; left: 12px; bottom: 64px; z-index: 30; width: 220px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: #111214; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.plus-pop[hidden], .gif-pop[hidden] { display: none; }
.plus-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--text); border-radius: 8px; cursor: pointer; text-align: left; }
.plus-item:hover { background: var(--bg3); }
.plus-item > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.plus-item span:last-child { display: flex; flex-direction: column; gap: 1px; }
.plus-item b { font-size: 13px; font-weight: 600; }
.plus-item small { font-size: 11.5px; color: var(--muted); }
.gif-badge { flex: none; width: 20px; text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; color: var(--muted); border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 0; }
.gif-pop { position: absolute; left: 12px; right: 12px; bottom: 64px; z-index: 30; height: 340px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #111214; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.gif-q { background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.gif-q:focus { border-color: var(--accent); }
.gif-grid { flex: 1; overflow-y: auto; columns: 2; column-gap: 6px; }
.gif-item { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; background: var(--bg3); border-radius: 6px; overflow: hidden; cursor: pointer; break-inside: avoid; }
.gif-item img { display: block; width: 100%; height: auto; }
.gif-item:hover { outline: 2px solid var(--accent); }
.gif-msg { column-span: all; text-align: center; color: var(--muted); font-size: 12.5px; padding: 40px 10px; }
.gif-foot { text-align: right; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--faint); }
.msg-gif { display: block; margin-top: 4px; max-width: min(100%, 260px); max-height: 200px; width: auto; height: auto; border-radius: 8px; cursor: zoom-in; background: var(--bg3); }
/* ---- 1.16: links e prévia de links no chat ---- */
.chat-link { color: #8ab4ff; text-decoration: none; word-break: break-all; }
.chat-link:hover { text-decoration: underline; }
.link-card { display: flex; gap: 10px; margin-top: 5px; max-width: 320px; padding: 8px 10px; background: var(--bg3); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 8px; text-decoration: none; color: var(--text); cursor: pointer; }
.link-card:hover { background: #2b2e36; }
.link-card.loading { display: none; }
.link-card.youtube { border-left-color: #ff3b3b; flex-direction: column; }
.link-card.tiktok { border-left-color: #25f4ee; }
.link-card.twitch { border-left-color: #9146ff; }
.lc-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lc-site { font-size: 11px; font-weight: 700; color: var(--muted); }
.lc-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-info small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-thumb { position: relative; border-radius: 6px; background: #000 center/cover no-repeat; flex: none; }
.link-card.youtube .lc-thumb { width: 100%; aspect-ratio: 16 / 9; }
.link-card.tiktok .lc-thumb { width: 60px; aspect-ratio: 3 / 4; }
.lc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 30px; border-radius: 8px; background: rgba(255,0,0,.9); color: #fff; display: grid; place-items: center; font-size: 14px; }
.gif-grid { columns: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; overflow-x: hidden; }
.gif-item { margin: 0; }
.gif-msg { grid-column: 1 / -1; }
/* ---- 1.17: modo turbo ---- */
.turbo-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 4px 0 8px; border-radius: 10px; background: linear-gradient(90deg, rgba(123,97,255,.16), rgba(123,97,255,.04)); border: 1px solid rgba(123,97,255,.35); }
.turbo-row[hidden] { display: none; }
.turbo-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.turbo-row b { font-size: 13.5px; }
.turbo-row small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.turbo-row .btn { flex: none; }
/* ---- 1.18: "Atualizando o Telinha…" ---- */
.updating { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(17,18,20,.92); backdrop-filter: blur(6px); animation: newsIn .2s ease-out; }
.updating[hidden] { display: none; }
.upd-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 30px 36px; }
.upd-logo { width: 84px; height: 84px; border-radius: 20px; background: url("../icon.png") center/cover no-repeat; box-shadow: 0 10px 30px rgba(123,97,255,.35); animation: updBob 2.4s ease-in-out infinite; }
@keyframes updBob { 50% { transform: translateY(-5px) scale(1.03); } }
.upd-card h2 { margin: 6px 0 0; font-size: 20px; }
.upd-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.upd-bar { width: 220px; height: 4px; border-radius: 4px; background: var(--bg3); overflow: hidden; margin-top: 6px; }
.upd-bar i { display: block; height: 100%; width: 35%; border-radius: 4px; background: var(--accent, #7b61ff); animation: updSlide 1.1s ease-in-out infinite; }
@keyframes updSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
/* 1.19.2: GIFs em quadradinhos do mesmo tamanho (antes a grade espremia as imagens em tirinhas) */
.gif-grid { grid-auto-rows: 104px; }
.gif-item { height: 104px; min-height: 104px; }
.gif-item img { width: 100%; height: 100%; object-fit: cover; }
/* câmera em pé (de quem está no celular): aparece inteira, sem cortar */
.cam-tile.portrait video, .cam-bubble.portrait video, .mini-cam.portrait video { object-fit: contain !important; background: #0b0c0e; }
