@font-face {
  font-family: 'Lilita One';
  src: url(../fonts/lilita-one-latin-400-normal.woff2) format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lilita One';
  src: url(../fonts/lilita-one-latin-ext-400-normal.woff2) format('woff2');
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --pink: #ff0066;
  --cyan: #5ce1e6;
  --font: 'Lilita One', 'Baloo 2', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: #000; overflow: hidden;
  font-family: var(--font);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
img { -webkit-user-drag: none; user-drag: none; }

/* ============ PALCO ============ */
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 2560px; height: 1600px;
  transform-origin: center center;
  background: #000; overflow: hidden;
}
.screen {
  position: absolute; inset: 0; display: none;
  background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
}
.screen.active { display: block; animation: screenIn .35s ease-out both; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ ÁREAS CLICÁVEIS SOBRE AS ARTES ============ */
.hot {
  position: absolute; padding: 0; margin: 0; border: 0; background: transparent;
  cursor: pointer; border-radius: 40px; outline: none;
  transition: background .15s, transform .1s;
}
.hot:hover { background: rgba(255, 255, 255, .10); }
.hot:active { background: rgba(255, 255, 255, .24); transform: scale(.97); }
.hot:focus-visible { outline: 8px solid #fff; }

/* ============ BARRA DE CARREGAMENTO (intro e pré-jogo) ============ */
.bar {
  position: absolute; left: 786px; top: 862px; width: 988px; height: 76px;
  border: 4px solid var(--pink); border-radius: 10px; background: var(--cyan);
  overflow: hidden; box-shadow: 0 0 0 6px rgba(0, 0, 0, .38);
}
.bar i {                       /* o ROSA sobrepõe o CIANO */
  display: block; height: 100%; width: 0;
  background: linear-gradient(180deg, #ff0066 0%, #e8186e 100%);
}
.bar.run i { animation: barfill 4s linear forwards; }
@keyframes barfill { from { width: 0; } to { width: 100%; } }
#s-intro .patch { position: absolute; left: 760px; top: 838px; width: 1040px; height: 124px; background: #000; }

/* barra de carregamento que antecede as partidas: canto inferior, centralizada */
#s-loading .bar { top: auto; bottom: 40px; }

/* ============ MENU ============ */
#logo {
  position: absolute; left: 690px; top: 92px; width: 1180px; height: auto;
  transform-origin: 50% 100%; pointer-events: none;
}
#logo.jump { animation: logojump 1.5s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes logojump {
  0%   { transform: translateY(-1000px) scale(.92, 1.08); opacity: 0; }
  22%  { opacity: 1; }
  34%  { transform: translateY(0) scale(1.14, .84); }
  50%  { transform: translateY(-170px) scale(.95, 1.07); }
  64%  { transform: translateY(0) scale(1.07, .93); }
  78%  { transform: translateY(-46px) scale(1, 1); }
  90%  { transform: translateY(0) scale(1.02, .98); }
  100% { transform: none; }
}
.slash { position: absolute; display: none; pointer-events: none; }
#stage.is-muted .slash { display: block; }

/* ============ BOTÕES DO JOGO (X e áudio) ============ */
.gbtn {
  position: absolute; bottom: 40px; width: 150px; height: 150px; padding: 0; border: 0;
  background: transparent; cursor: pointer; z-index: 20; transition: transform .1s;
}
.gbtn:hover { transform: scale(1.07); }
.gbtn:active { transform: scale(.94); }
.gbtn svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); }
#g-exit { left: 48px; }
#g-audio { right: 48px; }

/* ============ PLACARES ============ */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.placar { position: absolute; top: 16px; width: 409px; height: 510px; }
.placar.left { left: 36px; }
.placar.right { right: 36px; }
.placar img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.placar.in { animation: dropin 1s cubic-bezier(.2, 1.25, .3, 1) both; }
@keyframes dropin { from { transform: translateY(-720px) rotate(-6deg); opacity: 0; } 55% { opacity: 1; } to { transform: none; } }
.score {
  position: absolute; display: flex; align-items: center; justify-content: center;
  color: #fff; line-height: 1; font-size: 150px; letter-spacing: 2px;
  -webkit-text-stroke: 12px #121212; paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .28);
}
.placar .score { left: 9px; top: 285px; width: 391px; height: 216px; }
.score.pop { animation: scorepop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes scorepop { 0% { transform: scale(1); } 35% { transform: scale(1.35) rotate(-4deg); } 100% { transform: scale(1); } }

/* cronômetro (placar de tempo) */
.timer { position: absolute; top: 16px; left: 2081px; width: 480px; height: 400px; }
.timer.in { animation: dropin 1s cubic-bezier(.2, 1.25, .3, 1) both; }
.timer img { position: absolute; inset: 0; width: 100%; height: 100%; }
.clock {
  position: absolute; left: 44px; top: 174px; width: 392px; height: 218px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dg { width: 76px; height: 126px; overflow: visible; }
.dg polygon { fill: rgba(60, 0, 25, .22); transition: fill .08s; }
.dg polygon.on { fill: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.colon { width: 28px; height: 126px; display: flex; flex-direction: column; justify-content: center; gap: 34px; align-items: center; }
.colon b { width: 14px; height: 14px; border-radius: 3px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .9); }
.clock.warn .dg polygon.on { fill: #ffe600; filter: drop-shadow(0 0 8px #ffe600); }
.clock.warn .colon b { background: #ffe600; box-shadow: 0 0 8px #ffe600; }
.clock.warn { animation: warnpulse .5s ease-in-out infinite alternate; }
@keyframes warnpulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ============ INDICADORES DE VEZ ============ */
.vez { position: absolute; top: 536px; width: 409px; display: flex; justify-content: center; align-items: flex-start; pointer-events: none; z-index: 5; }
#vezL { left: 36px; }
#vezR { right: 36px; }
.vez > * { transform-origin: 50% 0; animation: vezpop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.vez img { transform: scale(1.12); display: block; }
@keyframes vezpop { from { transform: scale(.2) rotate(-10deg); opacity: 0; } to { opacity: 1; } }
.vez img { animation-name: vezpopimg; }
@keyframes vezpopimg { from { transform: scale(.2) rotate(-10deg); opacity: 0; } to { transform: scale(1.12); opacity: 1; } }
.vez-txt {
  width: 409px; text-align: center; font-size: 86px; line-height: 1; color: var(--c);
  -webkit-text-stroke: 10px #fff; paint-order: stroke fill;
  text-shadow: 0 0 30px var(--c), 0 0 70px var(--c);
}

/* ============ TABULEIRO / CARTAS ============ */
#board { position: absolute; left: 480px; top: 410px; width: 1600px; height: 1060px; z-index: 3; }
#board.locked { pointer-events: none; }
.card { position: absolute; width: 250px; height: 250px; perspective: 1000px; cursor: pointer; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); }
.card .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.4, .1, .3, 1); }
.card.up .in { transform: rotateY(180deg); }
.card:not(.up):not(.found):hover .in { transform: translateY(-8px) scale(1.04); }
.face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face img { width: 100%; height: 100%; display: block; pointer-events: none; }
.face.front { transform: rotateY(180deg); }
.card.deal { animation: dealin .55s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * 38ms); }
@keyframes dealin { from { transform: translateY(-260px) scale(.1) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
.card.pick { animation: pickpulse .55s ease-in-out; z-index: 4; }
@keyframes pickpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); filter: drop-shadow(0 0 28px #fff); } }
/* par incorreto: "vira e desvira" */
.card.wrong { animation: shake .42s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-16px) rotate(-3deg); } 40% { transform: translateX(16px) rotate(3deg); } 60% { transform: translateX(-12px) rotate(-2deg); } 80% { transform: translateX(10px) rotate(2deg); } }
/* par correto: "vira e magia" */
.card.magic { animation: magicpop .9s cubic-bezier(.3, 1.4, .5, 1); z-index: 6; }
@keyframes magicpop {
  0% { transform: scale(1); filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); }
  25% { transform: scale(1.22) rotate(-5deg); filter: drop-shadow(0 0 40px #fff36b) drop-shadow(0 0 80px #ff7bd5) brightness(1.25); }
  55% { transform: scale(1.1) rotate(4deg); filter: drop-shadow(0 0 40px #7bf6ff) drop-shadow(0 0 70px #fff36b) brightness(1.2); }
  100% { transform: scale(1); filter: drop-shadow(0 0 18px #ffe14d) drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); }
}
.card.found { filter: drop-shadow(0 0 18px #ffe14d) drop-shadow(0 10px 10px rgba(0, 0, 0, .35)); cursor: default; }
.spark {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; z-index: 9;
  background: radial-gradient(circle, #fff 0 18%, var(--sc, #ffe14d) 19% 40%, transparent 42%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: spark .9s ease-out forwards;
}
@keyframes spark { from { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1.5) rotate(200deg); opacity: 0; } }

/* ============ TEMPO ESGOTADO ============ */
#timeup { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(60, 0, 0, .55); z-index: 40; }
#timeup.show { display: flex; }
#timeup span {
  font-size: 260px; color: #ff2a2a; -webkit-text-stroke: 26px #fff; paint-order: stroke fill; text-align: center; line-height: .95;
  text-shadow: 0 0 60px rgba(255, 0, 0, .9); animation: timeupshake .5s ease-in-out infinite alternate;
}
@keyframes timeupshake { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.06); } }

/* ============ BOTÕES DAS TELAS FINAIS ============ */
.btn {
  position: absolute; top: 1435px; width: 600px; height: 125px; border: 8px solid #fff; border-radius: 70px;
  font-family: var(--font); font-size: 58px; color: #fff; cursor: pointer; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 22px; padding: 0;
  box-shadow: 0 12px 0 rgba(0, 0, 0, .38); transition: transform .1s, filter .15s; z-index: 30;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(8px); box-shadow: 0 4px 0 rgba(0, 0, 0, .38); }
.btn svg { width: 64px; height: 64px; flex: none; }
.btn.menu { left: 640px; background: #00b4c4; }
.btn.again { left: 1320px; background: var(--pink); }
.btn:focus-visible { outline: 8px solid #ffe600; }

/* ============ TELAS DE VITÓRIA / DERROTA / EMPATE ============ */
.sunburst-wrap {
  position: absolute; left: 1280px; top: 430px; width: 3600px; height: 3600px; margin: -1800px 0 0 -1800px;
  border-radius: 50%; pointer-events: none; overflow: hidden;
  /* máscaras ESTÁTICAS (não giram): 1) esmaecem as bordas externas; 2) deixam um vão suave
     em volta do troféu/foto/nome para os raios nascerem "por trás" do conteúdo */
  -webkit-mask-image: radial-gradient(circle, #000 0%, #000 46%, rgba(0,0,0,0) 70%),
                      radial-gradient(ellipse 640px 800px at 50% calc(50% + 350px), rgba(0,0,0,0) 62%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(circle, #000 0%, #000 46%, rgba(0,0,0,0) 70%),
              radial-gradient(ellipse 640px 800px at 50% calc(50% + 350px), rgba(0,0,0,0) 62%, #000 100%);
  mask-composite: intersect;
  mix-blend-mode: screen;
}
.sunburst-rays {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg, rgba(var(--tint), .30) 0 7.5deg, rgba(var(--tint), 0) 7.5deg 15deg);
  animation: spin 26s linear infinite; will-change: transform;
}
@keyframes spin { to { transform: rotate(360deg); } }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

#s-tie { background: linear-gradient(135deg, #5a2bbd 0%, #1fb0c0 100%); }
#s-tie .t-title { position: absolute; left: 0; right: 0; top: 120px; text-align: center; font-size: 250px; color: #fff; -webkit-text-stroke: 24px #121212; paint-order: stroke fill; text-shadow: 0 14px 0 rgba(0, 0, 0, .3); }
#s-tie .t-sub { position: absolute; left: 0; right: 0; top: 420px; text-align: center; font-size: 96px; color: #fff; -webkit-text-stroke: 12px #121212; paint-order: stroke fill; }
#s-tie .placar { top: 560px; }
#s-tie .placar.l { left: 700px; right: auto; }
#s-tie .placar.r { left: 1451px; right: auto; }

#s-bye { background: radial-gradient(circle at 50% 40%, #5a2bbd 0%, #14062e 100%); }
#s-bye .b-title { position: absolute; left: 0; right: 0; top: 520px; text-align: center; font-size: 230px; color: #fff; -webkit-text-stroke: 22px #121212; paint-order: stroke fill; }
#s-bye .b-sub { position: absolute; left: 0; right: 0; top: 820px; text-align: center; font-size: 90px; color: #ffe600; }
#s-bye .btn { top: 1100px; left: 980px; }

/* ============ CAIXA DE PERGUNTA (SAIR) ============ */
#modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .62); z-index: 80; }
#modal.show { display: flex; }
.qbox {
  width: 1380px; padding: 90px 70px 80px; border-radius: 80px; text-align: center;
  background: #ff1493; border: 14px solid #fff; box-shadow: 0 34px 0 rgba(0, 0, 0, .38);
  animation: qpop .4s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes qpop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.qbox h2 { margin: 0 0 80px; font-weight: 400; font-size: 150px; color: #fff; text-shadow: 0 10px 0 rgba(0, 0, 0, .25); }
.qbtn {
  width: 460px; height: 170px; margin: 0 34px; border-radius: 48px; border: 10px solid #fff;
  font-family: var(--font); font-size: 104px; color: #fff; cursor: pointer; box-shadow: 0 12px 0 rgba(0, 0, 0, .35);
  transition: transform .1s, filter .15s;
}
.qbtn:hover { filter: brightness(1.1); }
.qbtn:active { transform: translateY(8px); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.qbtn.yes { background: #1faa45; }
.qbtn.no { background: #e53935; }
.qbtn:focus-visible { outline: 8px solid #ffe600; }
