/* =====================================================
   ARCANE TRUCO — THE DUEL
   Cena pintada em camadas + UI flutuante.
   Asset paths preservam acentos (ç, á, ã) — UTF-8 OK
   nos navegadores modernos.
   ===================================================== */

:root {
  --c-bg-deep:        #0a0612;
  --c-bg-mid:         #14102a;
  --c-bg-soft:        #1d1740;
  --c-stone:          #2a2440;
  --c-stone-light:    #3a3358;
  --c-purple:         #6b3fa0;
  --c-cyan:           #4ad6e0;
  --c-cyan-glow:      #66f0ff;
  --c-green-magic:    #6fe09a;
  --c-gold:           #c9a24a;
  --c-gold-bright:    #e9c267;
  --c-gold-deep:      #8a6a2a;
  --c-blood:          #b03050;
  --c-text:           #e8e4f5;
  --c-text-soft:      #b3a8d4;
  --c-text-dim:       #7a6f9a;

  --suit-copas:       #d34960;
  --suit-ouros:       #e9c267;
  --suit-espadas:     #4ad6e0;
  --suit-paus:        #6fe09a;

  --font-display:     'Cinzel', 'Times New Roman', serif;
  --font-body:        'Cormorant Garamond', Georgia, serif;
  --font-ui:          system-ui, -apple-system, sans-serif;

  --radius-frame:     6px;
  --shadow-arcane:    0 0 24px rgba(106, 192, 255, 0.25), 0 0 48px rgba(106, 63, 160, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg-deep);
  user-select: none;
}

/* =====================================================
   SCREENS
   ===================================================== */

.screen { position: fixed; inset: 0; display: none; z-index: 1; }
.screen.active { display: block; }

.shared-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: url('assets/cenário/background.png') center/cover no-repeat;
  filter: saturate(1.08) contrast(1.04) brightness(0.82);
}

/* =====================================================
   TITLE SCREEN
   ===================================================== */

#title-screen.active { display: flex; align-items: center; justify-content: center; }

#title-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(28, 12, 52, 0.42), rgba(4, 5, 12, 0.82) 72%);
  backdrop-filter: blur(2px);
}

.title-bg {
  position: absolute;
  inset: 0;
  background: transparent;
  filter: none;
  overflow: hidden;
  z-index: 0;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.title-bg::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10,6,18,0.15) 0%, rgba(10,6,18,0.55) 100%);
}

.title-table-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 51%;
  z-index: 1;
  pointer-events: none;
  background: url('assets/cenário/mesa.png') bottom center / 100% auto no-repeat;
  opacity: 1;
  filter:
    drop-shadow(0 -10px 30px rgba(74, 214, 224, 0.12))
    brightness(0.96);
}

.title-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 40px;
  width: min(700px, 90vw);
  max-width: 700px;
}

#title-screen.is-leaving .title-content {
  pointer-events: none;
  animation: title-duel-fade-out 560ms cubic-bezier(.18,.76,.28,1) both;
}

.title-logo {
  max-width: 494px;
  width: 80%;
  margin-bottom: 28px;
  filter: drop-shadow(0 0 24px rgba(74, 214, 224, 0.5));
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(74, 214, 224, 0.4)); }
  50%      { filter: drop-shadow(0 0 32px rgba(74, 214, 224, 0.7)); }
}

@keyframes title-duel-fade-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.985);
    filter: blur(4px);
  }
}

.title-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, var(--c-gold-bright) 0%, var(--c-gold) 50%, var(--c-gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 28px rgba(201, 162, 74, 0.35);
  margin-bottom: 4px;
}
.title-sub {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-cyan);
  letter-spacing: 0.4em;
  font-weight: 500;
  margin-bottom: 28px;
}
.title-flavor {
  font-style: italic;
  color: var(--c-text-soft);
  font-size: 1.15rem;
  margin-bottom: 38px;
}

/* =====================================================
   ARCANE BUTTONS
   ===================================================== */

.arcane-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  padding: 12px 28px;
  background: linear-gradient(180deg, var(--c-stone-light) 0%, var(--c-stone) 100%);
  color: var(--c-gold-bright);
  border: 2px solid var(--c-gold-deep);
  border-radius: var(--radius-frame);
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -2px 4px rgba(0,0,0,0.6),
    0 4px 14px rgba(0,0,0,0.55);
}

.arcane-btn::before, .arcane-btn::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-gold-deep);
  font-size: 0.7rem;
  opacity: 0.8;
  transition: color 0.2s ease;
}
.arcane-btn::before { left: 8px; }
.arcane-btn::after  { right: 8px; }

.arcane-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--c-gold-bright);
  color: #fff5d6;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 0 22px rgba(201, 162, 74, 0.45),
    0 6px 18px rgba(0,0,0,0.6);
}
.arcane-btn:hover:not(:disabled)::before,
.arcane-btn:hover:not(:disabled)::after { color: var(--c-gold-bright); }
.arcane-btn:active:not(:disabled) { transform: translateY(0); }
.arcane-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.5); }
.arcane-btn[hidden] { display: none !important; }

.arcane-btn.primary {
  font-size: 1.1rem;
  padding: 16px 44px;
  background: linear-gradient(180deg, #3d2e6e 0%, #1f1840 100%);
  border-color: var(--c-cyan);
  color: var(--c-cyan-glow);
  box-shadow:
    inset 0 1px 0 rgba(74, 214, 224, 0.2),
    0 0 28px rgba(74, 214, 224, 0.35),
    0 6px 20px rgba(0,0,0,0.6);
}
.arcane-btn.primary:hover:not(:disabled) {
  border-color: var(--c-cyan-glow);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(74, 214, 224, 0.3),
    0 0 38px rgba(74, 214, 224, 0.6),
    0 6px 24px rgba(0,0,0,0.7);
}

.arcane-btn.truco   { color: var(--c-gold-bright); border-color: var(--c-gold); }
.arcane-btn.raise   { color: #ff9a4a; border-color: #aa5a1a; }
.arcane-btn.accept  { color: var(--c-green-magic); border-color: #2a6a4a; }
.arcane-btn.run     { color: var(--c-blood); border-color: #602030; }
.arcane-btn.pass    { color: var(--c-text-soft); border-color: var(--c-stone-light); }

/* =====================================================
   GAME SCREEN — cena fullscreen + UI flutuante
   ===================================================== */

#game-screen.active {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: calc(100vw / 0.9);
  height: calc(100vh / 0.9);
  overflow: hidden;
  background: transparent;
  transform: scale(0.9);
  transform-origin: top left;
}

/* ----------- SCENE: camadas pintadas ----------- */

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Camadas visuais não interceptam cliques. Cliques só nas cartas da mão. */
.layer { position: absolute; pointer-events: none; }

/* z=0: fundo */
.layer-bg {
  inset: 0;
  background: transparent;
  overflow: hidden;
  z-index: 0;
}
.layer-bg::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10,6,18,0.15) 0%, rgba(10,6,18,0.55) 100%);
}

/* z=2: rival */
.layer-rival {
  top: 4%;
  left: 50%;
  width: 30%;
  max-width: 480px;
  min-width: 260px;
  aspect-ratio: 1 / 1.05;
  transform: translateX(-50%);
  background: url('assets/Rival/Rival.png') center/contain no-repeat;
  z-index: 2;
  filter: drop-shadow(0 14px 30px rgba(74, 25, 80, 0.55));
  animation: rival-breathe 6s ease-in-out infinite;
}

@keyframes rival-breathe {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}

/* z=2.5: cartas que a Malistrix segura — abaixadas até o nível do peito/braços */
.layer-opp-hand {
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
  perspective: 700px;
  animation: rival-breathe-cards 6s ease-in-out infinite;
}

@keyframes rival-breathe-cards {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}

/* z=3: tampo da mesa */
.layer-table {
  bottom: 0;
  left: 0;
  right: 0;
  height: 48%;
  background:
    url('assets/cenário/mesa.png') bottom center/100% auto no-repeat;
  z-index: 4;
  filter: drop-shadow(0 -10px 30px rgba(74, 214, 224, 0.12));
}

/* z=4: props (ordem do conceito: caneca de madeira esq, caveira centro-esq, moedas/cartas centro, vela direita) */
.layer-props { inset: 0; z-index: 8; }

.prop {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.6));
}

.prop-mug {                /* caneca de madeira: canto esquerdo da mesa */
  bottom: 4%;
  left: 3%;
  width: 11%;
  min-width: 90px;
}
.prop-skull {              /* caneca caveira: ao centro-esquerda, em frente ao rival */
  bottom: 30%;
  left: 26%;
  width: 9%;
  min-width: 80px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.7))
          drop-shadow(0 0 14px rgba(74, 214, 224, 0.18));
}
.prop-coins {              /* moedas: centro-frente da mesa */
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  min-width: 240px;
  opacity: 0.95;
}
.prop-candle-r {           /* vela direita */
  bottom: 16%;
  right: 14%;
  width: 7%;
  min-width: 60px;
  filter: drop-shadow(0 0 22px rgba(255, 180, 90, 0.6));
  animation: candle-flicker 2.4s ease-in-out infinite;
}
.prop-candle-l {           /* vela esquerda — mais discreta */
  bottom: 36%;
  left: 14%;
  width: 5%;
  min-width: 44px;
  opacity: 0.85;
  filter: drop-shadow(0 0 18px rgba(255, 180, 90, 0.5));
  animation: candle-flicker 3.1s ease-in-out infinite reverse;
}

@keyframes candle-flicker {
  0%, 100% { filter: drop-shadow(0 0 22px rgba(255, 180, 90, 0.6)) brightness(1); }
  35%      { filter: drop-shadow(0 0 26px rgba(255, 200, 110, 0.75)) brightness(1.1); }
  60%      { filter: drop-shadow(0 0 18px rgba(255, 160, 80, 0.5)) brightness(0.92); }
}

/* z=5: cartas no centro da mesa — fileira HORIZONTAL deitadas na perspectiva da mesa */
.layer-played {
  position: absolute;
  bottom: 16%;                       /* sobre o tampo da mesa, não no centro do viewport */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;               /* HORIZONTAL: opp | vira | self */
  align-items: center;
  gap: 22px;
  z-index: 6;
  pointer-events: none;
}

/* perspective vai DIRETO no pai das cartas pra rotateX surtir efeito */
.played-row {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 110px;
  min-height: 100px;
  justify-content: center;
  perspective: 900px;
  perspective-origin: 50% 0%;
  transform-style: preserve-3d;
}

.vira-spot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 100px;
  perspective: 900px;
  perspective-origin: 50% 0%;
  transform-style: preserve-3d;
}

/* z=6: braço frontal do rival — alinhado ao corpo dele e estendendo p/ a mesa */
.layer-rival-arm {
  top: 46%;
  left: 50%;
  transform: translateX(-22%);       /* hand a esquerda do centro, ombro encostado no rival */
  width: 22%;
  min-width: 200px;
  aspect-ratio: 1.4 / 1;
  background: url('assets/Rival/braço frente rival.png') center/contain no-repeat;
  z-index: 5;                        /* atrás das cartas jogadas (cartas vencem o braço) */
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6));
}

/* z=7-9: POV do jogador — proporção igual ao concept (alto e estreito, canto inferior-esquerdo) */
.layer-player {
  bottom: -8%;
  left: -6%;
  width: 30%;
  min-width: 320px;
  height: 92%;
  z-index: 8;
}

.player-hand-bg {
  position: absolute;
  inset: 0;
  background: url('assets/jogador/mao_jogador.png') bottom left/contain no-repeat;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.65));
  z-index: 1;
  pointer-events: none;
}

/* Cartas no leque, sobre os dedos */
.player-hand-cards {
  position: absolute;
  bottom: 30%;
  left: 38%;
  width: 60%;
  height: 50%;
  z-index: 2;
  pointer-events: auto;          /* CRÍTICO: habilita cliques */
  perspective: 900px;
}

/* Polegar GRANDE, à frente das cartas (z=3) */
.player-hand-thumb {
  position: absolute;
  bottom: 18%;
  left: 56%;
  width: 32%;
  aspect-ratio: 1 / 1.25;
  background: url('assets/jogador/dedao_mao_jogador.png') center/contain no-repeat;
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
  pointer-events: none;
}

/* =====================================================
   CARDS (3D wrapper + face PNG)
   ===================================================== */

.card {
  --card-w: 100px;
  width: var(--card-w);
  aspect-ratio: 5 / 7;
  position: relative;
  flex-shrink: 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7));
  transition: transform 0.3s ease, filter 0.25s ease;
}

.card-3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.card-face {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: calc(var(--card-w) * 0.06);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-front {
  /* PNG ilustrado completo, atribuído via inline-style por carta */
  z-index: 2;
}

.card-back {
  background-image: url('assets/cartas/verso_padrão.png');
  transform: rotateY(180deg);
  z-index: 1;
}

/* Vira por padrão fica de frente. Quando .face-down, vira pro verso */
.card.face-down .card-3d {
  transform: rotateY(180deg);
}

/* Pequena espessura visual */
.card::after {
  content: "";
  position: absolute;
  inset: auto -1px -3px -1px;
  height: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
  border-radius: 0 0 calc(var(--card-w) * 0.06) calc(var(--card-w) * 0.06);
  z-index: 0;
  filter: blur(2px);
}

/* MANILHA: glow âmbar + estrela */
.card.is-manilha {
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7))
          drop-shadow(0 0 16px rgba(233, 194, 103, 0.9));
}
.card.is-manilha::before {
  content: "★";
  position: absolute;
  top: 4%;
  right: 6%;
  font-family: var(--font-display);
  font-size: calc(var(--card-w) * 0.18);
  color: var(--c-gold-bright);
  text-shadow: 0 0 10px rgba(233, 194, 103, 1), 0 0 4px rgba(0,0,0,0.8);
  z-index: 5;
  pointer-events: none;
}

/* =====================================================
   MÃO DO JOGADOR — leque, hover, deal animation
   ===================================================== */

.player-hand-cards .card {
  --card-w: 138px;
  --i: 0;
  --total: 3;
  --centered: calc(var(--i) - (var(--total) - 1) / 2);
  --rot: calc(var(--centered) * 16deg);
  --tx: calc(var(--centered) * 48px);
  --ty: calc(var(--centered) * var(--centered) * -6px);
  position: absolute;
  bottom: 0;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) translate(var(--tx), var(--ty)) rotate(var(--rot));
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.25s ease, filter 0.2s ease;
}

.player-hand-cards .card.fresh {
  animation: card-deal 0.55s cubic-bezier(.2,.7,.3,1.3) backwards;
}
.player-hand-cards .card.fresh:nth-child(1) { animation-delay: 0.05s; }
.player-hand-cards .card.fresh:nth-child(2) { animation-delay: 0.18s; }
.player-hand-cards .card.fresh:nth-child(3) { animation-delay: 0.31s; }

@keyframes card-deal {
  0%   { transform: translateX(-50%) translate(var(--tx), 100px) rotate(0); opacity: 0; }
  100% { transform: translateX(-50%) translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 1; }
}

.player-hand-cards .card:hover {
  transform: translateX(-50%) translate(var(--tx), -32px) rotate(var(--rot)) scale(1.1);
  filter: drop-shadow(0 14px 28px rgba(0,0,0,0.7))
          drop-shadow(0 0 22px rgba(74, 214, 224, 0.8));
  z-index: 50;
}

.player-hand-cards .card.disabled {
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.7)) brightness(0.7) saturate(0.6);
  cursor: not-allowed;
}
.player-hand-cards .card.disabled:hover {
  transform: translateX(-50%) translate(var(--tx), var(--ty)) rotate(var(--rot));
}

/* =====================================================
   CARTAS NA MESA — em perspectiva 3D (deitadas)
   ===================================================== */

.played-row .card {
  --card-w: 160px;
  --card-tilt: 0deg;
  --table-card-scale: 1;
  transform: translateY(-6px) rotateZ(var(--card-tilt)) scale(var(--table-card-scale));
  transform-origin: center;
  z-index: 2;
}

/* tilts aleatórios pra parecer cartas largadas */
#played-opp .card { --card-tilt: 5deg; }
#played-self .card { --card-tilt: -5deg; }

.played-row .card.played {
  animation:
    card-play 0.48s cubic-bezier(.2,.7,.3,1.22),
    card-float 3.4s ease-in-out 0.48s infinite;
}

@keyframes card-play {
  0% {
    transform: translateY(42px) rotateZ(calc(var(--card-tilt) - 10deg)) scale(0.72);
    opacity: 0;
  }
  70% {
    transform: translateY(-16px) rotateZ(var(--card-tilt)) scale(calc(var(--table-card-scale) * 1.06));
    opacity: 1;
  }
  100% {
    transform: translateY(-6px) rotateZ(var(--card-tilt)) scale(var(--table-card-scale));
    opacity: 1;
  }
}

@keyframes card-float {
  0%, 100% { transform: translateY(-6px) rotateZ(var(--card-tilt)) scale(var(--table-card-scale)); }
  50%      { transform: translateY(-18px) rotateZ(var(--card-tilt)) scale(var(--table-card-scale)); }
}

.played-row .card.winner-glow {
  filter: drop-shadow(0 9px 18px rgba(0,0,0,0.75))
          drop-shadow(0 0 34px rgba(111, 224, 154, 0.95));
  animation:
    card-float 3.4s ease-in-out infinite,
    winner-pulse 1.2s ease-in-out infinite;
}
.played-row .card.loser-fade { filter: brightness(0.55) saturate(0.5); opacity: 0.68; }

@keyframes winner-pulse {
  0%, 100% { filter: drop-shadow(0 9px 18px rgba(0,0,0,0.75)) drop-shadow(0 0 24px rgba(111, 224, 154, 0.85)); }
  50%      { filter: drop-shadow(0 9px 18px rgba(0,0,0,0.75)) drop-shadow(0 0 44px rgba(111, 224, 154, 1)); }
}

/* VIRA: carta deitada e levemente girada */
.vira-spot .card {
  --card-w: 226px;
  --card-rx: 66deg;
  --card-tilt: 14deg;
  transform: rotateX(var(--card-rx)) rotateZ(var(--card-tilt)) scaleY(0.42);
  transform-origin: center 70%;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.74))
          drop-shadow(0 0 30px rgba(233, 194, 103, 0.84));
}
.vira-spot .card::after {
  display: none;
}

/* =====================================================
   CARTAS NA MÃO DO RIVAL — face-down em leque inclinado
   ===================================================== */

.layer-opp-hand .card {
  --card-w: 54px;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.7));
}
.layer-opp-hand .card:nth-child(1) { transform: rotateY(20deg) rotateZ(-14deg) translateX(-6px); }
.layer-opp-hand .card:nth-child(2) { transform: rotateY(0deg)  rotateZ(0deg)   translateY(-4px); }
.layer-opp-hand .card:nth-child(3) { transform: rotateY(-20deg) rotateZ(14deg) translateX(6px); }

/* Cartas no cemitério (mini) */
.graveyard .card {
  --card-w: 30px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  transform: none;
}
.graveyard .card::after { display: none; }
.graveyard .card.is-manilha::before { font-size: 8px; }

/* =====================================================
   HUD SUPERIOR (flutuante)
   ===================================================== */

.hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(20,16,42,0.85) 0%, rgba(10,6,18,0.5) 100%);
  border: 1px solid var(--c-gold-deep);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-arcane), inset 0 1px 0 rgba(201,162,74,0.1);
  z-index: 20;
  backdrop-filter: blur(2px);
}

.hud-player { display: flex; align-items: center; gap: 14px; }
.hud-self { justify-content: flex-end; }

.portrait {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--c-gold-deep);
  background: radial-gradient(circle at 30% 30%, var(--c-stone-light), var(--c-bg-deep));
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(201,162,74,0.25), inset 0 0 12px rgba(0,0,0,0.7);
  position: relative;
}
.portrait::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--c-gold);
  opacity: 0.5;
}
.portrait-opp  {
  background: url('assets/Rival/Rival.png') center 20%/180% no-repeat, radial-gradient(circle at 30% 30%, #4a1d3a, #1a0612);
  border-color: var(--c-blood);
}
.portrait-opp::after { border-color: var(--c-blood); }
.portrait-self {
  background: url('assets/jogador/mao_jogador.png') center 60%/180% no-repeat, radial-gradient(circle at 30% 30%, #1d3a4a, #061218);
  border-color: var(--c-cyan);
}
.portrait-self::after { border-color: var(--c-cyan); }

.hud-info { min-width: 180px; max-width: 240px; }
.hud-info-right { text-align: right; }

.hud-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-gold-bright);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(201,162,74,0.3);
}

.hud-bar { display: flex; align-items: center; gap: 8px; }
.hud-info-right .hud-bar { flex-direction: row-reverse; }

.bar-track {
  flex: 1;
  height: 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--c-stone-light);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}
.bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  background-size: 200% 100%;
  animation: bar-shimmer 3s linear infinite;
}
.opp-bar    { background: linear-gradient(90deg, #b03050 0%, #ff5a7a 50%, #b03050 100%); }
.player-bar { background: linear-gradient(90deg, #2a8aaa 0%, #66f0ff 50%, #2a8aaa 100%); }

@keyframes bar-shimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.bar-text {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--c-text-soft);
  font-weight: 600;
  min-width: 42px;
}

.hud-rounds-mini {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--c-text-dim);
  margin-top: 2px;
}

.hud-center { text-align: center; padding: 0 16px; }

.hud-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, var(--c-gold-bright) 0%, var(--c-gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hud-subtitle {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--c-cyan);
  letter-spacing: 0.3em;
  margin-bottom: 6px;
}
.hand-value-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(107, 63, 160, 0.3);
  border: 1px solid var(--c-purple);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--c-cyan-glow);
  letter-spacing: 0.1em;
}

/* =====================================================
   PAINEL LATERAL (esquerdo, flutuante)
   ===================================================== */

.info-panel {
  position: absolute;
  bottom: 90px;
  left: 12px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(20,16,42,0.88) 0%, rgba(10,6,18,0.78) 100%);
  border: 1px solid var(--c-gold-deep);
  border-radius: var(--radius-frame);
  box-shadow: inset 0 1px 0 rgba(201,162,74,0.1), 0 6px 20px rgba(0,0,0,0.5);
  z-index: 20;
  backdrop-filter: blur(2px);
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.panel-block {
  padding: 6px 10px;
  background: rgba(10,6,18,0.4);
  border: 1px solid var(--c-stone-light);
  border-radius: 4px;
}

.panel-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--c-text-dim);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.panel-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--c-gold-bright);
  font-weight: 700;
}

.panel-value.tentos {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.tento-row em {
  font-style: normal;
  color: var(--c-text-soft);
  font-size: 0.78rem;
  margin-right: 6px;
}

.manilha-info {
  font-size: 0.85rem;
  color: var(--c-cyan-glow);
  text-shadow: 0 0 8px rgba(74, 214, 224, 0.5);
}

.panel-graveyard { min-height: 70px; }

.graveyard {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 50px;
  max-height: 110px;
  overflow-y: auto;
}

.history-panel {
  position: absolute;
  left: 16px;
  top: 150px;
  width: 46px;
  max-height: 330px;
  padding: 8px 7px;
  background: linear-gradient(180deg, rgba(36, 40, 58, 0.84), rgba(8, 10, 17, 0.78));
  border: 2px solid rgba(8, 10, 16, 0.95);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(116, 129, 154, 0.42) inset,
    0 10px 24px rgba(0, 0, 0, 0.44);
  z-index: 24;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  transition: width 180ms ease, padding 180ms ease, background 180ms ease;
}

.history-panel.is-expanded {
  width: 260px;
  padding: 11px 12px 12px;
  background: linear-gradient(180deg, rgba(36, 40, 58, 0.88), rgba(8, 10, 17, 0.82));
}

.history-panel:focus-visible {
  outline: 2px solid rgba(113, 226, 255, 0.9);
  outline-offset: 3px;
}

.history-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #d9e8ff;
  text-transform: uppercase;
  text-align: center;
  max-height: 0;
  margin-bottom: 0;
  text-shadow: 0 0 10px rgba(118, 190, 255, 0.42);
  opacity: 0;
  transform: translateX(-8px);
  overflow: hidden;
  transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease, margin 160ms ease;
  pointer-events: none;
}

.history-panel.is-expanded .history-title {
  max-height: 22px;
  margin-bottom: 8px;
  opacity: 1;
  transform: translateX(0);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  justify-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: linear-gradient(180deg, rgba(18, 22, 34, 0.78), rgba(7, 9, 15, 0.66));
  border: 1px solid rgba(105, 116, 140, 0.34);
  border-radius: 6px;
  overflow: hidden;
  transition: width 180ms ease, min-height 180ms ease, padding 180ms ease, gap 180ms ease;
}

.history-panel.is-expanded .history-entry {
  grid-template-columns: 24px 1fr;
  gap: 7px;
  justify-items: start;
  width: auto;
  min-height: 30px;
  height: auto;
  padding: 5px 8px;
}

.history-marker {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 50%;
  color: #9fb1c9;
  background: rgba(159, 177, 201, 0.12);
  border: 1px solid currentColor;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 10px currentColor;
}

.history-text {
  font-family: var(--font-display);
  font-size: 0.72rem;
  line-height: 1.25;
  color: #f0f4ff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.75);
  width: 0;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 160ms ease, width 160ms ease;
}

.history-panel.is-expanded .history-text {
  width: auto;
  opacity: 1;
  white-space: normal;
}

.history-empty {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: rgba(225, 234, 255, 0.62);
  text-align: center;
  border: 1px solid rgba(105, 116, 140, 0.34);
  border-radius: 6px;
}

.history-panel.is-expanded .history-empty {
  width: auto;
  height: auto;
  padding: 8px;
}

.history-entry.type-player .history-marker { color: #61e6ff; }
.history-entry.type-opp .history-marker { color: #ff4e6a; }
.history-entry.type-truco .history-marker { color: #ff9b22; }
.history-entry.type-round .history-marker { color: #e9c267; }
.history-entry.type-vira .history-marker { color: #79f2ae; }
.history-entry.type-hand .history-marker { color: #b889ff; }

/* =====================================================
   MESSAGE BAR (flutuante, abaixo do HUD)
   ===================================================== */

.message-bar {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 8px 24px;
  background: linear-gradient(90deg, transparent 0%, rgba(20,16,42,0.85) 20%, rgba(20,16,42,0.85) 80%, transparent 100%);
  border-top: 1px solid var(--c-gold-deep);
  border-bottom: 1px solid var(--c-gold-deep);
  z-index: 20;
  min-width: 320px;
  max-width: 60vw;
}

.message-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--c-cyan-glow);
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(74, 214, 224, 0.5);
  min-height: 1.4em;
}

.message-text.flash { animation: message-flash 0.6s ease; }

@keyframes message-flash {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); color: #fff; text-shadow: 0 0 20px var(--c-cyan-glow); }
  100% { transform: scale(1); }
}

/* =====================================================
   ACTION BAR (canto inferior direito)
   ===================================================== */

.action-bar {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 20;
  max-width: 50%;
}

.action-bar .arcane-btn { font-size: 0.78rem; padding: 10px 18px; }

/* =====================================================
   END SCREEN
   ===================================================== */

#end-screen.active { display: flex; align-items: center; justify-content: center; }

.end-content {
  text-align: center;
  padding: 50px 60px;
  background: linear-gradient(180deg, rgba(20,16,42,0.95) 0%, rgba(10,6,18,0.95) 100%);
  border: 2px solid var(--c-gold-deep);
  border-radius: var(--radius-frame);
  box-shadow: 0 0 60px rgba(74, 214, 224, 0.3), inset 0 0 40px rgba(0,0,0,0.6);
  max-width: 540px;
}

.end-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, var(--c-gold-bright), var(--c-gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.end-title.defeat {
  background: linear-gradient(180deg, #ff5a7a, #6a1830);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.end-flavor {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--c-text-soft);
  margin-bottom: 28px;
}
.end-score {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 32px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--c-gold-bright);
}
.end-score em { font-style: normal; color: var(--c-text-soft); margin-right: 6px; }

/* =====================================================
   RESPONSIVO
   ===================================================== */

@media (max-width: 1300px) {
  .player-hand-cards .card { --card-w: 110px; }
  .played-row .card { --card-w: 88px; }
  .vira-spot .card { --card-w: 78px; }
  .info-panel { width: 180px; }
}

@media (max-width: 1024px) {
  .layer-rival { width: 36%; }
  .layer-player { width: 44%; }
  .player-hand-cards .card { --card-w: 100px; }
  .info-panel { bottom: 80px; width: 170px; }
}

@media (max-width: 820px) {
  .hud { padding: 6px 10px; }
  .hud-name { font-size: 0.85rem; }
  .hud-info { min-width: 130px; }
  .hud-title { font-size: 1.1rem; }
  .info-panel {
    position: static;
    width: auto;
    max-height: none;
    margin: 12px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .history-panel {
    left: 8px;
    top: 116px;
    width: 42px;
    max-height: 220px;
    padding: 7px;
  }
  .history-panel.is-expanded {
    width: 210px;
    padding: 8px;
  }
  .history-text {
    font-size: 0.64rem;
  }
  .panel-block { min-width: 130px; flex-shrink: 0; }
  .layer-player { width: 56%; }
  .layer-rival  { width: 50%; }
  .player-hand-cards .card { --card-w: 88px; }
  .action-bar { max-width: 95%; bottom: 8px; right: 8px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: var(--c-stone-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-purple); }

/* =====================================================
   CONCEPT UI PASS
   HUD e controles inspirados no concept.png.
   ===================================================== */

#game-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 48% 46%, transparent 0%, transparent 48%, rgba(3, 6, 14, 0.36) 100%),
    linear-gradient(180deg, rgba(4, 7, 18, 0.16) 0%, transparent 34%, rgba(4, 7, 18, 0.24) 100%);
}

.layer-bg {
  filter: none;
}

.layer-rival {
  top: 5.2%;
  left: auto;
  right: 6.6%;
  width: 38.5%;
  max-width: 680px;
  min-width: 340px;
  transform: none;
}

.layer-rival-card-rig {
  top: 5.2%;
  left: auto;
  right: 6.6%;
  width: 38.5%;
  max-width: 680px;
  min-width: 340px;
  aspect-ratio: 1 / 1.05;
  z-index: 7;
  transform: none;
  animation: rival-breathe 6s ease-in-out infinite;
}

@keyframes rival-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.layer-opp-hand {
  position: absolute;
  top: 69.8%;
  left: 34%;
  right: auto;
  transform: none;
  z-index: 1;
  animation: none;
}

.layer-rival-right-arm {
  position: absolute;
  top: 71.4%;
  left: 0;
  width: 39.8%;
  max-width: none;
  min-width: 0;
  aspect-ratio: 267 / 190;
  z-index: 0;
  transform: rotate(0.5deg);
  transform-origin: 70% 34%;
  background: url('assets/Rival/Braço direiro rival.png') center/contain no-repeat;
  opacity: 0.98;
  filter: drop-shadow(0 7px 14px rgba(0,0,0,0.55));
  pointer-events: none;
}

.layer-opp-hand .card {
  --card-w: clamp(48px, 3vw, 58px);
}

@keyframes rival-breathe-cards {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.layer-rival-arm {
  position: absolute;
  display: none;
  top: 74.3%;
  left: 46.7%;
  right: auto;
  width: 53.1%;
  max-width: none;
  min-width: 0;
  aspect-ratio: 357 / 142;
  z-index: 2;
  transform: rotate(1deg);
  transform-origin: 78% 50%;
  opacity: 0.98;
  filter: drop-shadow(0 7px 14px rgba(0,0,0,0.58));
  animation: none;
}

.layer-rival-arm.is-holding-cards {
  display: block;
}

@keyframes rival-card-arm-breathe {
  0%, 100% { transform: rotate(1deg) translateY(0); }
  50%      { transform: rotate(1deg) translateY(-6px); }
}

.layer-table {
  height: 51%;
  filter:
    drop-shadow(0 -10px 30px rgba(74, 214, 224, 0.12))
    brightness(0.96);
}

.layer-played {
  inset: 0;
  left: 0;
  bottom: auto;
  width: 100%;
  height: 100%;
  display: block;
  gap: 0;
  z-index: 10;
  perspective: none;
  perspective-origin: center;
  transform: none;
  transform-style: flat;
}

.layer-played .played-row,
.layer-played .vira-spot {
  position: absolute;
  margin: 0;
}

.layer-played .played-row {
  min-width: 300px;
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer-played .played-row::before,
.layer-played .vira-spot::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.82);
  filter: blur(18px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.layer-played .played-row:has(.card)::before,
.layer-played .vira-spot:has(.card)::before,
.layer-played .vira-spot:has(.vira-landscape-card)::before {
  opacity: 1;
  transform: scale(1);
}

#played-opp {
  top: 51%;
  left: 67%;
  transform: translate(-50%, -50%);
}

#played-self {
  top: 52%;
  left: 55%;
  transform: translate(-50%, -50%);
}

.layer-played .vira-spot {
  top: 73%;
  left: 75%;
  width: 440px;
  height: 260px;
  transform: translate(-50%, -50%);
  transform-origin: center;
  transform-style: flat;
  isolation: isolate;
}

.played-row .card {
  --card-w: 160px;
  --table-card-scale: 1;
  transform: translateY(-6px) rotateZ(var(--card-tilt)) scale(var(--table-card-scale));
  transform-origin: center;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.72))
          drop-shadow(0 0 18px var(--card-aura, rgba(72, 215, 235, 0.48)));
}

.vira-spot .card {
  --card-w: 292px;
  position: relative;
  left: -128px;
  top: -12px;
  width: var(--card-w);
  aspect-ratio: 7 / 5;
  z-index: 1;
  transform: rotateZ(5deg) rotateX(6deg);
  transform-origin: center;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.74))
          drop-shadow(0 0 30px rgba(233, 194, 103, 0.84));
}

.vira-spot .card .card-3d {
  inset: auto;
  left: 50%;
  top: 50%;
  width: calc(var(--card-w) * 5 / 7);
  height: var(--card-w);
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
}

.layer-player {
  left: -3%;
  bottom: -11%;
  width: 42%;
  min-width: 500px;
  height: 94%;
}

.player-hand-cards {
  bottom: 43%;
  left: 48%;
  width: 78%;
}

.player-hand-thumb {
  bottom: 17.5%;
  left: 44%;
  width: 43%;
  aspect-ratio: 1 / 1;
  transition: opacity 0.18s ease;
}

.layer-player.no-cards .player-hand-thumb {
  opacity: 0;
  visibility: hidden;
}

.layer-player.has-cards .player-hand-thumb {
  opacity: 1;
  visibility: visible;
}

.player-hand-cards .card {
  --card-w: 252px;
  --rot: calc(var(--centered) * 12deg);
  --tx: calc(var(--centered) * 112px);
  --ty: calc(var(--centered) * var(--centered) * -20px);
}

.player-hand-cards .card:hover {
  transform: translateX(-50%) translate(var(--tx), -42px) rotate(var(--rot)) scale(1.08);
}

.prop-skull {
  bottom: 39%;
  left: 45%;
  width: 8.5%;
  z-index: 2;
}

.prop-mug {
  bottom: 18%;
  left: 2.7%;
  width: 12.3%;
  z-index: 1;
}

.prop-coins {
  bottom: 8.5%;
  left: 57%;
  width: 33%;
  z-index: 2;
}

.prop-candle-r {
  bottom: 32%;
  right: 17.5%;
  width: 6.3%;
  z-index: 4;
}

.prop-candle-l {
  bottom: 36%;
  left: 13.5%;
  width: 5.4%;
  z-index: 2;
}

#played-opp .card {
  --card-w: 180px;
  --card-tilt: -1deg;
  --table-card-scale: 1;
  --card-aura: rgba(255, 46, 80, 0.68);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.74))
          drop-shadow(0 0 24px rgba(255, 46, 80, 0.72))
          drop-shadow(0 0 44px rgba(142, 16, 49, 0.5));
}

#played-self .card {
  --card-w: 238px;
  --card-tilt: 2deg;
  --table-card-scale: 1;
  --card-aura: rgba(78, 219, 255, 0.72);
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.74))
          drop-shadow(0 0 26px rgba(78, 219, 255, 0.78))
          drop-shadow(0 0 48px rgba(29, 114, 255, 0.5));
}

.vira-spot {
  position: relative;
  min-width: 440px;
  min-height: 260px;
}

.vira-landscape-card {
  --vira-w: 330px;
  position: absolute;
  left: 8px;
  top: 92px;
  width: var(--vira-w);
  aspect-ratio: 7 / 5;
  z-index: 2;
  transform: rotate(4deg) skewX(-4deg) scaleY(0.66);
  transform-origin: center;
  filter:
    drop-shadow(0 12px 12px rgba(0,0,0,0.62))
    drop-shadow(0 0 24px rgba(233, 194, 103, 0.62));
  pointer-events: none;
}

.vira-landscape-card::before {
  content: "";
  position: absolute;
  inset: 9% 2% -7%;
  z-index: -1;
  border-radius: 45%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.58) 0 34%, rgba(0, 0, 0, 0.26) 54%, transparent 76%);
  filter: blur(10px);
  transform: none;
}

.vira-landscape-art {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--vira-w) * 5 / 7);
  height: var(--vira-w);
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: calc(var(--vira-w) * 0.038);
  box-shadow:
    0 0 0 2px rgba(28, 22, 16, 0.92),
    0 0 0 4px rgba(218, 173, 82, 0.34);
}

.vira-landscape-card.is-manilha .vira-landscape-art {
  box-shadow:
    0 0 0 2px rgba(28, 22, 16, 0.92),
    0 0 0 4px rgba(240, 198, 90, 0.6),
    0 0 24px rgba(255, 216, 105, 0.68);
}

#played-self::before {
  background:
    radial-gradient(circle, rgba(117, 239, 255, 0.72) 0 16%, rgba(48, 154, 255, 0.38) 38%, transparent 72%),
    radial-gradient(circle, rgba(80, 195, 255, 0.38), transparent 62%);
}

#played-opp::before {
  background:
    radial-gradient(circle, rgba(255, 82, 94, 0.7) 0 16%, rgba(170, 20, 48, 0.42) 38%, transparent 72%),
    radial-gradient(circle, rgba(255, 40, 74, 0.32), transparent 64%);
}

.layer-played .vira-spot::before {
  inset: 54% 4% 6%;
  background:
    radial-gradient(ellipse, rgba(255, 225, 112, 0.68) 0 16%, rgba(214, 142, 42, 0.42) 40%, transparent 72%),
    radial-gradient(ellipse, rgba(255, 196, 74, 0.32), transparent 66%);
  filter: blur(14px);
  transform: scale(1.06, 0.44);
}

.table-deck-pile {
  --deck-w: 245px;
  position: absolute;
  left: 255px;
  top: 64px;
  width: var(--deck-w);
  aspect-ratio: 254 / 233;
  z-index: 4;
  border-radius: 0;
  transform: rotate(1deg);
  transform-origin: center;
  transform-style: flat;
  background: url('assets/cartas/maço_em_cima_do_vira.png') center/contain no-repeat;
  filter:
    drop-shadow(0 12px 18px rgba(0,0,0,0.72))
    drop-shadow(0 0 20px rgba(233, 194, 103, 0.42));
  pointer-events: none;
}

.table-deck-pile::before,
.table-deck-pile::after {
  display: none;
}

.hud {
  top: 10px;
  left: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: minmax(310px, 390px) 1fr minmax(310px, 390px);
  align-items: start;
  gap: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 30;
}

.duelist-panel {
  position: relative;
  min-height: 124px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px 16px 118px;
  background:
    linear-gradient(180deg, rgba(52, 56, 75, 0.96) 0%, rgba(24, 26, 40, 0.96) 62%, rgba(12, 13, 22, 0.96) 100%);
  border: 2px solid rgba(12, 16, 30, 0.95);
  clip-path: polygon(24px 0, 100% 0, calc(100% - 26px) 84%, 56px 84%, 40px 100%, 0 100%, 0 28px);
  box-shadow:
    0 0 0 2px rgba(121, 126, 150, 0.58) inset,
    0 0 0 4px rgba(4, 5, 11, 0.78) inset,
    0 8px 24px rgba(0, 0, 0, 0.58),
    0 0 28px rgba(109, 53, 218, 0.24);
}

.duelist-panel::before {
  content: "";
  position: absolute;
  inset: 8px 12px auto auto;
  width: 19px;
  height: 27px;
  background: radial-gradient(circle at 50% 28%, #b661ff 0 22%, #6c19d4 44%, #211136 78%);
  clip-path: polygon(50% 0, 100% 34%, 72% 100%, 28% 100%, 0 34%);
  filter: drop-shadow(0 0 12px rgba(178, 87, 255, 0.95));
}

.hud-opponent {
  padding: 14px 118px 16px 18px;
  justify-content: flex-end;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 28px, 100% 100%, calc(100% - 40px) 100%, calc(100% - 56px) 84%, 26px 84%);
}

.hud-opponent::before {
  inset: 8px auto auto 12px;
}

.portrait-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
}

.hud-opponent .portrait-frame {
  left: auto;
  right: 0;
}

.portrait {
  width: 100px;
  height: 100px;
  border: 4px solid #596070;
  background-color: #111622;
  box-shadow:
    0 0 0 4px rgba(14, 17, 28, 0.95),
    0 0 0 7px rgba(111, 118, 142, 0.72),
    inset 0 0 18px rgba(0, 0, 0, 0.85),
    0 10px 22px rgba(0, 0, 0, 0.62);
}

.portrait::after {
  inset: -10px;
  border: 2px solid rgba(18, 21, 34, 0.95);
  box-shadow: inset 0 0 18px rgba(155, 104, 255, 0.2);
}

.portrait-self {
  background: url('assets/jogador/mao_jogador.png') center 53%/170% no-repeat, radial-gradient(circle at 45% 30%, #314b63, #08111a);
  border-color: #607180;
}

.portrait-opp {
  background: url('assets/Rival/Rival.png') center 18%/190% no-repeat, radial-gradient(circle at 45% 26%, #463053, #080912);
  border-color: #716b87;
}

.pov-badge {
  position: absolute;
  left: 48px;
  bottom: -26px;
  transform: translateX(-50%);
  padding: 3px 11px 5px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  color: #f2f1ff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.75);
  background: linear-gradient(180deg, #3b3c4d 0%, #1a1b28 100%);
  border: 2px solid #0a0c14;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(131, 138, 160, 0.8) inset, 0 5px 10px rgba(0,0,0,0.5);
}

.hud-info {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.hud-info-right {
  text-align: right;
}

.hud-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  color: #fff8eb;
  letter-spacing: 0;
  margin-bottom: 9px;
  text-shadow:
    0 2px 0 rgba(0,0,0,0.9),
    0 0 10px rgba(255,255,255,0.22);
}

.hud-bar {
  gap: 7px;
}

.bar-track {
  height: 24px;
  border: 3px solid #10131d;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.13), transparent 45%),
    #242838;
  box-shadow:
    0 0 0 2px rgba(90, 97, 112, 0.8),
    inset 0 3px 4px rgba(0,0,0,0.65);
}

.bar-fill {
  position: relative;
  background-size: 100% 100%;
  animation: none;
}

.bar-fill::after {
  content: "";
  position: absolute;
  inset: 2px 0 auto 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(255,255,255,0.38), transparent);
}

.player-bar,
.opp-bar {
  background: linear-gradient(90deg, #109b23 0%, #35f65c 58%, #138d29 100%);
}

.bar-text {
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  min-width: 0;
  width: max-content;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 24px;
  color: #eef6ea;
  text-shadow: 0 2px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.8);
  pointer-events: none;
}

.hud-bar {
  position: relative;
}

.hud-opponent .bar-text {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

.hud-tokens {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.hud-tokens-right {
  justify-content: flex-end;
}

.mana-gem,
.round-token {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 900;
  color: #f5efff;
  text-shadow: 0 2px 2px rgba(0,0,0,0.75);
  border: 2px solid #111521;
  clip-path: polygon(50% 0, 92% 25%, 80% 82%, 50% 100%, 20% 82%, 8% 25%);
  box-shadow: 0 0 0 1px rgba(235,235,255,0.28) inset, 0 0 12px rgba(144, 58, 244, 0.5);
}

.mana-gem {
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.82), transparent 16%),
    linear-gradient(140deg, #d06cff 0%, #8129e9 44%, #321156 100%);
}

.round-token {
  border-radius: 6px;
  clip-path: none;
}

.round-token.purple {
  background: linear-gradient(180deg, #b45cff 0%, #5a1ab4 100%);
}

.round-token.blue {
  background: linear-gradient(180deg, #46b8ff 0%, #134f91 100%);
  box-shadow: 0 0 0 1px rgba(220,245,255,0.38) inset, 0 0 12px rgba(64, 190, 255, 0.5);
}

.round-progress {
  padding: 4px 10px 5px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  color: #f1f4ff;
  background: linear-gradient(180deg, #3d3f51, #171924);
  border: 2px solid #0a0c14;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(135, 143, 170, 0.74) inset;
}

.hud-center {
  position: relative;
  justify-self: center;
  padding: 2px 8px 0;
  text-align: center;
  min-width: 360px;
}

.hud-title {
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff9ff 0%, #a9ddff 38%, #6c6fe2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 9px rgba(159, 213, 255, 0.86)) drop-shadow(0 2px 0 rgba(0,0,0,0.9));
}

.hud-subtitle {
  margin-top: -1px;
  color: #cfd8ff;
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  text-shadow: 0 0 12px rgba(123, 131, 255, 0.7);
}

.hand-value-badge {
  margin-top: 7px;
  padding: 4px 13px 5px;
  background: linear-gradient(180deg, rgba(53, 55, 74, 0.92), rgba(18, 19, 29, 0.92));
  border: 2px solid #151824;
  border-radius: 5px;
  color: #dec5ff;
  box-shadow: 0 0 0 1px rgba(132, 89, 219, 0.62) inset, 0 0 16px rgba(109, 53, 218, 0.25);
}

.message-bar {
  top: 31%;
  left: 51%;
  min-width: min(560px, 80vw);
  max-width: min(720px, 86vw);
  padding: 5px 28px 9px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(7, 13, 29, 0.88) 18%, rgba(7, 13, 29, 0.9) 82%, transparent 100%);
  border: 0;
  z-index: 25;
  pointer-events: none;
}

.message-bar::before,
.message-bar::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(170, 225, 255, 0.95), transparent);
  box-shadow: 0 0 12px rgba(115, 190, 255, 0.9);
}

.message-bar::before { top: 0; }
.message-bar::after { bottom: 0; }

.message-text {
  font-size: clamp(2rem, 3.8vw, 3.55rem);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #f3f5ff;
  text-shadow:
    0 3px 0 rgba(0,0,0,0.95),
    0 0 16px rgba(159, 213, 255, 0.9),
    0 0 30px rgba(98, 87, 205, 0.62);
}

.message-detail {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(225, 234, 255, 0.82);
  text-shadow: 0 2px 2px rgba(0,0,0,0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-panel {
  left: 14px;
  bottom: 18px;
  width: 232px;
  max-height: none;
  gap: 7px;
  padding: 12px 12px 10px;
  background:
    linear-gradient(180deg, rgba(47, 50, 63, 0.96), rgba(18, 19, 28, 0.96));
  border: 2px solid #0c0f18;
  border-radius: 6px;
  box-shadow:
    0 0 0 2px rgba(110, 118, 139, 0.52) inset,
    0 8px 24px rgba(0, 0, 0, 0.55);
}

.panel-block {
  padding: 7px 8px;
  background: linear-gradient(180deg, rgba(18, 21, 32, 0.9), rgba(9, 11, 18, 0.88));
  border: 1px solid rgba(123, 130, 148, 0.62);
  border-radius: 4px;
  text-align: center;
}

.panel-round {
  padding: 9px 8px;
  background:
    linear-gradient(180deg, rgba(56, 58, 74, 0.94), rgba(16, 17, 26, 0.94));
}

.panel-round .panel-value {
  color: #f6f4ff;
  font-size: 1.12rem;
  text-transform: uppercase;
}

.panel-label {
  margin-bottom: 5px;
  color: #f4f0e6;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.panel-value {
  color: #f3f0ff;
  font-size: 0.94rem;
}

.panel-value.tentos {
  gap: 2px;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.tento-row {
  color: #f3f0ff;
  text-shadow: 0 2px 2px rgba(0,0,0,0.75);
}

.manilha-info {
  color: #9beaff;
}

.panel-inventory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 1px;
}

.inventory-slot {
  min-width: 0;
  display: grid;
  grid-template-rows: 58px auto;
  justify-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 900;
  color: #f2f3ff;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0,0,0,0.8);
}

.inventory-slot span {
  white-space: nowrap;
}

.deck-icon {
  width: 45px;
  height: 58px;
  border-radius: 4px;
  background:
    url('assets/cartas/verso_padrão.png') center/100% 100% no-repeat,
    linear-gradient(180deg, #4e2b20, #1b1110);
  box-shadow: 0 0 0 2px #0b0d13, 0 0 0 3px rgba(130,138,160,0.55), 0 6px 12px rgba(0,0,0,0.55);
}

.grave-icon {
  width: 50px;
  height: 58px;
  position: relative;
  border-radius: 24px 24px 5px 5px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 35%),
    linear-gradient(180deg, #657282, #2d3943);
  box-shadow: 0 0 0 2px #0b0d13, 0 0 0 3px rgba(130,138,160,0.55), 0 6px 12px rgba(0,0,0,0.55);
}

.grave-icon::before,
.grave-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  background: #16202a;
  box-shadow: 0 0 3px rgba(255,255,255,0.2);
}

.grave-icon::before {
  width: 8px;
  height: 25px;
}

.grave-icon::after {
  width: 25px;
  height: 8px;
  top: 22px;
}

.graveyard {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  gap: 0;
}

.action-bar {
  right: 17px;
  bottom: 17px;
  width: min(402px, 42vw);
  max-width: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  grid-auto-rows: auto;
  gap: 11px 12px;
  justify-content: stretch;
  padding: 17px 18px 16px;
  background:
    radial-gradient(circle at 20% 30%, rgba(108, 64, 202, 0.35), transparent 24%),
    radial-gradient(circle at 79% 34%, rgba(58, 201, 220, 0.22), transparent 26%),
    linear-gradient(180deg, rgba(54, 57, 73, 0.96), rgba(17, 19, 30, 0.98));
  border: 3px solid #0a0d16;
  border-radius: 16px 16px 8px 8px;
  box-shadow:
    0 0 0 2px rgba(111, 120, 144, 0.6) inset,
    0 0 0 5px rgba(21, 25, 39, 0.68) inset,
    0 0 36px rgba(111, 56, 216, 0.35),
    0 10px 28px rgba(0,0,0,0.62);
}

.action-bar[hidden] {
  display: none !important;
}

.action-bar::before {
  content: "";
  position: absolute;
  inset: 7px 9px auto 9px;
  height: 10px;
  border-radius: 50%;
  border-top: 2px solid rgba(124, 232, 255, 0.72);
  opacity: 0.8;
}

.arcane-btn {
  min-width: 0;
  min-height: 0;
  font-size: 0.9rem;
  letter-spacing: 0;
  padding: 0;
  border-radius: 999px;
  border: 3px solid #111421;
  color: #fff8ee;
  text-shadow: 0 2px 2px rgba(0,0,0,0.92);
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.24),
    inset 0 -8px 18px rgba(0,0,0,0.48),
    0 0 0 3px rgba(109, 116, 138, 0.58),
    0 0 20px rgba(0,0,0,0.7);
}

.arcane-btn::before,
.arcane-btn::after {
  display: none;
}

.action-bar .arcane-btn {
  padding: 0;
  min-height: 82px;
}

.arcane-btn.truco,
.arcane-btn.pass,
.arcane-btn.run {
  aspect-ratio: 1 / 1;
}

.arcane-btn.truco {
  background:
    radial-gradient(circle at 35% 28%, #fff1a3 0 8%, #ff9b22 22%, #d24b0e 54%, #5b1606 100%);
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.3),
    inset 0 -8px 18px rgba(78,20,0,0.55),
    0 0 0 3px rgba(129, 76, 32, 0.9),
    0 0 22px rgba(255, 112, 21, 0.72);
}

.arcane-btn.pass {
  background:
    radial-gradient(circle at 38% 26%, #d7b3ff 0 8%, #8d42e9 34%, #5819a2 68%, #210b46 100%);
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.28),
    inset 0 -8px 18px rgba(40,10,75,0.58),
    0 0 0 3px rgba(100, 61, 168, 0.9),
    0 0 24px rgba(167, 76, 255, 0.74);
}

.arcane-btn.run {
  background:
    radial-gradient(circle at 38% 26%, #d9fbff 0 8%, #45d7e6 34%, #16879a 66%, #062f45 100%);
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.3),
    inset 0 -8px 18px rgba(0,50,67,0.58),
    0 0 0 3px rgba(51, 133, 152, 0.9),
    0 0 22px rgba(82, 232, 255, 0.72);
}

.arcane-btn.accept,
.arcane-btn.raise {
  min-height: 43px;
  aspect-ratio: auto;
  border-radius: 6px;
  font-size: 0.82rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 35%),
    linear-gradient(180deg, #7b3fb5 0%, #451b79 100%);
  clip-path: polygon(11% 0, 89% 0, 100% 50%, 89% 100%, 11% 100%, 0 50%);
}

.arcane-btn.accept {
  grid-column: 1 / 3;
  width: 74%;
  justify-self: end;
}

.arcane-btn.raise {
  grid-column: 2 / 4;
  width: 74%;
  justify-self: start;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 35%),
    linear-gradient(180deg, #277e9b 0%, #124e65 100%);
}

.arcane-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  color: #fff;
  border-color: #191d2e;
}

.arcane-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

/* =====================================================
   UI ASSETS PASS
   Status, avatares e painel de truco vindos de assets/conceito_UI.png.
   ===================================================== */

.hud {
  top: 42px;
  left: 66px;
  right: 66px;
  grid-template-columns: 495px 1fr 495px;
  gap: 14px;
  align-items: start;
}

.duelist-panel {
  width: 495px;
  height: 162px;
  min-height: 162px;
  padding: 0;
  display: block;
  background: transparent center/contain no-repeat;
  border: 0;
  clip-path: none;
  box-shadow: none;
}

.hud-self {
  justify-self: start;
  background-image: url('assets/INTERFACE/hud container status/container_status_kaelen.png');
}

.hud-opponent {
  justify-self: end;
  padding: 0;
  background-image: url('assets/INTERFACE/hud container status/container_status_malistrix.png');
  clip-path: none;
}

.duelist-panel::before,
.hud-opponent::before {
  display: none;
}

.portrait-frame {
  top: 16px;
  left: 6px;
  width: 123px;
  height: 123px;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}

.hud-opponent .portrait-frame {
  left: auto;
  right: 6px;
}

.portrait {
  width: 106px;
  height: 106px;
  border: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 26px rgba(0, 0, 0, 0.78),
    0 0 16px rgba(95, 54, 174, 0.4);
}

.portrait::after {
  display: none;
}

.portrait-self {
  background: url('assets/jogador/avatar_kaelen_the_seer.png') center/cover no-repeat;
}

.portrait-opp {
  background: url('assets/Rival/avatar_Malistrix_the_void.png') center/cover no-repeat;
}

.pov-badge {
  display: none;
}

.hud-info,
.hud-opponent .hud-info {
  position: absolute;
  top: 26px;
  width: 296px;
  min-width: 0;
  max-width: none;
  text-align: center;
}

.hud-info {
  left: 142px;
}

.hud-opponent .hud-info {
  left: 58px;
  right: auto;
}

.hud-info-right {
  text-align: center;
}

.hud-name {
  font-size: 1.26rem;
  line-height: 1;
  margin-bottom: 12px;
  color: #fff8ef;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.95),
    0 0 12px rgba(255, 255, 255, 0.25);
}

.hud-bar,
.hud-info-right .hud-bar {
  position: relative;
  width: 293px;
  height: 22px;
  display: block;
  margin: 0 auto;
  gap: 0;
  flex-direction: row;
}

.bar-track {
  width: 100%;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  display: block;
  border-radius: 0;
  opacity: 0.86;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.28),
    inset 0 -4px 7px rgba(0, 0, 0, 0.38);
}

.bar-fill::after {
  inset: 1px 0 auto 0;
  height: 38%;
}

.player-bar,
.opp-bar {
  background: linear-gradient(90deg, #1ebd37 0%, #47ff67 54%, #12962a 100%);
}

.hud-opponent .bar-fill {
  margin-left: auto;
}

.bar-text,
.hud-opponent .bar-text {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: 0;
  font-size: 0.82rem;
  line-height: 22px;
  color: #f7f7f1;
}

.hud-tokens,
.hud-tokens-right {
  position: absolute;
  left: 41px;
  top: 74px;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0;
}

.hud-opponent .hud-tokens {
  left: 154px;
  top: 74px;
}

.round-stone,
.mana-gem,
.round-token,
.round-progress,
.round-token.purple,
.round-token.blue {
  width: 24px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background: url('assets/INTERFACE/hud container status/pedra_tento_vida.png') center/contain no-repeat;
  color: transparent;
  text-shadow: none;
  box-shadow:
    0 0 12px rgba(255, 76, 137, 0.55),
    0 4px 7px rgba(0, 0, 0, 0.42);
  transform-origin: center;
  transition: opacity 240ms ease, filter 240ms ease, transform 240ms ease;
}

.round-stone.is-active {
  opacity: 1;
  filter: saturate(1.15) brightness(1.08);
}

.round-stone.is-broken {
  opacity: 0.28;
  filter: grayscale(0.65) brightness(0.62);
  transform: translateY(3px) rotate(-8deg) scale(0.82);
}

.round-stone.is-breaking {
  animation: stone-break 900ms cubic-bezier(.15,.8,.22,1) both;
}

.mana-gem span,
.round-token span,
.round-progress span,
.round-stone span {
  color: transparent;
}

@keyframes stone-break {
  0% {
    opacity: 1;
    filter: saturate(1.3) brightness(1.35);
    transform: translateY(0) rotate(0deg) scale(1);
  }
  28% {
    opacity: 1;
    filter: saturate(1.7) brightness(1.85) drop-shadow(0 0 15px rgba(255, 97, 168, 0.9));
    transform: translateY(-8px) rotate(7deg) scale(1.22);
  }
  52% {
    opacity: 0.88;
    filter: saturate(0.95) brightness(0.9);
    transform: translateY(5px) rotate(-13deg) scale(0.76);
  }
  100% {
    opacity: 0.28;
    filter: grayscale(0.65) brightness(0.62);
    transform: translateY(3px) rotate(-8deg) scale(0.82);
  }
}

.hud-center {
  padding-top: 82px;
  pointer-events: none;
}

.hud-title,
.hud-subtitle {
  display: none;
}

.hand-value-badge {
  margin-top: 0;
  pointer-events: none;
}

.message-bar {
  top: 32px;
  left: 50%;
  min-width: min(760px, 48vw);
  max-width: min(820px, 50vw);
  padding: 2px 30px 7px;
  z-index: 28;
}

.message-text {
  font-size: clamp(1.95rem, 3.1vw, 3.05rem);
  line-height: 0.98;
}

.message-detail {
  margin-top: 3px;
}

#game-screen.is-coin-stage .hud,
#game-screen.is-coin-stage .info-panel,
#game-screen.is-coin-stage .history-panel,
#game-screen.is-coin-stage .message-bar,
#game-screen.is-coin-stage .action-bar,
#game-screen.is-coin-stage .layer-rival,
#game-screen.is-coin-stage .layer-rival-card-rig,
#game-screen.is-coin-stage .layer-player,
#game-screen.is-coin-stage .layer-played,
#game-screen.is-coin-stage .layer-props {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.coin-modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 70;
  background:
    radial-gradient(ellipse at center, rgba(28, 12, 52, 0.42), rgba(4, 5, 12, 0.82) 72%);
  backdrop-filter: blur(2px);
}

.coin-modal[hidden] {
  display: none !important;
}

.coin-modal.is-video-only {
  place-items: center;
  padding-top: 0;
}

.coin-popup {
  position: relative;
  width: 1120px;
  height: 630px;
  max-width: 76vw;
  max-height: 76vh;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 0;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  isolation: isolate;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform;
}

.coin-popup::before {
  content: "";
  position: absolute;
  inset: 114px 132px 98px;
  z-index: 0;
  background:
    radial-gradient(ellipse at center, rgba(18, 22, 38, 0.04), rgba(3, 5, 12, 0.14) 84%),
    url('assets/videos cara ou coroa moeda/mesa_moldura_escolha_moedas.png') center calc(50% + 44px) / 124% auto no-repeat,
    #090d18;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
}

.coin-popup::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url('assets/videos cara ou coroa moeda/moldura_video_moedas.png') center/100% 100% no-repeat;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.72));
  transform: translate3d(0, 0, 0);
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform;
}

.coin-choice-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  max-width: none;
  pointer-events: none;
}

.coin-choice-panel[hidden],
.coin-video-panel[hidden] {
  display: none !important;
}

.coin-title {
  position: absolute;
  top: -126px;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 2.45rem;
  font-weight: 900;
  color: #fff8ef;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.9),
    0 0 18px rgba(148, 190, 255, 0.82);
}

.coin-subtitle {
  position: absolute;
  top: -80px;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: rgba(226, 235, 255, 0.78);
}

.coin-options {
  position: absolute;
  top: 250px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: 48px;
  pointer-events: auto;
}

.coin-choice-btn {
  width: 210px;
  height: 220px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.92),
    0 0 12px rgba(255, 236, 171, 0.38);
  box-shadow: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.coin-choice-btn:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.03);
  filter: brightness(1.12);
}

.coin-choice-btn:disabled {
  cursor: wait;
  filter: saturate(0.75) brightness(0.75);
}

.coin-choice-btn img {
  width: 174px;
  height: 180px;
  object-fit: contain;
  filter:
    drop-shadow(0 18px 18px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 18px rgba(255, 193, 72, 0.38));
  transition: transform 160ms ease, filter 160ms ease;
}

.coin-choice-btn:hover:not(:disabled) img {
  transform: translateY(-4px);
  filter:
    drop-shadow(0 22px 22px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 28px rgba(255, 214, 94, 0.7));
}

.coin-video-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
}

.coin-video-frame {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  background: transparent;
}

.coin-video-frame::before {
  content: "";
  position: absolute;
  inset: 8.3% 8.25%;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(2, 4, 12, 0.42), rgba(2, 4, 12, 0.72));
  transition: opacity 260ms ease;
}

.coin-video-frame::after {
  display: none;
}

.coin-video {
  position: relative;
  z-index: 1;
  width: 83.5%;
  height: 83.4%;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.82);
  image-rendering: auto;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

.coin-result-text {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 4;
  width: min(760px, 72%);
  min-height: 0;
  margin-top: 0;
  transform: translate(-50%, -50%);
  display: none;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.6vw, 3.65rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #fff8ef;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.coin-modal.is-video-only .coin-result-text {
  display: none;
}

.coin-modal.is-result-reveal .coin-result-text {
  display: grid;
  animation: coin-result-reveal 520ms cubic-bezier(.16,.84,.3,1) both;
}

.coin-modal.is-result-reveal .coin-video-frame::before {
  opacity: 1;
}

.coin-modal.is-result-reveal .coin-popup::after {
  animation: none;
  filter: none;
}

.coin-modal.is-choice-enter {
  pointer-events: none;
}

.coin-modal.is-choice-enter .coin-popup::after {
  animation: coin-frame-portal-enter 920ms linear both;
}

.coin-modal.is-choice-enter .coin-popup::before {
  animation: coin-surface-enter 1040ms ease-out both;
}

.coin-modal.is-choice-enter .coin-choice-panel {
  animation: coin-choice-panel-enter 1120ms cubic-bezier(.18,.76,.28,1) both;
}

.coin-modal.is-dissolving {
  pointer-events: none;
}

.coin-modal.is-dissolving .coin-popup {
  animation: coin-stage-dissolve 780ms ease-in both;
}

.coin-modal.is-dissolving .coin-result-text {
  animation: coin-result-dissolve 620ms ease-in both;
}

.coin-modal.is-portal-zoom {
  background: radial-gradient(ellipse at center, rgba(28, 12, 52, 0.35), rgba(4, 5, 12, 0.64) 76%);
  backdrop-filter: none;
  pointer-events: none;
}

.coin-modal.is-portal-zoom .coin-popup {
  animation: none;
}

.coin-modal.is-portal-zoom .coin-video-frame {
  animation: coin-video-fade-out 360ms ease-out both;
}

.coin-modal.is-portal-zoom .coin-popup::before {
  opacity: 0;
}

.coin-modal.is-portal-zoom .coin-popup::after {
  animation: coin-frame-portal-zoom 1120ms linear both;
  filter: none;
}

.coin-modal.is-portal-zoom .coin-result-text {
  display: grid;
  animation: coin-result-dissolve 320ms ease-out both;
}

#game-screen.is-entering-game .hud,
#game-screen.is-entering-game .info-panel,
#game-screen.is-entering-game .history-panel,
#game-screen.is-entering-game .message-bar,
#game-screen.is-entering-game .action-bar,
#game-screen.is-entering-game .layer-rival,
#game-screen.is-entering-game .layer-rival-card-rig,
#game-screen.is-entering-game .layer-player,
#game-screen.is-entering-game .layer-played,
#game-screen.is-entering-game .layer-props {
  animation: game-stage-enter 900ms cubic-bezier(.18,.78,.32,1) both;
}

#game-screen.is-entering-game .hud,
#game-screen.is-entering-game .message-bar {
  animation-delay: 90ms;
  animation-name: game-stage-enter-centered;
}

#game-screen.is-entering-game .layer-rival,
#game-screen.is-entering-game .layer-rival-card-rig {
  animation-delay: 180ms;
}

#game-screen.is-entering-game .layer-player,
#game-screen.is-entering-game .layer-played,
#game-screen.is-entering-game .layer-props,
#game-screen.is-entering-game .action-bar {
  animation-delay: 280ms;
}

@keyframes coin-result-reveal {
  0% {
    opacity: 0;
    transform: translate(-50%, -48%) scale(1);
    filter: none;
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: none;
  }
}

@keyframes coin-video-afterglow {
  0% {
    filter: brightness(1) saturate(1);
  }
  45% {
    filter: brightness(0.68) saturate(1.25) blur(1px);
  }
  100% {
    filter: brightness(0.52) saturate(1.18) blur(2px);
  }
}

@keyframes coin-frame-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 12px 28px rgba(0, 0, 0, 0.72))
      drop-shadow(0 0 0 rgba(255, 214, 107, 0));
  }
  42% {
    filter:
      drop-shadow(0 12px 28px rgba(0, 0, 0, 0.72))
      drop-shadow(0 0 34px rgba(255, 214, 107, 0.82))
      drop-shadow(0 0 58px rgba(131, 92, 255, 0.58));
  }
}

@keyframes coin-stage-dissolve {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.035);
    filter: blur(8px);
  }
}

@keyframes coin-result-dissolve {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56%) scale(1.14);
  }
}

@keyframes coin-portal-backdrop {
  0%, 52% {
    background:
      radial-gradient(ellipse at center, rgba(28, 12, 52, 0.42), rgba(4, 5, 12, 0.82) 72%);
    backdrop-filter: blur(2px);
  }
  100% {
    background:
      radial-gradient(ellipse at center, rgba(28, 12, 52, 0.08), rgba(4, 5, 12, 0.24) 76%);
    backdrop-filter: blur(0);
  }
}

@keyframes coin-portal-zoom {
  0% {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
  14% {
    transform: translate3d(0, 0, 0) scale3d(1.035, 1.035, 1);
  }
  42% {
    transform: translate3d(0, 0, 0) scale3d(1.42, 1.42, 1);
  }
  70% {
    transform: translate3d(0, 0, 0) scale3d(2.35, 2.35, 1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale3d(4.25, 4.25, 1);
  }
}

@keyframes coin-frame-portal-zoom {
  0% {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale3d(6.25, 6.25, 1);
  }
}

@keyframes coin-frame-portal-enter {
  0% {
    transform: translate3d(0, 0, 0) scale3d(6.25, 6.25, 1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}

@keyframes coin-surface-enter {
  0%, 46% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes coin-choice-panel-enter {
  0%, 58% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes coin-video-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes game-stage-enter {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes game-stage-enter-centered {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(-50%, 16px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, 0);
  }
}

/* ===================== HUD action-bar (INTERFACE 2.0) =====================
   O game-screen usa transform: scale(0.9); por isso o HUD é definido maior
   aqui para aparecer em Full HD com ~547×401px, como no modelo visual. */
.action-bar {
  right: 0 !important;
  bottom: 0 !important;
  width: 608px !important;
  height: 446px !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  display: block !important;
  background: url('assets/INTERFACE 2.0/hud_de_pedra_truco.png') center/100% 100% no-repeat;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
  overflow: visible;
  grid-template-columns: none !important;
  gap: 0 !important;
}

.action-bar::before {
  display: none;
}

.action-bar .arcane-btn {
  position: absolute !important;
  margin: 0 !important;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
  color: #fffaf2;
  font-size: 1.52rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.95),
    0 0 10px rgba(255, 255, 255, 0.25);
}

.action-bar .arcane-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.035);
  filter: brightness(1.13);
  border: 0;
}

.action-bar .arcane-btn:disabled {
  opacity: 1 !important;
  visibility: visible !important;
  cursor: not-allowed;
  filter: grayscale(0.94) brightness(0.42) saturate(0.26) contrast(0.96);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.95),
    0 0 7px rgba(20, 24, 38, 0.9);
  animation: none !important;
  pointer-events: none;
}

.action-bar .arcane-btn:disabled:hover {
  transform: none;
  filter: grayscale(0.94) brightness(0.42) saturate(0.26) contrast(0.96);
}

.action-bar .arcane-btn:not(:disabled) {
  filter: brightness(1.05);
}

.action-bar .arcane-btn:not(:disabled):hover {
  filter: brightness(1.18);
}

.action-bar .arcane-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

/* Posições calibradas pelos furos transparentes do HUD asset (1301×955).
   Slots detectados na arte:
     TRUCO     centro raw (393.5, 613)
     CORRER    centro raw (765.5, 611.5)
     ESCONDER  centro raw (1045.5, 611)
     MENSAGENS centro raw (1099, 298)
   O PNG do TRUCO tem chama subindo além do círculo, então a caixa é mais alta. */
.arcane-btn.truco {
  left: 98px !important;
  top: 168px !important;
  width: 178px !important;
  height: 202px !important;
  background-image: url('assets/INTERFACE 2.0/botão_truco.png');
  font-size: 1.78rem;
  line-height: 0.9;
  letter-spacing: 0.015em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 16px 0 5px;
  color: #fff8df;
  text-shadow:
    0 3px 0 rgba(78, 19, 0, 0.98),
    0 0 8px rgba(255, 245, 205, 0.7),
    0 0 18px rgba(255, 112, 21, 0.9);
}

.arcane-btn.truco.is-numeric-label {
  font-size: 3.35rem;
  line-height: 0.82;
  letter-spacing: 0;
  padding: 34px 14px 0 4px;
  text-shadow:
    0 4px 0 rgba(78, 19, 0, 0.98),
    0 0 10px rgba(255, 248, 214, 0.82),
    0 0 22px rgba(255, 122, 25, 0.95);
}

.arcane-btn.truco:disabled {
  color: rgba(255, 234, 188, 0.72);
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.95),
    0 0 6px rgba(40, 24, 18, 0.95);
}

.arcane-btn.run {
  left: 309px !important;
  top: 237px !important;
  width: 98px !important;
  height: 98px !important;
  background-image: url('assets/INTERFACE 2.0/botão_correr.png');
  font-size: 0;
  color: transparent;
}

.arcane-btn.pass {
  left: 440px !important;
  top: 237px !important;
  width: 98px !important;
  height: 98px !important;
  background-image: url('assets/INTERFACE 2.0/botão_esconder.png');
  font-size: 0;
  color: transparent;
}

.arcane-btn.chat {
  left: 486px !important;
  top: 111px !important;
  width: 56px !important;
  height: 56px !important;
  background-image: url('assets/INTERFACE 2.0/botão_mensagens.png');
  font-size: 0;
  color: transparent;
}

.arcane-btn.chat.is-open {
  filter: brightness(1.25) drop-shadow(0 0 16px rgba(110, 255, 170, 0.7));
}

/* ===================== TRUCO RECEBIDO ===================== */
#game-screen.is-truco-alert .action-bar {
  z-index: 82;
}

.truco-alert {
  position: absolute;
  inset: 0;
  z-index: 74;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(18, 28, 56, 0.24), rgba(4, 5, 12, 0.78) 72%),
    linear-gradient(180deg, rgba(4, 6, 16, 0.42), rgba(3, 4, 10, 0.66));
  animation: truco-alert-dim-in 260ms ease-out both;
}

.truco-alert::before {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 43%, rgba(115, 194, 255, 0.22), transparent 32%),
    radial-gradient(ellipse at 50% 50%, rgba(118, 91, 255, 0.16), transparent 46%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: truco-electric-flash 1320ms steps(1, end) infinite;
}

.truco-alert[hidden] {
  display: none !important;
}

.truco-alert-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 24px;
  margin-top: -72px;
  width: min(1040px, 80vw);
  min-height: 268px;
  pointer-events: auto;
  isolation: isolate;
}

.truco-lightning-field {
  position: absolute;
  left: 50%;
  top: 39%;
  width: min(1120px, 86vw);
  height: 338px;
  overflow: visible;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: 50% 50%;
  z-index: 0;
  mix-blend-mode: screen;
  opacity: 0.98;
}

.truco-bolt {
  fill: none;
  stroke: rgba(246, 251, 255, 0.98);
  stroke-width: var(--bolt-width, 5);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: url("#truco-electric-glow");
  opacity: 0;
  vector-effect: non-scaling-stroke;
  animation: truco-bolt-strike var(--bolt-duration, 1120ms) linear infinite;
  animation-delay: var(--bolt-delay, 0ms);
}

.bolt-a {
  --bolt-width: 5.8;
  --bolt-duration: 980ms;
  --bolt-delay: -40ms;
}

.bolt-b {
  --bolt-width: 4.2;
  --bolt-duration: 1260ms;
  --bolt-delay: -180ms;
}

.bolt-c {
  --bolt-width: 4.4;
  --bolt-duration: 1180ms;
  --bolt-delay: -320ms;
}

.bolt-d {
  --bolt-width: 3.7;
  --bolt-duration: 1360ms;
  --bolt-delay: -610ms;
}

.bolt-e {
  --bolt-width: 3.9;
  --bolt-duration: 1320ms;
  --bolt-delay: -480ms;
}

.bolt-f,
.bolt-g {
  --bolt-width: 3.2;
  --bolt-duration: 1040ms;
}

.bolt-f {
  --bolt-delay: -210ms;
}

.bolt-g {
  --bolt-delay: -520ms;
}

.truco-burst {
  fill: url("#truco-flare");
  filter: url("#truco-electric-glow");
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: truco-burst-pop var(--burst-duration, 1120ms) ease-out infinite;
  animation-delay: var(--burst-delay, 0ms);
}

.burst-a {
  --burst-duration: 980ms;
  --burst-delay: -40ms;
}

.burst-b {
  --burst-duration: 1260ms;
  --burst-delay: -180ms;
}

.burst-c {
  --burst-duration: 1180ms;
  --burst-delay: -320ms;
}

.burst-d {
  --burst-duration: 1320ms;
  --burst-delay: -480ms;
}

.truco-alert-word {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(5.8rem, 9.6vw, 9.4rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0.035em;
  color: #f9fbff;
  text-transform: uppercase;
  text-shadow:
    0 5px 0 rgba(4, 5, 15, 0.95),
    0 0 18px rgba(158, 236, 255, 0.96),
    0 0 42px rgba(95, 121, 255, 0.86),
    0 0 82px rgba(154, 92, 255, 0.62);
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.42));
  animation: truco-word-surge 1120ms steps(1, end) infinite;
}

.truco-accept-btn {
  position: relative;
  z-index: 2;
  min-width: 230px;
  height: 64px;
  padding: 0 34px;
  border: 2px solid rgba(174, 239, 255, 0.9);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #f7fcff;
  text-transform: uppercase;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(105, 222, 255, 0.22), rgba(53, 66, 139, 0.28)),
    linear-gradient(180deg, #26335c, #11152d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -7px 16px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(81, 221, 255, 0.42),
    0 12px 28px rgba(0, 0, 0, 0.62);
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.92),
    0 0 12px rgba(132, 229, 255, 0.75);
  transition: transform 120ms ease, filter 120ms ease;
}

.truco-accept-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.14);
}

.truco-accept-btn:active:not(:disabled) {
  transform: translateY(1px);
}

#game-screen.is-truco-alert .arcane-btn.truco.is-heat-alert {
  animation: truco-heat-warp 620ms ease-in-out infinite;
  filter:
    brightness(1.28)
    saturate(1.34)
    drop-shadow(0 0 18px rgba(255, 118, 25, 0.95))
    drop-shadow(0 0 34px rgba(255, 220, 88, 0.58));
}

@keyframes truco-alert-dim-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes truco-word-surge {
  0%, 7%, 14%, 28%, 48%, 100% {
    transform: translateY(0) scale(1);
    filter:
      brightness(1)
      drop-shadow(0 0 12px rgba(255, 255, 255, 0.38));
  }
  8%, 29% {
    transform: translate3d(-1px, -1px, 0) scale(1.018);
    filter:
      brightness(1.62)
      drop-shadow(0 0 30px rgba(151, 238, 255, 0.9))
      drop-shadow(0 0 54px rgba(84, 124, 255, 0.7));
  }
  10%, 31% {
    transform: translate3d(1px, 0, 0) scale(1.006);
    filter:
      brightness(1.18)
      drop-shadow(0 0 18px rgba(151, 238, 255, 0.52));
  }
}

@keyframes truco-electric-flash {
  0%, 7%, 13%, 28%, 36%, 100% {
    opacity: 0;
  }
  8%, 29% {
    opacity: 0.94;
  }
  10%, 31% {
    opacity: 0.28;
  }
}

@keyframes truco-bolt-strike {
  0%, 6% {
    opacity: 0;
    stroke-dashoffset: 1;
  }
  7% {
    opacity: 0.32;
    stroke-dashoffset: 0.82;
  }
  9% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  11% {
    opacity: 0.16;
    stroke-dashoffset: 0;
  }
  12%, 27% {
    opacity: 0;
    stroke-dashoffset: 1;
  }
  28% {
    opacity: 0.72;
    stroke-dashoffset: 0.44;
  }
  30% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
  32% {
    opacity: 0.1;
  }
  33%, 100% {
    opacity: 0;
    stroke-dashoffset: 1;
  }
}

@keyframes truco-burst-pop {
  0%, 6% {
    opacity: 0;
    transform: scaleX(0.16) scaleY(0.36);
  }
  8% {
    opacity: 0.94;
    transform: scaleX(1.08) scaleY(0.92);
  }
  12%, 27% {
    opacity: 0;
    transform: scaleX(1.6) scaleY(0.5);
  }
  29% {
    opacity: 0.72;
    transform: scaleX(0.88) scaleY(0.82);
  }
  33%, 100% {
    opacity: 0;
    transform: scaleX(1.42) scaleY(0.48);
  }
}

@keyframes truco-heat-warp {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  28% {
    transform: translate3d(1px, -2px, 0) scale(1.026) skewX(-1.2deg);
  }
  56% {
    transform: translate3d(-1px, 1px, 0) scale(1.014) skewX(1deg);
  }
  78% {
    transform: translate3d(0, -1px, 0) scale(1.032);
  }
}

@media (min-width: 1400px) and (min-aspect-ratio: 16/10) {
  .layer-rival {
    top: 1.1%;
    right: 15%;
    width: 28vw;
    max-width: 540px;
    min-width: 0;
  }

  .layer-rival-card-rig {
    top: 1.1%;
    right: 15%;
    width: 28vw;
    max-width: 540px;
    min-width: 0;
  }

  .layer-opp-hand {
    top: 69.8%;
    left: 34%;
    right: auto;
    gap: 6px;
  }

  .layer-opp-hand .card {
    --card-w: 52px;
  }

  .layer-rival-arm {
    top: 74.3%;
    left: 46.7%;
    right: auto;
    width: 53.1%;
  }
}

@media (max-width: 1180px) {
  .hud {
    grid-template-columns: minmax(250px, 330px) 1fr minmax(250px, 330px);
    gap: 10px;
  }

  .duelist-panel {
    min-height: 106px;
    padding-left: 96px;
  }

  .hud-opponent {
    padding-left: 14px;
    padding-right: 96px;
  }

  .portrait-frame {
    width: 96px;
    height: 96px;
  }

  .portrait {
    width: 82px;
    height: 82px;
  }

  .hud-name {
    font-size: 0.95rem;
  }

  .hud-title {
    font-size: clamp(1.45rem, 3vw, 2.25rem);
  }

  .player-hand-cards .card {
    --card-w: 188px;
    --tx: calc(var(--centered) * 84px);
  }

  /* .action-bar mantém tamanho fixo pra preservar o asset HUD do INTERFACE 2.0;
     a regra de scale geral abaixo cuida de viewports menores. */
}

@media (max-width: 880px) {
  .hud {
    left: 8px;
    right: 8px;
    grid-template-columns: 1fr 1fr;
  }

  .hud-center {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    order: -1;
  }

  .hud-self,
  .hud-opponent {
    grid-row: 2;
  }

  .duelist-panel {
    min-height: 84px;
    padding: 10px 12px 11px 76px;
  }

  .hud-opponent {
    padding: 10px 76px 11px 12px;
  }

  .portrait-frame {
    width: 76px;
    height: 76px;
  }

  .portrait {
    width: 62px;
    height: 62px;
    border-width: 3px;
  }

  .pov-badge {
    left: 38px;
    bottom: -21px;
    font-size: 0.62rem;
    padding: 2px 8px 3px;
  }

  .hud-name {
    font-size: 0.72rem;
  }

  .bar-track {
    height: 18px;
  }

  .bar-text {
    font-size: 0.72rem;
    line-height: 18px;
  }

  .hud-tokens {
    gap: 4px;
    margin-top: 7px;
  }

  .mana-gem,
  .round-token {
    width: 22px;
    height: 25px;
    font-size: 0.68rem;
  }

  .round-progress {
    font-size: 0.68rem;
    padding: 2px 7px 3px;
  }

  .message-bar {
    top: 34%;
    left: 50%;
  }

  .layer-rival {
    right: -2%;
    top: 13%;
    width: 56%;
    min-width: 270px;
  }

  .layer-rival-card-rig {
    right: -2%;
    top: 13%;
    width: 56%;
    min-width: 270px;
  }

  .layer-player {
    width: 60%;
    min-width: 340px;
    left: -12%;
  }

  .player-hand-cards .card {
    --card-w: 142px;
    --tx: calc(var(--centered) * 60px);
  }

  .player-hand-cards {
    bottom: 37%;
    left: 41%;
    width: 74%;
  }

  .layer-rival-arm {
    top: 74.3%;
    left: 46.7%;
    right: auto;
    width: 53.1%;
  }

  .layer-played {
    inset: 0;
    left: 0;
    bottom: auto;
    width: 100%;
    height: 100%;
    gap: 0;
  }

  #played-opp {
    top: 51%;
    left: 67%;
  }

  #played-self {
    top: 52%;
    left: 55%;
  }

  .layer-played .vira-spot {
    top: 73%;
    left: 75%;
    width: 440px;
    height: 260px;
    transform: translate(-50%, -50%);
  }

  .played-row .card {
    --card-w: 160px;
  }

  #played-opp .card {
    --card-w: 180px;
    --card-tilt: -1deg;
    --table-card-scale: 1;
  }

  #played-self .card {
    --card-w: 238px;
    --card-tilt: 2deg;
    --table-card-scale: 1;
  }

  .vira-spot .card {
    --card-w: 292px;
  }

  .vira-landscape-card {
    --vira-w: 330px;
  }

  .table-deck-pile {
    --deck-w: 245px;
    transform: rotate(1deg);
  }

  .info-panel {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 178px;
    margin: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 9px;
  }

  .panel-block {
    min-width: 0;
  }

  .panel-inventory {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .inventory-slot {
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto;
    align-items: center;
    justify-items: start;
    font-size: 0.64rem;
  }

  .deck-icon,
  .grave-icon {
    width: 24px;
    height: 31px;
  }

  /* HUD em viewport muito pequeno: encolhe inteiro proporcionalmente
     ao invés de tentar reposicionar (era o que quebrava o asset novo). */
  .action-bar {
    transform: scale(0.65);
    transform-origin: bottom right;
  }
}

/* ===================== ESCONDER (carta face-down) ===================== */
.arcane-btn.pass.is-armed {
  outline: 3px solid rgba(216, 168, 255, 0.95);
  outline-offset: 2px;
  box-shadow:
    inset 0 2px 5px rgba(255,255,255,0.32),
    inset 0 -8px 18px rgba(40,10,75,0.62),
    0 0 0 3px rgba(180, 120, 240, 0.95),
    0 0 32px rgba(200, 130, 255, 0.95);
  animation: hide-armed-pulse 1.4s ease-in-out infinite;
}

@keyframes hide-armed-pulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.18); }
}

.player-hand-cards.hide-arm .card:not(.disabled) {
  cursor: crosshair;
  filter: drop-shadow(0 0 10px rgba(190, 120, 255, 0.55));
}

.player-hand-cards.hide-arm .card:not(.disabled):hover {
  filter: drop-shadow(0 0 18px rgba(220, 150, 255, 0.85));
}

.card.played-hidden {
  filter: drop-shadow(0 0 12px rgba(120, 70, 200, 0.55));
}

/* ===================== EMPATE: jogar maior carta ===================== */
.card.forced-highest {
  filter: drop-shadow(0 0 14px rgba(255, 215, 100, 0.85));
  animation: forced-highest-pulse 1.6s ease-in-out infinite;
}

.card.forced-highest:hover {
  filter: drop-shadow(0 0 22px rgba(255, 230, 130, 1));
}

@keyframes forced-highest-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 215, 100, 0.7)); }
  50%      { filter: drop-shadow(0 0 22px rgba(255, 230, 130, 1)); }
}

.player-hand-cards .card.disabled {
  opacity: 0.32;
  filter: grayscale(0.85) brightness(0.6);
  cursor: not-allowed;
  pointer-events: none;
}

/* ===================== ACEITAR IMPLÍCITO (truco pendente) ===================== */
.player-hand-cards.accept-on-play .card:not(.disabled) {
  filter: drop-shadow(0 0 12px rgba(255, 180, 80, 0.65));
  animation: accept-on-play-pulse 1.4s ease-in-out infinite;
}

@keyframes accept-on-play-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 170, 70, 0.5)); }
  50%      { filter: drop-shadow(0 0 22px rgba(255, 200, 100, 0.95)); }
}

/* ===================== CHAT / EMOTES ===================== */
.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 420px;
  width: 320px;
  padding: 18px 18px 16px;
  background: linear-gradient(160deg, rgba(28, 14, 56, 0.95), rgba(14, 24, 38, 0.95));
  border: 2px solid rgba(140, 200, 170, 0.55);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 16px 48px rgba(0, 0, 0, 0.65),
    0 0 32px rgba(80, 220, 150, 0.25);
  z-index: 50;
  font-family: 'Cormorant Garamond', serif;
  color: #f5e6c2;
  animation: chat-panel-in 220ms ease-out;
}

@keyframes chat-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.chat-panel-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b6e8c8;
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(120, 220, 160, 0.5);
}

.chat-emote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chat-emote-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: linear-gradient(180deg, rgba(60, 80, 95, 0.55), rgba(30, 40, 55, 0.75));
  border: 1px solid rgba(140, 200, 170, 0.35);
  border-radius: 8px;
  color: #f1e6c8;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.chat-emote-btn:hover {
  filter: brightness(1.18);
  border-color: rgba(160, 230, 190, 0.75);
  transform: translateY(-1px);
}

.chat-emote-btn:active {
  transform: translateY(0);
}

.chat-emote-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===================== SPEECH BUBBLES ===================== */
.speech-bubble {
  position: fixed;
  max-width: 280px;
  padding: 12px 16px;
  background: linear-gradient(160deg, rgba(40, 24, 70, 0.96), rgba(20, 30, 48, 0.96));
  border: 2px solid rgba(180, 220, 200, 0.6);
  border-radius: 14px;
  color: #f5e6c2;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.18rem;
  font-style: italic;
  font-weight: 600;
  text-align: center;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(140, 200, 220, 0.25);
  z-index: 45;
  animation: bubble-in 280ms ease-out;
  pointer-events: none;
}

.speech-bubble.is-fading {
  animation: bubble-out 320ms ease-in forwards;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes bubble-out {
  from { opacity: 1; transform: translateY(0)     scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.94); }
}

.bubble-self {
  left: 200px;
  bottom: 240px;
  border-color: rgba(120, 200, 230, 0.65);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(80, 180, 220, 0.45);
}

.bubble-opp {
  right: 200px;
  top: 220px;
  border-color: rgba(220, 100, 130, 0.65);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(220, 80, 100, 0.45);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.bubble-self::before {
  bottom: -14px;
  left: 28px;
  border-width: 14px 12px 0 0;
  border-color: rgba(40, 24, 70, 0.96) transparent transparent transparent;
}

.bubble-opp::before {
  top: -14px;
  right: 28px;
  border-width: 0 12px 14px 0;
  border-color: transparent rgba(40, 24, 70, 0.96) transparent transparent;
}
