/* arena.css — layout da partida: palco 3D WebGL em ecrã inteiro e, por cima, o HUD em HTML (docs/DIRECAO-DE-ARTE.md):
   placas de plástico dos jogadores com relógio de xadrez (amarelo quando corre), logótipo, placas de turno, registo,
   botões à direita, mão em leque e mascote. Tudo opaco e mate; brilho só na carta jogável e nas respostas da Chain.
   Se o WebGL não estiver disponível usa-se o tabuleiro CSS (.table-3d). */
body.in-match #topnav { display: none; }
body.in-match { overflow: hidden; }
.screen.screen-match { padding: 0; max-width: none; }
.arena { position: relative; height: 100vh; overflow: hidden; color: var(--text-main); user-select: none; font-family: var(--font-sans);
  --tilt: 30deg; --bw: max(320px, min(calc((100vh - 330px) * 1.08), calc(100vw - 600px), 720px)); --side: calc(var(--bw) * .125); }

/* palco 3D */
.stage3d-host { position: absolute; inset: 0; z-index: 2; }
.stage3d, .stage3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.arena.webgl .arena-bg { display: none; }
.arena-fx { position: absolute; inset: 0; pointer-events: none; z-index: 25; }

/* fundo CSS (só sem WebGL) */
.arena-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(255, 183, 3, .1), transparent 70%), linear-gradient(180deg, #121925 0%, #0F141C 100%); }
.arena-bg .stands, .arena-bg .floor, .arena-bg .beam { display: none; }

/* ── placas dos jogadores ── */
.hud { position: absolute; top: 12px; left: 16px; right: 16px; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-p { position: relative; display: flex; gap: 12px; width: clamp(250px, 19.3vw, 380px); padding: 8px; border-radius: var(--radius-md);
  background: var(--surface-2); border: 3px solid var(--border-ink); box-shadow: var(--shadow-panel), inset 6px 0 0 #64748B; }
.hud-p.me { justify-self: end; flex-direction: row-reverse; text-align: right; box-shadow: var(--shadow-panel), inset -6px 0 0 var(--color-accent); }
.hud-p.opp { box-shadow: var(--shadow-panel), inset 6px 0 0 var(--color-danger); }
.hud-p.active { background: #2A3550; }
.hud-p.active::after { content: ''; position: absolute; left: 10px; right: 10px; top: -3px; height: 5px; border-radius: 0 0 4px 4px; background: var(--color-primary); border: 2px solid var(--border-ink); border-top: 0; }
.hud-col { display: flex; flex-direction: column; gap: 4px; width: clamp(72px, 5.6vw, 108px); flex: none; }
.hud-ava { width: 100%; aspect-ratio: 1.04; overflow: hidden; border-radius: 12px; border: 2.5px solid var(--border-ink);
  background: radial-gradient(circle at 50% 30%, #E2E8F0, #94A3B8 60%, #475569); box-shadow: inset 0 3px 0 rgba(0, 0, 0, .3); }
.hud-ava.b { background: radial-gradient(circle at 50% 30%, #64748B, #334158 55%, #1E293B); }
.hud-ava .piece-svg { width: 135%; height: 135%; margin: -2% -17% 0; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .4)); }
/* retratos 3D das peças (Portraits3D) */
.p3d { object-fit: contain; display: block; pointer-events: none; user-select: none; }
.hud-ava .p3d { width: 112%; height: 112%; margin: 2% -6% 0; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.mascot .p3d { width: 100%; height: 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
/* sprite sheet da peça (Portraits3D): tira de quadros que corre aos saltos (steps); 72 % salto, 28 % pausa.
   O quadro é 20 % mais largo e 35 % mais alto do que a foto, com a mesma base */
.p3d-spr { position: absolute; left: -10%; bottom: 0; width: 120%; height: 135%; overflow: hidden; pointer-events: none; }
.p3d-spr img { display: block; height: 100%; width: calc(var(--n) * 100%); max-width: none; }
.has-spr > .p3d { visibility: hidden; }
.play > .p3d-spr img { animation: spr-run 2.2s steps(var(--n)) infinite; }
@keyframes spr-run { 0% { transform: translateX(0); } 72% { transform: translateX(-100%); } 72.01%, 100% { transform: translateX(0); } }
.mascot .p3d-spr img { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
.hud-ava .eyes-star, .hud-ava .eyes-spiral, .hud-ava .brows, .hud-ava .mouth-o, .hud-ava .mouth-grit, .hud-ava .sweat { display: none; }
.hud-caps { height: clamp(20px, 1.5vw, 28px); display: flex; align-items: center; justify-content: center; padding: 0 4px; border-radius: 6px; background: var(--surface-1); box-shadow: var(--shadow-tray); overflow: hidden; }
.hud-caps i { width: clamp(12px, .95vw, 18px); height: 100%; margin: 0 -2px; display: grid; place-items: center; }
.hud-caps i .piece-svg, .hud-caps i .p3d { width: 130%; height: 130%; filter: none; }
.hud-caps i .eyes-star, .hud-caps i .eyes-spiral, .hud-caps i .brows, .hud-caps i .mouth-o, .hud-caps i .mouth-grit, .hud-caps i .sweat { display: none; }
.hud-caps small { color: var(--text-muted); }
.hud-stats { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.hud-name { font-weight: 800; font-size: clamp(13px, 1.02vw, 19px); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sub { font-size: clamp(10px, .66vw, 12px); color: var(--text-muted); margin-top: -2px; font-weight: 700; }
.hud-sub.warn { color: var(--color-warning); }   /* adversário sem sinal ou a ficar sem tempo (abandono) */
.hud-mat { font-weight: 800; font-size: clamp(12px, .95vw, 17px); color: var(--text-muted); letter-spacing: .03em; }
.hud-mat span { font-family: var(--font-num); font-weight: 700; color: var(--text-main); font-size: 1.15em; font-variant-numeric: tabular-nums; }
.hud-mat em { font-style: normal; font-family: var(--font-num); font-size: .85em; color: var(--color-success); }
/* relógio de xadrez: amarelo com dígitos escuros quando corre; recolhido em espera; vermelho com pouco tempo */
.hud-clock { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; font-size: clamp(19px, 1.55vw, 28px); letter-spacing: .06em; text-align: center; padding: 3px 8px;
  border-radius: 9px; border: 2.5px solid var(--border-ink); background: var(--surface-1); color: var(--text-muted); box-shadow: var(--shadow-tray); }
.hud-clock.running { background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary)); color: var(--text-inverse); box-shadow: 0 3px 0 var(--color-primary-lip), inset 0 2px 0 rgba(255, 255, 255, .45); }
.hud-clock.low { background: linear-gradient(180deg, var(--color-danger-hover), var(--color-danger)); color: var(--text-main); box-shadow: 0 3px 0 var(--color-danger-lip); animation: clock-pulse 1s ease-in-out infinite; }
@keyframes clock-pulse { 50% { transform: scale(1.04); } }

/* cartas na mão do adversário (versos pequenos no canto da placa) */
.hud-hand { position: absolute; bottom: 6px; display: flex; align-items: center; gap: 0; }
.hud-p.opp .hud-hand { right: 14px; } .hud-p.me .hud-hand { left: 14px; }
.hud-hand i { width: 12px; height: 17px; margin-left: -5px; border-radius: 3px; border: 1.5px solid var(--border-ink); background: linear-gradient(160deg, #2A3B5C, #121925); box-shadow: inset 0 0 0 1.5px #C9A24A; }
.hud-hand b { margin-left: 5px; font-family: var(--font-num); font-weight: 700; font-size: 12px; color: var(--text-muted); }
.arena.webgl .opp-hand { display: none; }

/* logótipo e placas de turno */
.hud-mid { display: flex; align-items: flex-start; gap: clamp(10px, 1.4vw, 28px); padding-top: 2px; }
.hud-logo { text-align: center; padding: 2px 10px; }
.hud-logo b { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 1.5vw, 30px); color: var(--color-primary); -webkit-text-stroke: 2px var(--border-ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--border-ink); }
.hud-logo small { display: block; margin-top: 2px; font-weight: 800; font-size: clamp(9px, .62vw, 12px); letter-spacing: .24em; color: var(--text-muted); text-transform: uppercase; }
.jumbo { width: clamp(140px, 10.5vw, 210px); padding: 6px 10px 8px; border-radius: 12px; background: var(--surface-2); border: 3px solid var(--border-ink); box-shadow: var(--shadow-panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.jb-bar { width: 100%; display: flex; justify-content: space-between; font-weight: 800; font-size: clamp(9px, .58vw, 11px); letter-spacing: .08em; color: var(--text-muted); border-bottom: 2px solid var(--surface-1); padding-bottom: 3px; }
.jb-bar span:last-child { font-family: var(--font-num); color: var(--text-main); }
.jb-pips { display: flex; gap: 8px; padding: 2px 0; }
.jb-pips i { width: 26px; height: 18px; border-radius: 5px; border: 2px solid var(--border-ink); background: var(--surface-1); box-shadow: var(--shadow-tray); }
.jb-pips i.on { background: linear-gradient(180deg, #5EE0D4, var(--color-success)); box-shadow: 0 2px 0 var(--color-success-lip), inset 0 2px 0 rgba(255, 255, 255, .4); }
.jb-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(12px, .9vw, 17px); color: var(--text-main); -webkit-text-stroke: 1.2px var(--border-ink); paint-order: stroke fill; text-align: center; line-height: 1.1; }

/* registo de 2 linhas */
.feed { position: absolute; left: 16px; top: clamp(140px, 19vh, 205px); z-index: 30; width: clamp(280px, 21vw, 410px); min-height: 52px; padding: 8px 12px; pointer-events: none;
  background: var(--surface-2); border: 2.5px solid var(--border-ink); border-radius: 12px; box-shadow: 0 4px 0 #090C10, inset 0 2px 0 var(--border-highlight); display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.feed:empty { display: none; }
.feed p { margin: 0; display: flex; align-items: center; gap: 7px; font-size: clamp(12px, .8vw, 14.5px); font-weight: 600; line-height: 1.25; pointer-events: auto; cursor: pointer; }
.feed p .lg-txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .t-w, .log-list .t-w { color: #F1F5F9; font-weight: 800; } .feed .t-b, .log-list .t-b { color: #94A3B8; font-weight: 800; }

/* botões à direita */
.arena-btns { position: absolute; right: 20px; top: clamp(300px, 40vh, 430px); z-index: 30; display: flex; flex-direction: column; gap: 10px; width: clamp(130px, 9.2vw, 178px); }
.turn-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: clamp(70px, 9vh, 100px); border-radius: var(--radius-md); cursor: default;
  background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary)); border: 3px solid var(--border-ink); color: var(--text-inverse);
  box-shadow: var(--shadow-btn-primary); transition: transform 120ms var(--ease-out-toy); }
.turn-btn b { font-family: var(--font-display); font-weight: 400; font-size: clamp(15px, 1.15vw, 21px); line-height: 1; text-align: center; }
.turn-btn small { font-weight: 800; font-size: clamp(10px, .62vw, 12px); text-align: center; }
.turn-btn.wait { background: var(--surface-2); color: var(--text-muted); box-shadow: var(--shadow-btn-secondary); }
.turn-btn.wait b { color: var(--text-main); -webkit-text-stroke: 1px var(--border-ink); paint-order: stroke fill; }
.turn-btn.chain { background: linear-gradient(180deg, #A78BFA, var(--type-counter)); color: var(--text-main); box-shadow: 0 5px 0 var(--type-counter-lip), 0 0 18px rgba(124, 58, 237, .6), inset 0 2px 0 rgba(255, 255, 255, .35); }
.turn-btn.chain b { -webkit-text-stroke: 1.2px var(--border-ink); paint-order: stroke fill; }
.turn-btn[data-act] { cursor: pointer; animation: btn-nudge 1.6s var(--ease-in-out-crisp) infinite; }
.turn-btn[data-act]:hover { transform: translateY(-2px); animation: none; }
.turn-btn[data-act]:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--color-primary-lip); animation: none; }
@keyframes btn-nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-4px); } 90% { transform: translateY(0); } }
.side-btn { height: clamp(36px, 4.2vh, 44px); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-2); border: 2.5px solid var(--border-ink); color: var(--text-main);
  font-weight: 800; font-size: clamp(11px, .76vw, 14px); letter-spacing: .05em; text-transform: uppercase; box-shadow: var(--shadow-btn-secondary);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform 120ms var(--ease-out-toy), background 120ms; }
.side-btn:hover { background: var(--surface-3); transform: translateY(-2px); }
.side-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #111722; }
.side-btn.danger { background: linear-gradient(180deg, var(--color-danger-hover), var(--color-danger)); box-shadow: var(--shadow-btn-danger); }
.side-btn .ico { width: 18px; height: 18px; }
.mini-btns { display: flex; gap: 6px; justify-content: space-between; }
.mini-btns button { flex: 1; height: 38px; border-radius: var(--radius-sm); border: 2.5px solid var(--border-ink); background: var(--surface-2); color: var(--text-main); cursor: pointer;
  box-shadow: var(--shadow-btn-secondary); display: grid; place-items: center; transition: transform 120ms var(--ease-out-toy), background 120ms; }
.mini-btns button:hover { background: var(--surface-3); transform: translateY(-1px); }
.mini-btns button:active { transform: translateY(3px); }

/* Chain, barra de ação, histórico */
.m-chain { position: absolute; right: 20px; top: clamp(140px, 19vh, 205px); z-index: 31; padding: 8px 10px 10px; border-radius: 14px; background: var(--surface-2); border: 3px solid var(--border-ink);
  box-shadow: var(--shadow-panel), 0 0 18px rgba(255, 183, 3, .35); }
.m-chain h3 { font-family: var(--font-display); font-weight: 400; font-size: 15px; letter-spacing: .04em; color: var(--color-primary); -webkit-text-stroke: 1.2px var(--border-ink); paint-order: stroke fill; margin: 0 0 6px; }
.chain-list { display: grid; grid-template-columns: repeat(4, auto); gap: 10px; }
.chain-list .hcard.size-sm { --cw: clamp(56px, 4.4vw, 84px); }
.action-bar { position: absolute; left: 50%; bottom: clamp(190px, 25vh, 250px); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 3px solid var(--border-ink); box-shadow: var(--shadow-panel), inset 0 4px 0 var(--color-primary); max-width: 92vw; }
.action-bar span { font-weight: 800; color: var(--text-main); margin-right: 4px; }
.log-drawer { position: absolute; left: 16px; top: 120px; bottom: 210px; z-index: 50; width: min(400px, 92vw); display: flex; flex-direction: column; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 3px solid var(--border-ink); box-shadow: var(--shadow-panel); overflow: hidden; }
.log-drawer header { display: flex; justify-content: space-between; align-items: center; height: 48px; padding: 0 10px 0 14px; background: var(--surface-1); border-bottom: 2px solid var(--border-ink); }
.log-drawer header b { font-family: var(--font-display); font-weight: 400; font-size: 17px; -webkit-text-stroke: 1.2px var(--border-ink); paint-order: stroke fill; }
.log-list { list-style: none; margin: 8px; padding: 6px; overflow-y: auto; flex: 1; font-weight: 600; font-size: 13.5px; line-height: 1.3; border-radius: 12px; background: var(--surface-1); box-shadow: var(--shadow-tray); }
.log-list .lg { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 8px; }
.log-list .lg.hot { cursor: pointer; }
.log-list .lg:hover { background: var(--surface-2); }
.log-list .lg-sep { padding: 10px 4px 3px; font-weight: 800; font-size: 10.5px; letter-spacing: .12em; color: var(--text-muted); border-bottom: 2px solid var(--surface-2); margin-bottom: 3px; }
.lg-where { display: flex; align-items: center; gap: 3px; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--color-primary); }
/* ícone de cada linha: cartinha (imagem do objeto sobre a moldura da carta), verso, ou foto da peça */
.lg-ico { flex: none; display: grid; place-items: center; width: 30px; height: 40px; }
.feed .lg-ico { width: 22px; height: 29px; }
.lg-card { position: relative; display: block; width: 100%; height: 100%; border-radius: 5px; border: 2px solid var(--border-ink);
  background: linear-gradient(170deg, var(--frame, #3B82F6), var(--frame2, #1E40AF)); background-size: 86%, cover; background-position: center; background-repeat: no-repeat; box-shadow: 0 2px 0 #090C10; }
.lg-card svg { display: block; width: 100%; height: 100%; }
.lg-card.r-LEGENDARY { box-shadow: 0 2px 0 #090C10, 0 0 0 2px var(--color-primary); }
.lg-card.back { background-color: #2A3B5C; background-size: cover; }
.lg-piece { position: relative; display: block; width: 100%; height: 100%; background: center bottom / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.lg-piece.glyph { display: grid; place-items: center; font-size: 22px; line-height: 1; } .lg-piece.glyph.w { color: #F1F5F9; } .lg-piece.glyph.b { color: #64748B; }
.lg-piece.cap::after { content: ''; position: absolute; right: -4px; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--color-danger); border: 2px solid var(--border-ink); }
.lg-dot { display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-ink); background: #64748B; }
.lg-dot.t-w { background: #F1F5F9; } .lg-dot.t-b { background: #334158; }

/* mão em leque (zoom no sítio ao passar o rato) */
.opp-hand { position: absolute; left: 50%; top: clamp(118px, 15.5vh, 172px); transform: translateX(-50%); z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.opp-hand .hcard.size-xs { --cw: clamp(30px, 2.4vw, 46px); margin: 0 -7px; transform: rotate(calc(var(--i) * 6deg)) translateY(calc(var(--i) * var(--i) * 1.5px)); }
.hand-dock { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 40; }
.hand-row { --zmax: 2.05; position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); display: flex; align-items: flex-end; }
.hand-row .hcard { --hw: clamp(104px, 7.2vw, 140px); --cw: var(--hw); margin: 0 -12px; transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg)); transform-origin: 50% 100%;
  transition: transform 160ms var(--ease-out-snappy), filter .2s; cursor: grab; touch-action: none; }
/* zoom estilo Hearthstone: só o desenho cresce; a área de clique fica do tamanho normal. O desenho é feito já no
   tamanho ampliado (--zmax × a carta) e encolhido em repouso: ao ampliar fica a 100 % e o texto sai nítido */
.hand-row .hcard .hc-tilt { --cw: calc(var(--hw) * var(--zmax)); inset: auto; left: calc(50% - var(--cw) / 2); bottom: 0; width: var(--cw); height: calc(var(--cw) * 1.4);
  pointer-events: none; transform-origin: 50% 100%; transform: translateY(var(--zy, 0px)) scale(calc(var(--zs, 1) / var(--zmax))) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 160ms var(--ease-out-snappy); }
.hand-row .hcard.tilting .hc-tilt { transition: transform .14s ease-out; }
.hand-row .hcard:hover { transform: translateY(0) rotate(0deg); z-index: 60; }
.hand-row .hcard:hover .hc-tilt { --zs: var(--zmax); --zy: -40px; }
.hand-row .hcard.picked { transform: translateY(-34px) rotate(0deg); z-index: 55; }
.hand-row .hcard.picked .hc-tilt { --zs: 1.15; }
.hand-row .hcard.picked:hover .hc-tilt { --zs: var(--zmax); --zy: -8px; }
.hand-row .hcard.dragging { visibility: hidden; }
.hand-row .hcard.enter { animation: hand-in 380ms var(--ease-out-snappy); }
/* carta jogável: o único brilho permanente do HUD (verde-menta) */
.hand-row .hcard.playable .hc-face { box-shadow: 0 0 0 2.5px var(--color-success), 0 0 12px rgba(46, 196, 182, .75), 0 calc(var(--cw) * .026) 0 var(--lip); }
.hand-row .hcard.picked .hc-face { box-shadow: 0 0 0 3px var(--color-accent), 0 0 14px rgba(0, 180, 216, .7), 0 calc(var(--cw) * .026) 0 var(--lip); }
.hand-row .hcard.respond .hc-face { box-shadow: 0 0 0 3px var(--color-primary), 0 0 20px rgba(255, 183, 3, .85), 0 calc(var(--cw) * .026) 0 var(--lip); }
.hand-row .hcard.dim { filter: brightness(.62) saturate(.6); }
.hand-row .hcard.dim:hover { filter: none; }
/* etiqueta ao lado da carta ampliada (tooltip de jogo) */
.hc-tip { position: absolute; bottom: calc(var(--hw) * 1.1); left: calc(50% + var(--hw) * var(--zmax) / 2 + 12px); width: 240px; padding: 11px 14px; z-index: 2; text-align: left;
  background: var(--bg-canvas); border: 2px solid var(--surface-3); border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .7);
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 120ms, transform 160ms var(--ease-out-snappy); }
.hcard.tip-left .hc-tip { left: auto; right: calc(50% + var(--hw) * var(--zmax) / 2 + 12px); }
.hand-row .hcard:hover .hc-tip { opacity: 1; transform: none; transition-delay: .12s; }
.hand-row .hcard.dragging .hc-tip { display: none; }
.hc-tip b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; line-height: 1.15; color: var(--text-main); -webkit-text-stroke: 1px var(--border-ink); paint-order: stroke fill; }
.tip-meta { display: block; font-weight: 700; font-size: 12.5px; color: var(--text-muted); margin: 4px 0 8px; }
.tip-meta em { font-style: normal; font-weight: 800; }
.hc-tip p { margin: 0 0 6px; font-weight: 600; font-size: 14px; line-height: 1.4; color: #E2E8F0; }
.hc-tip small { display: block; font-weight: 600; font-size: 12px; color: var(--text-muted); }
@media (hover: none) { .hand-row .hcard.picked .hc-tilt { --zs: 1.7; --zy: -16px; } }
@keyframes hand-in { from { transform: translateY(80px) scale(.7); opacity: 0; } }

/* mascote */
.mascot { position: absolute; right: 10px; bottom: -10px; width: clamp(110px, 10vw, 200px); aspect-ratio: 1; z-index: 28; pointer-events: auto; cursor: pointer; }
.mascot .squash { position: relative; width: 100%; height: 100%; animation: breathe 2s ease-in-out infinite; transform-origin: 50% 100%; }
.mascot .squash.play { animation: none; }
.mascot .piece-svg { width: 100%; height: 100%; }
.mascot .eyes-wrap { transform-box: fill-box; transform-origin: center; animation: blink 3.6s infinite; }
.mascot .eyes-star, .mascot .eyes-spiral, .mascot .brows, .mascot .mouth-o, .mascot .mouth-grit, .mascot .sweat { display: none; }
.mascot.checked .sweat, .mascot.checked .mouth-grit { display: inline; } .mascot.checked .mouth-smile { display: none; }
.mascot.checked .squash { animation: tremble .14s linear infinite; }
.mascot.win .squash { animation: jump .6s var(--ease-out-toy) infinite alternate; }
.mascot.win .eyes-star { display: inline; } .mascot.win .eyes-normal .pupil { display: none; }
@keyframes jump { to { transform: translateY(-24px) scale(1.05, .95); } }
@keyframes breathe { 50% { transform: scale(.99, 1.025); } }

.arena .respond-bar { bottom: clamp(190px, 25vh, 250px); z-index: 55; }
.arena .banner { top: 40%; }

/* ── tabuleiro CSS de reserva (sem WebGL) ── */
.table-3d { position: absolute; left: 50%; top: calc(50% + 4px); transform: translate(-50%, -50%); z-index: 3; perspective: 1500px; perspective-origin: 50% 10%; }
.plane { display: grid; grid-template-columns: var(--side) var(--bw) var(--side); gap: calc(var(--bw) * .04); transform: rotateX(var(--tilt)); transform-origin: 50% 55%; transform-style: preserve-3d; }
.side { display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 8px; }
.side-label { font-size: calc(var(--bw) * .018); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); text-align: center; font-weight: 800; }
.zone { display: flex; flex-direction: column; gap: calc(var(--bw) * .015); }
.zone-slot { position: relative; width: calc(var(--side) * .86); aspect-ratio: 1 / 1.4; border-radius: 8px; background: var(--surface-1); box-shadow: var(--shadow-tray); }
.zone-slot .hcard { position: absolute; inset: 0; --cw: calc(var(--side) * .86); }
.zone-slot .set-own { cursor: pointer; }
.zone-slot.fresh::after { content: 'zZ'; position: absolute; right: -8px; top: -8px; z-index: 3; background: var(--surface-3); color: var(--text-main); border: 2px solid var(--border-ink); border-radius: 6px; font: 700 11px/14px var(--font-num); padding: 1px 5px; }
.piles { display: flex; flex-direction: column; gap: calc(var(--bw) * .02); align-items: center; }
.deck-pile, .gy-pile { position: relative; width: calc(var(--side) * .86); aspect-ratio: 1 / 1.4; border-radius: 8px; }
.deck-pile { background: linear-gradient(160deg, #2A3B5C, #121925); border: 2.5px solid var(--border-ink); box-shadow: inset 0 0 0 3px #C9A24A; display: grid; place-items: center; }
.deck-pile span { font-family: var(--font-num); font-weight: 700; color: var(--text-main); }
.deck-pile.empty { opacity: .3; }
.gy-pile { background: var(--surface-1); box-shadow: var(--shadow-tray); cursor: pointer; }
.gy-pile .hcard { position: absolute; inset: 0; --cw: calc(var(--side) * .86); }
.gy-count { position: absolute; right: -8px; bottom: -8px; min-width: 22px; height: 22px; border-radius: 6px; background: var(--surface-3); border: 2px solid var(--border-ink); font: 700 12px/18px var(--font-num); text-align: center; }

/* ecrãs estreitos (≤1250px): sem placas de turno nem mascote */
@media (max-width: 1250px) {
  .jumbo { display: none; }
  .mascot { display: none; }
}

/* telemóvel na vertical */
@media (max-aspect-ratio: 4/5) {
  body.in-match { overflow: hidden; }
  .hud { top: 6px; left: 6px; right: 6px; grid-template-columns: 1fr 1fr; gap: 6px; }
  .hud-mid { display: none; }
  .hud-p, .hud-p.me { width: auto; height: 74px; padding: 4px; gap: 6px; }
  .hud-col { width: 44px; } .hud-ava { aspect-ratio: 1; } .hud-caps, .hud-hand { display: none; }
  .hud-name { font-size: 12px; } .hud-sub { display: none; } .hud-sub.warn { display: block; font-size: 10px; line-height: 1.15; } .hud-mat { font-size: 11px; } .hud-clock { font-size: 14px; padding: 2px 4px; letter-spacing: .02em; }
  .feed { top: 98px; left: 4vw; width: 92vw; min-height: 34px; padding: 4px 10px; }   /* espaço para os efeitos ativos (MatchBuffs) */
  .feed p:first-child:not(:last-child) { display: none; }
  .opp-hand { top: 136px; }
  .arena-btns { top: auto; bottom: 150px; right: 4vw; width: 92vw; flex-direction: row; gap: 6px; }
  .turn-btn { min-height: 44px; flex: 1.4; flex-direction: row; gap: 6px; }
  .turn-btn small { display: none; }
  .side-btn { height: 44px; flex: 1; font-size: 10.5px; }
  .mini-btns { display: none; }
  .m-chain { top: 124px; right: 4vw; }
  .action-bar, .arena .respond-bar { bottom: 200px; }
  .action-bar { bottom: 214px; width: 92vw; padding: 6px 10px; }
  .action-bar span { flex: 1 1 100%; text-align: center; font-size: 13px; }
  .log-drawer { left: 4vw; right: 4vw; width: auto; top: 86px; bottom: 200px; }
  .hand-row { bottom: -8px; }
  .hand-row .hcard { --hw: 86px; margin: 0 -8px; }
  .hand-row .hcard:hover { transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg)); }
  .hand-row .hcard:hover .hc-tilt { --zs: 1; --zy: 0px; }
  .hand-row .hcard.picked { transform: translateY(-20px) rotate(0deg); }
  .hand-row .hcard.picked .hc-tilt, .hand-row .hcard.picked:hover .hc-tilt { --zs: 1.55; --zy: -6px; }
  .hc-tip { display: none; }
  .mascot { display: none; }
}
