/* ================= Daily spin wheel ================= */
.wheel-fab { position: absolute; left: 16px; top: 84px; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 8px 0 6px; border-radius: 18px; background: linear-gradient(160deg, #c084fc, #7b3fd1); color: #fff; box-shadow: 0 6px 18px rgba(123, 63, 209, 0.45); }
.wheel-fab:hover { transform: translateY(-2px); }
.wf-icon { font-size: 28px; line-height: 1; animation: wfSpin 6s linear infinite; }
.wf-label { font-size: 12px; font-weight: 800; letter-spacing: 0.3px; }
.wheel-fab .dot { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; animation: pulse 1.2s infinite; }
@keyframes wfSpin { to { transform: rotate(360deg); } }

.wheel-layer { position: fixed; inset: 0; top:var(--modal-top,0px); bottom:auto; height:var(--modal-height,100dvh); z-index: 44; background: rgba(30, 12, 50, 0.6); display: grid; place-items: center; padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); overflow:hidden; }
.wheel { position: relative; width: min(440px, 100%); background: radial-gradient(circle at 50% 0%, #fff8e6, #faf8f3 60%); border-radius: 26px; padding: 22px 22px 20px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); animation: pop 0.25s ease; }
.wheel h2 { margin: 0; font-size: 24px; }
.wh-x { position: absolute; top: 12px; right: 12px; }
.wh-sub { margin: 6px 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.wh-stage { position: relative; width: min(340px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.wh-canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 8px #3b1f6b, 0 12px 30px rgba(0, 0, 0, 0.3); }
.wh-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid #ef4444; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3)); z-index: 2; }
.wh-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 26%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #f2c35b); color: #3b1f6b; font-weight: 800; font-size: 20px; box-shadow: 0 0 0 6px #3b1f6b, 0 6px 14px rgba(0, 0, 0, 0.35); }
.wh-hub:not(:disabled):hover { filter: brightness(1.05); transform: translate(-50%, -50%) scale(1.05); }
.wh-hub:disabled { cursor: default; opacity: 0.9; }
.wh-result { margin-top: 16px; padding: 14px; background: #fff; border-radius: 18px; border: 2px solid #e9d5ff; animation: pop 0.3s ease; }
.wh-big { font-size: 30px; font-weight: 800; color: #7b3fd1; letter-spacing: -0.5px; }
.wh-detail { margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; }
.wh-prod { display: flex; gap: 10px; align-items: center; text-align: left; }
.wh-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; flex: none; }
.wh-prod small { display: block; color: var(--muted); }
.wh-price s { color: var(--muted); }
.wh-price b { color: #e0482c; font-size: 16px; }
.wh-note { color: var(--muted); font-size: 12px; }
.wh-actions { display: flex; gap: 8px; margin-top: 10px; }
.wh-actions .btn { height: 42px; font-size: 14px; }
.wh-next { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }
.muted { color: var(--muted); }

@media (max-width: 1180px) {
  .wheel-fab { top: 140px; }
}
@media (max-width: 900px) {
  .wheel-fab { top: 58px; left: 12px; width: 56px; padding: 6px 0 5px; }
  .wf-icon { font-size: 24px; }
}

/* Keep the daily spin below the brand card at every screen size. */
.status-row { flex-direction:column; align-items:flex-start; gap:12px; }
.status-row .wheel-fab { position:relative; left:auto; top:auto; flex:none; }

.wh-error { color:#b12e36; font-size:13px; line-height:1.5; }
.wheel { max-height:100%; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.wheel .wh-x { position:sticky; top:0; float:right; margin:-10px -10px 0 0; z-index:3; background:#fff; }
.wheel .wh-stage { width:min(340px,100%); }
@media(max-width:600px){
 .wheel { border-radius:20px; padding:16px 18px; }
 .wheel h2 { font-size:21px; }
 .wh-sub { font-size:12px; margin:6px 18px 18px; }
 .wheel .wh-stage { width:min(280px,calc(100vw - 76px),calc(var(--modal-height,100dvh) * .39)); }
 .wh-pointer { top:-12px; border-left-width:12px; border-right-width:12px; border-top-width:24px; }
 .wh-hub { font-size:16px; }
 .wh-result { margin-top:14px; padding:10px; }
 .wh-big { font-size:24px; }
 .wh-detail { font-size:13px; }
 .wh-actions { flex-wrap:wrap; }
 .wh-actions .btn { flex:1; min-width:110px; }
 .wh-next { font-size:12px; }
 .scratch-card { padding:10px; }
}
@media(max-height:500px) and (min-width:601px){.wheel .wh-stage { width:200px; }.wh-sub { margin-bottom:18px; }}
.wh-scratch-slot { margin-top:14px; }
.scratch-card { border:1px solid #b9dacb; padding:14px; border-radius:18px; background:linear-gradient(130deg,#f7fff9,#edf8f1); color:#173b29; text-align:left; }
.scratch-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.scratch-heading b { font-size:17px; }
.scratch-heading span { font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:#52715f; }
.scratch-window { position:relative; height:72px; border-radius:12px; overflow:hidden; background:#fff; border:1px solid #d1ddd5; }
.scratch-pin { position:absolute; inset:0; display:grid; place-items:center; font:700 clamp(13px,3.8vw,18px) monospace; color:#173b29; user-select:text; }
.scratch-window canvas { position:absolute; inset:0; width:100%; height:72px; touch-action:none; cursor:crosshair; transition:opacity .45s ease,transform .45s ease; }
.scratch-window canvas.is-revealed { opacity:0; transform:scale(1.04); pointer-events:none; }
.scratch-status { font-size:12px; line-height:1.5; margin:10px 0; min-height:18px; }
.scratch-actions { display:flex; gap:8px; }
.scratch-actions .btn { height:38px; font-size:12px; min-width:0; }
.scratch-card > small { display:block; font-size:10px; color:#52715f; margin-top:10px; }
.wh-saved { text-align:left; margin-top:16px; font-size:13px; }
.wh-saved summary { cursor:pointer; padding:8px 0; font-weight:700; }
.wh-saved button { display:flex; justify-content:space-between; width:100%; padding:10px; border:1px solid #e0e5df; border-radius:10px; margin:5px 0; background:#fff; color:#173b29; }
@media(prefers-reduced-motion:reduce){.scratch-window canvas { transition:none; }}

.scratch-pin[data-long="true"] { font-size:clamp(10px,3vw,12px); }
