:root {
  /* Preto OLED: fundo preto de verdade (tela OLED desliga o pixel), camadas em cinza bem escuro e o laranja de destaque. */
  --bg: #000;
  --bg-2: #0b0b0c;
  --card: #141416;
  --line: #242427;
  --text: #f3f3f4;
  --muted: #9b9ba1;
  --accent: #ff7a3d;
  --accent-ink: #160a03;
  --sun: #ffc857;
  --ok: #3ddc97;
  --danger: #ff5a5f;
  --radius: 18px;
  --shadow: 0 12px 34px rgb(0 0 0 / .6);
  --glow-1: rgb(255 122 61 / .07);
  --glow-2: rgb(255 200 87 / .03);
  --glow-3: rgb(160 70 120 / .04);
  --grain: .025;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; letter-spacing: -.02em; margin: 0; }
img { display: block; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- marca ---------- */
.logo { font: 800 1.45rem/1 var(--display); text-decoration: none; letter-spacing: -.03em; }
.logo b { color: var(--accent); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: 600 .95rem/1 var(--body); padding: .8em 1.15em; border-radius: 999px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: .55em .85em; font-size: .85rem; }
.btn svg { width: 1.15em; height: 1.15em; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text] {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: .75em .95em; width: 100%;
}
textarea {
  width: 100%; resize: vertical; min-height: 110px; padding: .75em .9em; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; line-height: 1.45;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.bug-label { display: block; font-weight: 600; margin: 4px 0 8px; }
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---------- fundo "noite de resenha": brilho de pôr do sol + grão ---------- */
body.landing, .layout { position: relative; isolation: isolate; }
body.landing::before, .layout::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48rem 32rem at 12% -8%, var(--glow-1), transparent 62%),
    radial-gradient(40rem 30rem at 92% 12%, var(--glow-2), transparent 60%),
    radial-gradient(50rem 30rem at 50% 115%, var(--glow-3), transparent 65%);
}
body.landing::after, .layout::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- landing ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav nav a:not(.btn):hover { color: var(--text); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font: 600 .78rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sun);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 1.8s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; padding: 40px 0 88px; min-height: calc(100dvh - 90px); }
.hero h1 { font-size: clamp(3rem, 6.6vw, 5.4rem); font-weight: 800; letter-spacing: -.045em; line-height: .92; }
.hero h1 em {
  font-style: normal; color: var(--accent); position: relative; white-space: nowrap;
  background: linear-gradient(100deg, var(--accent), var(--sun)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero h1 em::after {
  content: ""; position: absolute; left: 2%; right: 4%; bottom: .02em; height: .1em; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--sun)); opacity: .35; transform: rotate(-1.2deg);
}
.hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 34ch; margin: 24px 0 26px; line-height: 1.55; }
.perks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.perks li {
  padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, transparent);
  font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 8px;
}
.perks li::before { content: "✓"; color: var(--ok); font-weight: 800; }

/* lado direito: a salinha animada atrás e o cartão de login na frente */
.hero-side { display: grid; position: relative; }
.hero-side > * { grid-area: 1 / 1; }
.mock {
  justify-self: end; align-self: start; width: min(440px, 100%); margin-right: -28px;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 18px;
  box-shadow: 0 30px 80px rgb(0 0 0 / .45); rotate: 3deg;
}
.mock-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-weight: 700; font-family: var(--display); }
.mock-live { font: 600 .78rem var(--body); color: var(--ok); display: flex; align-items: center; gap: 6px; }
.mock-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.mock-screen {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(180deg, #2a1a4a 0%, #7a3b6b 48%, #ff8a4c 100%);
}
.mock-sun { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; left: 58%; top: 34%; background: radial-gradient(circle, #ffe08a, #ffb347 60%, transparent 62%); filter: blur(.5px); }
.mock-hill { position: absolute; bottom: -30%; border-radius: 50%; }
.mock-hill.h1 { left: -20%; width: 90%; height: 70%; background: #3b1d3a; }
.mock-hill.h2 { right: -25%; width: 95%; height: 62%; background: #24122a; }
.mock-car { position: absolute; bottom: 14%; left: -12%; width: 12%; height: 6%; border-radius: 4px; background: var(--sun); box-shadow: 0 0 12px var(--sun); animation: drive 5s linear infinite; }
@keyframes drive { to { left: 110%; } }
.mock-tag { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: rgb(0 0 0 / .55); color: #fff; font-size: .72rem; font-weight: 600; }
/* pessoas e chat à direita: o cartão de login cobre o canto esquerdo da salinha */
.mock-people { display: flex; gap: 10px; justify-content: flex-end; }
.mock-people .p {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #1a0f08;
  animation: talk 4s ease-in-out infinite;
}
.p1 { background: #ffc857; animation-delay: 0s; }
.p2 { background: #7ee0b5; animation-delay: 1s !important; }
.p3 { background: #ff9f7a; animation-delay: 2s !important; }
.p4 { background: #a7b8ff; animation-delay: 3s !important; }
@keyframes talk { 0%, 22% { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ok); } 26%, 100% { box-shadow: 0 0 0 3px var(--card), 0 0 0 3px transparent; } }
.mock-chat { display: grid; gap: 6px; margin-top: 14px; }
.bubble { margin: 0; justify-self: end; padding: 7px 12px; border-radius: 14px 14px 4px 14px; background: var(--bg-2); font-size: .85rem; opacity: 0; animation: pop 8s ease-out infinite; }
.bubble b { color: var(--sun); margin-right: 4px; }
.b2 { animation-delay: 1.4s; }
@keyframes pop { 0% { opacity: 0; translate: 0 6px; } 8%, 80% { opacity: 1; translate: 0 0; } 90%, 100% { opacity: 0; } }

.login-card {
  justify-self: start; align-self: end; width: min(340px, 100%); margin-top: 250px; margin-left: -36px; position: relative;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 26px; padding: 30px 26px 22px; text-align: center;
  box-shadow: 0 30px 80px rgb(0 0 0 / .5), inset 0 1px 0 rgb(255 255 255 / .06);
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--accent), transparent 40%, transparent 70%, var(--sun));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6;
}
.login-card h2 { font-size: 2rem; margin-bottom: 6px; }
/* O botão do Google é um iframe claro: com o mesmo esquema de cor, o fundo dele fica transparente
   (sem isso o navegador pinta um retângulo branco atrás do botão no tema escuro). */
.login-card .gbtn { display: flex; justify-content: center; min-height: 44px; margin: 22px 0 6px; color-scheme: light; }
.fine { font-size: .78rem; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.fine a { color: var(--text); }
.dev-login { margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.dev-login small { color: var(--muted); }
.form-error { color: var(--danger); min-height: 1.4em; margin: 6px 0 0; font-size: .9rem; }

/* entrada da página, em cascata */
.reveal { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
.mock.reveal { animation-name: rise-tilt; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } }
@keyframes rise-tilt { from { opacity: 0; translate: 0 24px; rotate: 8deg; } }

section.block { padding: 96px 0; }
section.block h2 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); letter-spacing: -.035em; margin-bottom: 36px; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature {
  background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--line); border-radius: 22px; padding: 24px;
  transition: translate .2s, border-color .2s;
}
.feature:hover { translate: 0 -3px; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.feature.big { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card) 60%); }
.feature.big h3 { font-size: 1.7rem; }
.feature.big p { font-size: 1.05rem; }
.feature .ico { font-size: 1.7rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }
.mini-screen {
  position: relative; margin-top: 22px; flex: 1; min-height: 120px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #2a1a4a, #7a3b6b 55%, #ff8a4c); display: grid; place-items: center;
}
.mini-sun { position: absolute; width: 70px; aspect-ratio: 1; border-radius: 50%; right: 18%; bottom: 18%; background: radial-gradient(circle, #ffe08a, #ffb347 62%, transparent 64%); }
.mini-watch { position: relative; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .9rem; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.quality { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.quality span { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--muted); }
.quality span.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }

.privacy { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: end; }
.privacy h2 { margin-bottom: 0 !important; }
.privacy > p { color: var(--muted); font-size: 1.1rem; line-height: 1.6; margin: 0; }
.cta-final { text-align: center; padding: 40px 0 110px; }
.cta-final h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.04em; margin-bottom: 24px; }
.cta-final .btn { font-size: 1.05rem; padding: 1em 1.6em; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .mock-car, .mock-people .p, .bubble, .live-dot { animation: none !important; }
  .bubble { opacity: 1; }
}

.legal { max-width: 720px; padding: 32px 0 64px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal b { color: var(--text); }
.legal a, #privacidade a { color: var(--accent); }

footer.foot { padding: 32px 0 48px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
footer.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- app ---------- */
.layout { display: grid; grid-template-columns: auto 1fr; min-height: var(--vh, 100dvh); }
.main { min-width: 0; padding: 0 24px; }
.only-mobile { display: none !important; }

.sidebar { display: flex; height: var(--vh, 100dvh); position: sticky; top: 0; }

/* Barra de grupos: um ícone por grupo, com quantos estão na sala */
.rail {
  width: 72px; flex: none; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto;
}
.rail-groups { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-btn {
  --hue: 24; position: relative; width: 48px; height: 48px; flex: none; border-radius: 16px; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font: 800 1.15rem/1 var(--display); color: #fff;
  background: linear-gradient(140deg, hsl(var(--hue) 75% 52%), hsl(calc(var(--hue) + 40) 70% 38%));
  transition: border-radius .15s, transform .15s;
}
.rail-btn:hover { border-radius: 14px; transform: translateY(-1px); }
.rail-btn::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); translate: 0 -50%; transition: height .15s;
}
.rail-btn:hover::before { height: 18px; }
.rail-btn.active::before { height: 36px; }
.rail-btn.active { border-radius: 14px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px hsl(var(--hue) 75% 60% / .7); }
.rail-home { background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: 1.3rem; }
.rail-home b { color: var(--accent); }
.rail-home.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.rail-add { background: var(--bg-2); color: var(--ok); border: 1px dashed var(--line); font-size: 1.5rem; font-weight: 500; }
.rail-add:hover { border-color: var(--ok); }
.rail-sep { width: 28px; height: 2px; border-radius: 2px; background: var(--line); flex: none; }
.rail-live {
  position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--ok); color: #082015; font: 700 .7rem/20px var(--body); border: 2px solid var(--bg);
}
.rail-btn.connected .rail-live { background: var(--sun); color: var(--accent-ink); }

/* Coluna: amigos no início, canais dentro de um grupo; voz e você embaixo */
.panel {
  width: var(--panel-w, 296px); flex: none; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 12px;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.pane-head { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.pane-head h2 { flex: 1; min-width: 0; font-size: 1.15rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-actions:empty { display: none; }
.pane { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pane[hidden] { display: none; }
.channel {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; border: 0;
  background: none; color: var(--text); font: 600 .95rem var(--body); cursor: pointer; text-align: left;
}
.channel:hover:not(:disabled):not(.soon), .channel.active { background: var(--card); }
.channel.active .channel-ico { color: var(--ok); }
.channel:disabled { opacity: .5; cursor: not-allowed; }
.channel-ico { width: 20px; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.channel-ico svg { width: 18px; height: 18px; }
.channel-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-count { color: var(--muted); font-size: .75rem; font-weight: 500; }
.channel.soon { color: var(--muted); cursor: default; }
.channel-people { display: grid; gap: 2px; padding: 2px 0 0 26px; }
.channel-person { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: .88rem; color: var(--muted); min-width: 0; }
.channel-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-person .avatar { width: 24px; height: 24px; font-size: .7rem; flex: none; }

/* Painel de voz: a chamada continua enquanto você anda pelo app */
.voice {
  flex: none; display: grid; gap: 10px; padding: 10px; border-radius: 14px;
  background: color-mix(in srgb, var(--ok) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
}
.voice[hidden] { display: none; }
.voice-info { display: grid; gap: 1px; text-align: left; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.voice-status { color: var(--ok); font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.voice-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: live 1.8s ease-out infinite; }
.voice-where { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-info:hover .voice-where { text-decoration: underline; }
.voice-info .voice-time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.voice-btns { display: flex; gap: 8px; }
.voice-btns .icon-btn { width: 38px; height: 38px; }
.icon-btn.off { background: var(--danger); border-color: var(--danger); color: #fff; }
.icon-btn.hang { background: var(--danger); border-color: var(--danger); color: #fff; margin-left: auto; }
.icon-btn.hang svg { rotate: 135deg; }
.voice-pill { display: none; }

.me {
  position: relative; flex: none; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.me-profile {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.me-profile:hover { background: var(--bg-2); }
.me-profile .avatar { width: 34px; height: 34px; }
.me-status { display: block; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.me-group { display: flex; align-items: center; border-radius: 9px; }
.me-group.off { background: color-mix(in srgb, var(--danger) 16%, transparent); }
.me-btn, .me-more {
  height: 32px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; border-radius: 8px;
}
.me-btn { width: 32px; }
.me-more { width: 14px; margin-left: -3px; }
.me-btn svg { width: 19px; height: 19px; }
.me-more svg { width: 12px; height: 12px; }
.me-btn:hover, .me-more:hover { background: var(--bg-2); color: var(--text); }
.me-btn.off, .me-group.off .me-more { color: var(--danger); }
.me-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 20; padding: 8px; border-radius: 16px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .15s ease-out;
}
.me-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.me-pop-title { margin: 4px 8px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; border-radius: 12px; background: var(--card); }
.me-card .avatar { width: 44px; height: 44px; }
.me-card-names { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-card-names b, .me-card-names span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-list { display: flex; flex-direction: column; gap: 1px; }
.me-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border: 0; border-radius: 9px; background: none;
  color: var(--text); font: 500 .9rem var(--body); text-align: left; cursor: pointer;
}
.me-item:hover { background: var(--card); }
.me-item.active { background: var(--card); }
.me-item.danger { color: var(--danger); }
.me-item .dot { position: static; flex: none; width: 12px; height: 12px; border: 0; border-radius: 50%; }
.me-item .dot.offline { box-shadow: inset 0 0 0 3px var(--bg-2); }
.me-item-text { min-width: 0; display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-item-text small { color: var(--muted); font-size: .74rem; font-weight: 400; }
.me-radio { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.me-item.active .me-radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3px, transparent 4px); }
.me-note { margin: 6px 9px 2px; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.me .who { min-width: 0; flex: 1; line-height: 1.2; }
.me .name, .friend .name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nick-link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; }
.nick-link:hover { color: var(--text); text-decoration: underline; }
.add-friend { display: flex; gap: 8px; }
.add-friend input { padding: .55em .8em; }
.side-sec h4, .side-sec summary {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 4px 0 8px; font-weight: 700; cursor: default;
}
.side-sec summary { cursor: pointer; }
.friend { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; position: relative; }
.friend:hover { background: var(--card); }
.friend .who { min-width: 0; flex: 1; line-height: 1.2; }
.friend .sub { color: var(--muted); font-size: .8rem; }
.friend.offline .avatar-wrap { opacity: .55; }
.friend .acts { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: .9rem; padding: 0;
}
.icon-btn:hover { border-color: var(--muted); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.ok { background: var(--ok); border-color: var(--ok); color: #082015; }
.avatar-wrap { position: relative; flex: none; }
.avatar-wrap .dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); border: 2px solid var(--bg-2);
}
.avatar-wrap .dot.on, .dot.online { background: var(--ok); }
/* ausente: lua amarela; ocupado: vermelho com traço; offline/invisível: anel cinza */
.dot.idle { background: radial-gradient(circle at 30% 30%, transparent 0 32%, var(--sun) 34%); }
.dot.busy { background: linear-gradient(var(--bg-2), var(--bg-2)) center / 55% 2px no-repeat, var(--danger); }
.dot.offline { background: var(--muted); box-shadow: inset 0 0 0 3px var(--bg-2); }
.me-status.online { color: var(--ok); }
.me-status.idle { color: var(--sun); }
.me-status.busy { color: var(--danger); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-items {
  position: absolute; right: 0; top: 36px; z-index: 5; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px; display: grid; min-width: 170px; box-shadow: var(--shadow);
}
/* O cartão do perfil fica no pé da coluna: o menu dele abre pra cima. */
.me .menu-items { top: auto; bottom: 36px; }
.menu-items button { text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu-items button:hover { background: var(--bg-2); }
.menu-items button.danger { color: var(--danger); }
.side-empty { color: var(--muted); font-size: .9rem; padding: 4px 8px; }

.home { padding: 44px 0 72px; max-width: 1040px; }
.home h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); letter-spacing: -.04em; margin-bottom: 8px; }
.home h1 .hl { background: linear-gradient(100deg, var(--accent), var(--sun)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
#hello-sub { font-size: 1.05rem; margin: 0; }
.sec-title { font: 600 .78rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sun); margin: 40px 0 14px; }
.online-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.online-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px;
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .15s;
}
.online-chip:hover { border-color: var(--ok); }
.online-chip b { font-size: .9rem; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.new-group { display: flex; gap: 10px; margin-top: 16px; max-width: 560px; }
.invite { padding: 64px 0; }
.mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }

dialog {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 22px;
  padding: 24px; width: min(440px, calc(100% - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(0 0 0 / .55); }
dialog h2 { font-size: 1.5rem; margin-bottom: 6px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.nick-input { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding-left: 12px; margin-top: 16px; }
.nick-input span { color: var(--muted); font-weight: 700; }
.nick-input input { border: 0; background: transparent; padding-left: 0; }
.nick-input input:focus { outline: none; }
.nick-input:focus-within { outline: 2px solid var(--accent); }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; min-height: 1.3em; }
.hint.bad { color: var(--danger); }
.nick-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .85rem; }
.nick-suggest:empty { display: none; }
.chip {
  font: 600 .85rem var(--body); color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.hint.good { color: var(--ok); }
.members { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.badge { font-size: .7rem; font-weight: 700; background: var(--sun); color: #1a0f08; padding: 2px 8px; border-radius: 999px; }
.gd-add-btn { margin: 4px 0 12px; }

/* Adicionar amigos no grupo */
dialog.add-dialog { width: min(460px, calc(100% - 32px)); }
.add-dialog input[type=search] { width: 100%; margin: 4px 0 10px; }
.add-list { display: grid; gap: 2px; max-height: min(52vh, 420px); overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.add-list .friend { padding: 8px; border-radius: 10px; }
.add-list .friend:hover { background: var(--bg-2); }
.add-list .done { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.add-empty { padding: 18px 8px; text-align: center; color: var(--muted); }
.add-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.add-foot .hint { margin: 0; flex: 1; }
select {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: .55em .8em; flex: 1; min-width: 0;
}

.ring {
  position: fixed; top: 20px; right: 20px; z-index: 20; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px;
  box-shadow: var(--shadow); animation: ring-in .25s ease-out;
}
.ring .avatar { animation: pulse 1.2s ease-in-out infinite; }
.ring-text { display: grid; line-height: 1.25; }
.ring-text span { font-size: .8rem; }
@keyframes ring-in { from { transform: translateY(-12px); opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(69 211 154 / .35); } }
@media (prefers-reduced-motion: reduce) { .ring, .ring .avatar { animation: none; } }
.btn.on { background: var(--ok); border-color: var(--ok); color: #082015; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; font-weight: 700; color: #1a0f08; background: var(--sun);
}
.avatar.big { width: 72px; height: 72px; font-size: 1.6rem; }

.room-card {
  --hue: 20;
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line); border-radius: 22px;
  padding: 10px 10px 16px; display: grid; gap: 12px; transition: translate .2s, border-color .2s, box-shadow .2s;
}
.room-card:hover { translate: 0 -3px; border-color: hsl(var(--hue) 70% 55% / .6); box-shadow: 0 18px 40px rgb(0 0 0 / .3); }
.room-card > :not(.cover) { margin-inline: 8px; }
.room-card .cover {
  position: relative; height: 96px; border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(120% 140% at 85% 120%, hsl(calc(var(--hue) + 40) 85% 62% / .9), transparent 55%),
    linear-gradient(135deg, hsl(var(--hue) 70% 32%), hsl(calc(var(--hue) + 25) 75% 48%));
}
.cover-letter { position: absolute; left: 14px; bottom: -10px; font: 800 4.2rem/1 var(--display); color: rgb(255 255 255 / .22); letter-spacing: -.05em; }
.live-pill {
  position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; background: rgb(0 0 0 / .45); color: #fff; font-size: .78rem; font-weight: 700;
}
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: live 1.8s ease-out infinite; }
.room-card h3 { font-size: 1.25rem; overflow-wrap: anywhere; }
.room-card .who { display: flex; align-items: center; gap: 6px; min-height: 32px; color: var(--muted); font-size: .9rem; }
.room-card.live .who { color: var(--ok); font-weight: 600; }
.room-card .who .avatar { width: 30px; height: 30px; font-size: .8rem; margin-right: -12px; border: 2px solid var(--card); }
.room-card .who .avatar:last-of-type { margin-right: 6px; }
.room-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty {
  color: var(--text); padding: 32px 24px; text-align: center; border: 1px dashed var(--line); border-radius: 22px;
  display: grid; justify-items: center; gap: 6px; grid-column: 1 / -1; background: color-mix(in srgb, var(--card) 50%, transparent);
}
.empty p { margin: 0; max-width: 40ch; }
.empty-art { font-size: 2.4rem; margin-bottom: 4px; }
.empty-line { color: var(--muted); margin: 0; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 999px; }

/* sala */
.room { display: grid; grid-template-columns: 1fr var(--chat-w, 300px); gap: 16px; height: var(--vh, 100dvh); padding: 16px 0; }
.room-main { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.room-head h2 { font-size: 1.7rem; letter-spacing: -.03em; overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; }
.room-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: live 1.8s ease-out infinite; flex: none; }
.stage { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-content: start; overflow: auto; }
.stage:empty { display: none; }
.screen-tile { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.screen-tile video { width: 100%; height: 100%; object-fit: contain; display: block; }
.screen-tile .label {
  position: absolute; left: 10px; bottom: 10px; background: rgb(0 0 0 / .6); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: .8rem;
}
.screen-tile .full { position: absolute; right: 10px; bottom: 10px; }
.screen-tile .stop { position: absolute; right: 10px; top: 10px; }
/* YouTube junto */
.yt-tile .yt-frame, .yt-tile .yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-tile .label { z-index: 2; }
.yt-bar { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; align-items: center; gap: 6px; }
.yt-tile .yt-bar .screen-vol { position: static; width: 110px; }
.yt-unblock { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 3; }
#yt-form .dialog-actions .primary { order: 1; }
.yt-queue { flex: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.yt-queue[hidden] { display: none; }
.yt-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yt-queue-head b { font-family: var(--display); font-size: .95rem; }
.yt-queue-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; counter-reset: fila; }
.yt-queue-item {
  counter-increment: fila; flex: none; width: 240px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 12px; padding: 6px 6px 6px 8px; animation: rise .25s ease-out both;
}
.yt-queue-item::before { content: counter(fila); color: var(--sun); font: 700 .8rem var(--display); }
.yt-queue-item img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: #000; }
.yt-queue-text { min-width: 0; flex: 1; display: flex; flex-direction: column; font-size: .8rem; line-height: 1.25; }
.yt-queue-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.yt-queue-empty { margin: 6px 0 0; font-size: .85rem; }
.screen-offer {
  aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px dashed var(--line); background: var(--bg-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px;
}
.screen-offer p { margin: 0; font-weight: 600; }
.screen-offer p.muted { font-weight: 400; }

#screen-dialog { width: min(520px, calc(100% - 32px)); }
.opt-title { font-weight: 700; margin: 16px 0 8px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.opt {
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--bg-2);
}
.opt input { grid-row: span 2; accent-color: var(--accent); }
.opt span { color: var(--muted); font-size: .8rem; }
.opt:has(input:checked) { border-color: var(--accent); }

.people { display: flex; flex-wrap: wrap; gap: 14px; align-content: flex-start; }
.stage:empty + .people { flex: 1; justify-content: center; align-content: center; gap: 28px; }
.person { width: 128px; display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.person .avatar { transition: box-shadow .12s; }
.person.speaking .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--ok); }
.person .pname { font-size: .85rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .muted-ico {
  position: absolute; top: 48px; right: 30px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--danger); color: #fff; display: grid; place-items: center;
}
.person .muted-ico svg { width: 14px; height: 14px; }
/* Com câmera ligada, o vídeo ocupa o lugar do avatar. */
.person.cam { width: 220px; }
.person.cam .avatar { display: none; }
.cam-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; background: #000; transition: box-shadow .12s; }
.cam-video.mirror { transform: scaleX(-1); }
.person.cam.speaking .cam-video { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--ok); }
.person.cam .muted-ico { top: 8px; right: 8px; }
/* Volume por pessoa */
.person.remote { cursor: pointer; }
.person.silenced .avatar, .person.silenced .cam-video { opacity: .4; }
.person.silenced .pname::after { content: " · silenciado"; color: var(--muted); font-weight: 400; }
.vol-pop {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 6; width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow);
  display: grid; gap: 8px; text-align: left; cursor: default;
}
.vol-pop input[type=range], .screen-vol { accent-color: var(--accent); width: 100%; }
.screen-tile .screen-vol { position: absolute; left: 10px; top: 10px; width: 120px; opacity: .85; }

/* Configurações de áudio */
.field { display: grid; gap: 6px; font-weight: 600; margin-top: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 18px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.meter { position: relative; flex: 1; height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.meter span.below { background: var(--muted); }
.meter i { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--sun); }
.meter-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.meter-row .btn.on { background: var(--ok); border-color: var(--ok); color: #082015; }
/* Configurações: abas na lateral (vira faixa no topo no celular) */
dialog.settings { width: min(920px, calc(100% - 32px)); height: min(680px, calc(var(--vh, 100dvh) - 32px)); padding: 0; overflow: hidden; }
.settings-layout { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.settings-nav { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 12px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.settings-nav h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 10px; }
.settings-nav [role=tablist] { display: flex; flex-direction: column; gap: 2px; }
.settings-nav [role=tab] { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font: 600 .95rem var(--body); cursor: pointer; }
.settings-nav [role=tab]:hover { background: var(--card); color: var(--text); }
.settings-nav [role=tab][aria-selected=true] { background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.settings-nav [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings-body { position: relative; overflow-y: auto; padding: 26px 32px 32px; }
.settings-body h3 { font-size: 1.35rem; margin: 0 0 16px; }
.settings-body section { max-width: 560px; }
.settings-close { position: sticky; top: 0; float: right; margin: -8px -14px 0 0; z-index: 1; }
@media (max-width: 640px) {
  dialog.settings { height: calc(var(--vh, 100dvh) - 16px); width: calc(100% - 16px); }
  .settings-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; gap: 8px; }
  .settings-nav [role=tablist] { flex-direction: row; overflow-x: auto; }
  .settings-nav [role=tab] { white-space: nowrap; }
  .settings-nav [role=tab][aria-selected=true] { box-shadow: inset 0 -3px 0 var(--accent); }
  .settings-body { padding: 18px 16px 24px; }
}

/* Configurações → Sons */
.sound-list { display: grid; gap: 2px; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.sound-row:hover { background: var(--bg-2); }
.sound-row .check { flex: 1; margin: 0; }
.sound-list.off { opacity: .45; }

/* Configurações → App para Windows */
.app-perks { margin: 4px 0 18px; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.app-perks b { color: var(--text); }
.app-sha { word-break: break-all; font-family: ui-monospace, monospace; font-size: .75rem; }

/* Colunas redimensionáveis */
.panel { position: relative; }
.resizer { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; touch-action: none; }
.resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, .resizer:focus-visible::after, .resizer.dragging::after { background: var(--accent); }
.resizer:focus-visible { outline: none; }
.resizer-panel { right: -4px; }
.room { position: relative; }
.resizer-chat { right: calc(var(--chat-w, 300px) + 4px); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }

/* Acessibilidade (Configurações → Acessibilidade) */
html.a11y-contrast { --muted: #cfcfd4; --line: #4a4a52; --text: #fff; --bg-2: #101012; --card: #1b1b1f; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
html.a11y-focus :focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px !important; }
html.a11y-underline a { text-decoration: underline !important; }
dialog.settings .opt-title { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
dialog.settings .opt-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 6px; }
dialog.settings input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 8px; }
dialog.settings input[type=range]:disabled { opacity: .4; }
dialog.settings .row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.field output { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 6px; }
#btn-audio, #btn-deaf { padding: .9em; }

/* Controles da sala numa barra flutuante */
.controls {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-self: center;
  padding: 8px; border-radius: 999px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.controls .btn { padding: .85em 1.15em; border-color: transparent; background: var(--bg-2); }
.controls .btn:hover { border-color: var(--line); }
.controls .btn.danger { background: var(--danger); color: #fff; }
.controls .btn.off { background: var(--danger); border-color: var(--danger); color: #fff; }
.controls .btn.on { background: var(--ok); border-color: var(--ok); color: #082015; }
.controls { position: relative; }
#btn-sfx[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

/* Entrada do grupo e cena da sala: a roda debaixo do varal de luzinhas, numa noite de resenha */
.lobby { padding: 32px 0 48px; max-width: 1040px; display: grid; gap: 22px; }
.lobby[hidden] { display: none; }
.lobby .scene { min-height: min(440px, 56vh); }
.lobby-info h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
.lobby-info p { margin: 4px 0 16px; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.scene, .room-main:not(:has(.stage > *, .person.cam)) > .people {
  --hue: 24; position: relative; display: block; flex: 1; min-height: 320px; isolation: isolate;
  border-radius: var(--radius); border: 1px solid var(--line); color: #f7eee3;
  background:
    radial-gradient(ellipse 30% 20% at 50% 56%, rgb(255 165 80 / .32), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 115%, hsl(var(--hue) 60% 40% / .30), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% -10%, rgb(110 80 160 / .25), transparent 70%),
    linear-gradient(180deg, #0e0a14 0%, #17110f 55%, #20150e 100%);
}
/* Varal de luzinhas */
.scene::before, .room-main:not(:has(.stage > *, .person.cam)) > .people::before {
  content: ""; position: absolute; inset: 14px 6% auto; height: 34px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 70%, #ffd98a 0 3px, rgb(255 200 110 / .5) 4.5px, transparent 11px) 0 0 / 52px 34px repeat-x,
    linear-gradient(rgb(255 255 255 / .12), rgb(255 255 255 / .12)) 0 23px / 100% 1px no-repeat;
  animation: twinkle 2.8s ease-in-out infinite alternate;
}
/* Mesinha com a vela no meio da roda */
.scene::after, .room-main:not(:has(.stage > *, .person.cam)) > .people::after {
  content: ""; position: absolute; left: 50%; top: 56%; width: min(30%, 260px); aspect-ratio: 2.6; z-index: -1;
  translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, #ffe4a3 0 3px, rgb(255 190 90 / .7) 5px, rgb(255 150 60 / .18) 26%, transparent 46%),
    radial-gradient(ellipse at 50% 40%, #4a301d, #2a1a10 70%);
  box-shadow: 0 0 70px rgb(255 150 60 / .22), inset 0 -8px 14px rgb(0 0 0 / .45);
}
@keyframes twinkle { from { opacity: .75; } to { opacity: 1; } }
.scene > .person, .room-main:not(:has(.stage > *, .person.cam)) > .people > .person {
  --a: calc(var(--i, 0) / var(--n, 1) * 1turn + .25turn);
  position: absolute; left: calc(50% + 36% * cos(var(--a))); top: calc(54% + 28% * sin(var(--a)));
  translate: -50% -50%; transition: left .4s ease, top .4s ease;
}
.scene .pname { color: #f7eee3; text-shadow: 0 1px 3px rgb(0 0 0 / .7); }
.scene-empty {
  position: absolute; left: 50%; top: 80%; translate: -50% -50%; margin: 0;
  color: rgb(247 238 227 / .55); font-size: .9rem; font-style: italic;
}
@media (prefers-reduced-motion: reduce) {
  .scene::before, .room-main:not(:has(.stage > *, .person.cam)) > .people::before { animation: none; }
  .scene > .person, .room-main .people > .person { transition: none; }
}

/* Botões de som */
.sfx-pop {
  position: absolute; bottom: calc(100% + 12px); left: 50%; translate: -50% 0; z-index: 8; width: min(360px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  display: grid; gap: 12px; animation: rise .2s ease-out both;
}
.sfx-pop[hidden] { display: none; }
.sfx-pop.below { bottom: auto; top: calc(100% + 12px); }
.sfx-pop > b { font-family: var(--display); }
.sfx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sfx-btn {
  display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: 600 .78rem var(--body);
  transition: transform .08s, border-color .12s;
}
.sfx-btn:hover { border-color: var(--accent); }
.sfx-btn:active { transform: scale(.94); }
.sfx-emoji { font-size: 1.6rem; line-height: 1.2; }
.sfx-foot { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; font-size: .85rem; }
.sfx-foot input[type=range] { accent-color: var(--accent); }
.sfx-foot .check { grid-column: 1 / -1; margin-top: 0; font-weight: 500; }
.sfx-bubble {
  position: absolute; top: -6px; left: 50%; z-index: 4; font-size: 2rem; pointer-events: none;
  animation: sfx-float 1.6s ease-out forwards;
}
@keyframes sfx-float {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, -8px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -54px) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .sfx-bubble { animation-duration: 1.2s; animation-timing-function: steps(1); } }

/* ---------- chat (ao lado da chamada e na tela de texto) ---------- */
.chat {
  position: relative; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(12px); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1; min-width: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tool {
  flex: none; width: 36px; height: 36px; border-radius: 12px; border: 0; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; padding: 0; font: 800 .72rem/1 var(--body); letter-spacing: .04em;
  transition: background .15s, color .15s;
}
.chat-tool:hover { background: var(--bg-2); color: var(--text); }
.chat-tool svg { width: 19px; height: 19px; }
.chat-tool.primary { background: var(--accent); color: var(--accent-ink); }
.chat-tool.primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); color: var(--accent-ink); }
.chat-tool.gif-btn { border: 1.5px solid currentColor; width: auto; height: 24px; padding: 0 6px; border-radius: 7px; margin: 0 2px; }
.chat-tool[hidden] { display: none; }

.chat-search { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.chat-search[hidden] { display: none; }
.chat-search input { flex: 1; min-width: 0; padding: .55em .8em; }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.chat-day {
  align-self: center; margin: 12px 0 6px; padding: 3px 12px; border-radius: 999px; background: var(--bg-2);
  color: var(--muted); font-size: .74rem; font-weight: 600; letter-spacing: .02em;
}
.chat-empty, .chat-more { margin: auto; color: var(--muted); font-size: .88rem; text-align: center; padding: 20px; }
.chat-more { margin: 0 auto 4px; padding: 4px; font-size: .74rem; }
.chat-log .sys { color: var(--muted); font-size: .78rem; text-align: center; padding: 4px 0; }

.msg {
  position: relative; align-self: flex-start; max-width: min(88%, 520px); margin-top: 8px; padding: 7px 12px 8px;
  border-radius: 6px 18px 18px 18px; background: var(--bg-2); animation: rise .22s ease-out both;
}
.msg.cont { margin-top: 2px; border-top-left-radius: 18px; }
.msg.mine { align-self: flex-end; border-radius: 18px 6px 18px 18px; background: color-mix(in srgb, var(--accent) 22%, var(--bg-2)); }
.msg.mine.cont { border-top-right-radius: 18px; }
.msg.pending { opacity: .75; }
.msg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.msg-head .avatar.tiny { width: 18px; height: 18px; font-size: .55rem; }
.msg-head b { font-size: .8rem; color: var(--sun); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.mine .msg-head b { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.msg-head time { color: var(--muted); font-size: .7rem; }
.msg-text { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.4; }
.msg-text a { color: var(--sun); text-decoration: underline; text-underline-offset: 2px; }
.msg.k-image, .msg.k-gif { padding: 5px; }
.msg.k-image .msg-head, .msg.k-gif .msg-head { padding: 2px 7px 3px; }
.msg-media { display: block; padding: 0; border: 0; background: none; border-radius: 13px; overflow: hidden; cursor: zoom-in; }
.msg-media.gif { cursor: default; }
.msg-media img { display: block; width: auto; height: auto; max-width: 100%; max-height: 300px; min-width: 60px; min-height: 40px; background: var(--card); }
.msg-audio { display: flex; align-items: center; gap: 8px; }
.msg-audio audio { height: 36px; max-width: 240px; }
.msg-dur { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.msg-file {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; margin: 2px 0; border-radius: 12px;
  background: var(--card); color: var(--text); text-decoration: none; border: 1px solid var(--line); max-width: 300px;
}
.msg-file:hover { border-color: var(--muted); }
.msg-file-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--sun) 20%, transparent); color: var(--sun); }
.msg-file-ico svg { width: 20px; height: 20px; }
.msg-file-info { min-width: 0; display: flex; flex-direction: column; }
.msg-file-info b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-info small { color: var(--muted); font-size: .74rem; }
.msg-upload { display: grid; gap: 6px; font-size: .86rem; min-width: 180px; }
.msg-upload .btn { justify-self: start; }
.msg-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.msg-progress::after { content: ""; display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width .2s; }
.msg-del {
  position: absolute; top: 50%; translate: 0 -50%; right: calc(100% + 4px); width: 30px; height: 30px; border-radius: 50%;
  opacity: 0; transition: opacity .15s; background: var(--card);
}
.msg-del svg { width: 15px; height: 15px; }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.msg-del:hover { color: var(--danger); }
@media (hover: none) { .msg-del { opacity: .55; } }

.chat-newer {
  position: absolute; left: 50%; bottom: 76px; translate: -50% 0; z-index: 2; border: 0; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 .8rem var(--body); box-shadow: var(--shadow);
}
.chat-newer[hidden] { display: none; }

.chat-compose { display: flex; align-items: flex-end; gap: 2px; padding: 8px; border-top: 1px solid var(--line); }
.chat-compose[hidden] { display: none; }
.chat-compose textarea {
  flex: 1; min-width: 0; min-height: 0; height: 40px; max-height: 140px; resize: none; padding: .58em .85em; margin: 0 4px;
  border-radius: 14px; line-height: 1.4; overflow-y: hidden;
}
.chat-compose .chat-tool { height: 40px; }
.chat-compose .chat-tool.gif-btn { height: 24px; margin-bottom: 8px; }

.chat-rec { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); }
.chat-rec[hidden] { display: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: live 1.4s ease-out infinite; }
.rec-label { font-weight: 600; }
.rec-time { flex: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-rec .chat-tool { height: 40px; width: 40px; }

.gif-pop {
  position: absolute; left: 8px; right: 8px; bottom: 60px; margin-left: auto; max-width: 440px; z-index: 3; display: flex; flex-direction: column; gap: 8px;
  max-height: min(360px, 70%); padding: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.gif-pop[hidden] { display: none; }
.gif-grid { flex: 1; min-height: 0; overflow-y: auto; columns: 3 110px; column-gap: 6px; }
.gif-item { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--bg-2); break-inside: avoid; }
.gif-item img { display: block; width: 100%; height: auto; }
.gif-item:hover { outline: 2px solid var(--accent); }
.gif-note { color: var(--muted); font-size: .86rem; padding: 12px; text-align: center; column-span: all; }
.gif-credit { color: var(--muted); font-size: .68rem; text-align: right; letter-spacing: .04em; }

.chat-drop {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; border-radius: inherit; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px dashed var(--accent); color: var(--text); font: 700 1.1rem var(--display);
}
.chat-drop[hidden] { display: none; }

/* tela de texto: "# geral" do grupo ou conversa com amigo */
.text-view { display: flex; flex-direction: column; gap: 14px; height: var(--vh, 100dvh); padding: 18px 0; max-width: 1100px; }
.text-view[hidden] { display: none; }
.text-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.text-who { min-width: 0; }
.text-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.text-head p { margin: 2px 0 0; font-size: .9rem; }
.text-actions { display: flex; gap: 8px; }
.text-actions .btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.text-actions .btn:has(> svg:only-child) { padding-inline: .7em; }
.chat.big { flex: 1; }
.chat.big .chat-head { display: none; }

/* não lidas */
.rail-unread {
  position: absolute; right: -5px; top: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font: 700 .68rem/16px var(--body); border: 2px solid var(--bg); text-align: center;
}
.count {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff;
  font: 700 .68rem/19px var(--body); text-align: center;
}
.channel.unread .channel-name { color: var(--text); font-weight: 700; }
.channel-ico + .channel-name { flex: 1; }
/* a linha toda do amigo é clicável (abre a conversa); os botões ficam por cima */
.friend-open { position: absolute; inset: 0; border: 0; background: none; border-radius: inherit; cursor: pointer; padding: 0; }
.friend .acts, .friend .avatar-wrap { position: relative; z-index: 1; }
.friend .acts { pointer-events: auto; }
.friend .who { display: grid; grid-template-columns: 1fr auto; column-gap: 6px; align-items: center; pointer-events: none; }
.friend .who .sub { grid-column: 1; }
.friend .who .count { grid-column: 2; grid-row: 1 / span 2; }
.friend.unread .name { font-weight: 800; }
.friend.active { background: var(--card); }

/* foto aberta */
.lightbox { width: fit-content; max-width: calc(100% - 24px); max-height: calc(var(--vh, 100dvh) - 24px); padding: 0; display: none; background: none; border: 0; box-shadow: none; }
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox[open] { display: flex; flex-direction: column; gap: 10px; }
.lightbox img { display: block; max-width: 100%; max-height: calc(var(--vh, 100dvh) - 110px); object-fit: contain; border-radius: 12px; margin: auto; cursor: zoom-out; }
.lightbox-bar { display: flex; justify-content: flex-end; gap: 8px; }

/* App de Windows: aviso de versão nova (fica até a pessoa escolher). */
.update-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; animation: ring-in .25s ease-out;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 36px);
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  padding: 10px 12px 10px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600;
}

.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 30; animation: ring-in .25s ease-out;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
}

@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 16px 0 64px; min-height: 0; }
  .hero-side > * { grid-area: auto; }
  .hero-side { gap: 18px; }
  .login-card { order: -1; margin-top: 0; justify-self: stretch; width: 100%; }
  .mock { justify-self: center; width: 100%; rotate: 0deg; }
  .mock.reveal { animation-name: rise; }
  .bento { grid-template-columns: 1fr; }
  .feature.big { grid-column: auto; grid-row: auto; }
  .privacy { grid-template-columns: 1fr; gap: 16px; }
  section.block { padding: 64px 0; }
  .nav nav a:not(.btn) { display: none; }
  .room { grid-template-columns: 1fr; height: auto; }
  .room > .chat { height: 70dvh; }
  .text-view { height: calc(var(--vh, 100dvh) - 61px); padding: 12px 0 10px; }
  .text-head h1 { font-size: 1.35rem; }
  .stage { grid-template-columns: 1fr; }
  .new-group { flex-direction: column; }
  .layout { grid-template-columns: 1fr; }
  .main { padding: 0 16px 76px; }
  .only-mobile { display: flex !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; max-width: 94vw; z-index: 15;
    transform: translateX(-100%); transition: transform .2s;
  }
  .rail { width: 64px; }
  .panel { width: min(272px, calc(94vw - 64px)); }
  .resizer { display: none; }
  .scene, .room-main:not(:has(.stage > *, .person.cam)) > .people { min-height: 300px; }
  .scene > .person, .room-main .people > .person { width: 96px; }
  .controls { border-radius: 22px; gap: 6px; }
  .controls .btn { padding: .7em .95em; font-size: .88rem; }
  .scene .avatar.big, .room-main .people .avatar.big { width: 56px; height: 56px; font-size: 1.25rem; }
  .voice-pill:not([hidden]) {
    display: flex; align-items: center; gap: 8px; position: fixed; left: 16px; right: 16px; bottom: 14px; z-index: 12;
    padding: 12px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line));
    background: color-mix(in srgb, var(--ok) 14%, var(--card)); color: var(--text); font: 600 .9rem var(--body);
    box-shadow: var(--shadow); cursor: pointer;
  }
  .voice-pill b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
  .voice-pill .voice-time { color: var(--muted); font-variant-numeric: tabular-nums; }
  .voice-pill .voice-back { color: var(--ok); }
  .voice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: live 1.8s ease-out infinite; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .5); z-index: 14; display: none !important; }
  .sidebar.open + .scrim { display: block !important; }
  .ring { left: 16px; right: 16px; top: 16px; flex-wrap: wrap; }
}
