/* 魔術代儲：全站改版（首頁 B、面額、角色卡、簡訊、條款、等待、訂單、優惠）。只用在 magic888topup.com。 */
html[data-store-motion="magic"]{--mg-pur:#6b4fc4;--mg-pur2:#efe9fb;--mg-deep:#221b35;--mg-line:#e4dcf3;--mg-gold:#e8c46a}

/* ---------- 首頁 B：保留貓咪、精簡（手機） ---------- */
@media (max-width:760px){
  html[data-store-motion="magic"] #main .hero{padding:18px!important;min-height:0!important;gap:12px!important;border-radius:24px!important;align-items:center!important;grid-template-columns:1fr auto!important;display:grid!important}
  html[data-store-motion="magic"] #main .hero .hero-copy h1{font-size:22px!important;margin:0 0 4px!important;line-height:1.25!important}
  html[data-store-motion="magic"] #main .hero .hero-copy p{font-size:12px!important;margin:0 0 12px!important}
  html[data-store-motion="magic"] #main .hero .hero-copy .btn{height:38px!important;min-height:0!important;padding:0 14px!important;font-size:13px!important}
  html[data-store-motion="magic"] #main .hero .hero-art{width:96px!important;height:96px!important;min-height:0!important;margin:0!important}
  html[data-store-motion="magic"] #main .hero .hero-copy{padding:0!important}
  html[data-store-motion="magic"] #main .hero .hero-art .art-caption,html[data-store-motion="magic"] #main .hero .hero-art .orbit.two{display:none!important}
  html[data-store-motion="magic"] #main .hero .hero-art img{width:96px!important;height:96px!important}

  html[data-store-motion="magic"] #main .ui-popular{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:6px!important;margin:16px 0 0!important}
  html[data-store-motion="magic"] #main .ui-popular a{display:flex!important;flex-direction:column!important;align-items:center!important;gap:6px!important;padding:4px 0!important;border:0!important;background:none!important;box-shadow:none!important;font-size:11px!important;font-weight:700!important;text-align:center!important;min-height:0!important}
  html[data-store-motion="magic"] #main .ui-popular a img{width:52px!important;height:52px!important;border-radius:16px!important;box-shadow:0 4px 12px rgba(34,27,53,.12)!important}

  html[data-store-motion="magic"] #main .mgh-duo{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
  html[data-store-motion="magic"] #main .mgh-duo > *{margin:0!important;min-height:0!important;height:auto!important;padding:13px 14px!important;border-radius:18px!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;gap:2px!important;text-align:left!important;width:auto!important}
  html[data-store-motion="magic"] #main .mgh-duo strong{font-size:14px!important}
  html[data-store-motion="magic"] #main .mgh-duo small{font-size:11px!important;line-height:1.4!important}
  html[data-store-motion="magic"] #main .mgh-duo .offers-link > span,html[data-store-motion="magic"] #main .mgh-duo .opinion-entry > span:last-child:not(:first-child){display:none!important}
  html[data-store-motion="magic"] #main .mgh-duo .opinion-entry > span{display:flex!important;flex-direction:column!important;gap:2px!important}

  html[data-store-motion="magic"] #main .category-caption > span{display:none!important}
  html[data-store-motion="magic"] #main .filters{scrollbar-width:none!important;-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent);padding-right:24px!important}
  html[data-store-motion="magic"] #main .filters::-webkit-scrollbar{display:none!important}
  html[data-store-motion="magic"] #main .category-picker [class*="scroll"]:not(.filters){display:none!important}
}
html[data-store-motion="magic"] .mgh-due{display:flex;align-items:center;gap:12px;margin-top:12px;padding:12px 14px;border-radius:18px;background:#fff7ec;border:1px solid #f3d6ad;color:#3a2a12;text-decoration:none}
html[data-store-motion="magic"] .mgh-due img{width:36px;height:36px;border-radius:11px;flex:none;object-fit:cover}
html[data-store-motion="magic"] .mgh-due b{display:block;font-size:14px}
html[data-store-motion="magic"] .mgh-due small{font-size:12px;color:#9a6a2a}
html[data-store-motion="magic"] .mgh-due em{margin-left:auto;flex:none;font-style:normal;height:34px;padding:0 12px;border-radius:10px;background:#f08a24;color:#fff;font-weight:900;font-size:13px;display:grid;place-items:center}
html[data-theme="dark"][data-store-motion="magic"] .mgh-due{background:#3a2a17;border-color:#6b4a22;color:#fbe7c8}
html[data-theme="dark"][data-store-motion="magic"] .mgh-due small{color:#e7b878}

/* ---------- 面額：選取改紫色 ---------- */
html[data-store-motion="magic"] .product.selected{border-color:var(--mg-pur)!important;box-shadow:0 0 0 1.5px var(--mg-pur),0 8px 20px rgba(107,79,196,.16)!important;background-color:#f7f3ff!important}
html[data-theme="dark"][data-store-motion="magic"] .product.selected{background-color:#2a2342!important}
html[data-store-motion="magic"] .product .ui-selection-check{background:var(--mg-pur)!important;background-image:none!important;color:#fff!important;border-color:var(--mg-pur)!important;box-shadow:0 2px 8px rgba(107,79,196,.35)!important}
html[data-store-motion="magic"] .product .ui-selection-check *{color:#fff!important;stroke:#fff!important}
html[data-store-motion="magic"] .ui-products-grid.mg-same-note .ux-note-summary{display:none!important}
html[data-store-motion="magic"] .mg-note-chip{display:inline-flex;align-items:center;gap:6px;margin:0 0 12px;padding:6px 12px;border-radius:999px;background:var(--mg-pur2);color:#4b3696;font-size:12px;font-weight:700}
html[data-theme="dark"][data-store-motion="magic"] .mg-note-chip{background:#2f2750;color:#d8cbff}

/* ---------- 角色核對 ---------- */
html[data-store-motion="magic"] dialog .mg-role-load{display:flex;flex-direction:column;align-items:center;gap:12px;padding:18px 12px;border-radius:18px;background:var(--mg-pur2);color:#4b3696;font-weight:700;font-size:14px;text-align:center}
html[data-store-motion="magic"] dialog.mg-role-dlg #role-check-status .spinner{display:none!important}
html[data-store-motion="magic"] .mg-star{width:32px;height:32px;color:var(--mg-pur);filter:drop-shadow(0 4px 10px rgba(107,79,196,.35));animation:mg-flip 1.2s cubic-bezier(.6,0,.3,1) infinite}
html[data-store-motion="magic"] .mg-star.mg-star.mg-star{animation-iteration-count:infinite!important}
html[data-store-motion="magic"] .mg-role{display:flex;flex-direction:column;gap:12px;padding:16px;border-radius:18px;background:radial-gradient(120% 120% at 100% 0%,#4a3a86,#221b35);color:#efe8ff;animation:mg-in .35s ease-out;text-align:left}
html[data-store-motion="magic"] .mg-role-r{display:flex;align-items:center;gap:12px}
html[data-store-motion="magic"] .mg-role-av{width:46px;height:46px;border-radius:50%;flex:none;background:#3b2e63;box-shadow:0 0 0 2.5px var(--mg-gold);display:grid;place-items:center;font-weight:900;color:var(--mg-gold);font-size:18px}
html[data-store-motion="magic"] .mg-role b{display:block;font-size:17px;color:#fff}
html[data-store-motion="magic"] .mg-role small{font-size:12px;color:#b9abdc}
html[data-store-motion="magic"] .mg-role-tag{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#cbbcf3}
html[data-store-motion="magic"] .mg-role-tag.ok{color:#9be3b8}
html[data-store-motion="magic"] .mg-role-tag i{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.12);font-style:normal}
html[data-store-motion="magic"] .mg-role-tag.ok i{background:#2fa86a}
html[data-store-motion="magic"] .mg-role-tag .mg-mini{width:12px;height:12px;border-radius:50%;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;animation:mg-spin .8s linear infinite}
html[data-store-motion="magic"] .mg-role-tag .mg-mini.mg-mini{animation-iteration-count:infinite!important}
html[data-store-motion="magic"] .mg-role-err{margin-top:8px;padding:14px;border-radius:16px;background:#fff3f1;border:1.5px solid #f4c7bf;color:#8a2c1c;animation:mg-shake .4s}
html[data-store-motion="magic"] .mg-role-err b{display:block;font-size:15px;margin-bottom:4px}
html[data-store-motion="magic"] .mg-role-err p{margin:0;font-size:12px;line-height:1.6;color:#9b5346}
html[data-theme="dark"][data-store-motion="magic"] .mg-role-err{background:#3a1d19;border-color:#7a3a30;color:#ffc9bd}
html[data-theme="dark"][data-store-motion="magic"] .mg-role-err p{color:#f0a99a}
html[data-store-motion="magic"] .mg-role-step3{margin:0 0 14px}

/* ---------- 簡訊：圓圈轉→打勾 ---------- */
html[data-store-motion="magic"] #otp-delivery-status.mg-otp{display:flex;align-items:center;gap:10px;min-height:28px;font-weight:700}
html[data-store-motion="magic"] #otp-delivery-status.mg-otp::before{content:"";flex:none;width:24px;height:24px;border-radius:50%;box-sizing:border-box}
html[data-store-motion="magic"] #otp-delivery-status.mg-otp-busy::before{border:2.5px solid var(--mg-pur2);border-top-color:var(--mg-pur);animation:mg-spin .8s linear infinite}
html[data-store-motion="magic"] #otp-delivery-status.mg-otp-busy.mg-otp-busy::before{animation-iteration-count:infinite!important}
html[data-store-motion="magic"] #otp-delivery-status.mg-otp-ok{color:#23885a}
html[data-store-motion="magic"] #otp-delivery-status.mg-otp-ok::before{background:#2f9a63 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.5 3.5 6.5-8'/%3E%3C/svg%3E") center/13px no-repeat;animation:mg-pop .4s ease-out}

/* ---------- 條款沒勾：晃一下＋紅框 ---------- */
html[data-store-motion="magic"] .digital-consent.ui-invalid{border-color:#e46b4f!important;background:#fff4f1!important;border-radius:14px;animation:mg-shake .4s}
html[data-theme="dark"][data-store-motion="magic"] .digital-consent.ui-invalid{background:#3a1d19!important}
html[data-store-motion="magic"] #terms-error:not(:empty){color:#c2412a!important;font-weight:700!important;animation:mg-in .25s ease-out}
html[data-store-motion="magic"] #terms-error:not(:empty)::before{content:"↑ "}

/* ---------- 下單等待：魔法星星 ---------- */
html[data-store-motion="magic"] dialog .mgw{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;background:var(--mg-surface,#fff);border-radius:inherit;animation:mg-in .25s ease-out}
html[data-theme="dark"][data-store-motion="magic"] dialog .mgw{background:#1f1a2e;color:#efe8ff}
html[data-store-motion="magic"] dialog.mg-wait-on{position:fixed}
html[data-store-motion="magic"] .mgw-stage{height:72px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;margin-bottom:10px}
html[data-store-motion="magic"] .mgw .mg-star{width:46px;height:46px}
html[data-store-motion="magic"] .mgw-sh{width:36px;height:6px;border-radius:50%;background:rgba(36,29,56,.14);animation:mg-sh 1.2s infinite}
html[data-store-motion="magic"] .mgw-sh.mgw-sh{animation-iteration-count:infinite!important}
html[data-store-motion="magic"] .mgw h2{margin:0;font-size:18px}
html[data-store-motion="magic"] .mgw p{margin:0 0 14px;font-size:13px;color:#7d7395}
html[data-store-motion="magic"] .mgw-dots{display:flex;gap:6px}
html[data-store-motion="magic"] .mgw-dots i{width:26px;height:5px;border-radius:3px;background:var(--mg-line);transition:background .3s}
html[data-store-motion="magic"] .mgw-dots i.on{background:var(--mg-pur)}
html[data-store-motion="magic"] .mgw .mgw-note{margin:16px 0 0!important;font-size:12px!important}

/* ---------- 訂單：狀態分顏色 ---------- */
html[data-store-motion="magic"] .order-card[data-mg-tone]{border-left:4px solid var(--mg-c)!important}
html[data-store-motion="magic"] .order-card[data-mg-tone] .tag{background:var(--mg-cb)!important;color:var(--mg-c)!important;border-color:transparent!important;font-weight:900!important}
html[data-store-motion="magic"] .order-card[data-mg-tone="warn"]{--mg-c:#d9771c;--mg-cb:#fff3e4}
html[data-store-motion="magic"] .order-card[data-mg-tone="proc"]{--mg-c:#6b4fc4;--mg-cb:#f1ecfd}
html[data-store-motion="magic"] .order-card[data-mg-tone="ok"]{--mg-c:#2f9a63;--mg-cb:#e8f7ef}
html[data-store-motion="magic"] .order-card[data-mg-tone="dead"]{--mg-c:#9a93a8;--mg-cb:#f2f0f5}
html[data-theme="dark"][data-store-motion="magic"] .order-card[data-mg-tone]{--mg-cb:rgba(255,255,255,.08)}
html[data-store-motion="magic"] .order-card[data-mg-tone="dead"] h3,html[data-store-motion="magic"] .order-card[data-mg-tone="dead"] strong{opacity:.65}

/* ---------- 優惠頁：空狀態＋領券步驟 ---------- */
html[data-store-motion="magic"] .offer-wallet-list .offer-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:22px 12px!important;text-align:center}
html[data-store-motion="magic"] .offer-wallet-list .offer-empty::before{content:"NT$";width:110px;height:58px;border-radius:14px;background:linear-gradient(135deg,#efe9fb,#fff6df);border:1.5px dashed #c9b6f2;display:grid;place-items:center;color:var(--mg-pur);font-weight:900;font-size:19px}
html[data-store-motion="magic"] .mg-steps{margin-top:14px;padding:16px 18px;border-radius:20px;border:1px solid var(--mg-line);background:var(--mg-surface,#fff)}
html[data-theme="dark"][data-store-motion="magic"] .mg-steps{background:#1f1a2e;border-color:#3a3152}
html[data-store-motion="magic"] .mg-steps h3{margin:0 0 10px;font-size:15px}
html[data-store-motion="magic"] .mg-steps ol{list-style:none;margin:0;padding:0}
html[data-store-motion="magic"] .mg-steps li{display:flex;gap:12px;align-items:flex-start;padding:8px 0;position:relative}
html[data-store-motion="magic"] .mg-steps li:not(:last-child)::after{content:"";position:absolute;left:13.5px;top:38px;bottom:-6px;border-left:1.5px dashed #cdbff0}
html[data-store-motion="magic"] .mg-steps li > i{width:28px;height:28px;border-radius:50%;flex:none;background:var(--mg-pur2);color:var(--mg-pur);font-style:normal;font-weight:900;display:grid;place-items:center;font-size:13px}
html[data-store-motion="magic"] .mg-steps b{display:block;font-size:14px}
html[data-store-motion="magic"] .mg-steps small{font-size:12px;color:#7d7395}

@keyframes mg-spin{to{transform:rotate(360deg)}}
@keyframes mg-flip{0%{transform:rotate(0) scale(1)}45%{transform:rotate(200deg) scale(.7)}70%{transform:rotate(180deg) scale(1.08)}100%{transform:rotate(180deg) scale(1)}}
@keyframes mg-sh{45%{transform:scaleX(.6)}}
@keyframes mg-pop{0%{transform:scale(.4);opacity:0}60%{transform:scale(1.15);opacity:1}100%{transform:scale(1)}}
@keyframes mg-in{from{opacity:0;transform:translateY(6px)}}
@keyframes mg-shake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
@media (prefers-reduced-motion:reduce){html[data-store-motion="magic"] .mg-star,html[data-store-motion="magic"] .mgw-sh,html[data-store-motion="magic"] .mg-role,html[data-store-motion="magic"] .mg-role-err,html[data-store-motion="magic"] .digital-consent.ui-invalid{animation:none!important}}
