:root {
  --bg: #15110e;
  --bg-2: #1f1915;
  --card: #261f1a;
  --line: #3a3029;
  --text: #f6ede2;
  --muted: #b8a999;
  --accent: #ff7a3d;
  --accent-ink: #1a0f08;
  --sun: #ffc857;
  --ok: #45d39a;
  --danger: #ff5a5f;
  --radius: 18px;
  --shadow: 0 10px 30px rgb(0 0 0 / .35);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf5ee; --bg-2: #f3e9dd; --card: #ffffff; --line: #e6d8c8;
    --text: #23180f; --muted: #6f5f50; --accent: #e85d1f; --accent-ink: #fff;
    --shadow: 0 10px 30px rgb(80 50 20 / .12);
    color-scheme: light;
  }
}

* { 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%;
}
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

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

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 56px 0 72px; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 32ch; margin: 20px 0 28px; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* mock de sala no hero */
.mock {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 20px; box-shadow: var(--shadow); transform: rotate(1.5deg);
}
.mock-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-weight: 600; }
.mock-live { font-size: .8rem; color: var(--ok); display: flex; align-items: center; gap: 6px; }
.mock-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.mock-screen {
  aspect-ratio: 16 / 9; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, #2b6cb0, #6b46c1 55%, #ff7a3d);
  display: grid; place-items: center; color: #fff; font: 700 1.1rem var(--display);
}
.mock-people { display: flex; gap: 10px; }
.mock-people span {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #1a0f08;
}
.mock-people span.talk { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ok); }

section.block { padding: 72px 0; border-top: 1px solid var(--line); }
section.block h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
section.block > .wrap > p { color: var(--muted); max-width: 60ch; margin: 0 0 36px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature .ico { font-size: 1.6rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.2rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); }

.enter-card {
  max-width: 440px; margin: 0 auto; text-align: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 26px; padding: 32px 24px; box-shadow: var(--shadow);
}
.enter-card h2 { margin-bottom: 8px; }
/* 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). */
.enter-card .gbtn { display: flex; justify-content: center; min-height: 44px; margin: 22px 0 8px; color-scheme: light; }
.dev-login { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.dev-login small { color: var(--muted); }
.form-error { color: var(--danger); min-height: 1.5em; margin: 8px 0 0; font-size: .9rem; }

.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: 290px 1fr; min-height: 100dvh; }
.main { min-width: 0; padding: 0 24px; }
.only-mobile { display: none !important; }

.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px;
  display: flex; flex-direction: column; gap: 14px; height: 100dvh; position: sticky; top: 0; overflow-y: auto;
}
.side-top { display: flex; justify-content: space-between; align-items: center; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.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; }
.side-link {
  text-align: left; background: none; border: 0; color: var(--text); font: 600 .95rem var(--body);
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
}
.side-link:hover, .side-link.active { background: var(--card); }
.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 { background: var(--ok); }
.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);
}
.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: 36px 0 64px; max-width: 980px; }
.home h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 6px; }
.sec-title { font-size: 1.1rem; margin: 32px 0 12px; }
.online-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.online-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.online-chip b { font-size: .9rem; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.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 { display: flex; gap: 8px; margin-top: 14px; }
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 {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: grid; gap: 12px;
}
.room-card h3 { font-size: 1.2rem; overflow-wrap: anywhere; }
.room-card .who { display: flex; align-items: center; gap: 6px; min-height: 36px; color: var(--muted); font-size: .9rem; }
.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(--muted); padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }

/* sala */
.room { display: grid; grid-template-columns: 1fr 300px; gap: 16px; height: 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.5rem; overflow-wrap: anywhere; }
.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; }

.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: 104px; 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: 18px; 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; }

.controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.controls .btn { padding: .9em 1.2em; }
.controls .btn.off { background: var(--danger); border-color: var(--danger); color: #fff; }
.controls .btn.on { background: var(--ok); border-color: var(--ok); color: #082015; }

.chat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.chat h3 { font-size: 1rem; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-log .msg b { font-size: .85rem; }
.chat-log .msg time { color: var(--muted); font-size: .75rem; margin-left: 6px; }
.chat-log .msg p { margin: 2px 0 0; overflow-wrap: anywhere; }
.chat-log .sys { color: var(--muted); font-size: .85rem; font-style: italic; }
.chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10;
  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: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .mock { transform: none; }
  .nav nav a:not(.btn) { display: none; }
  .room { grid-template-columns: 1fr; height: auto; }
  .chat { height: 360px; }
  .stage { grid-template-columns: 1fr; }
  .new-group { flex-direction: column; }
  .layout { grid-template-columns: 1fr; }
  .main { padding: 0 16px; }
  .only-mobile { display: flex !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); z-index: 15;
    transform: translateX(-100%); transition: transform .2s;
  }
  .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; }
}
