.tv-vitrine {
  container-type: inline-size;
  --tv-recorte: clamp(54px, 9.4cqw, 118px);
  --tv-base: clamp(58px, 6vw, 82px);
  --tv-sobreposicao: calc(var(--tv-base) / 3);
}
.tv-vitrine-palco {
  position: relative;
  overflow: hidden;
  border-radius: clamp(16px, 3vw, 32px);
  aspect-ratio: 16 / 9;
  background: linear-gradient(125deg, #def3ff, #fff2ca);
  box-shadow: 0 9px 26px #47508422;
}
.tv-vitrine-capa {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tv-vitrine-info {
  position: absolute;
  z-index: 1;
  top: clamp(12px, 4vw, 55px);
  left: clamp(12px, 4vw, 55px);
  display: grid;
  justify-items: start;
  gap: clamp(5px, 1.1vw, 13px);
}
.tv-vitrine-info h1 {
  --sombra-rotulo: #241336d9;
  margin: 0;
  color: #fff;
  font: 800 clamp(1rem, 2.45vw, 2.1rem)/1.08 Nunito, sans-serif;
  letter-spacing: .025em;
  text-shadow: 0 1px 2px var(--sombra-rotulo), 0 0 9px var(--sombra-rotulo);
}
.tv-vitrine-palco[data-fundo="claro"] h1 {
  --sombra-rotulo: #fffae8;
  color: #271442;
}
.tv-vitrine-play {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  min-height: 40px;
  border: 1px solid #ffdc7b;
  border-radius: 10px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(180deg, #ffedaa 0%, #ffcf63 6%, #ac741b 30%, #915608 51%, #a96e11 75%, #e9b14a 100%);
  color: #fff;
  text-shadow: 0 1px 2px #452400, 0 1px 5px #492700cf;
  box-shadow: inset 0 0 0 1px #fff2be52, 2px 5px 0 #36210c80, 5px 9px 15px #2d1b0ca6;
  font: 800 clamp(.72rem, 1.6vw, .97rem)/1.1 Nunito, sans-serif;
  text-align: left;
  cursor: pointer;
}
.tv-vitrine-play::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -30%;
  background: linear-gradient(110deg, transparent 40%, #fff3bb33 46%, #fff8d082 50%, #fff3bb33 54%, transparent 60%);
  transform: translateX(-57%);
  animation: tv-reflexo-dourado 5s ease-in-out infinite;
}
.tv-vitrine-play:hover { filter: brightness(1.08); }
@keyframes tv-reflexo-dourado {
  0%, 22% { transform: translateX(-57%); }
  63%, 100% { transform: translateX(57%); }
}

.tv-janelas {
  position: relative;
  width: min(95%, 1080px);
  z-index: 2;
  margin: calc(0px - var(--tv-recorte) - var(--tv-sobreposicao)) auto 0;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-areas: "a b surpresa c d";
  gap: clamp(7px, 1.45vw, 21px);
}
.tv-pos-0 { grid-area: a; }
.tv-pos-1 { grid-area: b; }
.tv-pos-2 { grid-area: c; }
.tv-pos-3 { grid-area: d; }
.tv-janela {
  position: relative;
  display: grid;
  grid-template-rows: var(--tv-recorte) var(--tv-base);
  align-items: end;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--claro, #43256f);
  text-align: center;
  cursor: pointer;
  font-family: var(--fonte-titulo);
}
.tv-personagem {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  --tv-escala: 1.12;
  width: 98%;
  height: calc(var(--tv-recorte) + 4px);
  transform-origin: center bottom;
  transform: translateX(-50%) scale(var(--tv-escala));
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 3px 1px #211330a6) drop-shadow(8px 8px 5px #241331ad);
  transition: transform .22s ease;
  pointer-events: none;
}
.tv-miniatura-janela {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .22;
  pointer-events: none;
}
.tv-janela:hover .tv-personagem, .tv-janela:focus-visible .tv-personagem {
  transform: translate(-50%, -3px) scale(calc(var(--tv-escala) + .035));
}
.tv-janela-base {
  position: relative;
  isolation: isolate;
  z-index: 2;
  grid-row: 2;
  align-content: center;
  display: grid;
  width: 100%;
  height: var(--tv-base);
  padding: 6px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: clamp(9px, 1.4vw, 17px);
  background: radial-gradient(ellipse at 16% 0%, #ffffffa8, transparent 63%),
    linear-gradient(135deg, var(--janela, #fff1b2), var(--luz, #b1e8ff));
  box-shadow: 0 3px 0 #65518c26, 0 6px 14px #65518c24;
}
.tv-janela-base strong {
  position: relative;
  color: inherit;
  font-size: clamp(.8rem, 1.65vw, 1.43rem);
  line-height: 1.05;
  text-shadow: 0 1px #ffffff9e;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.tv-janela-base::before,
.tv-janela-base::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.tv-janela-magica .tv-janela-base::before {
  background:
    radial-gradient(circle at 8% 26%, #fff 0 1.3px, transparent 2.8px),
    radial-gradient(circle at 16% 72%, #fff 0 2px, transparent 5px),
    radial-gradient(circle at 34% 14%, #fff 0 1.1px, transparent 3.1px),
    radial-gradient(circle at 52% 84%, #fff 0 1.6px, transparent 4px),
    radial-gradient(circle at 69% 25%, #fff 0 1.5px, transparent 4px),
    radial-gradient(circle at 82% 76%, #fff 0 1.5px, transparent 4px),
    radial-gradient(circle at 92% 32%, #fff 0 2px, transparent 5px);
  animation: tv-luzes 2.6s ease-in-out infinite alternate;
}
.tv-janela-base::after {
  inset: -45% -70%;
  background: linear-gradient(110deg, transparent 44%, #fff3 47%, #fffb 50%, #fff3 53%, transparent 57%);
  transform: translateX(-45%);
  animation: tv-reflexo 4.8s ease-in-out infinite;
}
.tv-pos-3 .tv-janela-base::after { animation-delay: -1.2s; }
.tv-pos-2 .tv-janela-base::after { animation-delay: -2.1s; }
@keyframes tv-luzes {
  from { opacity: .28; }
  to { opacity: .96; }
}
@keyframes tv-reflexo {
  0%, 12% { opacity: 0; transform: translateX(-44%); }
  28% { opacity: .9; }
  60%, 100% { opacity: 0; transform: translateX(44%); }
}

.tv-estrelas-internas {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 3px #fff9cc);
}
.tv-estrelas-internas i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  background: #fff;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: tv-estrelas-passando 3.6s linear infinite;
  animation-delay: var(--d);
}
.tv-estrelas-internas i:nth-child(1) { --x: 1%; --y: 19%; --s: 13px; --d: -.6s; }
.tv-estrelas-internas i:nth-child(2) { --x: 16%; --y: 68%; --s: 10px; --d: -1.9s; }
.tv-estrelas-internas i:nth-child(3) { --x: 39%; --y: 8%; --s: 8px; --d: -2.8s; }
.tv-estrelas-internas i:nth-child(4) { --x: 52%; --y: 65%; --s: 12px; --d: -1.2s; }
.tv-estrelas-internas i:nth-child(5) { --x: 69%; --y: 16%; --s: 11px; --d: -3.2s; }
.tv-estrelas-internas i:nth-child(6) { --x: 81%; --y: 63%; --s: 14px; --d: -2.1s; }
@keyframes tv-estrelas-passando {
  0%, 100% { opacity: 0; }
  0% { transform: translate(-14px, 4px) scale(.6); }
  24%, 62% { opacity: 1; }
  48% { transform: translate(3px, 0) scale(1.18); }
  100% { transform: translate(28px, -5px) scale(.55); }
}

.tv-surpresa { position: relative; grid-area: surpresa; min-width: 0; }
.tv-janela-magica .tv-janela-base {
  background: radial-gradient(ellipse at 28% 18%, #ffffffdb 0%, transparent 54%),
    conic-gradient(from 55deg at 40% 65%, #ffadef, #ffe6a3, #bcffcf, #a7faff, #b0c7ff, #ffadef);
  box-shadow: 0 1px 2px #5c49a245, 0 0 20px #c999f3a6, 0 0 12px #82eaef94;
}
.tv-janela-magica .tv-janela-base::before {
  animation-duration: 1.65s;
}
.tv-janela-magica .tv-janela-base::after {
  background: linear-gradient(105deg, transparent 42%, #f8e4ff80 46%, #ffffffe6 50%, #e0fcffb3 54%, transparent 59%);
  animation-duration: 2.85s;
}
.tv-janela-magica:not(.revelada) { pointer-events: none; }
.tv-janela-magica:not(.revelada) .tv-janela-base { pointer-events: auto; }
.tv-janela-magica:not(.revelada) strong { display: block; }
.tv-janela-magica strong b {
  display: block;
  margin-bottom: 4px;
  color: #85318e;
  font-size: clamp(1.6rem, 3.6vw, 2.65rem);
  line-height: .85;
  text-shadow: 0 0 8px #fff, 0 2px #fff4df;
}
.tv-faíscas {
  position: absolute;
  z-index: 3;
  inset: auto -10px -10px;
  display: block;
  height: calc(var(--tv-base) + 28px);
  pointer-events: none;
}
.tv-faíscas i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  background: #fffdf7;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: tv-cintilar 2.5s ease-in-out infinite;
  animation-delay: var(--d);
}
.tv-faíscas { filter: drop-shadow(0 0 3px #9f5bec) drop-shadow(0 0 6px #fff3a7); }
.tv-faíscas i:nth-child(1) { --x: 1%; --y: 5%; --s: 18px; --d: -.3s; }
.tv-faíscas i:nth-child(2) { --x: 16%; --y: 0%; --s: 11px; --d: -1s; }
.tv-faíscas i:nth-child(3) { --x: 78%; --y: 4%; --s: 16px; --d: -1.7s; }
.tv-faíscas i:nth-child(4) { --x: 94%; --y: 21%; --s: 11px; --d: -.9s; }
.tv-faíscas i:nth-child(5) { --x: 92%; --y: 80%; --s: 17px; --d: -2.3s; }
.tv-faíscas i:nth-child(6) { --x: 31%; --y: 86%; --s: 13px; --d: -1.2s; }
.tv-faíscas i:nth-child(7) { --x: 0%; --y: 73%; --s: 11px; --d: -2s; }
.tv-faíscas i:nth-child(8) { --x: 67%; --y: 94%; --s: 9px; --d: -1.2s; }
.tv-faíscas i:nth-child(9) { --x: 26%; --y: 1%; --s: 8px; --d: -2.4s; }
.tv-faíscas i:nth-child(10) { --x: 57%; --y: 5%; --s: 12px; --d: -.5s; }
.tv-faíscas i:nth-child(11) { --x: 17%; --y: 93%; --s: 9px; --d: -1.5s; }
.tv-faíscas i:nth-child(12) { --x: 79%; --y: 92%; --s: 13px; --d: -.8s; }
@keyframes tv-cintilar {
  0%, 100% { opacity: .28; transform: translateY(4px) scale(.66) rotate(0); }
  40% { opacity: 1; transform: translateY(-4px) scale(1.26) rotate(12deg); }
  65% { opacity: .73; }
}
.tv-janela-magica.revelada .tv-personagem { animation: tv-revelar-personagem .4s ease-out; }
@keyframes tv-revelar-personagem {
  from { opacity: 0; transform: translate(-50%, 12px) scale(.87); }
  to { opacity: 1; transform: translateX(-50%) scale(var(--tv-escala)); }
}

.tv-sortear-novamente {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 96%;
  min-height: 27px;
  border: 1px solid #e9d4ff;
  border-radius: 7px;
  background: #f9f0ff;
  color: #553480;
  cursor: pointer;
  font: 800 clamp(.61rem, 1.2vw, .82rem)/1.05 Nunito, sans-serif;
}
.tv-vitrine :is(button, summary):focus-visible {
  outline: 3px solid #7940c0;
  outline-offset: 3px;
}
@media (max-width: 700px), (max-width: 950px) and (pointer: coarse) and (hover: none) {
  .tv-vitrine {
    --tv-recorte: clamp(40px, 13cqw, 84px);
    --tv-base: clamp(41px, 9vw, 58px);
  }
  .tv-vitrine-info { top: 14px; left: 14px; }
  .tv-vitrine-play { min-height: 34px; padding: 5px 9px; }
  .tv-personagem { width: 93%; --tv-escala: 1.16; }
  .tv-janelas {
    width: calc(100% - 12px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "a surpresa c";
    align-items: end;
    gap: 7px;
  }
  .tv-pos-1, .tv-pos-3, .tv-surpresa-texto { display: none; }
  .tv-janela-magica strong b { margin: 0; }
  .tv-janela-base { padding: 4px; }
  .tv-janela-base strong { font-size: clamp(.72rem, 2.8vw, .96rem); }
}
@media (prefers-reduced-motion: reduce) {
  .tv-vitrine *, .tv-vitrine *::before, .tv-vitrine *::after { animation: none !important; transition: none !important; }
  .tv-janela-base::after { display: none; }
}