/*
 * স্পিন হুইল popup (SPIN-PLAN §3; r2 option A, approved by Saad 2026-10-14).
 * Loaded only by partials/spin-wheel.blade.php, on the pages that show the wheel.
 * Two new fonts, served from the site (SIL Open Font License, see ../fonts/OFL-*.txt):
 * Tiro Bangla for the popup heading only, IBM Plex Mono for the code and the number.
 * Everything else is the site's Hind Siliguri.
 * spin-fix2 r5-light (Saad, approved 2026-10-15): light and calm. One white card with a thin border
 * and one small soft shadow, no glow and no dark panel; the wheel itself unchanged, at 72% of the
 * card; one column at every width. The popup stays light on a phone set to dark, like the rest of
 * the storefront. The heading and the short line under it are centred; the form, the prize card,
 * the code row and the notes stay left.
 */
@font-face{font-family:'Tiro Bangla';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/tiro-bangla-bengali.woff2) format('woff2');
  unicode-range:U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+25CC}
@font-face{font-family:'Tiro Bangla';font-style:normal;font-weight:400;font-display:swap;
  src:url(../fonts/tiro-bangla-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:600;font-display:swap;
  src:url(../fonts/ibm-plex-mono-600-latin.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}

.spw{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;
  --ink:#1F1A1C;--body:#5C5257;--muted:#776C71;--line:#EFE5E8;--line-strong:#E3D5DA;--surface:#FFFFFF;--field:#FFFFFF;
  --panel:transparent;--accent:#C0124F;--accent-ink:#B0104A;--ticket:#FFF7F9;--ticket-line:#F2D9E1;--chip:#FFFFFF;--error:#B42318;
  --close:#F6F1F3;--shadow:0 8px 24px rgba(40,12,24,.12);--wheel-shadow:drop-shadow(0 3px 6px rgba(60,20,35,.10));
  font-family:'Hind Siliguri',system-ui,sans-serif;-webkit-font-smoothing:antialiased;line-height:1.5;color-scheme:light}
.spw[hidden]{display:none}
.spw *,.spw *::before,.spw *::after{box-sizing:border-box}
.spw-backdrop{position:absolute;inset:0;background:rgba(25,15,20,.40);animation:spw-fade .2s ease-out both}
.spw-box{position:relative;width:min(380px,100%);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);outline:0;
  animation:spw-in .22s cubic-bezier(.2,.8,.2,1) both}
/* spin-fix (Saad, 2026-10-15): every storefront popup opens from the centre, the backdrop fading in
   (200 ms) and the box fading in from 94% (220 ms); no sheet rising from the bottom. */
@keyframes spw-fade{from{opacity:0}to{opacity:1}}
@keyframes spw-in{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}
.spw-close{position:absolute;top:10px;right:10px;z-index:3;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;
  background:var(--close);color:var(--body);display:grid;place-items:center;font-size:18px}
.spw-stage{position:relative;background:var(--panel);padding:30px 0 2px;display:grid;place-items:center}
.spw-wheelwrap{position:relative;width:72%}
.spw-wheel{display:block;width:100%;height:auto;filter:var(--wheel-shadow)}
.spw-wheel text{font-family:'Hind Siliguri',sans-serif}
.spw-rotor{transform-box:view-box;transform-origin:200px 200px}
.spw-rotor.is-spinning{transition:transform 4.6s cubic-bezier(.12,.66,.12,1)}
.spw-pointer{position:absolute;left:50%;top:-14px;width:26px;transform:translateX(-50%);z-index:2}
.spw-body{padding:14px 22px 20px}
.spw-title{font-family:'Tiro Bangla',serif;font-weight:400;font-size:22px;line-height:1.35;margin:0;color:var(--ink);letter-spacing:.005em;text-align:center}
/* With no wheel above it, the heading sits beside the close button: equal room on both sides keeps it centred. */
.spw-box[data-state="won"] .spw-title,.spw-box[data-state="code"] .spw-title{padding:0 34px}
.spw-text{margin:6px 0 0;font-size:15px;line-height:1.55;color:var(--body);text-align:center}
.spw-panel[hidden]{display:none}
.spw-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;margin-top:16px;border:0;border-radius:12px;cursor:pointer;text-decoration:none;
  background:var(--accent);color:#fff;font:600 17px/1 'Hind Siliguri',sans-serif;letter-spacing:.01em;box-shadow:none}
.spw-btn:hover,.spw-btn:focus{color:#fff;text-decoration:none}
.spw-btn[disabled]{opacity:.7;cursor:progress}
.spw-later{display:block;width:100%;min-height:44px;margin-top:4px;border:0;background:none;color:var(--muted);font:500 15px 'Hind Siliguri',sans-serif;cursor:pointer}
.spw-fine{margin:10px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}
.spw-ticket{position:relative;margin-top:14px;border-radius:14px;background:var(--ticket);border:1px solid var(--ticket-line);padding:14px 18px}
.spw-ticket::before,.spw-ticket::after{content:"";position:absolute;top:50%;width:18px;height:18px;margin-top:-9px;border-radius:50%;background:var(--surface);border:1px solid var(--ticket-line)}
.spw-ticket::before{left:-10px;clip-path:inset(0 0 0 50%)}
.spw-ticket::after{right:-10px;clip-path:inset(0 50% 0 0)}
.spw-ticket--code::before,.spw-ticket--code::after{top:90px}
.spw-prize{display:flex;align-items:baseline;gap:8px}
.spw-prize b{font-size:32px;line-height:1.05;font-weight:700;color:var(--accent-ink)}
.spw-prize span{font-size:18px;font-weight:600;color:var(--ink)}
.spw-cond{margin:4px 0 0;font-size:14px;color:var(--body)}
.spw-cut{border:0;border-top:1.5px dashed var(--ticket-line);margin:16px -18px 14px;opacity:1}
.spw-coderow{display:flex;align-items:center;gap:10px}
.spw-coderow code{flex:1;font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:22px;font-weight:600;letter-spacing:.12em;color:var(--ink);background:none;padding:0}
.spw-copy{min-height:40px;padding:0 16px;border-radius:999px;border:1px solid var(--line-strong);background:var(--chip);color:var(--accent-ink);font:600 15px 'Hind Siliguri',sans-serif;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.spw-meta{margin:10px 0 0;font-size:13.5px;line-height:1.6;color:var(--muted)}
.spw-form{display:grid;gap:12px;margin-top:14px}
.spw-form label{display:block;margin-bottom:6px;font-size:14px;font-weight:600;color:var(--ink)}
.spw-form input{width:100%;min-height:48px;border:1px solid var(--line-strong);border-radius:12px;padding:0 16px;font:500 17px 'Hind Siliguri',sans-serif;background:var(--field);color:var(--ink)}
.spw-form input.is-num{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:16px;letter-spacing:.04em}
.spw-form input:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.spw-form .spw-btn{margin-top:4px}
.spw-error{margin:0;font-size:14px;color:var(--error)}
.spw-error[hidden]{display:none}
.spw-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.spw button:focus-visible,.spw a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* After the spin the won and code screens drop the wheel so the form fits; the empty screen keeps a
   small stopped wheel. */
.spw-box[data-state="won"] .spw-stage,.spw-box[data-state="code"] .spw-stage{display:none}
.spw-box[data-state="empty"] .spw-stage{padding:28px 0 2px}
.spw-box[data-state="empty"] .spw-wheelwrap{width:52%}

@media (min-width:768px){
  .spw{padding:24px}
  .spw-box{width:400px;border-radius:22px}
  .spw-stage{padding:32px 0 2px}
  .spw-pointer{width:28px;top:-15px}
  .spw-body{padding:16px 32px 26px}
  .spw-title{font-size:24px}
  .spw-text{font-size:15.5px}
}

@media (prefers-reduced-motion:reduce){
  .spw-rotor.is-spinning{transition:none}
  .spw-box{animation:spw-fade .15s linear both}
}
