/* One physical hero, three compositions. Layout belongs here rather than to
   successive mobile overrides. The gallery keeps its original image ratios. */
html[data-candy20="true"] .cinema-hero.candy-hero {
  height: 320px;
  min-height: 320px;
  margin: 0 0 22px;
  border-radius: 14px;
  border: 0;
  background: radial-gradient(ellipse at 80% 40%, #164f68, transparent 58%), #051c29;
  box-shadow: inset 0 1px #b9fcff22, 0 18px 36px -22px #000b;
  transition: background-color .6s;
  isolation: isolate;
}
html[data-candy20="true"] .candy-hero[data-feature-scene="stack"] { background: radial-gradient(ellipse at 76% 42%, #246353, transparent 62%), #08282a; }
html[data-candy20="true"] .candy-hero[data-feature-scene="play"] { background: radial-gradient(ellipse at 76% 42%, #452b6d, transparent 58%), #15182f; }
html[data-candy20="true"] .candy-hero::before,
html[data-candy20="true"] .candy-hero::after,
html[data-candy20="true"] .candy-hero-slide::before,
html[data-candy20="true"] .candy-hero-slide::after { display: none; }
html[data-candy20="true"] .candy-live-stage {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  transform: translate3d(calc(var(--c20-hero-x) * 12px), calc(var(--c20-hero-y) * 8px - var(--c20-scroll) * 25px), calc(var(--c20-scroll) * -40px)) rotateX(calc(var(--c20-scroll) * 12deg)) rotateY(calc(var(--c20-hero-x) * 4deg));
  transition: transform .2s ease-out;
}
html[data-candy20="true"] .candy-live-canvas { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; display: block; }
html[data-candy20="true"] .candy-hero-viewport { z-index: 2; }
html[data-candy20="true"] .candy-hero-slide {
  display: flex; align-items: center; padding: 24px 32px 48px;
  background: transparent; pointer-events: none;
  transition: opacity .48s ease, transform .58s cubic-bezier(.16,1,.3,1), visibility .58s;
}
html[data-candy20="true"] .candy-hero-slide.is-active { transform: none; }
html[data-candy20="true"] .candy-hero-copy {
  position: relative; z-index: 3; max-width: 470px; width: 48%; pointer-events: auto;
  transform: translate3d(calc(var(--c20-hero-x) * -5px), calc(var(--c20-hero-y) * -4px), 0);
}
html[data-candy20="true"] .candy-hero-copy h1 {
  font-family: var(--c20-ui) !important; font-size: clamp(40px,4.3vw,60px); font-weight: 800;
  line-height: .99; margin: 0 0 14px; color: #f3fbff; letter-spacing: -.035em !important;
  text-transform: none; filter: none;
}
html[data-candy20="true"] .candy-hero-copy h1 em { display: block; color: #59f5dd; font-style: normal; -webkit-text-stroke: 0; text-shadow: none; }
html[data-candy20="true"] [data-scene="stack"] .candy-hero-copy h1 em { color: #a8ffce; }
html[data-candy20="true"] [data-scene="play"] .candy-hero-copy h1 em { color: #d4a8ff; }
html[data-candy20="true"] .candy-hero-copy > p { max-width: 310px; font-size: 14px; line-height: 1.55; color: #c7e7ec; margin: 0 0 20px; }
html[data-candy20="true"] .candy-proof { display: none; }
html[data-candy20="true"] .candy-hero-actions { gap: 10px; }
html[data-candy20="true"] .candy-hero-actions .candy-cta {
  min-height: 46px; padding: 0 19px; border: 0; border-radius: 10px;
  color: #022a35; background: linear-gradient(115deg,#14dcf4,#6cf9d8);
  box-shadow: inset 0 1px #ffffff75, 0 10px 25px -13px #26e9df99;
  font-size: 13px; font-weight: 800;
}
html[data-candy20="true"] [data-scene="stack"] .candy-cta { background: linear-gradient(115deg,#6be9b1,#d4ffca); }
html[data-candy20="true"] [data-scene="play"] .candy-cta { background: linear-gradient(115deg,#c797ff,#efd5ff); }
html[data-candy20="true"] .candy-hero-actions .candy-ghost { color: #e5f6fc; background: #173442; box-shadow: inset 0 1px #acffff22; }
html[data-candy20="true"] .candy-hero-actions .candy-cta::before,
html[data-candy20="true"] .candy-hero-actions .candy-cta::after { display: none; }
html[data-candy20="true"] .candy-visual,
html[data-candy20="true"] .candy-hero .cinema-hero-art { position: absolute; inset: 0 0 0 47%; width: 53%; min-height: 0; height: 100%; background: none; transform: none; }
html[data-candy20="true"] .candy-hero:has(.has-live-scene) .candy-visual { visibility: hidden; }
html[data-candy20="true"] .candy-coin-stage { inset: 0; transform: scale(.66); }
html[data-candy20="true"] .candy-stack-stage { inset: -20%; transform: scale(.60) rotateX(10deg) rotateY(-10deg); }
html[data-candy20="true"] .candy-play-stage { inset: -20%; transform: scale(.62); }
html[data-candy20="true"] .candy-portal b { font-family: var(--c20-ui); font-size: 60px; font-weight: 800; }
html[data-candy20="true"] .candy-stack-total, html[data-candy20="true"] .candy-mini-card { display: none; }
html[data-candy20="true"] .candy-hero-nav { left: 29px; right: 24px; bottom: 9px; gap: 8px; }
html[data-candy20="true"] .candy-hero-tabs { gap: 6px; }
html[data-candy20="true"] .candy-hero-dot,
html[data-candy20="true"] .candy-hero-dot.is-active { width: 42px; height: 34px; border: 0; border-radius: 0; background: transparent; }
html[data-candy20="true"] .candy-hero-dot::before { position: absolute; inset: 15px 0; height: 3px; width: 100%; background: #74a9b54d; border-radius: 2px; }
html[data-candy20="true"] .candy-hero-dot::after { position: absolute; inset: 15px 0; height: 3px; width: 100%; border-radius: 2px; background: #70ffe0; transform: scaleX(0); transform-origin: left; }
html[data-candy20="true"] .candy-hero-dot.is-active::after { animation: c20-hero-progress 6.6s linear forwards; }
html[data-candy20="true"] .candy-hero.is-paused .candy-hero-dot::after { animation-play-state: paused; }
html[data-candy20="true"] .candy-hero-count { display: none; }
html[data-candy20="true"] .candy-hero-pause { margin-left: auto; min-height: 34px; border: 0; border-radius: 8px; background: #092637bb; color: #cce7ed; font-size: 11px; padding: 0 10px; }

/* A bounded, non-blocking resolution. Permanent receipts stay in flow. */
html[data-candy20="true"] .px-game[data-play13] .px-world > :is(.candy-win-moment,.candy-loss-moment) {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  pointer-events: none; overflow: hidden; perspective: 700px;
}
.candy-win-moment { --result-color: #8affd5; --result-duration: 2.8s; }
.candy-loss-moment { --result-color: #ffabb9; --result-duration: 1.8s; }
.candy-win-light {
  position: absolute; inset: 0; background: radial-gradient(ellipse at center,#17473ddd, #071720ed 68%);
  animation: h23-result-light var(--result-duration) ease-out both;
}
.candy-loss-moment .candy-win-light { background: radial-gradient(ellipse at center,#372030de, #08121fed 68%); }
.candy-win-copy {
  position: relative; z-index: 2; max-width: 100%; padding: 16px 20px; text-align: center;
  font-family: var(--c20-ui); color: var(--result-color);
  animation: h23-win-in var(--result-duration) cubic-bezier(.16,1,.3,1) both;
}
.candy-result-icon {
  display: block; width: 38px; height: 38px; margin: 0 auto 12px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.candy-result-icon circle { opacity: .5; }
.candy-win-copy > span { font-size: clamp(24px,2.6vw,32px); line-height: 1.2; font-weight: 800; color: #f4fbff; letter-spacing: -.025em; }
.candy-win-copy strong { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 8px 0 14px; font-weight: 800; text-shadow: 0 6px 20px #0006; }
.candy-win-copy b { font-size: min(clamp(62px,7vw,96px),calc((100vw - 92px) / var(--result-digits) * 1.4)); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.candy-win-copy small { font-size: 14px; font-weight: 700; color: #cfdee8; }
.candy-win-copy p { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin: 0; color: #cedee9; }
.candy-win-copy p i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.candy-win-coins { position: absolute; inset: 0; }
.candy-win-coins > i {
  position: absolute; left: 50%; top: 58%; width: 22px; height: 22px; border-radius: 50%;
  background: url('/brand/05/mark.svg') center/55% no-repeat,radial-gradient(circle at 30% 20%,#effff8,#a2e6d2 35%,#447d72 80%);
  box-shadow: 1px 3px 0 #315952,0 8px 12px #0005;
  animation: h23-win-coin 1.9s cubic-bezier(.16,1,.3,1) var(--delay) both;
}
.candy-win-moment[data-tier="big"],.candy-win-moment[data-tier="epic"] { --result-color: #ffe198; }
.candy-win-moment[data-tier="big"] .candy-win-coins > i,.candy-win-moment[data-tier="epic"] .candy-win-coins > i {
  background: url('/brand/05/mark.svg') center/55% no-repeat,radial-gradient(circle at 30% 20%,#fffadc,#dfbb69 35%,#8f6123 80%);
  box-shadow: 1px 3px 0 #6b4a24,0 8px 12px #0005;
}
@keyframes h23-result-light { 0% { opacity: 0; } 12%,80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes h23-win-in { 0% { opacity: 0; transform: translateY(16px) scale(.9); } 14% { opacity: 1; transform: translateY(-2px) scale(1.02); } 24%,82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
.candy-loss-moment .candy-win-copy { animation-name: h23-loss-in; }
@keyframes h23-loss-in { 0% { opacity: 0; transform: translateY(-6px); } 16%,78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(5px); } }
@keyframes h23-win-coin { 0% { opacity: 0; transform: translate3d(0,20px,0) rotateY(0deg) scale(.3); } 14% { opacity: .85; } 78% { opacity: .85; } 100% { opacity: 0; transform: translate3d(var(--dx),var(--dy),80px) rotateY(var(--turn)) rotateZ(var(--turn)) scale(.7); } }
@media (max-width: 760px) {
  html[data-candy20="true"] .cinema-hero.candy-hero { height: 244px; min-height: 244px; margin-bottom: 16px; border-radius: 14px; }
  html[data-candy20="true"] .candy-hero-slide { padding: 16px 18px 40px; }
  html[data-candy20="true"] .candy-hero-copy { width: 52%; max-width: 220px; }
  html[data-candy20="true"] .candy-hero-copy h1 { font-size: clamp(30px,9vw,38px); line-height: 1.02; margin-bottom: 12px; }
  html[data-candy20="true"] .candy-hero-copy > p { font-size: 12px; line-height: 1.5; margin-bottom: 12px; max-width: 175px; }
  html[data-candy20="true"] .candy-hero-actions .candy-cta { min-height: 44px; padding: 0 12px; font-size: 11px; gap: 10px; }
  html[data-candy20="true"] .candy-hero-actions .candy-ghost { display: none; }
  html[data-candy20="true"] .candy-hero-nav { left: 19px; right: 12px; bottom: 5px; }
  html[data-candy20="true"] .candy-hero-dot, html[data-candy20="true"] .candy-hero-dot.is-active { width: 33px; }
  html[data-candy20="true"] .candy-coin-stage { inset: 0; transform: scale(.65); }
  html[data-candy20="true"] .candy-coin { width: 250px; }
  html[data-candy20="true"] .candy-stack-stage { transform: scale(.43) rotateX(10deg) rotateY(-10deg); }
  html[data-candy20="true"] .candy-play-stage { transform: scale(.47); }
  .candy-win-copy { padding: 12px 18px; }
  .candy-result-icon { width: 32px; height: 32px; margin-bottom: 10px; }
  .candy-win-copy > span { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-candy20="true"] .candy-live-stage { transform: none; transition: none; }
  :is(.candy-win-moment,.candy-loss-moment) { display: none !important; }
}
html[data-candy20="true"].reduce-motion .candy-live-stage { transform: none; transition: none; }
html[data-candy20="true"].reduce-motion :is(.candy-win-moment,.candy-loss-moment) { display: none !important; }

/* Cards rise through a shallow 3D perspective while entering the viewport.
   Native view timelines avoid a scroll handler per tile. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html[data-candy20="true"]:not(.reduce-motion) .cinema-section .game-card {
      animation: h23-card-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
}
@keyframes h23-card-rise {
  from { transform: perspective(650px) translate3d(0,25px,-24px) rotateX(12deg) scale(.96); opacity: .82; }
  to { transform: perspective(650px) translate3d(0,0,0) rotateX(0) scale(1); opacity: 1; }
}
