/* Winner Low High scene. Sizes are design pixels inside the FL box.
 * Shared parts (sunburst, title, postmark, sparkles) come from the scene kit in fl-frame.css. */
.fl-sun { --sun-a: #ef6f7c; --sun-b: #f8b9b9; --sun-y: 54%; }
.wn .fl-greet { color: var(--paper); text-shadow: 2px 2px 0 var(--red-d); }
.wn .fl-title .amp { color: var(--paper); text-shadow: 3px 3px 0 var(--red-d); font-size: .5em; vertical-align: .3em; }
.wn .fl-postmark { --pm: var(--paper); }
.is-tall .wn .fl-postmark, .is-tall .wn .fl-spark.s3 { display: none; }

/* table: the card, the deck under it and the cards that fly out while shuffling */
.wn-table { position: absolute; left: 420px; top: 232px; width: 260px; height: 364px; z-index: 2; }
.is-tall .wn-table { left: 210px; top: 162px; width: 240px; height: 336px; }
.wn-shadow { position: absolute; left: -10%; right: -10%; bottom: -46px; height: 50px; border-radius: 50%; background: rgba(120, 20, 35, .25); filter: blur(6px); }
.wn-deck i { position: absolute; inset: 0; border-radius: 22px; background: #fff8ea; box-shadow: 0 0 0 5px #2b1d1a inset; }
.wn-deck i:nth-child(1) { transform: translate(18px, 16px) rotate(4deg); }
.wn-deck i:nth-child(2) { transform: translate(12px, 11px) rotate(2.6deg); }
.wn-deck i:nth-child(3) { transform: translate(7px, 6px) rotate(1.4deg); }
.wn-deck i:nth-child(4) { transform: translate(3px, 3px) rotate(.6deg); }
.wn-fly svg, .wn-card, .wn-card-in, .wn-card-in svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wn-fly svg { opacity: 0; }
.wn.is-shuffle .wn-fly .f1 { animation: wn-fly-l 1.3s ease-in-out 2; }
.wn.is-shuffle .wn-fly .f2 { animation: wn-fly-r 1.3s ease-in-out .2s 2; }
.wn.is-shuffle .wn-fly .f3 { animation: wn-fly-u 1.3s ease-in-out .4s 2; }
@keyframes wn-fly-l { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(-250px, 30px) rotate(-24deg); } }
@keyframes wn-fly-r { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(250px, 20px) rotate(22deg); } }
@keyframes wn-fly-u { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(-40px, -70px) rotate(-8deg) scale(1.04); } }
.is-tall .wn.is-shuffle .wn-fly .f1 { animation-name: wn-fly-lt; }
.is-tall .wn.is-shuffle .wn-fly .f2 { animation-name: wn-fly-rt; }
@keyframes wn-fly-lt { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(-170px, 30px) rotate(-24deg); } }
@keyframes wn-fly-rt { 0%, 100% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(170px, 20px) rotate(22deg); } }

.wn-card { perspective: 1600px; z-index: 2; }
/* no filter on .wn-card-in: a filter flattens preserve-3d and shows the face through the back */
.wn-card-in { transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .7, .3, 1.2); }
.wn-card-in svg { backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; box-shadow: 0 10px 0 rgba(120, 20, 35, .3); }
.wn-face { transform: rotateY(0deg); }
.wn-back { transform: rotateY(180deg); }
.wn-card.is-back .wn-card-in { transform: rotateY(180deg); }
.wn.is-shuffle .wn-card { animation: wn-shake .26s ease-in-out infinite alternate; }
@keyframes wn-shake { from { transform: rotate(-2deg); } to { transform: rotate(2deg) translateY(-6px); } }
.wn-card.is-deal { animation: wn-deal .8s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes wn-deal { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-40px) scale(1.08) rotate(-3deg); } 100% { transform: none; } }

/* Low / High badges */
.wn-badge {
  position: absolute; top: 330px; width: 230px; height: 230px; border-radius: 50%; z-index: 2; color: var(--c);
  background: var(--paper); box-shadow: 0 0 0 8px var(--c), 0 0 0 14px var(--paper), 0 12px 0 14px rgba(120, 20, 35, .25);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.4), opacity .35s, background .35s, color .35s;
}
.wn-low { --c: var(--teal); left: 92px; transform: rotate(-8deg); }
.wn-high { --c: var(--red); right: 92px; transform: rotate(8deg); }
.is-tall .wn-badge { top: 592px; width: 190px; height: 190px; }
.is-tall .wn-low { left: 80px; }
.is-tall .wn-high { right: 80px; }
.wn-badge .in { display: flex; flex-direction: column; align-items: center; }
.wn-badge b { font: 400 62px/1 var(--font-num); text-transform: uppercase; }
.wn-badge span { margin-top: 8px; padding: 6px 14px; border-radius: 999px; font: 800 18px/1 var(--font-ui); letter-spacing: .12em; background: var(--c); color: var(--paper); }
.is-tall .wn-badge b { font-size: 50px; }
.is-tall .wn-badge span { font-size: 15px; }
.wn-badge::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 6px solid var(--mustard); opacity: 0; }
.wn-badge.is-on { background: var(--c); color: var(--paper); }
.wn-badge.is-on span { background: var(--paper); color: var(--c); }
.wn-low.is-on { transform: rotate(-8deg) scale(1.1); }
.wn-high.is-on { transform: rotate(8deg) scale(1.1); }
.wn-badge.is-on::after { animation: wn-ring 1.2s ease-out 3; }
@keyframes wn-ring { 0% { opacity: 1; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.3); } }
.wn-badge.is-off { opacity: .72; }

/* the result stamp goes in the lower right, clear of the card and the badges */
.fl-game-winner.is-wide .fl-stamp { top: auto; bottom: 26px; right: 26px; width: 220px; height: 220px; }
.fl-game-winner.is-tall .fl-stamp { right: auto; bottom: auto; left: 225px; top: 225px; }

@media (prefers-reduced-motion: reduce) { .wn.is-shuffle .wn-fly svg, .wn.is-shuffle .wn-card, .wn-card.is-deal, .wn-badge.is-on::after { animation: none; } }
