/* Round 7 (2026-12-03): the prize slot machine (js/reel.js). Everything is scoped to html[data-style="reel"]; the round-6
 * wheel (?style=wheel) renders exactly as before. The machine is drawn in em of its own box: 1em = 1 % of its width,
 * height 178em, so it scales as one piece on every screen. Same background and fruit friends as the juice game. */

/* ---------------------------------------------------------------- page: the juice stand of the game */
html[data-style="reel"] .bg { background: #FCE6CF url("../../game/assets/bg.webp") 50% 0 / cover no-repeat; }
@media (orientation: landscape) { html[data-style="reel"] .bg { background-image: url("../../game/assets/bg-land.webp"); } }
html[data-style="reel"] .bg-img, html[data-style="reel"] .bg-glow, html[data-style="reel"] .fruits, html[data-style="reel"] .deco { display: none !important; }
html[data-style="reel"] .brand { background: linear-gradient(180deg, #FF8A4A, #F15A25 55%, #D84A1C); border-radius: 22px; padding: 8px 18px;
  box-shadow: 0 0 0 3px rgba(255, 246, 234, .95), 0 14px 28px -12px rgba(122, 12, 14, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
html[data-style="reel"][data-theme] .brand img.logo-light { display: none !important; }
html[data-style="reel"][data-theme] .brand img.logo-dark { display: block !important; filter: none; }

/* ---------------------------------------------------------------- the machine box */
.machine { position: relative; width: var(--mw, 420px); height: calc(var(--mw, 420px) * 1.78); font-size: calc(var(--mw, 420px) / 100);
  -webkit-user-select: none; user-select: none; }
.machine > * { position: absolute; }
.m-shadow { left: 2em; right: 2em; bottom: 3em; height: 12em; border-radius: 50%; background: radial-gradient(closest-side, rgba(59, 13, 10, .45), rgba(59, 13, 10, 0)); z-index: 0; }

/* pipes from the title plate down into the cabinet's shoulders */
.m-pipes { left: 9em; right: 9em; top: 5em; height: 22em; z-index: 1; border: 3.6em solid #E8612A; border-bottom: 0; border-radius: 13em 13em 0 0;
  box-shadow: 0 -.5em 0 -.0em rgba(255, 196, 150, .55), 0 .6em 1em -.4em rgba(59, 13, 10, .4); }
.m-pipes::before { content: ""; position: absolute; left: -2.6em; right: -2.6em; top: -2.6em; bottom: 0; border: .9em solid rgba(255, 196, 150, .7); border-bottom: 0; border-radius: 11em 11em 0 0; }

/* title plate: dark LED panel on an orange bezel */
.m-plate { left: 15em; right: 15em; top: 0; height: 17em; z-index: 4; border-radius: 4.4em;
  background: linear-gradient(180deg, #FF9C63, #F15A25 58%, #C9431A);
  box-shadow: inset 0 .5em 0 rgba(255, 220, 190, .55), inset 0 -.6em 0 rgba(122, 12, 14, .35), 0 1.1em 0 #7A0C0E, 0 2em 2.4em -.8em rgba(59, 13, 10, .55); }
.m-plate-in { position: absolute; inset: 2.1em; border-radius: 2.6em; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, rgba(255, 196, 120, .11) 0 .3em, transparent .36em) 0 0 / 1em 1em, linear-gradient(180deg, #2A0806, #4A120D 55%, #2A0806);
  box-shadow: inset 0 .5em 1em rgba(0, 0, 0, .65), 0 0 0 .35em rgba(255, 196, 150, .8); }
.led { position: relative; display: block; font-weight: 900; font-size: 7.6em; line-height: 1.25; white-space: nowrap; direction: rtl; color: transparent;
  background: radial-gradient(circle, #FFFBE6 0 34%, #FFD36A 46%, rgba(255, 180, 60, .15) 60%) 0 0 / .075em .075em;
  -webkit-background-clip: text; background-clip: text; }
.led::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; color: #FFB347; filter: blur(.06em); opacity: .75; }

/* cabinet */
.m-body { left: 6em; right: 6em; top: 15em; height: 132em; z-index: 3; border-radius: 17em 17em 7em 7em;
  background: linear-gradient(90deg, #C23D15 0%, #F15A25 12%, #FF8A4A 34%, #FF8A4A 46%, #F15A25 72%, #B83812 100%);
  box-shadow: inset 0 1.2em 0 rgba(255, 210, 175, .5), inset 0 -3em 4em rgba(122, 12, 14, .35), inset 1.2em 0 2em rgba(122, 12, 14, .18), 0 3em 4em -1em rgba(59, 13, 10, .45); }
.m-bolt { position: absolute; top: 9em; width: 3.2em; height: 3.2em; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #FFC7A0, #C9431A 55%, #7A0C0E);
  box-shadow: 0 .2em 0 rgba(255, 220, 190, .5); }
.m-bolt.b1 { left: 3.4em; } .m-bolt.b2 { right: 3.4em; }

/* bulb band around the window */
.m-frame { position: absolute; left: 5em; right: 5em; top: 9em; height: 116em; border-radius: 12em;
  background: linear-gradient(180deg, #D94A1C, #B5320F 60%, #9E2A0C);
  box-shadow: inset 0 .7em 0 rgba(255, 190, 150, .55), inset 0 -.7em 0 rgba(90, 10, 10, .45), 0 .5em 0 rgba(255, 200, 165, .35); }
.machine .bulbs { display: block; position: absolute; left: -11em; top: -24em; width: 100em; height: 178em; pointer-events: none; z-index: 1; }
.bulb { position: absolute; width: 2.6em; height: 2.6em; margin: -1.3em 0 0 -1.3em; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #F7D2B0, #C9774A 60%, #8A3A1C); box-shadow: inset 0 -.2em .3em rgba(60, 10, 0, .35); }
.bulb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 1;
  background: radial-gradient(circle at 36% 30%, #FFFFFF, #FFF5DC 42%, #FFD889 78%); box-shadow: 0 0 1em .3em rgba(255, 220, 140, .85); }
.bulb.y::after { background: radial-gradient(circle at 36% 30%, #FFFDF0, #FFD45A 48%, #F7A51C); box-shadow: 0 0 1em .3em rgba(255, 186, 60, .85); }
.bulbs[data-mode="idle"] .bulb::after { animation: bulbChase 1.8s linear infinite; animation-delay: calc(var(--k) * .6s - 1.8s); }
.bulbs[data-mode="spin"] .bulb::after { animation: bulbChase .42s linear infinite; animation-delay: calc(var(--k) * .14s - .42s); }
.bulbs[data-mode="win"] .bulb::after { animation: bulbBlink .5s linear infinite; animation-delay: calc(var(--j) * .25s - .5s); }
.bulbs[data-mode="on"] .bulb::after { opacity: 1; }
@keyframes bulbChase { 0%, 33.2% { opacity: 1; } 33.4%, 100% { opacity: .08; } }
@keyframes bulbBlink { 0%, 49.8% { opacity: 1; } 50%, 100% { opacity: .1; } }

/* the window and its reel */
.m-window { position: absolute; left: 6em; right: 6em; top: 6em; bottom: 6em; z-index: 2; overflow: hidden; border-radius: 7.4em;
  border: 1.5em solid #3B0D0A; background: linear-gradient(180deg, #FFEBD3, #FFFDF8 42%, #FFF6EA 70%, #FFE9CF);
  box-shadow: 0 0 0 .5em rgba(255, 205, 170, .9), 0 .6em 1em rgba(59, 13, 10, .35); touch-action: none; cursor: grab; transform: translateZ(0); }
.strip { position: absolute; left: 0; right: 0; top: 43.5em; height: 0; }
.machine.idle .strip { animation: reelPeek 6.5s var(--ease-in-out) infinite; }
@keyframes reelPeek { 0%, 72%, 100% { transform: none; } 80% { transform: translateY(3.4em); } 87% { transform: translateY(-.6em); } 93% { transform: none; } }
.m-shade { position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(180deg, rgba(122, 12, 14, .32) 0, rgba(255, 246, 234, 0) 17%, rgba(255, 246, 234, 0) 76%, rgba(122, 12, 14, .22) 100%),
    linear-gradient(90deg, rgba(122, 12, 14, .14), rgba(122, 12, 14, 0) 13%, rgba(122, 12, 14, 0) 87%, rgba(122, 12, 14, .14)),
    linear-gradient(115deg, rgba(255, 255, 255, .5) 0 8%, rgba(255, 255, 255, 0) 22%); }
.m-glow { position: absolute; left: 50%; top: 43.5em; width: 48em; height: 48em; margin: -24em 0 0 -24em; border-radius: 10.5em; z-index: 4; pointer-events: none;
  box-shadow: 0 0 0 .8em #FFFFFF, 0 0 3.4em 1.2em rgba(255, 184, 28, .95), inset 0 0 2.4em rgba(255, 184, 28, .6); opacity: 0; transition: opacity .3s; }
.m-glow.on { opacity: 1; animation: glowPulse 1.2s ease-in-out infinite; }

/* prize cards: orange rim, cream sunburst, the 3D prize object, a fitted label pill */
.rc { position: absolute; left: 50%; top: 0; width: 44em; height: 44em; margin: -22em 0 0 -22em; box-sizing: border-box; padding: 2.4em; border-radius: 9.5em;
  background: linear-gradient(180deg, #FFA45C 0%, #F7782F 45%, #E2561E 100%);
  box-shadow: inset 0 .5em 0 rgba(255, 228, 196, .75), inset 0 -.7em 0 rgba(150, 40, 10, .45), 0 1.2em 1.6em -.6em rgba(122, 12, 14, .45);
  will-change: transform; backface-visibility: hidden; transition: opacity .3s; }
.rc-in { position: relative; width: 100%; height: 100%; border-radius: 7.2em; overflow: hidden; background: #FFF6EA; box-shadow: inset 0 .5em .9em rgba(150, 50, 10, .35); }
.rc-sun { position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 58%),
  repeating-conic-gradient(from 0deg at 50% 38%, #FFF6EA 0 9deg, #FFDFB4 9deg 18deg); }
.rc-art { position: absolute; left: 18%; top: 4%; width: 64%; height: 64%; object-fit: contain; filter: drop-shadow(0 .8em .7em rgba(90, 30, 8, .3)); }
.rc-lbl { position: absolute; left: 50%; bottom: 2em; width: 33.5em; height: 9.6em; margin-left: -16.75em; box-sizing: border-box; padding: 0 1.6em;
  display: grid; place-items: center; overflow: hidden; white-space: pre; text-align: center; direction: rtl;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; font-weight: 800; color: #FFFFFF; border-radius: 3.2em;
  background: linear-gradient(180deg, #EC6A31, #A3200F 70%, #7A0C0E); border: .3em solid rgba(255, 255, 255, .75); text-shadow: 0 .06em .12em rgba(0, 0, 0, .25); }
.rc-t { display: block; font-weight: 800; white-space: pre; }
.rc.no-art .rc-lbl { bottom: 50%; transform: translateY(50%); }
.rc.gold { background: linear-gradient(180deg, #FFF0B8 0%, #F2C66D 45%, #C98F2E 100%); }
.rc.gold .rc-lbl { color: #3B2A07; text-shadow: none; background: linear-gradient(180deg, #FFF3C4, #F2C66D 55%, #DDA845); }
.rc.dim { opacity: .45; }
.rc.win { z-index: 2; }
.rc.win .rc-art { animation: artPop .7s var(--spring, cubic-bezier(.34, 1.4, .64, 1)) both; }
@keyframes artPop { 0% { transform: scale(1); } 45% { transform: scale(1.16) translateY(-4%); } 100% { transform: scale(1.08) translateY(-2%); } }
.m-window.fast .rc { filter: blur(.42em); }

/* side pointers on the centre line */
.m-ptr { position: absolute; top: 45.5em; width: 9em; height: 11em; z-index: 3; pointer-events: none; }
.m-ptr.l { left: .6em; transform-origin: 8% 50%; } .m-ptr.r { right: .6em; transform-origin: 92% 50%; }
.m-ptr::before, .m-ptr::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.m-ptr.r::before, .m-ptr.r::after { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.m-ptr::before { background: #4A0809; opacity: .5; transform: translate(.3em, .8em); }
.m-ptr::after { background: linear-gradient(160deg, #FFD0A8 0%, #FF8A4A 22%, #E2481C 55%, #7A0C0E 100%); }

/* front panel, START button, prize slot */
.m-front { left: 0; right: 0; top: 114em; height: 52em; z-index: 5; }
.m-front-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 -.5em .9em rgba(59, 13, 10, .3)); }
.m-start { position: absolute; left: 50%; top: 4em; width: 28em; height: 32em; margin-left: -14em; padding: 0; border: 0; background: none; border-radius: 50%; touch-action: manipulation; }
.m-start::before { content: ""; position: absolute; left: -2.2em; right: -2.2em; top: 2.2em; height: 31.6em; border-radius: 50%;
  background: radial-gradient(closest-side, #5A0A0B 70%, #A8361A 100%); box-shadow: 0 .4em 0 rgba(255, 196, 150, .55); }
.m-start::after { content: ""; position: absolute; left: -3em; right: -3em; top: -3em; height: 34em; border-radius: 50%; border: .5em solid rgba(255, 215, 80, .9); opacity: 0; pointer-events: none; }
body.s-attract .m-start::after { animation: startRing 2.2s var(--ease-out) infinite; }
@keyframes startRing { 0% { opacity: .9; transform: scale(.86); } 100% { opacity: 0; transform: scale(1.18); } }
.m-start-base { position: absolute; left: 0; right: 0; top: 4em; height: 28em; border-radius: 50%; background: linear-gradient(180deg, #B0391B, #7A0C0E 60%, #5A0A0B);
  box-shadow: 0 1.4em 2em -.6em rgba(59, 13, 10, .6); }
.m-start-cap { position: absolute; left: 0; top: 0; width: 28em; height: 28em; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #FFF6B5 0, #FFE04A 34%, #FFC21A 68%, #F09C0E 100%);
  box-shadow: inset 0 -1em 0 rgba(201, 110, 0, .45), inset 0 .8em 0 rgba(255, 255, 255, .6), 0 .35em 0 #D9800A; transition: transform .12s var(--ease-out); }
.m-start-cap b { font-weight: 900; font-size: 8.4em; line-height: 1; color: #5A1408; text-shadow: 0 .04em 0 rgba(255, 255, 255, .6); }
body.s-attract .m-start-cap { animation: capPulse 2.2s ease-in-out infinite; }
@keyframes capPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.m-start:not(:disabled):active .m-start-cap, .m-start:disabled .m-start-cap { animation: none; transform: translateY(2.8em); }
.m-start:disabled { cursor: default; }
.m-start:disabled .m-start-cap { filter: saturate(.85) brightness(.97); }
.m-start:focus-visible { outline: none; }
.m-start:focus-visible .m-start-cap { box-shadow: 0 0 0 .8em rgba(255, 255, 255, .9), inset 0 -1em 0 rgba(201, 110, 0, .45); }
.m-start.nudge .m-start-cap { animation: nudge .5s var(--ease-out); }
.m-slot { position: absolute; left: 32em; width: 36em; top: 42em; height: 23em; overflow: hidden; pointer-events: none; }
.slot-card { position: absolute; left: 3em; top: 0; width: 30em; box-sizing: border-box; padding: 1.2em 1.2em 1.4em; border-radius: 0 0 3em 3em; display: flex; flex-direction: column; align-items: center; gap: .4em;
  background: linear-gradient(180deg, #FFF1DE, #FFFFFF); border: .9em solid #F7782F; border-top: 0; box-shadow: 0 1em 1.4em -.6em rgba(59, 13, 10, .4);
  transform: translateY(-105%); transition: transform .75s var(--spring, cubic-bezier(.34, 1.4, .64, 1)); }
.slot-card.gold { border-color: #E2B04A; }
.slot-card img { width: 10em; height: 10em; object-fit: contain; }
.slot-card span { max-width: 100%; font-weight: 900; font-size: 2.9em; line-height: 1.25; color: #7A0C0E; text-align: center; overflow-wrap: anywhere; }
.m-slot.out .slot-card { transform: translateY(0); }

/* the juice-game friends beside the machine */
.mascot { width: 30em; height: auto; z-index: 6; pointer-events: none; transform-origin: 50% 100%;
  filter: drop-shadow(0 1.4em 1.2em rgba(59, 13, 10, .35)); animation: mascotBob 3.2s ease-in-out infinite; }
.ms-orange { left: -9em; bottom: 4em; }
.ms-strawberry { right: -9em; bottom: 4em; animation-delay: -1.6s; }
.ms-mango, .ms-guava { display: none; z-index: 1; width: 27em; bottom: 20em; }
.ms-mango { left: -40em; animation-delay: -.8s; } .ms-guava { right: -40em; animation-delay: -2.4s; }
@keyframes mascotBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4%) rotate(2deg); } }
.mascot.cheer { animation: mascotCheer .62s ease-out 4; }
.ms-strawberry.cheer, .ms-guava.cheer { animation-delay: .12s; }
@keyframes mascotCheer { 0% { transform: translateY(0) scale(1.04, .94); } 35% { transform: translateY(-22%) scale(.97, 1.04) rotate(-6deg); } 70% { transform: translateY(-6%) rotate(5deg); } 100% { transform: translateY(0) scale(1.03, .96); } }

@media (prefers-reduced-motion: reduce) {
  .bulbs .bulb::after, .mascot, .mascot.cheer, .machine.idle .strip, body.s-attract .m-start-cap, body.s-attract .m-start::after, .m-glow.on, .rc.win .rc-art { animation: none !important; }
  .bulbs .bulb::after { opacity: 1; }
  .slot-card { transition: none; }
}

/* ---------------------------------------------------------------- landscape (booth 1920×1080, laptops 1440×900): copy card beside the machine */
@media (orientation: landscape) {
  html[data-style="reel"] { --mw: min(calc((100dvh - 64px) / 1.78), 30vw); }
  html[data-style="reel"] .stage { grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
  html[data-style="reel"] .v-attract, html[data-style="reel"] .v-spinning { background: rgba(255, 249, 241, .93); border: 2px solid rgba(255, 255, 255, .95); border-radius: 36px;
    padding: clamp(22px, 4vmin, 56px); box-shadow: 0 30px 60px -30px rgba(122, 12, 14, .5); max-width: 760px; }
  html[data-style="reel"] .ms-mango, html[data-style="reel"] .ms-guava { display: block; }
  html[data-style="reel"] .panel { padding-top: clamp(96px, 14vmin, 170px); }
  html[data-style="reel"] .title.hero { font-size: clamp(44px, 9vmin, 112px); white-space: nowrap; }
  html[data-style="reel"] .ms-orange { width: 34em; left: -26em; bottom: 3em; }
  html[data-style="reel"] .ms-strawberry { width: 34em; right: -26em; bottom: 3em; }
}

/* ---------------------------------------------------------------- portrait (phones 360–430 wide, the 1080×1920 booth) */
@media (orientation: portrait) {
  html[data-style="reel"] {
    --htop: calc(env(safe-area-inset-top) + clamp(16px, 2.2vh, 44px) + clamp(80px, 8vh, 132px) + 16px + clamp(8px, 1.4vh, 28px));
    --mh: calc(100dvh - var(--wtop) - var(--pb));
    --mw: min(calc(var(--mh) / 1.78), 84vw, 860px);
  }
  html[data-style="reel"] .wheel-zone { top: calc(var(--wtop) + max(0px, (var(--mh) - var(--mw) * 1.78) / 2)); }
  html[data-style="reel"] #spinBtn, html[data-style="reel"] .btn-wait, html[data-style="reel"] .v-attract .hint, html[data-style="reel"] .prod-row { display: none !important; }
  html[data-style="reel"] .view .title { color: #FFF8EE;
    text-shadow: 0 .045em 0 #7A0C0E, 0 -.045em 0 #7A0C0E, .045em 0 0 #7A0C0E, -.045em 0 0 #7A0C0E, .032em .032em 0 #7A0C0E, -.032em .032em 0 #7A0C0E, .032em -.032em 0 #7A0C0E, -.032em -.032em 0 #7A0C0E,
      0 .1em 0 #7A0C0E, 0 .14em .2em rgba(59, 13, 10, .45); }
  html[data-style="reel"] .view .title em { color: #FFD23F; }
  html[data-style="reel"] .view .sub { align-self: center; display: inline-block; width: auto; padding: 0 1em; border-radius: 99px; background: #7A0C0E; color: #FFF6EA !important;
    box-shadow: 0 6px 14px -6px rgba(59, 13, 10, .6); }
  html[data-style="reel"] .sub.lined span { color: #FFF6EA; }
}
@media (orientation: portrait) and (max-height: 700px) {
  html[data-style="reel"] .v-attract .sub { display: none; }
  html[data-style="reel"] { --wtop: calc(var(--htop) + var(--t-fs) * 1.3 + 14px); }
}
