/* The pre-Black Friday wheel (shop/_spin-wheel.blade.php, spin-wheel.js). Colours per layout: Cadeautjestijd (classic)
   night blue, purple and gold with a gift box in the middle; magica.world ivory, plum and rose. */
.sw {
    --sw-bg: #14113a; --sw-ink: #fff; --sw-muted: rgba(255, 255, 255, .78);
    --sw-a: #2b2470; --sw-a2: #3a2f8f; --sw-b: #7b3fc4; --sw-c: #f2b632;
    --sw-label: #fff; --sw-label-c: #14113a; --sw-rim: #f2b632; --sw-dot: #fff3c4;
    --sw-btn: #f2b632; --sw-btn-ink: #14113a; --sw-hub: #fff; --sw-field: #fff;
    --sw-font: inherit;
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
}
.sw[hidden], .sw-tab[hidden], .sw-step[hidden] { display: none; }
.sw[data-layout="magica"] {
    --sw-bg: #fbf6ef; --sw-ink: #3b1736; --sw-muted: #6b4a63;
    --sw-a: #3b1736; --sw-a2: #57264f; --sw-b: #c86b85; --sw-c: #d9a441;
    --sw-label: #fbf6ef; --sw-label-c: #3b1736; --sw-rim: #d9a441; --sw-dot: #fbf6ef;
    --sw-btn: #3b1736; --sw-btn-ink: #fbf6ef; --sw-hub: #fbf6ef;
    --sw-font: "Fraunces", Georgia, serif;
}
.sw-backdrop { position: absolute; inset: 0; background: rgba(10, 8, 30, .62); opacity: 0; transition: opacity .3s; }
.sw-box {
    position: relative; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 340px); gap: 28px; align-items: center;
    max-width: 760px; width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; scrollbar-width: none; padding: 32px 32px 26px;
    background: var(--sw-bg); color: var(--sw-ink); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    transform: translateY(18px) scale(.97); opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .3, 1.2), opacity .3s;
    outline: none;
}
.sw:not([data-layout="magica"]) .sw-box { background: radial-gradient(circle at 20% 10%, #2a2168 0, #14113a 60%); }
.sw-box::-webkit-scrollbar { display: none; }
.sw.is-in .sw-backdrop { opacity: 1; }
.sw.is-in .sw-box { transform: none; opacity: 1; }
.sw-close {
    position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none;
    color: var(--sw-muted); font-size: 30px; line-height: 1; cursor: pointer; border-radius: 50%;
}
.sw-close:hover { color: var(--sw-ink); }

.sw-wheel-wrap { position: relative; width: 100%; max-width: min(300px, calc(100vh - 110px)); aspect-ratio: 1; margin: 0 auto; }
.sw-wheel { width: 100%; height: 100%; display: block; transform: rotate(0deg); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .3)); }
.sw-wheel.is-spinning { transition: transform 5.2s cubic-bezier(.12, .62, .12, 1); }
.sw-seg { stroke: var(--sw-rim); stroke-width: .8; }
.sw-seg-a { fill: var(--sw-a); }
.sw-seg-a.sw-alt { fill: var(--sw-a2); }
.sw-seg-b { fill: var(--sw-b); }
.sw-seg-c { fill: var(--sw-c); }
.sw-label { fill: var(--sw-label); font: 700 17px/1 var(--sw-font, inherit); font-family: inherit; }
.sw[data-layout="magica"] .sw-label { font-family: "Fraunces", Georgia, serif; }
.sw-seg-c + .sw-label { fill: var(--sw-label-c); font-size: 20px; }
.sw-rim { fill: none; stroke: var(--sw-rim); stroke-width: 6; }
.sw-dot { fill: var(--sw-dot); }
.sw-pointer {
    position: absolute; top: -10px; left: 50%; z-index: 2; width: 30px; height: 38px; transform: translateX(-50%);
    background: var(--sw-rim); clip-path: polygon(50% 100%, 0 0, 100% 0); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
}
.sw-hub {
    position: absolute; top: 50%; left: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%);
    display: grid; place-items: center; background: var(--sw-hub); border: 4px solid var(--sw-rim); border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.sw-hub svg { width: 70%; height: 70%; }
/* Before the spin the middle invites a tap: a soft beat; it spins the wheel like the button. */
.sw-hub { z-index: 2; cursor: pointer; transition: transform .2s; }
.sw-hub:not(.is-used) { animation: sw-beat 1.6s ease-in-out infinite; }
.sw-hub:not(.is-used):hover { transform: translate(-50%, -50%) scale(1.08); }
.sw-hub.is-used { cursor: default; }
@keyframes sw-beat { 50% { transform: translate(-50%, -50%) scale(1.09); } }
.sw-gift-box { fill: #7b3fc4; }
.sw-gift-lid { fill: #5a2ea0; }
.sw-gift-ribbon, .sw-gift-bow { fill: #f2b632; }
.sw-hub-star { color: var(--sw-c); font-size: 26px; line-height: 1; }
.sw-wheel-wrap.is-won .sw-hub { animation: sw-pop .6s ease; }
@keyframes sw-pop { 40% { transform: translate(-50%, -50%) scale(1.18); } }

/* The win (spin-wheel.js celebrate): the winning field lights up, then a small party per store. */
.sw-seg.is-win { animation: sw-win 1.2s ease 2; }
@keyframes sw-win { 50% { filter: brightness(1.45) saturate(1.2); } }
.sw-party { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.sw-party i {
    position: absolute; top: 50%; left: 50%; width: 9px; height: 14px; margin: -7px 0 0 -4px; border-radius: 2px; opacity: 0;
    background: #f2b632; animation: sw-confetti 1.9s cubic-bezier(.15, .8, .3, 1) var(--t) forwards;
}
.sw-party i:nth-child(3n+1) { background: #a66bff; }
.sw-party i:nth-child(3n+2) { background: #fff; width: 7px; height: 7px; border-radius: 50%; }
@keyframes sw-confetti {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(var(--r)); }
}
.sw[data-layout="magica"] .sw-party i {
    width: auto; height: auto; margin: 0; background: none; border-radius: 0; color: #d9a441; font-size: 28px; line-height: 1;
    text-shadow: 0 0 10px rgba(255, 214, 120, .95), 0 0 2px #fff; transform: translate(-50%, -50%);
    animation: sw-sparkle 1.5s ease var(--t) forwards;
}
.sw[data-layout="magica"] .sw-party i:nth-child(even) { color: #e8b84f; font-size: 19px; }
/* magica.world: a soft gold glow around the wheel, once. */
.sw[data-layout="magica"] .sw-wheel-wrap.is-won::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
    animation: sw-glow 1.6s ease-out forwards;
}
@keyframes sw-glow {
    0% { box-shadow: 0 0 0 0 rgba(217, 164, 65, .7); }
    100% { box-shadow: 0 0 0 26px rgba(217, 164, 65, 0); }
}
@keyframes sw-sparkle {
    0% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(calc(var(--a) * -1)) scale(.2); }
    40% { opacity: 1; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(calc(var(--a) * -1)) scale(1.2); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(calc(var(--a) * -1)) scale(.6); }
}

.sw-kicker { margin: 0 0 6px; color: var(--sw-c); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.sw[data-layout="magica"] .sw-kicker { color: #b0566f; }
.sw-body h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; color: var(--sw-ink); }
.sw[data-layout="magica"] .sw-body h2 { font-family: "Fraunces", Georgia, serif; font-weight: 400; }
.sw-percent { color: var(--sw-c); white-space: nowrap; }
.sw[data-layout="magica"] .sw-percent { color: #b0566f; }
.sw-lead { margin: 0 0 16px; color: var(--sw-muted); font-size: 15px; line-height: 1.5; }
.sw-btn, .sw .btn.sw-btn {
    display: block; width: 100%; min-height: 50px; padding: 12px 20px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--sw-btn); color: var(--sw-btn-ink); font-size: 17px; font-weight: 700; text-align: center;
}
.sw-btn:hover { filter: brightness(1.06); }
.sw-btn:disabled { opacity: .6; cursor: default; }
.sw-form input[type=email] {
    display: block; width: 100%; min-height: 48px; margin: 0 0 10px; padding: 10px 14px; border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 12px; background: var(--sw-field); color: #1d1a33; font-size: 16px;
}
.sw-news { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--sw-muted); font-size: 14px; line-height: 1.4; cursor: pointer; }
.sw-news input { flex: 0 0 auto; width: auto; min-height: 0; margin: 2px 0 0; }
.sw-news span, .sw-news { text-align: left; }
.sw-message { margin: 10px 0 0; font-size: 14px; color: var(--sw-ink); }
.sw-message:empty { display: none; }
.sw-message.is-error { color: #ff9a9a; }
.sw[data-layout="magica"] .sw-message.is-error { color: #b3261e; }
.sw-code {
    margin: 4px 0 12px; padding: 12px; border: 2px dashed var(--sw-c); border-radius: 12px; text-align: center;
    font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--sw-ink); user-select: all;
}
.sw-timer { margin: 0 0 16px; font-weight: 700; color: var(--sw-ink); }
.sw-small { margin: 16px 0 0; color: var(--sw-muted); font-size: 12px; line-height: 1.45; }

.sw-tab {
    position: fixed; left: 14px; bottom: 14px; z-index: 900; display: inline-flex; gap: 6px; align-items: center;
    padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px;
    background: #14113a; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.layout-magica .sw-tab { background: #3b1736; color: #fbf6ef; }
body.sw-open { overflow: hidden; }

/* Low windows (a laptop with the browser not full screen): smaller, so it all fits without scrolling. */
@media (min-width: 681px) and (max-height: 560px) {
    .sw-box { padding: 20px 28px 18px; grid-template-columns: auto minmax(0, 340px); }
    .sw-wheel-wrap { width: calc(100vh - 90px); max-width: 300px; }
    .sw-body h2 { font-size: 22px; }
    .sw-lead { margin-bottom: 12px; }
    .sw-small { margin-top: 10px; }
}
@media (max-width: 680px) {
    .sw { padding: 10px; align-items: end; }
    .sw-box { grid-template-columns: 1fr; gap: 10px; padding: 22px 18px 18px; border-radius: 20px; max-height: calc(100vh - 20px); text-align: center; }
    .sw-wheel-wrap { max-width: 210px; }
    .sw-body h2 { font-size: 22px; }
    .sw-lead { margin-bottom: 12px; font-size: 14px; }
    .sw-news { justify-content: center; }
    .sw-small { margin-top: 10px; }
    .sw-tab { bottom: 76px; }
}
@media (max-width: 680px) and (max-height: 640px) {
    .sw-wheel-wrap { max-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
    .sw-wheel.is-spinning { transition-duration: 1.2s; }
    .sw-box { transition: none; }
}
