/* ---------- page / stage ---------- */
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { cursor: none; user-select: none; -webkit-user-select: none; }
body.preview { cursor: default; }
#viewport { position: fixed; inset: 0; overflow: hidden; background: #000; }
/* ecrãs que não são 16:9: o que sobra à volta do palco leva a cor de fundo do ecrã, em vez de barras pretas (ajuste «adapt») */
#backdrop { position: absolute; inset: 0; background: var(--bg); display: none; }
body.fit-adapt #backdrop { display: block; }
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden; background: var(--bg); color: var(--white);
  font-family: var(--font-title);
}
#stage * { box-sizing: border-box; }

/* ---------- persistent background ----------
   Organic & simple: flat dark background + one decorative artwork on the right (o DESENHO escolhido na competição:
   assets/img/fundos/<id>.svg, branco sobre transparente, usado como máscara e pintado com a cor da competição).
   modes: pdf / full / frame (artwork right) | soft (55 %) | dim (28 %) | frameDim (= dim)
          | mirror (artwork on the left, flipped — for layouts with the photo on the right) | none */
#bg { position: absolute; inset: 0; }
#bg .bg-fill { position: absolute; inset: 0; background: var(--bg); }
#bg .bg-glow, #bg .bg-vignette, #bg .sweep, #particles { display: none !important; }
#bg .stripes-set { position: absolute; inset: 0; opacity: 0; transition: opacity 800ms ease, transform 1200ms cubic-bezier(.2,.7,.2,1); }
#bg .stripes-set .arte { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  background: linear-gradient(115deg, var(--accent-b) 0%, var(--accent) 45%, var(--accent-a) 100%);
  -webkit-mask-size: 1920px 1080px; mask-size: 1920px 1080px; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
#stripes { transform: translateX(120px); }
#stripesL { transform: scaleX(-1) translateX(120px); }

#bg.mode-pdf #stripes, #bg.mode-full #stripes, #bg.mode-frame #stripes, #bg.mode-hero #stripes { opacity: 1; transform: none; }
#bg.mode-soft #stripes { opacity: .55; transform: none; }
#bg.mode-dim #stripes, #bg.mode-frameDim #stripes { opacity: .28; transform: none; }
#bg.mode-mirror #stripesL { opacity: 1; transform: scaleX(-1); }
#bg.mode-mirrorDim #stripesL { opacity: .25; transform: scaleX(-1); }
/* fundo da competição: desenho (acima) · liso (sem desenho) · imagem própria · vídeo em loop (ocupam o ecrã, mais escuros nos ecrãs "dim")
   .bg-img = caixa do fundo (as regras de escurecer); .bg-layer = foto ou vídeo lá dentro (troca com fade) */
#bg[data-look="liso"] .stripes-set, #bg[data-look="imagem"] .stripes-set, #bg[data-look="video"] .stripes-set { opacity: 0 !important; }
#bg .bg-img { position: absolute; inset: 0; opacity: 0; transition: opacity 600ms ease; }
#bg[data-look="imagem"]:not(.mode-none) .bg-img, #bg[data-look="video"]:not(.mode-none) .bg-img { opacity: 1; }
#bg[data-look="imagem"].mode-soft .bg-img, #bg[data-look="video"].mode-soft .bg-img { opacity: .6; }
#bg[data-look="imagem"].mode-dim .bg-img, #bg[data-look="imagem"].mode-frameDim .bg-img, #bg[data-look="imagem"].mode-mirrorDim .bg-img,
#bg[data-look="video"].mode-dim .bg-img, #bg[data-look="video"].mode-frameDim .bg-img, #bg[data-look="video"].mode-mirrorDim .bg-img { opacity: .3; }
/* fundo próprio de um ecrã (fundosEcra): aparece mesmo nos ecrãs sem riscas */
#bg.has-ecra.mode-none .bg-img { opacity: 1; }
#bg .bg-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: center / cover no-repeat; opacity: 0; transition: opacity 600ms ease; }
#bg .bg-layer.on { opacity: 1; }
/* ---------- scenes ---------- */
#scenes { position: absolute; inset: 0; }
.scene { position: absolute; inset: 0; overflow: hidden; }
.abs { position: absolute; }

/* ---------- wipe transition (slanted bands in the accent colour + dark body) ---------- */
#wipe { position: absolute; inset: 0; pointer-events: none; z-index: 50; visibility: hidden; }
#wipe .wipe-track { position: absolute; top: 0; left: 0; height: 1080px; width: 4200px; will-change: transform; }
#wipe .band { position: absolute; top: 0; height: 1080px; }
#wipe .band.o { background: var(--grad); }
#wipe .band.body { background: var(--bg); }

/* ---------- shared components ---------- */
.uel-logo { position: absolute; display: block; object-fit: contain; object-position: 50% 0; }
.crest { position: absolute; display: block; object-fit: contain; filter: drop-shadow(0 10px 30px rgba(0,0,0,.55)); }

/* flat helpers */
.panel { position: absolute; }
.chip { position: absolute; background: var(--accent); border-radius: 6px; color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.tag { position: absolute; color: var(--accent); letter-spacing: .08em; }
.rule { position: absolute; height: 4px; background: var(--accent); }
.t-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- components — organic, flat (client's language: Marcador.pdf + player cards) ---------- */
.tile { position: absolute; }
.tile-glass, .tile-dark, .tile-line { background: none; }
.tile-orange { background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.tile-rim, .tile-shine { display: none; }
.crest-box { position: absolute; }
.crest-box > .crest, .crest { filter: none; }
svg.lineart { display: none; }
.hairline { position: absolute; height: 2px; background: rgba(255,255,255,.18); }

/* big text */
.bigtext .bt-inner { white-space: nowrap; color: #fff; text-transform: uppercase; }
.bt-outline { color: #fff !important; }
.bt-grad, .bt-orange { color: var(--accent) !important; }

/* caption: spaced capitals, white 65 % */
.caption { display: flex; align-items: center; font-size: 30px; letter-spacing: .16em; color: rgba(255,255,255,.65); white-space: nowrap; }
.caption .cap-bar { display: none; }

.flash, .burst { display: none !important; }
/* UEFA added-time indicator: [1:52][+2] — flat */
.added-chip { display: flex; justify-content: center; align-items: stretch; line-height: 1; color: #fff; }
.added-chip .ac-seg { display: none; align-items: center; justify-content: center; padding: 0 .4em; }
.added-chip.has-extra .ac-extra { display: flex; background: rgba(255,255,255,.14); border-radius: .14em; }
.added-chip.has-added .ac-added { display: flex; background: var(--accent); color: var(--accent-ink); border-radius: .14em; }
.added-chip.has-extra.has-added .ac-extra { border-radius: .14em 0 0 .14em; }
.added-chip.has-extra.has-added .ac-added { border-radius: 0 .14em .14em 0; }
/* arrows for substitutions */
.arrow-in, .arrow-out { display: inline-block; width: 0; height: 0; border-style: solid; }

/* MOMENTO PATROCINADO (Kit.sponsorStrip): canto superior direito, placa da cor do fundo, texto pequeno espaçado + logo */
.sp-strip { position: absolute; right: 48px; top: 48px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  max-width: 300px; padding: 14px 18px 16px; border-radius: 6px; background: rgba(0, 12, 15, .82); pointer-events: none; }
.sp-strip.on-video { background: rgba(0, 12, 15, .7); }
.sp-strip .sp-lab { display: flex; flex-direction: column; align-items: flex-end; font-size: 19px; line-height: 1.2; letter-spacing: .16em; margin-right: -.16em; white-space: nowrap; }
.sp-strip .sp-l1 { color: rgba(255, 255, 255, .9); }
.sp-strip .sp-l2 { color: rgba(255, 255, 255, .55); font-size: 16px; }
.sp-strip .sp-logo { display: block; height: 84px; width: auto; max-width: 264px; object-fit: contain; object-position: right center; }
/* sem licença a marca DEMO ocupa o canto: a faixa desce */
body.demo .sp-strip { top: 104px; }

/* debug overlay */
#debug { position: absolute; right: 12px; bottom: 8px; font: 14px monospace; color: #0f0; z-index: 99; display: none; }
/* sem licença: marca DEMO por cima de todos os ecrãs */
#demo { position: absolute; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
#demo[hidden] { display: none; }
#demo .demo-x { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg); font: 900 420px/1 Arial, sans-serif; letter-spacing: 40px; color: rgba(255, 255, 255, .10); -webkit-text-stroke: 4px rgba(255, 255, 255, .16); white-space: nowrap; }
#demo .demo-tag { position: absolute; right: 36px; top: 30px; display: flex; align-items: center; gap: 14px; background: rgba(255, 178, 36, .95); color: #0a0a0a; padding: 12px 20px; border-radius: 10px; font: 700 26px/1 Arial, sans-serif; letter-spacing: 2px; }
#demo .demo-tag b { font-size: 34px; }
body.debug #debug { display: block; }

/* connection lost indicator — tiny, only visible in preview */
#conn { position: fixed; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #f33; display: none; z-index: 100; }
body.preview.offline #conn { display: block; }

/* ---------- rodapé rotativo (js/output/footer.js): faixa fina no fundo do marcador ---------- */
#footer { position: absolute; left: 0; bottom: 0; width: 1920px; height: 58px; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 500ms ease;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.45)); border-top: 3px solid var(--accent); }
#footer .ft-inner { position: relative; width: 100%; height: 100%; }
#footer .ft-item { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 22px; white-space: nowrap; font-family: var(--font-title); font-size: 30px; color: #fff; letter-spacing: .06em; }
#footer .ft-lab { font-size: 22px; letter-spacing: .2em; color: var(--accent); }
#footer .ft-logo { height: 40px; width: auto; max-width: 220px; object-fit: contain; }
#footer .ft-wrap { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
