/* ==========================================================
   COMUNIDADE — chat. Mobile primeiro, no mesmo estilo "adesivo" do app.
   ========================================================== */
.com { display: flex; flex-direction: column; gap: var(--s4); max-width: 760px; margin-inline: auto; }
.com__head h1 { font-size: var(--fs-h2); }
.com__head p { color: var(--muted); font-size: .9375rem; }

/* ---------- Feel de celular na mão, sentado na borda do chat ---------- */
.csit { position: relative; z-index: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: -16px; padding-top: var(--s2); }
.csit__say {
  align-self: center; margin-bottom: var(--s6); max-width: 54%;
  padding: var(--s2) var(--s3); background: var(--paper); border: var(--line); border-radius: var(--r-md); border-bottom-right-radius: 4px;
  font-weight: 600; font-size: .875rem; line-height: 1.3; box-shadow: var(--shadow-sm);
}
.csit__say.pop { animation: l-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.csit__fig { position: relative; width: 158px; flex: none; margin-right: var(--s2); }
.csit__bob { position: relative; transform-origin: 50% 100%; animation: c-nod 2.2s ease-in-out infinite; }
.csit__bob img { display: block; width: 100%; height: auto; }
.csit__fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.csit__ping path { transform-box: fill-box; transform-origin: 0 100%; animation: c-ping 2.6s ease-in-out infinite; }
.csit__ping path:nth-child(2) { animation-delay: .12s; } .csit__ping path:nth-child(3) { animation-delay: .24s; }
.csit__tap circle { fill: none; stroke: #FFFAEB; stroke-width: 7; transform-box: fill-box; transform-origin: center; opacity: 0; animation: l-ripple 1.8s ease-out infinite; }
.csit__tap .r2 { animation-delay: .35s; }
.csit__emo { position: absolute; z-index: 2; left: 52%; top: 18%; font-size: 1.3rem; line-height: 1; opacity: 0; pointer-events: none; animation: c-emo 5s ease-out infinite; }
.csit__emo--1 { animation-delay: 0s; } .csit__emo--2 { left: 62%; animation-delay: 1s; } .csit__emo--3 { left: 46%; animation-delay: 2s; } .csit__emo--4 { left: 70%; animation-delay: 3s; } .csit__emo--5 { left: 56%; animation-delay: 4s; }
.csit.is-ping .csit__bob { animation: c-jump .6s cubic-bezier(.3, 1.5, .5, 1); }
.csit.is-ping .csit__ping path { animation: c-ping-fast .5s ease-out 2; }

@keyframes c-nod { 0%, 100% { transform: translateY(0) rotate(-.8deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@keyframes c-ping { 0%, 55%, 100% { opacity: 0; transform: scale(.4); } 62%, 85% { opacity: 1; transform: scale(1); } }
@keyframes c-ping-fast { 0% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1); } }
@keyframes c-jump { 0% { transform: translateY(0); } 35% { transform: translateY(-10px) rotate(-2deg); } 100% { transform: translateY(0); } }
@keyframes c-emo { 0% { opacity: 0; transform: translate(0, 0) scale(.4) rotate(0); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -120px) scale(1.15) rotate(16deg); } }

/* ---------- regras ---------- */
.com__rules { background: var(--paper); border: var(--line); border-radius: var(--r-md); }
.com__rules summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); font-weight: 700; min-height: var(--tap); align-items: center; }
.com__rules summary::-webkit-details-marker { display: none; }
.com__rules summary::after { content: "+"; font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.com__rules[open] summary::after { transform: rotate(45deg); }
.com__rules ul { display: flex; flex-direction: column; gap: var(--s2); padding: 0 var(--s4) var(--s4) calc(var(--s4) + 1.1rem); font-size: .875rem; color: #4a443d; list-style: disc; margin: 0; }

/* ---------- mensagens ---------- */
.clog { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--s3); min-height: 260px; padding: var(--s4) var(--s3); background: var(--paper); border: var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.cload { margin: auto; color: var(--muted); }
.cempty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; color: #4a443d; max-width: 30ch; padding: var(--s4) 0; }
.cempty img { height: 110px; width: auto; }

.cmsg { display: flex; align-items: flex-end; gap: var(--s2); max-width: 90%; animation: l-pop .3s ease-out; }
.cmsg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.cmsg__av { flex: none; width: 36px; height: 36px; border-radius: 50%; border: var(--line); background: var(--yellow); object-fit: cover; }
.cmsg__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmsg.is-mine .cmsg__body { align-items: flex-end; }
.cmsg__meta { display: flex; gap: var(--s2); align-items: baseline; font-size: .75rem; color: var(--muted); }
.cmsg__meta strong { color: var(--ink); font-size: .8125rem; }
.cmsg__text { position: relative; padding: var(--s2) var(--s3); background: var(--cream); border: var(--line); border-radius: 16px; border-bottom-left-radius: 4px; font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); }
.cmsg.is-mine .cmsg__text { background: var(--yellow); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.cmsg__text.is-spoiler { cursor: pointer; }
.cmsg__text.is-spoiler span { filter: blur(6px); transition: filter .2s; user-select: none; }
.cmsg__text.is-spoiler em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: .75rem; font-weight: 700; }
.cmsg__text.is-spoiler.is-open span { filter: none; user-select: text; }
.cmsg__text.is-spoiler.is-open em { display: none; }
.cmsg__act button { padding: 2px var(--s1); background: none; border: 0; font-size: .6875rem; color: var(--muted); text-decoration: underline; min-height: 24px; }
.cmsg__act button:disabled { text-decoration: none; }

/* ---------- escrever ---------- */
.ccomp { position: sticky; z-index: 10; bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s2)); padding: var(--s3) 0 var(--s1); background: linear-gradient(to top, var(--cream) 75%, rgba(245, 237, 220, 0)); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.ccomp__row { display: flex; gap: var(--s2); align-items: center; }
.ccomp__in { flex: 1; min-width: 0; height: 52px; padding: 0 var(--s4); background: var(--paper); border: var(--line); border-radius: var(--r-pill); font-size: 1rem; box-shadow: var(--shadow-sm); }
.ccomp__in:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.cchip { flex: none; min-height: 40px; padding: 0 var(--s3); background: var(--paper); border: var(--line); border-radius: var(--r-pill); font-size: .8125rem; font-weight: 700; }
.cchip[aria-pressed="true"] { background: var(--pink); }
.ccomp .btn--icon { width: 52px; min-height: 52px; }
.ccomp.is-busy { opacity: .7; pointer-events: none; }
.ccomp__err { min-height: 0; margin-bottom: var(--s2); color: var(--red); font-size: .8125rem; font-weight: 600; }
.ccomp__err:empty { display: none; }
.cnew { position: sticky; z-index: 11; bottom: calc(var(--tabbar-h) + var(--safe-b) + 86px); align-self: center; padding: var(--s2) var(--s4); background: var(--ink); color: var(--paper); border: 0; border-radius: var(--r-pill); font-weight: 700; font-size: .8125rem; box-shadow: var(--shadow-sm); }
.cnew[hidden] { display: none; }

@media (min-width: 600px) {
  .csit__fig { width: 196px; }
  .csit__say { font-size: .9375rem; }
  .csit { margin-bottom: -20px; }
  .clog { padding: var(--s5) var(--s4); }
}
@media (min-width: 960px) {
  .csit__fig { width: 230px; }
  .ccomp { bottom: var(--s3); margin-inline: 0; padding-inline: 0; }
  .cnew { bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .csit__bob, .csit__ping path, .csit__tap circle, .csit__emo, .cmsg { animation: none !important; }
  .csit__ping path { opacity: 1; } .csit__emo, .csit__tap { display: none; }
}
.ccomp.is-off { opacity: .55; }
