:root {
  --bg-0: #08090d;
  --bg-1: #0f1117;
  --bg-2: #14171f;
  --bg-3: #1b1f2a;
  --bg-4: #242a38;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e8eaf0;
  --muted: #8a92a6;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.14);
  --ok: #22c55e;
  --live: #ef4444;
  --radius: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-2); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.icon { display: inline-flex; flex-shrink: 0; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
code { background: var(--bg-4); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: linear-gradient(135deg, #8b6bff, #6a4dff); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { background: linear-gradient(135deg, #9a7dff, #7859ff); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ff526f; }
.btn-ghost { background: var(--bg-3); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-4); }
.btn-danger-ghost { color: var(--danger); padding: 0 10px; height: 38px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font-weight: 600; }
.btn-danger-ghost:hover { background: var(--danger-soft); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover, .icon-btn.active { background: var(--bg-4); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.danger-soft:hover { background: var(--danger-soft); color: var(--danger); }

.tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: #b9a8ff; }
.muted-tag { background: var(--bg-4); color: var(--muted); }
.live-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 5px; background: var(--live); color: #fff; }

/* ---------------------------------------------------------------- formulários */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
input:not([type=checkbox]):not([type=range]), textarea, .select {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { width: auto; padding: 8px 32px 8px 12px; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a92a6' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-error { color: var(--danger); margin: 0; min-height: 0; font-size: 13px; }
.form-error:empty { display: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint.warn { color: #fbbf24; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; }
.seg-btn { flex: 1; height: 34px; border-radius: 9px; font-weight: 600; color: var(--muted); transition: all 0.15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg-4); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset; }
.seg-desc { display: block; margin-top: 4px; }

.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex-shrink: 0; width: 38px; height: 22px; border-radius: 22px; background: var(--bg-4); position: relative; transition: background 0.2s; margin-top: 2px; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- autenticação */

.auth { height: 100%; display: grid; place-items: center; padding: 16px; position: relative; overflow: auto; }
.auth-glow { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(600px 400px at 20% 10%, rgba(124, 92, 255, 0.25), transparent 60%), radial-gradient(500px 400px at 85% 90%, rgba(34, 211, 238, 0.15), transparent 60%); }
.auth-card { position: relative; width: 100%; max-width: 420px; background: rgba(20, 23, 31, 0.85); backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 26px; line-height: 1.2; }
.auth-card > p { margin: -8px 0 0; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.link-btn { align-self: flex-start; margin-top: -6px; color: var(--accent-2); font-size: 13px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.google-btn { gap: 10px; }
.discord-btn { gap: 10px; background: #5865f2; color: #fff; text-decoration: none; }
.discord-btn:hover { background: #4752c4; }
.invite-banner { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: #c9bcff; font-weight: 500; }

/* ---------------------------------------------------------------- shell */

.app { display: grid; grid-template-columns: 72px 260px 1fr; height: 100%; }
.rail { background: var(--bg-0); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--line-2); margin: 2px 0; }
.rail-btn { position: relative; width: 72px; display: grid; place-items: center; }
.server-icon {
  width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center;
  background: var(--bg-3); color: var(--text); font-weight: 700; font-size: 15px;
  transition: border-radius 0.2s, background 0.2s, color 0.2s;
}
.server-btn .server-icon { background: color-mix(in srgb, var(--c) 22%, var(--bg-3)); color: color-mix(in srgb, var(--c) 70%, #fff); }
.rail-btn:hover .server-icon, .rail-btn.active .server-icon { border-radius: 16px; }
.server-btn:hover .server-icon, .server-btn.active .server-icon { background: var(--c); color: #fff; }
.brand-icon { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important; }
.rail-btn.action .server-icon { color: var(--ok); background: var(--bg-2); }
.rail-btn.action:hover .server-icon { background: var(--ok); color: #fff; }
.rail-pill { position: absolute; left: 0; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: #fff; transition: height 0.2s; }
.rail-btn:hover .rail-pill { height: 18px; }
.rail-btn.active .rail-pill { height: 38px; }
.rail-dot { position: absolute; left: 0; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: #fff; }
.rail-btn.active .rail-dot { display: none; }
.rail-live { position: absolute; bottom: -3px; font-size: 8.5px; font-weight: 800; padding: 1px 4px; border-radius: 4px; background: var(--live); color: #fff; border: 2px solid var(--bg-0); }
.server-icon.sm { width: 40px; height: 40px; border-radius: 12px; background: var(--c); color: #fff; }

.sidebar { background: var(--bg-1); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.side-header { height: 56px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.side-header strong { font-size: 15px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 12px 8px; }
.side-empty { color: var(--muted); padding: 4px 10px; margin: 0; font-size: 13px; }
.section { margin-bottom: 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 6px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.channel {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 8px 0 10px;
  border-radius: 8px; color: var(--muted); cursor: pointer; text-align: left; position: relative;
}
.channel:hover { background: var(--bg-3); color: var(--text); }
.channel.active { background: var(--bg-4); color: var(--text); }
.channel.unread { color: var(--text); font-weight: 600; }
.channel.unread::before { content: ''; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: #fff; }
.channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--bg-4); color: var(--text); }
.channel-del { display: none; color: var(--muted); padding: 4px; border-radius: 6px; }
.channel-del:hover { color: var(--danger); background: var(--danger-soft); }
.channel:hover .channel-del { display: inline-flex; }
.mini-icon { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--c); color: #fff; flex-shrink: 0; }
.participants { padding: 2px 0 6px 30px; display: flex; flex-direction: column; gap: 2px; }
.participant { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.participant:hover { background: var(--bg-3); color: var(--text); }
.p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); }
.member .truncate { flex: 1; }
.in-stream { color: var(--ok); }
.mod-btn { opacity: 0; flex-shrink: 0; margin-left: auto; }
.member:hover .mod-btn, .participant:hover .mod-btn, .mod-btn:focus-visible { opacity: 1; }
.member .in-stream + .mod-btn, .member .tag + .mod-btn { margin-left: 0; }

.menu { position: fixed; z-index: 60; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop 0.12s ease-out; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-weight: 500; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--bg-4); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }

.msg-text { position: relative; padding-right: 34px; }
.msg-del { position: absolute; right: 4px; top: -2px; display: none; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); background: var(--bg-3); border: 1px solid var(--line); }
.msg-text:hover .msg-del { display: grid; }
.msg-del:hover { color: var(--danger); background: var(--danger-soft); }
@media (pointer: coarse) { .msg-del { display: grid; opacity: 0.6; } .mod-btn { opacity: 1; } }

.ban-list { display: flex; flex-direction: column; gap: 6px; }
.ban-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); }
.ban-item .truncate { flex: 1; }

.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0; user-select: none; }

.voice-panel { display: flex; align-items: center; gap: 4px; padding: 10px 8px 10px 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.voice-info { flex: 1; min-width: 0; cursor: pointer; }
.voice-status { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; font-size: 13px; }
.voice-where { color: var(--muted); font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.user-panel { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; background: var(--bg-0); }
.user-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; margin: -4px -6px; border-radius: 10px; text-align: left; }
.user-me:hover { background: var(--bg-3); }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.discord-link { margin-top: 0; align-self: center; color: #8b95ff; }
.user-meta span { font-size: 12px; }

.main { min-width: 0; background: var(--bg-2); position: relative; }
.view { display: none; height: 100%; flex-direction: column; }
.view.visible { display: flex; }
.topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.topbar strong { color: var(--text); font-size: 15px; }
.header-count { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.only-mobile { display: none; }
.scrim { display: none; }

/* ---------------------------------------------------------------- início */

.home { flex: 1; overflow-y: auto; padding: 48px 32px; max-width: 980px; width: 100%; margin: 0 auto; }
.home-hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.home-hero p { font-size: 16px; max-width: 560px; margin: 12px 0 32px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.home-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 20px; border-radius: 16px; background: var(--bg-3); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.home-card:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--bg-4); }
.home-card strong { font-size: 16px; }
.home-card > span:last-child { color: var(--muted); font-size: 13.5px; }
.home-card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-1); color: var(--accent-2); margin-bottom: 8px; }
.home-card.primary { background: linear-gradient(145deg, rgba(124, 92, 255, 0.28), rgba(34, 211, 238, 0.1)); border-color: rgba(124, 92, 255, 0.4); }
.home-card.primary .home-card-icon { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.tips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tip { padding: 10px 14px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.tip strong { color: var(--accent-2); }

/* ---------------------------------------------------------------- chat */

.chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; display: flex; flex-direction: column; }
.chat-welcome { padding: 24px 20px 20px; margin-top: auto; }
.welcome-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; margin-bottom: 12px; color: var(--text); }
.chat-welcome h2 { font-size: 22px; }
.chat-welcome p { margin: 4px 0 0; }
.msg { display: flex; gap: 14px; padding: 6px 20px; margin-top: 10px; }
.msg:hover { background: rgba(255, 255, 255, 0.02); }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 700; }
.msg-head time { font-size: 11.5px; color: var(--muted); }
.msg-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.composer { display: flex; align-items: flex-end; gap: 6px; margin: 4px 16px 16px; padding: 6px 6px 6px 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; }
.composer:focus-within { border-color: var(--line-2); }
.composer textarea { border: 0 !important; box-shadow: none !important; background: transparent !important; resize: none; padding: 8px 10px; max-height: 160px; }
.send-btn { color: var(--accent); }

/* ---------------------------------------------------------------- transmissão */

.stream-body { flex: 1; display: flex; min-height: 0; }
.stream-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #06070a; }
.stream-chat { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--bg-2); }
.chat-header { height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); flex-shrink: 0; }
.chat-header strong { color: var(--text); }
.stream-chat .msg { padding: 4px 14px; gap: 10px; }
.stream-chat .msg .avatar { width: 30px !important; height: 30px !important; font-size: 12px !important; }
.stream-chat .composer { margin: 4px 10px 10px; }
.stream-chat .chat-welcome { padding: 16px 14px; }
.stream-chat .chat-welcome h2 { font-size: 17px; }
.stream-chat .welcome-icon { width: 44px; height: 44px; }

.join-card { flex: 1; display: grid; place-items: center; padding: 24px; background: radial-gradient(600px 400px at 50% 40%, rgba(124, 92, 255, 0.14), transparent 70%); }
.join-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 420px; }
.join-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 40px rgba(124, 92, 255, 0.4); }
.join-inner h2 { font-size: 24px; }
.join-inner p { margin: 0; }
.join-people { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 3px solid #06070a; margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.stage { flex: 1; min-height: 0; position: relative; padding: 12px; display: flex; }
.grid { flex: 1; display: grid; gap: 10px; grid-template-columns: 1fr; grid-auto-rows: 1fr; min-height: 0; }
.grid[data-count='2'] { grid-template-columns: repeat(2, 1fr); }
.grid[data-count='3'], .grid[data-count='4'] { grid-template-columns: repeat(2, 1fr); }
.grid[data-count='5'], .grid[data-count='6'], .grid[data-count='7'], .grid[data-count='8'], .grid[data-count='9'] { grid-template-columns: repeat(3, 1fr); }
.grid:empty { display: none; }

/* Modo foco: um vídeo grande e os demais numa faixa abaixo. */
.stage.focus-mode .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); grid-template-rows: 1fr 124px; grid-auto-rows: 124px; justify-content: center; }
.stage.focus-mode .tile.focused { grid-column: 1 / -1; grid-row: 1; }
.stage.focus-mode .grid[data-count='1'] { grid-template-rows: 1fr; grid-template-columns: 1fr; }

.tile { position: relative; background: #000; border-radius: 14px; overflow: hidden; min-height: 0; min-width: 0; cursor: pointer; border: 1px solid var(--line); }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile.focused { border-color: rgba(124, 92, 255, 0.5); }
.tile:fullscreen { border-radius: 0; border: 0; }
.tile-label { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); font-weight: 600; font-size: 13px; max-width: calc(100% - 20px); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); flex-shrink: 0; }
.tile.local .live-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-actions { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.15s; }
.tile:hover .tile-actions, .tile:fullscreen .tile-actions { opacity: 1; }
.tile-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #fff; }
.tile-btn:hover { background: rgba(255, 255, 255, 0.15); }
.volume { width: 90px; accent-color: var(--accent); }
.unmute-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.stage.focus-mode .tile:not(.focused) .tile-actions, .stage.focus-mode .tile:not(.focused) .unmute-hint { display: none; }
.stage.focus-mode .tile:not(.focused) .tile-label { font-size: 11.5px; padding: 3px 7px; left: 6px; bottom: 6px; }

.stage-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; border: 2px dashed var(--line-2); border-radius: 16px; }
.stage-empty h3 { font-size: 20px; }
.stage-empty p { max-width: 440px; margin: 0 0 8px; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--bg-3); color: var(--accent-2); }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-1); flex-wrap: wrap; }
.controls-group { display: flex; align-items: center; gap: 8px; }
.upload-hint { font-size: 12px; min-width: 120px; justify-content: flex-end; cursor: help; }

.no-sound { display: inline-flex; align-items: center; gap: 3px; }
.tile.silent .volume, .tile.silent .tile-actions .tile-btn:first-child:not(:only-child) { display: none; }

/* ---------------------------------------------------------------- modal de compartilhamento */

.share-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 14px; border-radius: 14px; background: var(--bg-3); border: 1.5px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.share-option:hover { border-color: var(--line-2); background: var(--bg-4); }
.share-option.active { border-color: var(--accent); background: linear-gradient(160deg, rgba(124, 92, 255, 0.2), var(--bg-3)); }
.share-option small { font-size: 12px; line-height: 1.35; }
.share-option-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-1); color: var(--accent-2); margin-bottom: 6px; }
.share-option.active .share-option-icon { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.share-howto { padding: 12px 14px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--line); }
.share-howto .section-title { padding: 0 0 6px; }
.share-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: #d5ccff; }
.notice .icon { margin-top: 2px; }
.notice-error { background: var(--danger-soft); color: #ffc2cd; }

@media (max-width: 560px) {
  .share-options { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- modais e toasts */

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 8, 0.7); backdrop-filter: blur(4px); animation: fade 0.15s; }
.overlay.out { opacity: 0; transition: opacity 0.15s; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; animation: pop 0.18s ease-out; }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 19px; }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-form > p { margin: 0; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.join-target { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-3); border-radius: 10px; }
.explore-list { display: flex; flex-direction: column; gap: 8px; }
.explore-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); }
.explore-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.explore-meta strong { display: flex; align-items: center; gap: 6px; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 12px; pointer-events: auto; padding: 11px 16px; border-radius: 12px; background: var(--bg-4); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 500; animation: pop 0.2s ease-out; transition: opacity 0.3s, transform 0.3s; max-width: 480px; text-align: center; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-error { border-color: rgba(244, 63, 94, 0.5); background: #2a1219; }
.toast-success { border-color: rgba(34, 197, 94, 0.45); background: #10241a; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* ---------------------------------------------------------------- responsivo */

@media (max-width: 1100px) {
  .stream-chat { width: 280px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 30; transition: transform 0.22s ease; }
  .rail { left: 0; width: 72px; transform: translateX(-332px); }
  .sidebar { left: 72px; width: min(260px, calc(100vw - 72px)); transform: translateX(-332px); }
  .app.nav-open .rail, .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.55); }
  .only-mobile { display: inline-grid; margin-left: -8px; }
  .stream-body { flex-direction: column; }
  .stream-chat { width: auto; height: 42%; border-left: 0; border-top: 1px solid var(--line); }
  .home { padding: 28px 16px; }
  .hide-sm { display: none; }
  .upload-hint { display: none; }
  .tile-actions { opacity: 1; }
  .grid[data-count] { grid-template-columns: 1fr; }
  .stage.focus-mode .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-template-rows: 1fr 90px; grid-auto-rows: 90px; }
}
