/* =====================================================================
   TRUCO — usa o MESMO design system do BLUFF (hud.css é a fonte de verdade).
   Aqui só entra o conteúdo do truco dentro dos componentes do BLUFF:
     #me           placar "7 × 4" (mesma letra do "Rainhas" da mesa) + 3 vazas (mesmas marcas das balas)
     placas        "Parceiro" / "Adversário" no lugar das balas (mesma letra pequena do HUD)
     #actions      as cartas do parceiro na mão de onze
     #announce     variação "chamada" para TRUCO! SEIS! NOVE! DOZE! (mesmo componente de "Era blefe!")
   ===================================================================== */

/* sem nada do BLUFF que não existe no truco (revólver, leque em DOM) */
#hud.truco-mode #hand { display: none !important; }

/* ---------- canto do jogador: placar + vazas ---------- */
#hud.truco-mode #me { gap: 16px; }
.tr-score { display: inline-flex; align-items: baseline; gap: 8px; font: 400 31px/1 'Rye', serif; color: var(--h-ink); text-shadow: var(--h-outline); }
.tr-score .us { color: var(--h-ink); }
.tr-score .them { color: var(--h-ink-dim); }
.tr-score > i { font: 400 15px 'Oswald', sans-serif; font-style: normal; color: var(--h-brass); }
.tr-score.flash b { animation: tr-flash 1s ease; }
@keyframes tr-flash { 0% { transform: none; } 30% { transform: scale(1.3); color: #fff2cc; } 100% { transform: none; } }
#my-chambers:has(.tr-score) { display: inline-flex; align-items: center; gap: 14px; }
.tr-rows { display: inline-flex; flex-direction: column; gap: 6px; }
.tr-row { display: inline-flex; align-items: center; gap: 8px; }
.tr-row em { font: 400 10px 'Oswald', sans-serif; font-style: normal; letter-spacing: .22em; text-transform: uppercase; color: var(--h-ink-dim); text-shadow: var(--h-outline); }
.tr-hands { gap: 4px; }
.tr-hands i { width: 8px; height: 12px; border-radius: 2px; }
/* as vazas: as mesmas marcas das balas do BLUFF — latão (nossa), cobre (deles), meio a meio (empate), vazia (a jogar) */
.tr-vz { gap: 3px; }
.tr-vz i { width: 5px; height: 12px; }
.tr-vz i.them, .tr-hands i.them { background: linear-gradient(90deg, #7a2a1c, #d0705a 50%, #7a2a1c); }
.tr-vz i.tie { background: linear-gradient(90deg, #a07a3a 50%, #b0503c 50%); }

/* ---------- quem venceu a vaza: nome ao lado da carta vencedora (mesmo estilo das placas) ---------- */
#tr-trick { position: absolute; z-index: 3; text-align: center; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 16px)); }
#tr-trick.hidden { display: none; }
#tr-trick b { display: block; font: 400 22px 'Rye', serif; letter-spacing: .04em; color: var(--h-ink); text-shadow: var(--h-outline), 0 0 16px rgba(0, 0, 0, .5); }
#tr-trick.mine b { color: var(--h-brass); }
#tr-trick span { display: block; margin-top: 2px; font: 400 12px 'Oswald', sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--h-ink); text-shadow: var(--h-outline); }
#tr-trick::after { content: ''; display: block; width: 0; height: 0; margin: 4px auto 0; border: 6px solid transparent; border-top: 7px solid var(--h-brass); border-bottom: 0; filter: drop-shadow(0 1px 1px #000); }
#tr-trick.show { animation: tr-tag 1.75s ease both; }
@keyframes tr-tag { 0% { opacity: 0; transform: translate(-50%, calc(-100% - 6px)) scale(.92); } 14% { opacity: 1; transform: translate(-50%, calc(-100% - 16px)) scale(1); } 82% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, calc(-100% - 22px)); } }

/* ---------- placas: o papel de cada um no lugar das balas ---------- */
.plate.truco .tr-role { font: 400 11px 'Oswald', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--h-ink-dim); text-shadow: var(--h-outline); }
.plate.truco.partner .tr-role { color: var(--h-brass); }

/* ---------- ações: cartas do parceiro na mão de onze (acima da dica) ---------- */
#hud.truco-mode #actions { grid-template-areas: 'partner partner' 'hint hint' 'pick pick' 'timer row'; }
#tr-partner { grid-area: partner; display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin-bottom: 12px; }
#tr-partner small { margin-right: 6px; font: 400 11px 'Oswald', sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--h-ink-dim); text-shadow: var(--h-outline); }
#tr-partner img { width: 58px; border-radius: 5px; box-shadow: 0 0 0 1px rgba(60, 40, 20, .55), 2px 5px 10px rgba(0, 0, 0, .55); }
#tr-partner img:nth-of-type(1) { transform: rotate(-5deg); }
#tr-partner img:nth-of-type(3) { transform: rotate(5deg); }

/* ---------- TRUCO! SEIS! NOVE! DOZE!: o aviso grande do jogo, com os filetes da faixa "Sua vez" ---------- */
#announce.call h2 { font-size: clamp(54px, 8vw, 104px); letter-spacing: .06em; color: var(--gold); text-shadow: 0 4px 0 #3b1d0b, 0 0 34px rgba(0, 0, 0, .85); }
#announce.call h2::before, #announce.call h2::after { content: ''; display: inline-block; width: clamp(40px, 6vw, 90px); height: 2px; margin: 0 .35em; vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--h-brass)); }
#announce.call h2::after { background: linear-gradient(90deg, var(--h-brass), transparent); }
#announce.call p { font: 400 16px 'Oswald', sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--h-ink); }
#announce.call.show h2 { animation: tr-call .5s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes tr-call { from { transform: scale(1.35); opacity: 0; } to { transform: none; opacity: 1; } }

/* regras na Ajuda */
#rules[data-game="truco"] .rules-bluff, #rules[data-game="truco"] .rules-dice { display: none; }
#rules:not([data-game="truco"]) .rules-truco { display: none; }
.rules-truco .credit { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-dim); }

/* ajuda: só as regras do jogo aberto (POBRE RICO MILIONÁRIO) */
#rules[data-game="prm"] .rules-bluff, #rules[data-game="prm"] .rules-dice, #rules[data-game="prm"] .rules-truco { display: none; }
#rules:not([data-game="prm"]) .rules-prm { display: none; }
