/* ===== Telepatia (Atividade aberta numa call) =====
   Herda o topo, os botões, o saguão e as folhas do Império. O que é só daqui: o céu
   do sonho e as cartas, com a cor do time. */
.telepatia {
  --te-a: #4c9bff; --te-a-2: #1b4fa8; --te-b: #ff5277; --te-b-2: #a81d43; --te-n: #8d93a8; --te-p: #0a0509;
  position: fixed; inset: 0; z-index: 4; overflow: hidden; color: var(--im-marfim); background: #070716;
}
.telepatia.em-partida .im-saguao { display: none; }
.te-fundo { position: absolute; inset: 0; pointer-events: none; transition: background 1s;
  background: radial-gradient(120% 80% at 50% 10%, #241a55, #0d0b28 58%, #05040f); }
.telepatia.vez-A .te-fundo { background: radial-gradient(120% 80% at 50% 10%, #173a78, #0b1230 58%, #05040f); }
.telepatia.vez-B .te-fundo { background: radial-gradient(120% 80% at 50% 10%, #66183c, #220a22 58%, #05040f); }
.te-estrelas { position: absolute; inset: 0; opacity: .55;
  background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 72% 12%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 38% 64%, #fff, transparent), radial-gradient(1px 1px at 86% 58%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 22% 86%, #fff, transparent), radial-gradient(1px 1px at 58% 34%, #fff, transparent); }

.te-palco { position: absolute; display: grid; gap: 8px; justify-items: center; align-content: start; overflow-y: auto; overscroll-behavior: contain;
  inset: calc(var(--im-pad) + 58px) max(8px, var(--in-right, 0px)) max(8px, var(--in-bottom, 0px)) max(8px, var(--in-left, 0px)); }
.telepatia:not(.em-partida) .te-palco { display: none; }
.te-palco > * { width: min(100%, 720px); }

/* ----- placar ----- */
.te-placar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.te-lado { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px; border-radius: 12px; opacity: .62;
  background: rgba(255,255,255,.05); border: 1.5px solid transparent; transition: opacity .3s, border-color .3s, box-shadow .3s; }
.te-lado.B { flex-direction: row-reverse; text-align: right; }
.te-lado b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.te-lado.A b { color: var(--te-a); }
.te-lado.B b { color: var(--te-b); }
.te-lado span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.te-lado.vez { opacity: 1; }
.te-lado.A.vez { border-color: var(--te-a); box-shadow: 0 0 16px rgba(76,155,255,.4); }
.te-lado.B.vez { border-color: var(--te-b); box-shadow: 0 0 16px rgba(255,82,119,.4); }
.te-meio { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); }

/* ----- a pista ----- */
.te-pista { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 62px; padding: 6px 12px 8px; box-sizing: border-box;
  border-radius: 12px; background: rgba(8,8,26,.62); border: 1px solid rgba(255,255,255,.12); text-align: center; }
.te-pista small { font-size: 12px; color: rgba(255,255,255,.66); }
.te-pista-linha { display: flex; align-items: center; gap: 10px; }
.te-pista-palavra { font-size: clamp(22px, 6vw, 30px); font-weight: 900; letter-spacing: .05em; color: #fff; }
.te-pista-numero { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; font-weight: 900; color: #120a2a; background: linear-gradient(145deg, #ffe680, #e0a81c); }
/* A pista chega letra por letra, como uma transmissão. */
.te-pista-palavra i { display: inline-block; font-style: normal; }
.te-pista.nova .te-pista-palavra i { animation: te-letra .42s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes te-letra { from { transform: translateY(-14px) scale(1.7); opacity: 0; filter: blur(5px); } }
.te-pista.nova .te-pista-numero { animation: te-letra .5s cubic-bezier(.2, 1.5, .4, 1) .55s both; }
.te-pista .im-tempo { width: 100%; }
/* Escolha do Oráculo (regra "Time escolhe"): o time toca em quem quer. */
.te-votos-oraculo { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 2px 0; }
.te-voto { position: relative; display: grid; justify-items: center; gap: 3px; width: 66px; padding: 6px 2px 5px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.28); color: rgba(255,255,255,.82); font: 700 11.5px var(--im-sans); }
.te-voto .ava { width: 34px; height: 34px; font-size: 13px; }
.te-voto span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-voto i { position: absolute; top: -5px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; box-sizing: border-box;
  font: 900 11px/18px var(--im-sans); font-style: normal; color: #120a2a; background: linear-gradient(145deg, #ffe680, #e0a81c); }
.te-voto.on { border-color: #ffe680; background: rgba(255,230,128,.14); box-shadow: 0 0 16px -4px rgba(255,230,128,.7); color: #fff; }
.te-fim { font-size: 22px; font-weight: 900; }
.te-fim.A { color: var(--te-a); }
.te-fim.B { color: var(--te-b); }

/* O Oráculo escreve aqui: fica em cima, longe do teclado. */
.te-form { display: grid; gap: 6px; padding: 8px; box-sizing: border-box; border-radius: 12px; background: rgba(40,28,90,.8); border: 1.5px solid #ffd24a; }
.te-form label { font-size: 12.5px; font-weight: 700; color: #ffe08a; text-align: center; }
.te-form-linha { display: flex; gap: 6px; }
.te-palavra-campo { flex: 1; min-width: 0; height: 42px; box-sizing: border-box; padding: 0 12px; border: 0; border-radius: 9px; outline: 0; color: #120a2a; background: #fff;
  font-size: 17px; font-weight: 800; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
.te-enviar { flex: none; height: 42px; padding: 0 14px; border: 0; border-radius: 9px; font-size: 15px; font-weight: 800; color: #3a2a00; background: linear-gradient(145deg, #ffe680, #e0a81c); cursor: pointer; }
.te-numeros { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.te-numeros button { height: 34px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 800; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.te-numeros button.on { color: #3a2a00; background: linear-gradient(145deg, #ffe680, #e0a81c); }

/* ----- o tabuleiro ----- */
.te-tabuleiro { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.te-carta { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.42; min-width: 0; padding: 0; border: 1.5px solid rgba(255,255,255,.14); border-radius: 9px;
  color: #f4f1ff; background: linear-gradient(160deg, #2c2758, #181536); box-shadow: 0 3px 8px rgba(0,0,0,.4); cursor: pointer; transition: transform .12s, border-color .2s; }
.te-carta:active { transform: scale(.96); }
.te-carta:disabled { cursor: default; }
/* O tamanho base: a palavra que não couber encolhe em teAjustarPalavras. */
.te-palavra { display: block; width: max-content; white-space: nowrap; font-size: clamp(10px, 2.9vw, 15px); font-weight: 800; }
/* O mapa do Oráculo: a cor por baixo, sem parecer carta virada. */
.te-carta.mapa.dono-A { border-color: var(--te-a); background: linear-gradient(160deg, rgba(76,155,255,.42), #181536 86%); }
.te-carta.mapa.dono-B { border-color: var(--te-b); background: linear-gradient(160deg, rgba(255,82,119,.42), #181536 86%); }
.te-carta.mapa.dono-N { border-color: rgba(255,255,255,.14); opacity: .7; }
.te-carta.mapa.dono-P { border-color: #ff2a2a; background: repeating-linear-gradient(45deg, #17060a 0 7px, #34080f 7px 14px); box-shadow: 0 0 12px rgba(255,40,40,.6); }
/* Virada: a carta é do time, e a palavra quase some. */
.te-carta.virada { cursor: default; border-color: transparent; }
.te-carta.virada .te-palavra { opacity: .7; }
.te-carta.virada.dono-A { color: #fff; background: linear-gradient(160deg, var(--te-a), var(--te-a-2)); }
.te-carta.virada.dono-B { color: #fff; background: linear-gradient(160deg, var(--te-b), var(--te-b-2)); }
.te-carta.virada.dono-N { color: #23242e; background: linear-gradient(160deg, #c4c7d2, #8d93a8); }
.te-carta.virada.dono-P { color: #ff5a5a; background: radial-gradient(circle, #3a0710, #000); border-color: #ff2a2a; }
/* Fim de jogo: as que ninguém virou aparecem, mais apagadas. */
.telepatia.acabou .te-carta.mapa { opacity: .62; }

/* As cartas em que o Oráculo pensou: só ele vê. */
.te-carta.alvo { outline: 2.5px solid #ffd24a; outline-offset: 1px; }
.te-carta.minha { border-color: #ffd24a; box-shadow: 0 0 0 1.5px #ffd24a, 0 0 12px rgba(255,210,74,.5); }
.te-carta.confirmei { background: linear-gradient(160deg, #6b5310, #2a2110); }
.te-carta.suspense { z-index: 2; animation: te-treme .9s ease-in both; }
@keyframes te-treme {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(255,255,255,0); }
  30% { transform: scale(1.1) rotate(-1.4deg); }
  50% { transform: scale(1.12) rotate(1.4deg); }
  70% { transform: scale(1.14) rotate(-1.4deg); }
  100% { transform: scale(1.16); box-shadow: 0 0 26px rgba(255,255,255,.75); }
}
.te-votos { position: absolute; left: 2px; right: 2px; bottom: 1px; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.te-votos i { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 9px; font-style: normal; font-weight: 800; color: #1a1436; background: #dfd8ff; }
.te-votos i.ok { color: #3a2a00; background: #ffd24a; box-shadow: 0 0 6px #ffd24a; }

/* ----- os botões do time ----- */
.te-acao { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; min-height: 42px; text-align: center; font-size: 13.5px; color: rgba(255,255,255,.76); }
.te-acao:empty { display: none; }
.te-acao .im-btn { flex: 1 1 140px; max-width: 320px; }

/* ----- quem está em cada time ----- */
.te-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.te-time { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.05); }
.te-time h3 { margin: 0 0 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.te-time.A h3 { color: var(--te-a); }
.te-time.B h3 { color: var(--te-b); }
.te-pessoa { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 28px; font-size: 13px; cursor: pointer; border-radius: 7px; }
.te-pessoa:hover { background: rgba(255,255,255,.07); }
.te-pessoa .ava { flex: none; width: 22px; height: 22px; font-size: 10px; }
.te-pessoa span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-pessoa small { flex: none; margin-left: auto; font-size: 10.5px; font-weight: 800; color: #ffd24a; }
.te-pessoa.fora { opacity: .4; }

/* ----- o Pesadelo ----- */
.te-pesadelo { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; pointer-events: none; color: #ff3030; background: #000;
  animation: te-noite 2.6s ease-out both; }
.te-pesadelo b { font-size: clamp(38px, 13vw, 84px); font-weight: 900; letter-spacing: .08em; text-shadow: 0 0 34px #ff0000; animation: te-grito .5s cubic-bezier(.2, 1.6, .4, 1) .25s both; }
@keyframes te-noite { 0% { opacity: 0; } 8% { opacity: 1; } 14% { background: #4a0000; } 22% { background: #000; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes te-grito { from { transform: scale(3); opacity: 0; } }
.telepatia.tremendo { animation: te-tremor .5s linear; }
@keyframes te-tremor { 25% { transform: translate(-7px, 3px); } 50% { transform: translate(6px, -4px); } 75% { transform: translate(-4px, 4px); } }

/* ----- os momentos ----- */
.te-faisca { position: fixed; z-index: 35; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; }
.te-tabuleiro { position: relative; }
.te-nevoa { position: absolute; inset: -6px; z-index: 3; pointer-events: none; border-radius: 12px;
  background: linear-gradient(100deg, transparent, rgba(205,212,232,.72) 30%, rgba(230,233,245,.85) 50%, rgba(205,212,232,.72) 70%, transparent);
  animation: te-nevoa 1.5s ease-in-out both; }
@keyframes te-nevoa { from { transform: translateX(-110%); opacity: 0; } 30% { opacity: 1; } 70% { opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

.te-sintonia { position: fixed; inset: 0; z-index: 36; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; pointer-events: none; text-align: center; padding: 0 16px;
  background: radial-gradient(circle, rgba(10,8,40,.78), rgba(10,8,40,.25) 70%); animation: te-sint 2.5s ease-out both; --c: #7db8ff; }
.te-sintonia.B { --c: #ff86a0; }
.te-sintonia b { font-size: clamp(30px, 9vw, 62px); font-weight: 900; line-height: 1.05; color: #fff; text-shadow: 0 0 24px var(--c), 0 0 60px var(--c); animation: te-grito .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.te-sintonia span { font-size: 15px; font-weight: 700; color: #fff; }
.te-sintonia i { position: absolute; left: 50%; top: 50%; width: 60vmin; height: 60vmin; margin: -30vmin; border-radius: 50%; border: 3px solid var(--c); animation: te-anel 1.3s ease-out both; }
.te-sintonia i:nth-child(2) { animation-delay: .22s; }
.te-sintonia i:nth-child(3) { animation-delay: .44s; }
@keyframes te-anel { from { transform: scale(.1); opacity: 1; } to { transform: scale(2); opacity: 0; } }
@keyframes te-sint { 0% { opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* O pânico do Oráculo: a borda pulsa no ritmo do coração. */
body.te-panico .telepatia::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  box-shadow: inset 0 0 90px 24px rgba(255,0,0,.75); animation: te-coracao .95s ease-in-out infinite; }
@keyframes te-coracao { 0%, 100% { opacity: .35; } 14% { opacity: 1; } 28% { opacity: .5; } 42% { opacity: .95; } }
.te-alerta { position: absolute; left: 50%; bottom: calc(14px + var(--in-bottom, 0px)); z-index: 7; transform: translateX(-50%); width: max-content; max-width: 92%; padding: 8px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 800; text-align: center; color: #ffb4b4; background: rgba(20,4,8,.92); border: 1px solid #ff4040; }
.te-alerta.meu { color: #fff; background: #b81010; animation: te-coracao .95s ease-in-out infinite; }

/* ----- o final ----- */
.te-final { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; overflow-y: auto; padding: calc(var(--im-pad) + 58px) 12px 16px; box-sizing: border-box; background: rgba(4,3,14,.76); }
.te-final-cartao { display: flex; flex-direction: column; gap: 10px; width: min(100%, 620px); padding: 16px; box-sizing: border-box; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, #1d1a4a, #0e0c28); border: 1.5px solid rgba(255,255,255,.18); box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: te-sobe .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.te-final-cartao.A { border-color: var(--te-a); }
.te-final-cartao.B { border-color: var(--te-b); }
@keyframes te-sobe { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.te-final-cartao h2 { margin: 0; font-size: clamp(26px, 7vw, 36px); font-weight: 900; color: #fff; }
.te-final-cartao h3 { margin: 4px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #ffd24a; }
.te-premios { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.te-premio { flex: 1 1 150px; display: flex; flex-direction: column; gap: 1px; padding: 8px; border-radius: 11px; background: rgba(255,255,255,.07); animation: te-sobe .5s .25s both; }
.te-premio:nth-child(2) { animation-delay: .4s; }
.te-premio:nth-child(3) { animation-delay: .55s; }
.te-premio small { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #ffd24a; }
.te-premio.sabotador small { color: #ff86a0; }
.te-premio b { font-size: 17px; }
.te-premio span { font-size: 12px; color: rgba(255,255,255,.66); }
.te-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.te-replays { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.te-replay { padding: 7px 9px; border-radius: 10px; background: rgba(255,255,255,.055); border-left: 3px solid var(--te-a); }
.te-replay.B { border-left-color: var(--te-b); }
.te-replay > div { display: flex; align-items: center; gap: 6px; }
.te-replay b { font-size: 15px; font-weight: 900; }
.te-replay i { font-style: normal; font-size: 12px; font-weight: 900; padding: 0 6px; border-radius: 99px; color: #120a2a; background: #ffd24a; }
.te-replay small { margin-left: auto; font-size: 11.5px; color: rgba(255,255,255,.6); }
.te-replay p { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.te-replay em { font-size: 12px; color: rgba(255,255,255,.55); }
.te-chip { padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.1); }
.te-chip.certa { color: #bfead6; background: rgba(40,160,110,.25); }
.te-chip.leu { color: #06301f; background: #4fe3a2; }
.te-chip.errada { color: #ffb8c6; background: rgba(255,60,90,.22); text-decoration: line-through; }
.te-chip.pensou { color: #ffe08a; background: transparent; box-shadow: inset 0 0 0 1.5px #ffd24a; }

/* No PC, o tabuleiro no centro e um time de cada lado. */
body[data-layout="pc"] .te-palco { grid-template-columns: minmax(0, 1fr) minmax(0, 700px) minmax(0, 1fr); column-gap: 16px; left: 16px; right: 16px; }
body[data-layout="pc"] .te-palco > * { grid-column: 2; width: 100%; }
body[data-layout="pc"] .te-times { display: contents; }
body[data-layout="pc"] .te-time { grid-row: 1 / span 4; align-self: start; width: 100%; max-width: 220px; padding: 10px; }
body[data-layout="pc"] .te-time.A { grid-column: 1; justify-self: end; }
body[data-layout="pc"] .te-time.B { grid-column: 3; justify-self: start; }
body[data-layout="pc"] .te-palavra { font-size: clamp(11px, 1.25vw, 16px); }
/* A altura manda: o tabuleiro encolhe para os botões do time caberem sem rolar. */
body[data-layout="pc"] .te-palco { overflow: hidden; }
body[data-layout="pc"] .te-carta { aspect-ratio: 1.75; }
body[data-layout="pc"] .te-tabuleiro { width: min(100%, calc((100vh - 292px) * 1.72)); justify-self: center; }

@media (prefers-reduced-motion: reduce) {
  .te-pista.nova .te-pista-palavra i, .te-pista.nova .te-pista-numero, .te-carta.suspense, .te-pesadelo, .te-pesadelo b, .telepatia.tremendo,
  .te-sintonia i, .te-nevoa, .te-final-cartao, .te-premio { animation: none; }
  .te-sintonia b { animation: none; }
  .te-pesadelo { opacity: 0; }
}

/* A mesa tem até 4 por time: dois times lado a lado, em duas fileiras cada. */
.telepatia .im-assentos.duplas { align-items: stretch; }
.telepatia .im-dupla { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); justify-items: center; min-width: 0; gap: 4px 2px; padding: 22px 4px 6px; position: relative; }
.telepatia .im-dupla .im-assento { width: 100%; max-width: 62px; }
.telepatia .im-dupla-t { position: absolute; top: 4px; left: 0; right: 0; width: auto; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.telepatia .im-dupla.dupla-A .im-dupla-t { color: #4c9bff; font-size: 0; }
.telepatia .im-dupla.dupla-B .im-dupla-t { color: #ff5277; font-size: 0; }
.telepatia .im-dupla.dupla-A .im-dupla-t::after { content: "Lúcidos"; font-size: 11px; }
.telepatia .im-dupla.dupla-B .im-dupla-t::after { content: "Insones"; font-size: 11px; }

/* Os pacotes não cabem numa linha só (viravam "Cl…"): o rótulo sobe e eles quebram. */
#te-folha .im-op { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.te-pacotes .im-seg { display: flex; flex-wrap: wrap; }
.te-pacotes .im-seg button { flex: 1 1 64px; padding-inline: 4px; font-size: 12px; }
.te-pac-grupo { display: grid; gap: 3px; }
.te-pac-grupo small { font-size: 10.5px; font-weight: 700; color: rgba(244,236,216,.55); }
/* Dezesseis pacotes: em tela baixa a folha rola por dentro. */
#te-folha .im-folha-cartao { overflow-y: auto; overscroll-behavior: contain; }

/* ===== Sussurros: o chat de quem não fala na call =====
   No PC fica de lado, ao pé do time da direita; no celular sobe como uma gaveta
   por cima do tabuleiro. A bolha leva a cor do time de quem fala. */
.te-chat-btn { position: absolute; z-index: 9; right: max(12px, var(--in-right, 0px)); bottom: max(12px, var(--in-bottom, 0px));
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #f4ecd8;
  border: 1px solid rgba(190,170,255,.45); background: radial-gradient(circle at 35% 30%, #4a3a9a, #1c1546 70%);
  box-shadow: 0 10px 26px -8px rgba(0,0,0,.8), 0 0 22px -6px rgba(150,120,255,.75); transition: transform .2s; }
.te-chat-btn:active { transform: scale(.94); }
.te-chat-btn.lado-A { border-color: rgba(76,155,255,.7); box-shadow: 0 10px 26px -8px rgba(0,0,0,.8), 0 0 22px -6px rgba(76,155,255,.8); }
.te-chat-btn.lado-B { border-color: rgba(255,82,119,.7); box-shadow: 0 10px 26px -8px rgba(0,0,0,.8), 0 0 22px -6px rgba(255,82,119,.8); }
.te-chat-btn .ico { width: 24px; height: 24px; }
.te-chat-btn b { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px;
  font: 900 11px/20px var(--im-sans); color: #120a2a; background: linear-gradient(145deg, #ffe680, #e0a81c); }
.te-chat-btn b:empty { display: none; }
.te-chat-btn.tem { animation: te-chama 1.6s ease-in-out infinite; }
@keyframes te-chama { 50% { box-shadow: 0 10px 26px -8px rgba(0,0,0,.8), 0 0 34px 0 rgba(255,230,128,.55); } }
.telepatia.chat-aberto .te-chat-btn { display: none; }

.te-sussurro { position: absolute; z-index: 9; right: max(72px, calc(var(--in-right, 0px) + 60px)); bottom: max(18px, calc(var(--in-bottom, 0px) + 6px));
  max-width: min(260px, calc(100% - 96px)); padding: 8px 12px; border-radius: 14px 14px 4px 14px; pointer-events: none;
  font-size: 13px; line-height: 1.3; color: #f4ecd8; background: rgba(28,22,70,.94); border: 1px solid rgba(190,170,255,.35);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.85); opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .25s, transform .25s; }
.te-sussurro.on { opacity: 1; transform: none; }
.te-sussurro b { display: block; font-size: 11.5px; color: #c9b8ff; }
.te-sussurro.lado-A b { color: var(--te-a); } .te-sussurro.lado-B b { color: var(--te-b); }
.telepatia.chat-aberto .te-sussurro { display: none; }

.te-chat { position: absolute; z-index: 10; display: flex; flex-direction: column; overflow: hidden;
  left: max(8px, var(--in-left, 0px)); right: max(8px, var(--in-right, 0px)); bottom: max(8px, var(--in-bottom, 0px)); height: min(62%, 460px);
  border-radius: 22px; border: 1px solid rgba(190,170,255,.3);
  background: linear-gradient(180deg, #1e184a, #0a081e); box-shadow: 0 -20px 50px -16px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.08);
  animation: te-chat-sobe .3s cubic-bezier(.2,.9,.3,1.05) both; }
@keyframes te-chat-sobe { from { opacity: 0; transform: translateY(24px); } }
body[data-layout="pc"] .te-chat { left: auto; width: clamp(300px, calc((100vw - 760px) / 2), 330px); height: min(52%, 440px); right: max(16px, var(--in-right, 0px)); bottom: max(16px, var(--in-bottom, 0px)); }
.te-chat-topo { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.te-chat-nome { flex: none; font: 400 16px var(--im-deco); letter-spacing: .1em; color: #d9ccff; text-shadow: 0 0 12px rgba(160,130,255,.6); }
.te-chat-canais { display: flex; gap: 4px; flex: 1; min-width: 0; justify-content: flex-end; overflow: hidden; }
.te-chat-canais button { position: relative; padding: 5px 10px; border-radius: 999px; cursor: pointer; font: 800 11.5px var(--im-sans);
  color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); border: 1px solid transparent; white-space: nowrap; }
.te-chat-canais button.on { color: #120a2a; background: linear-gradient(145deg, #e6dcff, #a993ff); }
.te-chat-canais button.lado-A.on { color: #fff; background: linear-gradient(145deg, #4c9bff, #1b4fa8); }
.te-chat-canais button.lado-B.on { color: #fff; background: linear-gradient(145deg, #ff5277, #a81d43); }
.te-chat-canais i { position: absolute; top: -6px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px;
  font: 900 10px/16px var(--im-sans); font-style: normal; color: #120a2a; background: #ffe680; }
.te-chat-x { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: rgba(255,255,255,.7); background: transparent; border: 1px solid rgba(255,255,255,.14); }
.te-chat-x .ico { width: 14px; height: 14px; }

.te-msgs { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 8px; }
.te-chat-vazio { margin: auto; max-width: 240px; text-align: center; font-size: 12.5px; line-height: 1.45; color: rgba(255,255,255,.5); }
.te-grupo { display: flex; align-items: flex-end; gap: 7px; max-width: 88%; }
.te-grupo .ava { width: 28px; height: 28px; flex: none; font-size: 11px; }
.te-grupo.eu { align-self: flex-end; flex-direction: row-reverse; }
.te-bolhas { display: grid; gap: 3px; min-width: 0; }
.te-grupo.eu .te-bolhas { justify-items: end; }
.te-autor { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 800; color: #e6c36a; }
.te-grupo.lado-A .te-autor { color: var(--te-a); } .te-grupo.lado-B .te-autor { color: var(--te-b); }
.te-autor time { font-weight: 600; font-size: 10px; color: rgba(255,255,255,.4); }
.te-selo { padding: 1px 6px; border-radius: 6px; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: #120a2a; background: #ffe680; }
.te-grupo.eu .te-autor { display: none; }
.te-bolha { padding: 7px 11px; border-radius: 4px 14px 14px 14px; font-size: 13.5px; line-height: 1.38; overflow-wrap: anywhere;
  color: #f4ecd8; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.06); animation: te-bolha .22s ease-out both; }
@keyframes te-bolha { from { opacity: 0; transform: translateY(6px); } }
.te-grupo.lado-A .te-bolha { background: rgba(76,155,255,.14); border-color: rgba(76,155,255,.22); }
.te-grupo.lado-B .te-bolha { background: rgba(255,82,119,.13); border-color: rgba(255,82,119,.22); }
.te-grupo.eu .te-bolha { border-radius: 14px 4px 14px 14px; color: #fff; background: linear-gradient(145deg, #6b55d6, #3d2c99); border-color: transparent; }
.te-grupo.eu.lado-A .te-bolha { background: linear-gradient(145deg, #3d8bf0, #1b4fa8); }
.te-grupo.eu.lado-B .te-bolha { background: linear-gradient(145deg, #f04a6e, #a81d43); }
.te-bolha.enviando { opacity: .55; }
.te-novas { position: sticky; bottom: 4px; align-self: center; padding: 5px 12px; border-radius: 999px; cursor: pointer; border: 0;
  font: 800 12px var(--im-sans); color: #120a2a; background: #ffe680; box-shadow: 0 6px 16px -6px rgba(0,0,0,.8); }

.te-chat-motivo { margin: 0; padding: 7px 14px; font-size: 12px; line-height: 1.35; text-align: center; color: #ffe680; background: rgba(255,230,128,.07); }
.te-escrever { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.te-escrever textarea { flex: 1; min-width: 0; max-height: 110px; resize: none; padding: 9px 12px; border-radius: 16px; box-sizing: border-box;
  font: 500 16px/1.3 var(--im-sans); color: #fff; background: rgba(0,0,0,.35); border: 1px solid rgba(190,170,255,.25); outline: none; }
.te-escrever textarea:focus { border-color: rgba(190,170,255,.6); box-shadow: 0 0 0 3px rgba(150,120,255,.18); }
.te-escrever textarea:disabled { opacity: .5; }
.te-escrever button { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 0;
  color: #120a2a; background: linear-gradient(145deg, #ffe680, #e0a81c); }
.te-escrever button svg { width: 18px; height: 18px; fill: currentColor; }
.te-escrever button:disabled { opacity: .4; cursor: default; }
/* No celular a partida deixa espaço embaixo para o botão do chat não tapar as cartas. */
body:not([data-layout="pc"]) .telepatia.em-partida .te-palco { padding-bottom: 64px; }
@media (prefers-reduced-motion: reduce) { .te-chat, .te-bolha, .te-chat-btn.tem { animation: none; } }

/* ===== Saguão no formato do Ludo =====
   O tabuleiro (uma vitrine) fica à mostra e a mesa vem numa gaveta embaixo no
   celular e num painel à direita no PC, como no Ludo. */
.te-vitrine { position: absolute; z-index: 1; display: none; place-items: center; pointer-events: none;
  top: calc(var(--im-pad) + 64px); left: max(10px, var(--in-left, 0px)); right: max(10px, var(--in-right, 0px)); bottom: calc(var(--te-baixo, 300px) + 10px); }
.telepatia.no-saguao .te-vitrine { display: grid; }
.te-vitrine-grade { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 5px;
  width: 100%; height: 100%; max-width: 680px; max-height: 470px; min-width: 0; min-height: 0; animation: te-vitrine-entra .6s ease-out both; }
@keyframes te-vitrine-entra { from { opacity: 0; transform: scale(.96); } }
/* id: vence a carta do tabuleiro do PC, que fixa o formato. */
#te-vitrine .te-carta { aspect-ratio: auto; width: auto; height: 100%; min-height: 0; transition: background .35s, border-color .35s, color .35s; }
body[data-layout="pc"] .te-vitrine { right: calc(360px + 28px + var(--in-right, 0px)); bottom: max(14px, var(--in-bottom, 0px)); }
/* No PC a mesa é o painel da direita (o mesmo do Ludo), não o cartão embaixo. */
body[data-layout="pc"] #telepatia #te-saguao { left: auto; width: 360px; right: max(14px, var(--in-right, 0px)); top: calc(var(--im-pad) + 66px); bottom: auto;
  max-height: calc(100% - var(--im-pad) - 80px); margin: 0; overflow-y: auto; padding: 14px; gap: 10px; border-radius: 22px; border: 1px solid rgba(230,195,106,.35); }
body[data-layout="pc"] #telepatia #te-saguao::before { display: none; }
/* Gaveta grande demais para a tela (celular baixo): rola por dentro. */
#te-saguao.aperto { max-height: calc(100% - var(--im-pad) - 70px); overflow-y: auto; }
#te-saguao .te-serie { padding: 8px 10px; gap: 4px; }
#te-saguao .te-serie-placar b { font-size: 26px; }
#te-saguao .te-serie-dupla { display: none; }   /* o entrosamento fica na tela final */
/* O botão do chat sobe para cima da gaveta: embaixo ele tapava o Entrar. */
body:not([data-layout="pc"]) .telepatia.no-saguao .te-chat-btn { bottom: calc(var(--te-baixo, 0px) + 14px); }
body:not([data-layout="pc"]) .telepatia.no-saguao .te-sussurro { bottom: calc(var(--te-baixo, 0px) + 20px); }

/* Mesa aberta: os dois times, grandes; tocar é entrar. */
.te-sg-times { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 8px; }
.te-sg-time { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 9px 8px 8px; border-radius: 16px; min-width: 0;
  border: 1.5px solid var(--cor-l); background: linear-gradient(180deg, var(--cor-f), rgba(0,0,0,.22)); transition: box-shadow .25s, border-color .25s; }
.te-sg-time.lado-A { --cor: var(--te-a); --cor-2: var(--te-a-2); --cor-l: rgba(76,155,255,.35); --cor-f: rgba(76,155,255,.14); }
.te-sg-time.lado-B { --cor: var(--te-b); --cor-2: var(--te-b-2); --cor-l: rgba(255,82,119,.35); --cor-f: rgba(255,82,119,.13); }
.te-sg-time.meu { border-color: var(--cor); box-shadow: 0 0 26px -8px var(--cor); }
.te-sg-time-nome { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.te-sg-time-nome b { font: 400 16px var(--im-deco); letter-spacing: .06em; color: var(--cor); }
.te-sg-time-nome small { font-size: 11px; font-weight: 800; color: rgba(255,255,255,.55); }
/* Só quem já entrou: nada de vagas vazias parecendo botões. */
.te-sg-gente { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 4px 2px; min-height: 52px; }
.te-sg-gente .im-assento { width: 58px; }
.te-sg-gente .im-assento .ava { width: 34px; height: 34px; }
/* Quem criou a mesa: cada rosto vira botão, com o selinho de troca. */
.te-sg-mover { position: relative; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 12px; transition: transform .15s; }
.te-sg-mover:hover { transform: translateY(-2px); }
.te-sg-mover:active { transform: scale(.94); }
.te-sg-mover > i { position: absolute; top: 24px; right: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  color: #120a2a; background: linear-gradient(145deg, #ffe680, #e0a81c); box-shadow: 0 2px 6px rgba(0,0,0,.6); font-style: normal; }
.te-sg-mover > i .ico { width: 12px; height: 12px; }
.te-sg-ninguem { align-self: center; font-size: 12px; color: rgba(255,255,255,.4); font-style: italic; }
.te-sg-escolher { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 40px; border: 0; border-radius: 12px; cursor: pointer;
  font: 800 14px var(--im-sans); white-space: nowrap; color: #fff; background: linear-gradient(180deg, var(--cor), var(--cor-2));
  box-shadow: 0 8px 20px -8px var(--cor), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .15s, filter .15s; }
.te-sg-escolher:hover { filter: brightness(1.12); }
.te-sg-escolher:active { transform: scale(.97); }
.te-sg-escolher .ico { width: 17px; height: 17px; }
.te-sg-aqui { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; box-sizing: border-box;
  font: 800 13px var(--im-sans); color: var(--cor); border: 1.5px dashed var(--cor-l); }
.te-sg-aqui .ico { width: 16px; height: 16px; }
.te-sg-aqui.cheio { color: rgba(255,255,255,.45); border-color: rgba(255,255,255,.15); }

/* ===== Placar da mesa: os lados somam vitória quem quer que esteja neles ===== */
.te-serie { display: grid; justify-items: center; gap: 6px; padding: 10px 12px; border-radius: 16px; text-align: center;
  background: linear-gradient(90deg, rgba(76,155,255,.14), rgba(0,0,0,.25) 50%, rgba(255,82,119,.13)); border: 1px solid rgba(255,255,255,.1); }
.te-serie-rot { font: 800 10.5px var(--im-sans); letter-spacing: .16em; text-transform: uppercase; color: #ffe680; }
.te-serie-placar { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px; width: 100%; }
.te-serie-placar span { font: 400 15px var(--im-deco); letter-spacing: .06em; }
.te-serie-placar span.A { color: var(--te-a); text-align: right; } .te-serie-placar span.B { color: var(--te-b); text-align: left; }
.te-serie-placar b { font: 900 34px/1 var(--im-sans); font-variant-numeric: tabular-nums; }
.te-serie-placar b.A { color: var(--te-a); } .te-serie-placar b.B { color: var(--te-b); }
.te-serie-placar i { font-style: normal; color: rgba(255,255,255,.35); }
.te-serie.lider-A b.A, .te-serie.lider-B b.B { text-shadow: 0 0 18px currentColor; }
.te-serie-ultimas { display: flex; gap: 4px; }
.te-serie-ultimas i { width: 9px; height: 9px; border-radius: 50%; }
.te-serie-ultimas i.A { background: var(--te-a); } .te-serie-ultimas i.B { background: var(--te-b); }
.te-serie-ultimas i:last-child { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.te-serie-dupla { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1px 8px; width: 100%; padding: 5px 9px; border-radius: 10px;
  box-sizing: border-box; font-size: 12px; text-align: left; background: rgba(0,0,0,.25); }
.te-serie-dupla small { grid-column: 1 / -1; font-size: 10.5px; font-weight: 800; color: #4ade80; white-space: nowrap; }
.te-serie-dupla.ruim small { color: #f87171; }
.te-serie-dupla b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.te-serie-dupla b i { font-style: normal; color: #ffe680; }
.te-serie-dupla span { color: rgba(255,255,255,.6); white-space: nowrap; }
.te-premio.entrosamento small { color: #4ade80; }
.te-premio.desencontro small { color: #f87171; }

/* Feitos da partida, na tela final: um por linha, chegando um de cada vez. */
.te-feitos-final { display: grid; gap: 6px; }
.te-feito-final { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; text-align: left;
  background: linear-gradient(90deg, rgba(255,230,128,.16), rgba(255,255,255,.04)); border: 1px solid rgba(255,230,128,.3); animation: te-feito .55s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes te-feito { from { opacity: 0; transform: translateX(-16px) scale(.9); } }
.te-feito-final > i { font-size: 26px; font-style: normal; filter: drop-shadow(0 0 8px rgba(255,230,128,.6)); }
.te-feito-final b { display: block; font-size: 14.5px; color: #fff; }
.te-feito-final b em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: 2px; color: #120a2a; background: #cd8b52; }
.te-feito-final.nivel-2 b em { background: #d9dde6; } .te-feito-final.nivel-3 b em { background: #ffe680; }
.te-feito-final small { font-size: 12px; color: rgba(255,255,255,.65); }
@media (prefers-reduced-motion: reduce) { .te-feito-final { animation: none; } }

