/* SEX GROK — cara de jogo de danca de fliperama: letra condensada inclinada,
   contorno preto, neon rosa/amarelo, cantos retos. Fontes servidas daqui. */

@font-face { font-family: "Anton"; src: url("/fonts/anton.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/plexmono-500.woff2") format("woff2"); font-display: swap; }

:root {
  --rosa: #ff2d95; --amarelo: #ffe14d; --azul: #21d4fd; --roxo: #7a2dff; --vermelho: #ff2b2b;
  --fundo: #07021a; --tinta: #fff; --faixa: 0px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--tinta); }
body { font-family: "Plex Mono", ui-monospace, monospace; font-size: 13px; overflow-x: hidden; }
[hidden] { display: none !important; }
.rot { font-size: 10px; letter-spacing: .18em; opacity: .7; }

/* ---------- faixa do CA ---------- */
#ca { position: sticky; top: 0; z-index: 50; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 7px 12px; background: var(--amarelo); color: #000; font-size: 12px; }
#ca code { font-family: inherit; font-weight: 700; word-break: break-all; }
#ca button, #ca a { font: inherit; font-weight: 700; background: #000; color: var(--amarelo); border: 0; padding: 3px 9px; text-decoration: none; cursor: pointer; }

/* ---------- palco ---------- */
#show { position: relative; height: 100vh; height: 100dvh; min-height: 520px; overflow: hidden; background: var(--fundo); }
#ca:not([hidden]) + #show { height: calc(100dvh - 34px); }
#tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#sem3d { position: absolute; inset: 40% 10% auto; text-align: center; }
#clarao { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#clarao.piscar { animation: clarao .7s ease-out; }
#clarao.branco { background: #fff; } #clarao.vermelho { background: var(--vermelho); }
@keyframes clarao { 0% { opacity: .85; } 100% { opacity: 0; } }

/* borda de velocidade no frenesi e no climax */
#show::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255,45,149,.0) 60%, rgba(255,30,30,.55) 100%); }
body[data-fase="3"] #show::after { opacity: .45; }
body[data-fase="4"] #show::after, body[data-fase="climax"] #show::after { opacity: 1; animation: pulsa .35s infinite alternate; }
@keyframes pulsa { to { opacity: .6; } }

.contorno, .marca, #fase, #nota, #combo b, #grande b {
  font-family: "Anton", Impact, sans-serif; font-style: italic; text-transform: uppercase; line-height: .9;
  -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000;
}

#topo { position: absolute; top: 14px; left: 96px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.marca { font-size: clamp(30px, 4.6vw, 62px); color: var(--amarelo); transform: skewX(-6deg); }
.ao-vivo { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#selo { font-family: "Anton", Impact, sans-serif; font-size: 18px; letter-spacing: .08em; padding: 3px 12px 2px; color: #000; background: var(--amarelo); }
#selo.vivo { background: var(--vermelho); color: #fff; }
#selo.vivo::before { content: "● "; animation: pulsa .8s infinite alternate; }
#selo.caiu { background: #777; color: #fff; }
#selo.espera { background: var(--azul); color: #000; }
.x-link { display: inline-block; font-family: "Anton", Impact, sans-serif; font-size: 18px; letter-spacing: .06em; color: #000; background: var(--amarelo); padding: 8px 16px; text-decoration: none; border: 3px solid #000; box-shadow: 4px 4px 0 #000; }
#selo-sub { font-size: 11px; background: rgba(0,0,0,.6); padding: 2px 6px; }

/* ---------- termometro ---------- */
#termo { position: absolute; left: 16px; top: 14px; bottom: 150px; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#termo .alvo { font-family: "Anton", Impact, sans-serif; font-size: 13px; letter-spacing: .06em; color: var(--amarelo); }
#termo .tubo { position: relative; flex: 1; width: 40px; background: rgba(0,0,0,.65); border: 3px solid #fff; outline: 3px solid #000; overflow: hidden; }
#nivel { position: absolute; left: 0; right: 0; bottom: 0; height: 0; transition: height .45s cubic-bezier(.2,1.6,.4,1);
  background: linear-gradient(to top, var(--roxo), var(--rosa) 45%, #ff7a00 75%, var(--amarelo)); box-shadow: 0 0 18px var(--rosa); }
#nivel::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: #fff; }
#termo .tubo i { position: absolute; left: 0; width: 12px; height: 2px; background: #fff; opacity: .8; }
#termo b { font-family: "Anton", Impact, sans-serif; font-size: 22px; }
#termo .leg { font-size: 9px; letter-spacing: .1em; text-align: center; opacity: .8; line-height: 1.3; }
#termo.bateu .tubo { animation: bate .3s; }
@keyframes bate { 30% { transform: scale(1.12, 1.03); border-color: var(--amarelo); } }

/* ---------- nota e combo ---------- */
#centro { position: absolute; left: 0; right: 0; top: 2%; text-align: center; pointer-events: none; display: flex; flex-direction: column; align-items: center; }
#nota { font-size: clamp(40px, 8vw, 110px); opacity: 0; margin-top: 6px; }
#nota.pular { animation: nota .9s ease-out; }
#nota.perfect { color: var(--amarelo); } #nota.great { color: var(--rosa); } #nota.good { color: var(--azul); } #nota.ok { color: #fff; }
@keyframes nota { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 18% { opacity: 1; transform: scale(1.15) rotate(-4deg); } 70% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: scale(1) translateY(-40px) rotate(-4deg); } }
#nota.breaker { color: var(--vermelho); }

/* ---------- modo cartaz (?arte=1): so a cena ---------- */
body.arte #ca, body.arte #topo, body.arte #termo, body.arte #centro, body.arte #grande, body.arte #feed, body.arte #base, body.arte #regras, body.arte .fala, body.arte #show::after { display: none !important; }
body.arte #show { height: 100vh; min-height: 0; }

/* ---------- baloes de fala ---------- */
/* o palco.js poe o transform (posicao em cima da bola); sem 3D ficam nos cantos abaixo */
.fala { position: absolute; left: 0; top: 0; max-width: min(340px, 46vw); pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 5; will-change: transform; }
.fala.he { transform: translate(-50%, -100%) translate(32vw, 42vh); }
.fala.she { transform: translate(-50%, -100%) translate(64vw, 58vh); }
.fala.ativa { opacity: 1; }
.fala span { position: relative; display: block; background: #fff; color: #000; font-weight: 600; font-size: clamp(13px, 1.35vw, 19px); line-height: 1.25;
  padding: 10px 14px; border: 3px solid var(--azul); border-radius: 16px; box-shadow: 4px 4px 0 #000; transform-origin: 50% 100%; }
.fala.she span { border-color: var(--rosa); }
.fala.ativa span { animation: balao .35s cubic-bezier(.2,1.6,.4,1); }
.fala span::after { content: ""; position: absolute; left: 50%; bottom: -13px; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top: 11px solid var(--azul); }
.fala.she span::after { border-top-color: var(--rosa); }
@keyframes balao { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

/* contador de combo: sempre na tela, cresce a cada compra, muda de cor por patamar */
#combo { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; transform: rotate(-4deg); margin-top: 8px; }
#combo .rot-combo { font-family: "Anton", Impact, sans-serif; font-size: clamp(14px, 1.6vw, 22px); letter-spacing: .18em; color: var(--amarelo); -webkit-text-stroke: 1px #000; }
#combo b { font-size: clamp(64px, 10vw, 150px); color: #fff; line-height: .85; display: inline-block; }
#combo small { font-size: 11px; letter-spacing: .12em; opacity: .85; background: rgba(0,0,0,.6); padding: 2px 8px; }
#combo[data-nivel="1"] b { color: var(--amarelo); }
#combo[data-nivel="2"] b { color: #ff7a00; }
#combo[data-nivel="3"] b { color: var(--rosa); }
#combo[data-nivel="4"] b { color: var(--vermelho); animation: treme .12s infinite alternate; }
#combo.bate b { animation: bate-combo .4s cubic-bezier(.2,1.8,.4,1); }
@keyframes bate-combo { 0% { transform: scale(1.4) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes treme { from { transform: translate(-2px, 1px); } to { transform: translate(2px, -1px); } }

#grande { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none; opacity: 0; transition: opacity .3s; }
#grande.ativo { opacity: 1; }
#grande b { font-size: clamp(64px, 15vw, 230px); transform: skewX(-8deg) rotate(-5deg); }
#grande.ativo b { animation: entra .45s cubic-bezier(.2,1.8,.4,1); }
#grande span { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; background: #000; padding: 4px 12px; }
#grande.ouro b { color: var(--amarelo); } #grande.vermelho b { color: var(--vermelho); } #grande.azul b { color: var(--azul); font-size: clamp(40px, 8vw, 120px); }
@keyframes entra { from { transform: skewX(-8deg) rotate(-5deg) scale(3); opacity: 0; } }

/* ---------- compras e vendas ---------- */
#feed { position: absolute; right: 16px; top: 92px; width: 230px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
#feed li { display: flex; flex-direction: column; padding: 5px 10px; background: rgba(0,0,0,.72); border-left: 5px solid var(--amarelo); animation: chega .25s ease-out; transition: opacity 1.5s; }
#feed li.venda { border-color: var(--vermelho); }
#feed li.velho { opacity: .25; }
#feed b { font-family: "Anton", Impact, sans-serif; font-size: 20px; letter-spacing: .03em; color: var(--amarelo); }
#feed li.venda b { color: var(--vermelho); }
#feed span { font-size: 11px; opacity: .85; }
@keyframes chega { from { transform: translateX(60px); opacity: 0; } }

/* ---------- base ---------- */
#base { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.fase-caixa { flex: 1 1 320px; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
#fase { font-size: clamp(38px, 6vw, 84px); color: var(--rosa); }
body[data-fase="3"] #fase, body[data-fase="4"] #fase { color: #ff7a00; }
body[data-fase="climax"] #fase { color: var(--amarelo); }
body[data-fase="tapa"] #fase { color: var(--vermelho); }
body[data-fase="descanso"] #fase { color: var(--azul); }
.barra { position: relative; height: 14px; max-width: 520px; background: rgba(0,0,0,.65); border: 2px solid #fff; outline: 2px solid #000; }
#forca { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(to right, var(--rosa), var(--amarelo)); transition: width .4s; }
#forca-piso { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .8s;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.55) 0 5px, transparent 5px 10px); border-right: 2px solid #000; }
.mini { font-size: 10px; opacity: .8; background: rgba(0,0,0,.5); padding: 1px 5px; align-self: flex-start; }
#base dl { display: flex; gap: 8px; margin: 0; }
#base dl div { background: rgba(0,0,0,.72); padding: 7px 12px 6px; border-top: 4px solid var(--rosa); min-width: 118px; }
#base dt { font-size: 9px; letter-spacing: .16em; opacity: .75; }
#base dd { margin: 2px 0 0; font-family: "Anton", Impact, sans-serif; font-size: 28px; line-height: 1; }
#base dd.sub { font-family: inherit; font-size: 10px; letter-spacing: .1em; color: var(--amarelo); margin-top: 4px; }
#som { font-family: "Anton", Impact, sans-serif; font-size: 16px; letter-spacing: .08em; padding: 10px 16px 8px; background: #000; color: #fff; border: 3px solid #fff; cursor: pointer; }
#som.on { background: var(--amarelo); color: #000; border-color: #000; }

/* ---------- regras ---------- */
#regras { padding: 70px 24px 90px; background: var(--amarelo); color: #000; }
#regras h2 { font-family: "Anton", Impact, sans-serif; font-style: italic; font-size: clamp(54px, 10vw, 150px); line-height: .85; margin: 0 0 34px; transform: skewX(-6deg); }
#regras ol { list-style: none; counter-reset: passo; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; border: 4px solid #000; }
#regras li { counter-increment: passo; padding: 22px 20px 26px; border-right: 4px solid #000; background: #fff; }
#regras li:nth-child(even) { background: var(--rosa); color: #fff; }
#regras li:last-child { border-right: 0; background: #000; color: #fff; }
#regras li::before { content: "0" counter(passo); font-family: "Anton", Impact, sans-serif; font-size: 18px; opacity: .6; }
#regras li b { display: block; font-family: "Anton", Impact, sans-serif; font-style: italic; font-size: 46px; line-height: 1; margin: 6px 0 10px; }
#regras li p { margin: 0; font-size: 14px; line-height: 1.5; }
.nota-pe { max-width: 760px; margin: 28px 0 0; font-size: 13px; line-height: 1.6; }

/* ---------- celular ---------- */
@media (max-width: 720px) {
  #topo { left: 70px; top: 10px; right: 10px; }
  #termo { left: 8px; width: 50px; bottom: 210px; top: 10px; }
  #termo .tubo { width: 30px; }
  #feed { right: 8px; top: 70px; width: 150px; }
  #feed li:nth-child(n+4) { display: none; }
  #feed b { font-size: 16px; }
  #base { left: 8px; right: 8px; bottom: 8px; gap: 8px; }
  #base dl { width: 100%; gap: 4px; }
  #base dl div { flex: 1; min-width: 0; padding: 6px 8px; }
  #base dd { font-size: 20px; }
  #som { font-size: 13px; padding: 7px 10px 5px; }
  #regras li { border-right: 0; border-bottom: 4px solid #000; }
}
@media (prefers-reduced-motion: reduce) {
  #show::after, #selo.vivo::before { animation: none !important; }
}
