/* Account, membership, and settings use the selected app theme. */
.profile-view,
.vip-premium {
  --member-gold: #f1cf92;
  --member-ink: #171615;
  --member-panel: #27221e;
  --member-edge: #514231;
  --member-glow: #ad753b3d;
  --member-tint: #d0a56317;
}

:root[data-theme="light"] :is(.profile-view, .vip-premium) {
  --member-gold: #774618;
  --member-ink: #f8f0e4;
  --member-panel: #fffaf1;
  --member-edge: #dfc9a9;
  --member-glow: #d8a55b45;
  --member-tint: #a9632013;
}

#profile-view { gap: 16px; }
.profile-header { display: grid; gap: 12px; }
.profile-header h1 { font-size: clamp(26px, 7vw, 36px); line-height: 1.15; }
.profile-identity-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.profile-view .vip-avatar { width: 58px; height: 58px; }
.profile-view .vip-identity { min-width: 0; }
.profile-view .vip-identity h2 { font-size: clamp(17px, 5vw, 24px); line-height: 1.22; }
.profile-view .vip-identity :is(h2, p) { overflow-wrap: anywhere; }
.profile-view .vip-identity p { margin-top: 5px; line-height: 1.4; color: var(--muted); }

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(56px, 31%);
  align-items: center;
  gap: 10px;
  padding: clamp(13px, 4vw, 22px);
  border: 1px solid var(--member-edge);
  border-radius: 22px;
  background: radial-gradient(ellipse at 90% 50%, var(--member-glow), transparent 65%),
    linear-gradient(135deg, var(--member-panel), var(--member-ink));
}
.profile-membership-info { display: grid; min-width: 0; gap: 6px; }
.profile-membership-info h2 { font-size: 14px; color: var(--member-gold); }
.profile-membership-info p { line-height: 1.45; overflow-wrap: anywhere; }
#profile-membership #vip-status { font-weight: 750; font-size: clamp(15px, 4vw, 19px); color: var(--text); }
#profile-membership[data-membership="active"] #vip-status { color: var(--member-gold); }
#profile-membership #vip-expiry { font-size: 12px; color: var(--muted); }
.profile-membership-stage { min-width: 0; }
.profile-membership-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.profile-view .profile-membership-actions > button { min-height: 44px; padding: 6px 12px; font-size: 13px; }
.profile-view .profile-membership-actions > :is(.profile-vip-open, .profile-renew) {
  background: var(--member-tint);
  border: 1px solid var(--member-edge);
  color: var(--text);
}
.profile-language, .profile-links {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.profile-language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
}
.profile-language button { min-width: 44px; min-height: 44px; }
.profile-links { overflow: clip; }
.profile-view .profile-link {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--text);
  text-align: start;
  text-decoration: none;
  touch-action: manipulation;
}
.profile-view .profile-link + .profile-link { border-top: 1px solid var(--line); }
.profile-view .profile-link::after {
  content: "";
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
}
.profile-view .profile-link:active { transform: none; background: var(--member-tint); }
.profile-link svg {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 8px;
  color: var(--member-gold);
  background: var(--member-tint);
  border-radius: 11px;
}
.profile-link strong { display: block; font-size: 15px; }
.profile-link span > span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }

@media (hover: hover) {
  .profile-view .profile-link:hover { background: var(--member-tint); }
}
@media (prefers-reduced-motion: no-preference) {
  .profile-revealed { animation: profile-reveal .3s ease-out both; }
}
@keyframes profile-reveal {
  from { opacity: .55; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.vip-dialog {
  width: min(430px, calc(100% - 28px));
  max-height: 82dvh;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
}
.vip-dialog::backdrop { background: var(--scrim); }
.vip-dialog h3 { margin: 0 0 12px; font-size: 20px; }
.vip-dialog p { line-height: 1.4; }
.vip-dialog :is(form, #vip-checkout-content) { display: grid; gap: 8px; }
.vip-dialog button { min-height: 44px; }
.vip-dialog input[type="text"] { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); }
.vip-dialog figure { margin: 0; display: flex; align-items: center; gap: 10px; }
.vip-dialog figure img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
#vip-admin-settings label { display: block; padding: 5px 0; }
#vip-checkout-close { width: 100%; margin-top: 14px; }

.vip-recipient { border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0; }
.vip-recipient figcaption { display: grid; gap: 3px; overflow-wrap: anywhere; min-width: 0; }
.vip-recipient small { color: var(--muted); }
.vip-recipient-avatar { position: relative; flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--panel-2); }
.vip-recipient-avatar img { position: absolute; inset: 0; }
.vip-pay-link { display: grid; place-items: center; min-height: 44px; }
.vip-policy { width: min(650px, calc(100% - 24px)); padding: 0; }
.vip-policy[open] { display: flex; flex-direction: column; overflow: hidden; }
#vip-terms-form { flex: 0 0 auto; padding: 14px 18px; }
.vip-policy-body { overflow: auto; overscroll-behavior: contain; border-block: 1px solid var(--line); padding: 10px 18px 18px; min-height: 0; }
.vip-policy-body h4 { font-size: 15px; margin: 20px 0 5px; }
.vip-policy-body p { margin: 6px 0; line-height: 1.65; }
.vip-policy-body a { color: inherit; text-decoration: underline; }
#vip-terms-form label { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
#vip-terms-form input { flex: 0 0 auto; margin-top: 3px; }
#vip-terms-status:empty { display: none; }

.vip-page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.vip-page-heading h2 { margin: 0; }
.vip-page-heading button { min-height: 44px; }


.vip-paper[open] { transform-origin: center; animation: vip-paper-open .44s cubic-bezier(.2,.75,.3,1) both; }
.vip-paper-section h4 { margin: 12px 0 4px; }
.vip-paper-section ul { margin: 0; padding-inline-start: 18px; line-height: 1.55; }
.vip-paper-section li + li { margin-top: 5px; }
#vip-benefits-close { width: 100%; margin-top: 16px; }
@keyframes vip-paper-open {
  0% { transform: scale(.94); clip-path: inset(48% 0 round 16px); opacity: 0; }
  20% { transform: scale(1); clip-path: inset(43% 0 round 16px); opacity: 1; }
  100% { transform: scale(1); clip-path: inset(0 round 16px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .vip-paper[open] { animation: none; }
}

.vip-dialog.vip-policy { width: min(330px, calc(100% - 28px)); max-height: min(420px, 76dvh); }
.vip-policy-body { font-size: 12px; border-block-start: 0; }
.vip-policy-body h4 { font-size: 12px; }
#vip-terms-form label { font-size: 12px; }
.privacy-screen.privacy-reader {
  padding: calc(16px + var(--safe-top)) max(18px, calc((100vw - 620px) / 2)) calc(20px + var(--safe-bottom));
  font-size: 13px;
  line-height: 1.65;
  scroll-behavior: auto;
}
.privacy-reader h4 { font-size: 13px; margin: 18px 0 5px; }
.privacy-reader p { margin: 8px 0; }
.privacy-reader a { color: inherit; text-decoration: underline; }
.privacy-reader #privacy-close { margin-top: 14px; }

.vip-history-list { padding: 0; margin: 0 0 12px; list-style: none; }
.vip-history-list li { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.vip-history-list span { color: var(--muted); font-size: 13px; }
#vip-history-close, #vip-history-more { width: 100%; margin-top: 6px; }
#vip-source-form { display: grid; gap: 8px; }
#vip-source-form :is(input, select) { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
#vip-source-list > div { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#vip-source-list button { min-height: 40px; margin-inline-end: 8px; }

.vip-premium .vip-plan {
  grid-template-columns: clamp(68px, 24vw, 125px) minmax(0, 1fr);
  gap: clamp(10px, 4vw, 22px);
  padding: clamp(12px, 4vw, 20px);
  border-radius: 22px;
  border-color: var(--member-edge);
  background: radial-gradient(ellipse at 5% 50%, var(--member-glow), transparent 62%), var(--panel);
}
.vip-premium .vip-tier-emblem { filter: drop-shadow(0 5px 12px var(--member-glow)); }
.vip-plan-info { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.vip-premium .vip-plan h3 { font-size: clamp(15px, 4.5vw, 21px); overflow-wrap: anywhere; }
.vip-premium .vip-plan-duration { font-size: 13px; color: var(--muted); margin-top: 2px; }
.vip-price-ticket {
  --ticket-notch: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--member-tint), transparent), var(--member-panel);
  color: var(--text);
  -webkit-mask: radial-gradient(circle at left center, transparent var(--ticket-notch), #000 6px) left / 51% 100% no-repeat,
    radial-gradient(circle at right center, transparent var(--ticket-notch), #000 6px) right / 51% 100% no-repeat;
  mask: radial-gradient(circle at left center, transparent var(--ticket-notch), #000 6px) left / 51% 100% no-repeat,
    radial-gradient(circle at right center, transparent var(--ticket-notch), #000 6px) right / 51% 100% no-repeat;
}
.vip-premium .vip-plan-prices { min-width: 0; justify-items: start; white-space: normal; }
.vip-premium .vip-plan-prices strong { font-size: clamp(15px, 4.5vw, 20px); overflow-wrap: anywhere; }
.vip-premium .vip-plan-prices del { font-size: 12px; color: var(--muted); }
.vip-premium .vip-plan-note {
  border-inline-start: 1px dashed var(--member-edge);
  padding-inline-start: 8px;
  font-size: 12px;
  color: var(--member-gold);
  font-weight: 700;
}
.vip-premium .vip-plan-buy { min-height: 44px; min-width: 72px; padding: 6px 18px; font-size: 14px; }
#vip-benefits-open { justify-self: center; min-height: 44px; padding: 6px 16px; }
#vip-checkout-status:empty { display: none; }
.vip-dialog[data-layout="confirm"] #vip-checkout-content p { margin: 4px 0; }
.vip-dialog[data-layout="confirm"] #vip-checkout-content button:last-child,
.vip-dialog[data-layout="groups"] #vip-checkout-close,
.vip-dialog[data-layout="confirm"] #vip-checkout-close {
  background: transparent; border: 0; box-shadow: none; color: var(--muted); min-height: 38px; width: auto;
}
.vip-group-list { display: grid; gap: 8px; }
.vip-group-list .vip-group-choice { display: flex; align-items: center; gap: 10px; justify-content: flex-start; text-align: left; border-radius: 999px; padding: 6px 10px; min-width: 0; }
.vip-group-choice > span:last-child { overflow-wrap: anywhere; }
.vip-group-choice .vip-recipient-avatar { flex-basis: 34px; height: 34px; }
.vip-group-choice .vip-recipient-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vip-dialog .vip-group-refresh { justify-self: end; background: transparent; border: 0; box-shadow: none; color: var(--muted); padding: 0 4px; min-height: 32px; font-size: 13px; }
.vip-group-toast { z-index: 1; }

.entry-promotion {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: max(14px, var(--safe-top)) var(--gutter-right) max(20px, var(--safe-bottom)) var(--gutter-left);
  border: 0;
  background: transparent;
  color: #fff7e8;
  overflow: auto;
}
.entry-promotion::backdrop { background: #05050bd1; }
.entry-promotion-home::backdrop { background: #08070bb0; backdrop-filter: blur(9px); }
.entry-promotion-stage {
  min-height: 100%;
  display: grid;
  grid-template-rows: minmax(0, .8fr) auto minmax(46px, .48fr) auto minmax(0, .2fr);
  justify-items: center;
  align-items: center;
}
.entry-vip-offer, #entry-poster-link { grid-row: 2; }
.entry-vip-offer {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 430px);
  background: transparent;
  color: inherit;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.entry-vip-art {
  width: 100%;
  position: relative;
  isolation: isolate;
  display: block;
  container-type: inline-size;
}
.entry-vip-art::before, .entry-vip-art::after {
  position: absolute;
  content: "";
  pointer-events: none;
  z-index: -1;
}
.entry-vip-art::before {
  inset: 32% -3% -10%;
  background: radial-gradient(ellipse at 55% 77%, #ffac382e, transparent 67%);
}
.entry-vip-art::after {
  inset: auto 8% -3% 17%;
  height: 16%;
  background: radial-gradient(ellipse, #ffbe4e72 0%, #e1852625 50%, transparent 73%);
  animation: entry-gold-light 3.4s ease-in-out infinite alternate;
}
.entry-vip-art img { display: block; width: 100%; height: auto; }
.entry-vip-ticket {
  position: absolute;
  inset: 3% auto auto 3%;
  width: 44%;
  height: 40%;
  display: grid;
  place-content: center;
  gap: 1px;
  text-align: center;
  transform: rotate(-7deg);
  color: #fff0bc;
  font-weight: 750;
  line-height: 1.08;
  text-shadow: 0 1px 3px #270300;
}
#entry-vip-promo { text-transform: uppercase; font-size: clamp(10px, 3.6cqi, 15px); letter-spacing: .09em; }
#entry-vip-price { font-size: clamp(18px, 7.2cqi, 31px); white-space: nowrap; }
.entry-vip-price-detail { display: flex; justify-content: center; align-items: center; gap: 5px; font-size: clamp(9px, 3.1cqi, 13px); white-space: nowrap; }
.entry-vip-price-detail del { opacity: .9; }
.entry-vip-benefit { font-size: clamp(13px, 3.8vw, 17px); }
.entry-vip-cta { color: #ffc45b; font-size: clamp(17px, 4.6vw, 23px); font-weight: 800; }
.entry-vip-glints { position: absolute; inset: 0; pointer-events: none; }
.entry-vip-glints i {
  --spark-x: 22%; --spark-y: 49%; --spark-delay: .15s;
  position: absolute;
  left: var(--spark-x);
  top: var(--spark-y);
  width: 6%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 11% 49%, #fff9d5, transparent),
    radial-gradient(ellipse 49% 11%, #fff1a6, transparent),
    radial-gradient(circle, #ffb02e99, transparent 60%);
  opacity: 0;
  animation: entry-gold-glint 4.2s var(--spark-delay) ease-in-out infinite;
}
.entry-vip-glints i:nth-child(2) { --spark-x: 85%; --spark-y: 43%; --spark-delay: .8s; }
.entry-vip-glints i:nth-child(3) { --spark-x: 49%; --spark-y: 95%; --spark-delay: 1.65s; }
.entry-vip-glints i:nth-child(4) { --spark-x: 37%; --spark-y: 9%; --spark-delay: 2.3s; }
#entry-poster-link { width: min(100%, 320px, 38dvh); aspect-ratio: 2/3; }
#entry-poster-link img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.entry-promo-close {
  grid-row: 4;
  min-width: 64px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff8eb;
  font-size: 13px;
  font-weight: 500;
}
.entry-promotion[open] :is(.entry-vip-offer, #entry-poster-link):not([hidden]) { animation: entry-promotion-in .32s ease-out both; }
.entry-promotion.is-leaving :is(.entry-vip-offer, #entry-poster-link):not([hidden]) { animation: entry-promotion-out .18s ease-in both; }
.entry-vip-page { margin: auto; }
#entry-vip-page-close { width: 100%; }
#entry-poster-form { align-items: center; margin-block: 12px; }
#entry-poster-select { min-width: 0; max-width: 100%; min-height: 44px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; }
@keyframes entry-promotion-in { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes entry-promotion-out { to { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes entry-gold-light { from { opacity: .48; } to { opacity: 1; } }
@keyframes entry-gold-glint { 0%, 22%, 100% { opacity: 0; } 7% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .entry-promotion[open] :is(.entry-vip-offer, #entry-poster-link):not([hidden]),
  .entry-vip-glints i, .entry-vip-art::after { animation: none; }
}
.entry-promo-close:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }
