body.access-locked { overflow: hidden; }
.access-modal {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px;
  background: rgba(3, 6, 13, .82); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transition: .2s ease;
}
.access-modal.show { opacity: 1; visibility: visible; }
.access-dialog {
  position: relative; width: min(560px, 100%); padding: 32px;
  border: 1px solid rgba(139, 112, 255, .32); border-radius: 20px;
  background: linear-gradient(145deg, #111827, #090e19); color: #eef2f8;
  box-shadow: 0 35px 100px rgba(0,0,0,.58);
}
.access-dialog.compact { width: min(460px, 100%); }
.access-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); color: #abb5c5; font-size: 21px; cursor: pointer; }
.access-kicker { color: #a995ff; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.access-dialog h2 { margin: 10px 38px 10px 0; font-size: clamp(24px,5vw,32px); }
.access-dialog p { margin: 0; color: #929daf; line-height: 1.8; }
.access-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.access-prices span { padding: 13px; border: 1px solid rgba(148,163,184,.12); border-radius: 11px; background: rgba(255,255,255,.03); color: #aab4c3; font-size: 13px; }
.access-prices b { display: block; margin-top: 4px; color: #ffb15a; font-size: 18px; }
.access-actions { display: grid; gap: 9px; margin-top: 22px; }
.access-actions.row { grid-template-columns: 1fr 1fr; }
.access-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 14px; border: 1px solid rgba(148,163,184,.17); border-radius: 10px; background: rgba(255,255,255,.04); color: #d0d7e2; text-decoration: none; cursor: pointer; }
.access-btn.primary { border-color: rgba(139,112,255,.42); background: linear-gradient(105deg,#6f50ec,#8769f4); color: #fff; font-weight: 800; }
.access-btn.subtle { color: #8995a7; }
.redeem-dialog {
  width: min(480px, 100%);
  padding: 30px;
  overflow: hidden;
  border-color: rgba(139, 112, 255, .28);
  background:
    radial-gradient(circle at 8% 0%, rgba(126, 84, 255, .18), transparent 18rem),
    linear-gradient(150deg, #11182a, #090e19 72%);
  box-shadow: 0 34px 100px rgba(0,0,0,.62), 0 0 44px rgba(113,84,255,.1);
}
.redeem-heading { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.redeem-heading-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(174,145,255,.28); border-radius: 14px; background: linear-gradient(145deg,rgba(132,84,255,.28),rgba(65,111,255,.14)); color: #d5c7ff; font-size: 24px; box-shadow: 0 12px 28px rgba(92,58,190,.2); }
.redeem-heading h2 { margin: 4px 0 0; font-size: 28px; line-height: 1.2; }
.redeem-description { margin-top: 18px !important; color: #919caf !important; font-size: 14px; }
.redeem-input { width: 100%; min-height: 54px; margin-top: 20px; padding: 14px 16px; border: 1px solid rgba(148,163,184,.2); border-radius: 12px; outline: 0; background: rgba(5,9,17,.72); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.redeem-input::placeholder { color: #667187; font-weight: 500; letter-spacing: .02em; }
.redeem-input:focus { border-color: #8e70f5; background: #080d17; box-shadow: 0 0 0 4px rgba(124,92,255,.12), 0 12px 28px rgba(0,0,0,.18); }
.redeem-error { min-height: 20px; margin-top: 8px; color: #ff8580; font-size: 12px; text-align: center; }
.redeem-buy-hint { margin-top: 3px !important; color: #737f94 !important; font-size: 12px; text-align: center; }
.redeem-buy-hint button { padding: 0; border: 0; background: transparent; color: #aa94ff; cursor: pointer; }
.redeem-buy-hint button:hover { color: #d5caff; }
.redeem-dialog .access-actions.row { gap: 10px; margin-top: 18px; }
.redeem-dialog .access-actions.row .access-btn { min-height: 48px; border-radius: 12px; }
.redeem-purchase-fallback { display: none; margin-top: 22px; padding: 19px; border: 1px solid rgba(255,177,90,.22); border-radius: 14px; background: rgba(255,177,90,.06); text-align: center; }
.redeem-purchase-fallback.show { display: block; }
.redeem-purchase-fallback strong { color: #ffbd73; }
.redeem-purchase-fallback p { margin: 8px 0 16px; font-size: 13px; }
.redeem-success-dialog { text-align: center; }
.redeem-success-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; background: linear-gradient(135deg,#59c58c,#7be0aa); color: #07140d; font-size: 28px; font-weight: 900; box-shadow: 0 14px 36px rgba(89,197,140,.22); }
.purchase-steps { margin: 20px 0; padding-left: 22px; color: #aab4c3; line-height: 1.9; }
.demo-host { position: fixed; inset: 0; z-index: 1400; display: none; background: #070b13; }
.demo-host.show { display: block; }
.demo-host iframe { width: 100%; height: 100%; border: 0; background: #070b13; }
.access-toast { position: fixed; z-index: 1700; left: 50%; bottom: 28px; padding: 12px 18px; border: 1px solid rgba(139,112,255,.28); border-radius: 10px; background: rgba(10,15,27,.94); color: #fff; opacity: 0; transform: translate(-50%,12px); transition: .2s ease; pointer-events: none; }
.access-toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 600px) {
  .access-modal { padding: 12px; }
  .access-dialog { padding: 26px 20px 22px; border-radius: 16px; }
  .access-prices { grid-template-columns: 1fr; }
  .redeem-dialog { width: min(94vw,400px); padding: 24px 18px 20px; }
  .redeem-heading { gap: 11px; padding-right: 28px; }
  .redeem-heading-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; }
  .redeem-heading h2 { font-size: 24px; }
  .redeem-description { margin-top: 15px !important; font-size: 13px; line-height: 1.65 !important; }
  .redeem-input { min-height: 52px; margin-top: 17px; font-size: 15px; }
  .redeem-dialog .access-actions.row { grid-template-columns: 1fr; gap: 8px; }
}

/* ── 支持作者 / 打赏二维码 ── */
.support-author-qr {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 18px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

/* ── 模拟广告弹窗 ── */
.reward-ad-overlay { z-index: 1600; }
.reward-ad-dialog { text-align: center; }
.reward-ad-dialog .access-kicker { color: #ffb15a; }
.ad-countdown-wrap { margin: 24px 0 8px; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.ad-countdown { font-size: 56px; font-weight: 900; color: #ffb15a; line-height: 1; }
.ad-countdown-label { color: #929daf; font-size: 16px; }
#adClaimBtn:disabled { opacity: .45; pointer-events: none; }
#adClaimBtn:not(:disabled) { animation: adBtnPulse 1.6s ease infinite alternate; }
@keyframes adBtnPulse { 0% { box-shadow: 0 0 0 0 rgba(255,177,90,.35); } 100% { box-shadow: 0 0 0 10px rgba(255,177,90,0); } }

/* Support-author prompt: warm, voluntary and visually separate from paywalls. */
.support-author-overlay {
  z-index: 2600;
  min-height: 100dvh;
  padding: 16px;
  background: rgba(2, 6, 15, .82);
  backdrop-filter: blur(16px) saturate(.82);
  -webkit-backdrop-filter: blur(16px) saturate(.82);
  pointer-events: none;
}

.support-author-overlay.show {
  pointer-events: auto;
}

.support-author-overlay.show .support-author-dialog {
  animation: supportDialogEnter .26s cubic-bezier(.2, .8, .2, 1) both;
}

.support-author-dialog {
  isolation: isolate;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 28px 32px 24px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(135, 151, 255, .22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% -18%, rgba(113, 84, 255, .2), transparent 42%),
    linear-gradient(150deg, rgba(16, 24, 43, .98), rgba(8, 14, 27, .99));
  box-shadow:
    0 36px 110px rgba(0, 0, 0, .62),
    0 0 52px rgba(94, 77, 216, .12),
    inset 0 1px 0 rgba(255, 255, 255, .035);
}

.support-author-dialog::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -72px;
  bottom: -96px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(55, 113, 255, .1);
  filter: blur(42px);
  pointer-events: none;
}

.support-author-dialog .support-author-title {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 5px;
  margin: 2px auto 0;
  padding: 0 38px;
  color: #f5f7ff;
  font-weight: 850;
  line-height: 1.16;
  text-align: center;
}

.support-author-welcome {
  color: #d8deea;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .08em;
}

.support-author-game-title {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: clip;
}

.support-author-dialog .support-author-description {
  max-width: 380px;
  margin: 0 auto;
  color: #b1bbcc;
  font-size: 16px;
  line-height: 1.75;
}

.support-author-dialog .support-author-note {
  margin: 10px auto 0;
  color: #77849a;
  font-size: 13px;
  line-height: 1.65;
}

.support-author-actions {
  gap: 10px;
  margin-top: 16px;
}

.support-author-dialog .support-author-primary,
.support-author-dialog .support-author-secondary {
  width: 100%;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 750;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, filter .18s ease;
}

.support-author-dialog .support-author-primary {
  min-height: 54px;
  border-color: rgba(255, 185, 92, .56);
  background: linear-gradient(110deg, #ff9a23 0%, #ff7a1a 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(255, 126, 26, .25);
}

.support-author-dialog .support-author-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(255, 126, 26, .34);
}

.support-author-dialog .support-author-primary.donate-bounce {
  animation: donateBounce .28s ease;
}

.support-author-dialog .support-author-secondary {
  min-height: 50px;
  border-color: rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .028);
  color: #9ca8ba;
}

.support-author-dialog .support-author-secondary:hover {
  border-color: rgba(148, 163, 184, .3);
  background: rgba(255, 255, 255, .055);
  color: #cbd3df;
}

.support-author-dialog .support-author-primary:active,
.support-author-dialog .support-author-secondary:active {
  transform: scale(.98);
}

.support-author-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .11);
  background: rgba(255, 255, 255, .045);
  color: #8f9bad;
  line-height: 1;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.support-author-close:hover {
  border-color: rgba(154, 166, 255, .36);
  background: rgba(129, 108, 255, .1);
  color: #eef1ff;
  transform: rotate(4deg);
}

@keyframes supportDialogEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes donateBounce {
  0% { transform: scale(1); }
  45% { transform: scale(.96); }
  72% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .support-author-overlay.show .support-author-dialog {
    animation: none;
  }
}

@media (max-width: 600px) {
  .support-author-overlay {
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .support-author-dialog {
    width: min(94vw, 520px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 24px 16px 18px;
    border-radius: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .support-author-qr {
    width: min(100%, 330px, 42dvh);
    max-width: calc(100vw - 58px);
    margin-top: 14px;
    border-radius: 14px;
  }

  .support-author-dialog .support-author-title {
    gap: 4px;
    margin-top: 0;
    padding: 0 30px;
  }

  .support-author-welcome {
    font-size: 17px;
  }

  .support-author-game-title {
    font-size: 28px;
    line-height: 1.18;
  }

  .support-author-dialog .support-author-description {
    max-width: 300px;
    font-size: 14px;
    line-height: 1.7;
  }

  .support-author-dialog .support-author-note {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
  }

  .support-author-actions {
    gap: 8px;
    margin-top: 14px;
  }

  .support-author-dialog .support-author-primary {
    min-height: 52px;
    font-size: 16px;
  }

  .support-author-dialog .support-author-secondary {
    min-height: 48px;
    font-size: 15px;
  }

  .support-author-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}
