/* ===== variables.css ===== */
:root {
    --stage-w: 393px;
    --stage-h: 852px;

    --font-main: "Poppins", "Segoe UI", system-ui, sans-serif;

    --color-bg-deep: #1d0028;
    --color-bg-edge: #2a0a40;
    --color-purple: #a101fd;
    --color-purple-glow: rgba(161, 1, 253, 0.55);

    --silver-grad: linear-gradient(180deg, #eeecf1 24.731%, #ffffff 53.763%, #dedfe1 82.796%);
    --gold-grad: linear-gradient(180deg, #edc039 0%, #ffba11 25%, #fffa66 50%, #ecc537 75%, #f4db42 100%);

    --shadow-label: 0px 2.818px 15.215px rgba(29, 0, 40, 0.7);
    --shadow-spin: 0px 5.04px 27.215px rgba(0, 0, 0, 0.6);
    --shadow-claim: 0px 3.534px 19.081px rgba(0, 0, 0, 0.6);
    --shadow-prize: 0px 3.025px 16.335px rgba(0, 0, 0, 0.6);

    --ease-spin: cubic-bezier(0.12, 0.66, 0.06, 1);
    --ease-pop: cubic-bezier(0.22, 1.4, 0.36, 1);
}

/* ===== base.css ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg-deep);
    color: #fff;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

.app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("../assets/images/bg.jpg");
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.app::before {
    content: "";
    position: absolute;
    inset: -10%;
    background-image: url("../assets/images/bg.jpg");
    background-size: cover;
    background-position: center;
    filter: blur(34px) brightness(0.5) saturate(1.1);
    transform: scale(1.1);
    z-index: 0;
}

.stage {
    position: relative;
    width: var(--stage-w);
    height: var(--stage-h);
    transform: scale(var(--scale, 1));
    transform-origin: center center;
    z-index: 1;
    flex-shrink: 0;
}

.stage-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.text-silver {
    background: var(--silver-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-gold {
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ===== wheel.css ===== */
.wheel-stage {
    position: absolute;
    left: -41px;
    top: 117px;
    width: 474px;
    height: 461px;
    z-index: 2;
}

.wheel-plasma {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    animation: plasmaPulse 4.5s ease-in-out infinite;
    will-change: transform, opacity;
}

.wheel-rotor {
    position: absolute;
    inset: 0;
    transform-origin: 237px 235px;
    will-change: transform;
}

.wheel-disc {
    position: absolute;
    left: 52px;
    top: 50px;
    width: 370px;
    height: 370px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 18px 34px rgba(20, 0, 35, 0.55));
}

.wheel-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wheel-label {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
}

.wheel-label span {
    display: inline-block;
    white-space: nowrap;
    font-weight: 700;
    font-size: 21px;
    line-height: normal;
    letter-spacing: 0.42px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
    -webkit-text-stroke: 1.2px #000000;
    paint-order: stroke fill;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.wheel-pointer {
    position: absolute;
    left: 219px;
    top: 40px;
    width: 36px;
    height: 54px;
    object-fit: contain;
    pointer-events: none;
    transform-origin: 50% 14%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    z-index: 3;
}

/* Pointer deflection is driven per-frame from JS (synced to cell crossings). */

.wheel-flash {
    position: absolute;
    left: 237px;
    top: 235px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(255, 245, 200, 0.95) 0%, rgba(255, 213, 80, 0.55) 35%, rgba(161, 1, 253, 0) 70%);
    pointer-events: none;
    opacity: 0;
    z-index: 2;
}

.wheel-flash.burst {
    animation: flashBurst 0.9s ease-out forwards;
}

.wheel-labels.swap-out {
    animation: labelFade 0.35s ease forwards;
}

.wheel-labels.swap-in {
    animation: labelFade 0.4s ease reverse;
}

/* ===== components.css ===== */
.logo {
    position: absolute;
    left: 63px;
    top: 7px;
    width: 268px;
    height: 138px;
    object-fit: contain;
    z-index: 3;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
    animation: logoFloat 5s ease-in-out infinite;
}

.hero {
    position: absolute;
    left: 0;
    top: 462px;
    width: 267px;
    height: 390px;
    overflow: hidden;
    z-index: 4;
    pointer-events: none;
}

.hero-img {
    position: absolute;
    left: -45.8px;
    top: 10px;
    width: 358.6px;
    height: 686px;
    max-width: none;
    object-fit: contain;
}

.btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.btn .btn-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 16px var(--color-purple-glow));
}

.btn .btn-label {
    position: relative;
    z-index: 2;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    background: var(--silver-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: #ffffff84;
    color: transparent;
    pointer-events: none;
}

.btn:not(:disabled):hover {
    transform: scale(1.035);
    filter: brightness(1.06);
}

.btn:not(:disabled):active {
    transform: scale(0.97);
}

.btn:disabled {
    cursor: default;
    filter: saturate(0.85) brightness(0.92);
}

.btn--spin {
    position: absolute;
    left: 28px;
    top: 671px;
    width: 336px;
    height: 98px;
    z-index: 5;
    animation: btnBreath 2.6s ease-in-out infinite;
}

.btn--spin .btn-label {
    font-size: 36px;
    letter-spacing: 0.72px;
    text-transform: uppercase;
    text-shadow: var(--shadow-spin);
}

.btn--claim {
    width: 235.583px;
    height: 68.712px;
    animation: btnBreath 2.6s ease-in-out infinite;
}

.btn--claim .btn-label {
    font-size: 18px;
    letter-spacing: 0.36px;
    text-transform: capitalize;
    text-shadow: var(--shadow-claim);
}

/* ===== modal.css ===== */
.modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 0, 40, 0.55);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    width: 386.503px;
    height: 350px;
    margin-top: 8px;
    transform: scale(0.6);
    opacity: 0;
}

.modal-overlay.open .modal {
    animation: modalPop 0.6s var(--ease-pop) forwards;
}

.modal-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 22px 48px rgba(0, 0, 0, 0.55));
}

.modal-content {
    position: absolute;
    left: 50%;
    top: calc(50% + 3.6px);
    transform: translate(-50%, -50%);
    width: 289.877px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.modal-heading {
    position: relative;
    width: 266px;
    height: 93px;
}

.modal-grande {
    position: absolute;
    left: 37.44px;
    top: -3.06px;
    width: 191.118px;
    height: 53.372px;
    object-fit: contain;
}

.modal-vitoria {
    position: absolute;
    left: 35.14px;
    top: 38.82px;
    width: 195.722px;
    height: 54.658px;
    object-fit: contain;
}

.modal-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10.736px;
    width: 100%;
    text-align: center;
}

.modal-subtitle {
    font-weight: 800;
    font-size: 27.914px;
    line-height: 1;
    letter-spacing: 0.5583px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffffff 0%, #f1f1f6 46%, #ccd0db 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 0.8px rgba(40, 8, 60, 0.35);
    filter: drop-shadow(0 2px 5px rgba(29, 0, 40, 0.55));
}

.modal-prize {
    font-weight: 800;
    font-size: 38px;
    line-height: 1;
    letter-spacing: 0.72px;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(180deg, #fff3b0 0%, #ffd64a 36%, #f7a200 66%, #ffd45e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-text-stroke: 1.4px rgba(74, 28, 0, 0.92);
    filter: drop-shadow(0 2px 2px rgba(60, 20, 0, 0.5)) drop-shadow(0 0 16px rgba(255, 184, 40, 0.55));
}

/* ===== effects.css ===== */
/* ===========================================================
   Visual FX layer — ambiance, lightning, glow, win effects
   =========================================================== */

/* --- God rays sweeping behind the wheel --- */
.fx-rays {
    position: absolute;
    left: 50%;
    top: 300px;
    width: 760px;
    height: 760px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    background:
        conic-gradient(
            from 0deg,
            transparent 0deg,
            rgba(199, 138, 255, 0.18) 10deg,
            transparent 20deg,
            transparent 40deg,
            rgba(255, 214, 120, 0.14) 50deg,
            transparent 60deg,
            transparent 90deg,
            rgba(199, 138, 255, 0.16) 100deg,
            transparent 115deg,
            transparent 150deg,
            rgba(255, 214, 120, 0.12) 160deg,
            transparent 175deg,
            transparent 210deg,
            rgba(199, 138, 255, 0.18) 220deg,
            transparent 235deg,
            transparent 270deg,
            rgba(255, 214, 120, 0.13) 280deg,
            transparent 295deg,
            transparent 330deg,
            rgba(199, 138, 255, 0.16) 340deg,
            transparent 352deg
        );
    -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 64%);
    mask-image: radial-gradient(circle, #000 18%, transparent 64%);
    filter: blur(2px);
    opacity: 0.75;
    animation: raysSpin 38s linear infinite;
    will-change: transform;
}

@keyframes raysSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.is-spinning .fx-rays {
    opacity: 1;
    animation-duration: 8s;
}

/* --- Floating gold dust / sparkles --- */
.fx-sparkles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 6;
}

.spark {
    position: absolute;
    bottom: -16px;
    width: var(--s, 6px);
    height: var(--s, 6px);
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ffe79a 38%, rgba(255, 186, 17, 0) 72%);
    opacity: 0;
    will-change: transform, opacity;
    animation: sparkRise var(--dur, 9s) linear var(--delay, 0s) infinite;
}

@keyframes sparkRise {
    0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
    10%  { opacity: var(--peak, 0.9); }
    50%  { transform: translate3d(var(--dx, 12px), -440px, 0) scale(1); opacity: var(--peak, 0.9); }
    90%  { opacity: 0; }
    100% { transform: translate3d(calc(var(--dx, 12px) * -1), -880px, 0) scale(0.4); opacity: 0; }
}

/* --- Lightning flashes (Zeus) --- */
.fx-lightning {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: screen;
    opacity: 0;
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(220, 200, 255, 0.9), rgba(161, 1, 253, 0.25) 40%, transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 45%);
}

.fx-lightning.strike {
    animation: lightningStrike 0.9s ease-out;
}

@keyframes lightningStrike {
    0%   { opacity: 0; }
    6%   { opacity: 0.95; }
    12%  { opacity: 0.1; }
    18%  { opacity: 0.8; }
    28%  { opacity: 0; }
    100% { opacity: 0; }
}

/* --- Button shine sweep --- */
.btn-shine {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    border-radius: 22px;
    -webkit-mask-image: url("../assets/images/button.png");
    mask-image: url("../assets/images/button.png");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.btn-shine::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -60%;
    width: 45%;
    height: 180%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    transform: skewX(-18deg);
    animation: shineSweep 3.4s ease-in-out infinite;
}

@keyframes shineSweep {
    0%, 22%  { left: -60%; }
    45%, 100% { left: 130%; }
}

/* --- Win: coin shower --- */
.coins {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9;
}

.coin {
    position: absolute;
    top: -40px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff6cf 0%, #ffd54a 30%, #f4a800 70%, #b9740b 100%);
    box-shadow: inset 0 0 0 2px rgba(255, 247, 200, 0.7), 0 3px 8px rgba(0, 0, 0, 0.35);
    opacity: 0;
    will-change: transform, opacity;
    animation: coinFall var(--dur, 2.6s) cubic-bezier(0.4, 0.1, 0.7, 1) var(--delay, 0s) forwards;
}

.coin::before {
    content: "€";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 800 14px/1 "Poppins", sans-serif;
    color: #9a5a00;
}

@keyframes coinFall {
    0%   { transform: translate3d(0, -40px, 0) rotateY(0deg) scale(0.7); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translate3d(var(--dx, 0), 940px, 0) rotateY(900deg) scale(1); opacity: 0; }
}

/* --- Win screen flash + shake --- */
.fx-winflash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 8;
    background: radial-gradient(circle at 50% 38%, rgba(255, 244, 200, 0.85), rgba(255, 213, 80, 0.25) 35%, transparent 70%);
    opacity: 0;
    mix-blend-mode: screen;
}

.fx-winflash.burst {
    animation: winFlash 0.7s ease-out;
}

@keyframes winFlash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

.shake {
    animation: stageShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes stageShake {
    10%, 90% { transform: translate(-1px, 0) scale(var(--scale, 1)); }
    20%, 80% { transform: translate(2px, -1px) scale(var(--scale, 1)); }
    30%, 50%, 70% { transform: translate(-3px, 1px) scale(var(--scale, 1)); }
    40%, 60% { transform: translate(3px, 1px) scale(var(--scale, 1)); }
}

/* --- Sound toggle button --- */
.sound-toggle {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 46px;
    height: 46px;
    z-index: 11;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(36, 6, 56, 0.55);
    border: 1.5px solid rgba(199, 138, 255, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(161, 1, 253, 0.25);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.sound-toggle:hover { transform: scale(1.08); }
.sound-toggle:active { transform: scale(0.94); }

.sound-toggle svg {
    width: 24px;
    height: 24px;
    fill: #ffe79a;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.sound-toggle .icon-off { display: none; }
.sound-toggle.muted .icon-on { display: none; }
.sound-toggle.muted .icon-off { display: block; }

/* --- Forked lightning bolts (matches the promo videos) --- */
.fx-bolt {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
}
.fx-bolt svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fx-bolt .glow { fill: none; stroke: #b673ff; stroke-width: 16; stroke-linejoin: round; stroke-linecap: round; filter: blur(7px); }
.fx-bolt .core { fill: none; stroke: #eaf3ff; stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 7px #cfe6ff) drop-shadow(0 0 14px #9d6bff); }

.fx-bolt.strike { animation: boltStrike 0.55s ease-out; }

@keyframes boltStrike {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    18%  { opacity: 0.12; }
    28%  { opacity: 0.9; }
    44%  { opacity: 0; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fx-rays,
    .spark,
    .btn-shine::after {
        animation: none;
    }
    .fx-sparkles,
    .fx-lightning,
    .fx-bolt { display: none; }
}

/* ===== animations.css ===== */
@keyframes plasmaPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
        opacity: 1;
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes btnBreath {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.025);
        filter: brightness(1.08);
    }
}

/* Pointer leans into the spin direction and ticks as the pegs pass:
   a peg pushes it out, then it snaps back — not a symmetric jitter. */
@keyframes pointerTick {
    0% {
        transform: rotate(-4deg);
    }
    55% {
        transform: rotate(-12deg);
    }
    66% {
        transform: rotate(-2deg);
    }
    100% {
        transform: rotate(-4deg);
    }
}

@keyframes flashBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    25% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(95);
        opacity: 0;
    }
}

@keyframes labelFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.82);
    }
}

@keyframes modalPop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes winGlow {
    0%, 100% {
        filter: drop-shadow(0 18px 34px rgba(20, 0, 35, 0.55));
    }
    50% {
        filter: drop-shadow(0 0 26px rgba(255, 221, 120, 0.9)) drop-shadow(0 18px 34px rgba(20, 0, 35, 0.55));
    }
}

.wheel-rotor.win .wheel-disc {
    animation: winGlow 0.55s ease-in-out 3;
}

@keyframes confettiFall {
    0% {
        transform: translate3d(0, -20px, 0) rotate(0deg);
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--dx, 0), 900px, 0) rotate(var(--rot, 720deg));
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    will-change: transform, opacity;
    animation: confettiFall var(--dur, 2.6s) cubic-bezier(0.3, 0.2, 0.6, 1) var(--delay, 0s) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .wheel-plasma,
    .logo,
    .btn--spin,
    .btn--claim {
        animation: none;
    }
}


