/* Member purchase artwork and controls are scoped to the native H5 auxiliary host. */
#secondary-host .secondary-overlay:has(.membership-dialog) {
  align-items: center;
  justify-content: center;
  padding: max(14px, var(--secondary-safe-top)) 16px max(14px, var(--secondary-safe-bottom));
  background: rgba(8, 5, 3, .78);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
#secondary-host .membership-dialog {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 400px;
  max-height: min(650px, calc(100dvh - 28px - var(--secondary-safe-top) - var(--secondary-safe-bottom)));
  border: 1.2px solid #edbd67;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 8, 4, .04) 0%, rgba(15, 8, 4, .04) 30%, rgba(13, 8, 5, .55) 49%, rgba(12, 8, 5, .86) 70%, rgba(14, 9, 5, .87) 100%), url('assets/membership/portrait.jpg') center top / cover no-repeat, #110b08;
  box-shadow: 0 0 0 1px rgba(255, 225, 155, .1) inset, 0 12px 36px rgba(0, 0, 0, .65), 0 0 22px rgba(238, 174, 63, .13);
  overflow: hidden;
  color: #fff8ed;
}
#secondary-host .membership-dialog:not(.player-paywall-dialog) { animation: membership-sway 6s ease-in-out var(--membership-sway-delay, 0ms) infinite; }
#secondary-host .membership-dialog.is-entering:not(.player-paywall-dialog) { animation: membership-pop 520ms cubic-bezier(.2,.8,.25,1) var(--membership-entry-delay, 0ms) both, membership-sway 6s ease-in-out var(--membership-sway-delay, 0ms) infinite; }
#secondary-host .secondary-overlay:has(.membership-dialog.is-entering:not(.player-paywall-dialog)) { animation-delay: var(--membership-entry-delay, 0ms); }
#secondary-host .membership-dialog::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 70% 20% at 0% 53%, rgba(255, 171, 40, .25), transparent 72%), radial-gradient(ellipse 80% 17% at 95% 80%, rgba(232, 144, 31, .18), transparent 75%);
  pointer-events: none;
}
#secondary-host .membership-header { position: absolute; z-index: 3; inset: 10px 10px auto auto; }
#secondary-host .membership-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
#secondary-host .membership-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 247, 220, .42);
  border-radius: 50%;
  background: rgba(8, 6, 5, .2);
  box-shadow: none;
  cursor: pointer;
}
#secondary-host .membership-close img { width: 18px; height: 18px; filter: brightness(0) invert(1); }
#secondary-host .membership-close:focus-visible { outline: none; border-color: #f8be64; box-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
#secondary-host .membership-dialog .secondary-sheet-body {
  display: block;
  min-height: 0;
  padding: 185px 17px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
#secondary-host .membership-dialog .secondary-sheet-body::-webkit-scrollbar { display: none; }
#secondary-host .membership-hero { display: none; }
#secondary-host .membership-intro { text-align: center; text-shadow: 0 2px 12px #160b05, 0 1px 2px #160b05; }
#secondary-host .membership-intro h2 {
  color: #f6d481;
  font-family: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif;
  font-size: clamp(30px, 9.3vw, 41px);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -.035em;
}
#secondary-host .membership-intro p {
  margin-top: 6px;
  color: #eadfce;
  font-family: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif;
  font-size: clamp(14px, 4.2vw, 18px);
  font-weight: 300;
  line-height: 1.3;
  text-shadow: 0 1px 3px #160b05;
}
#secondary-host .membership-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 23px 0 24px; }
#secondary-host .membership-perk { display: flex; align-items: center; gap: 7px; min-width: 0; color: #eadfce; font-family: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif; font-size: 12px; font-weight: 300; line-height: 1.3; text-shadow: 0 1px 2px #130805; }
#secondary-host .membership-perk + .membership-perk { border-inline-start: 1px solid rgba(231, 187, 104, .39); padding-inline-start: 7px; }
#secondary-host .membership-perk-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid #f8d887; border-radius: 50%; background: rgba(10, 7, 5, .77); box-shadow: inset 0 0 0 1px rgba(239, 179, 69, .18); }
#secondary-host .membership-perk-icon img { width: 19px; height: 19px; filter: brightness(0) saturate(100%) invert(86%) sepia(31%) saturate(577%) hue-rotate(344deg) brightness(101%) contrast(96%); }
#secondary-host .membership-selection { min-height: 0; }
#secondary-host .membership-plans { display: grid; gap: 16px; }
#secondary-host .membership-plan {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  width: 100%;
  min-height: 90px;
  padding: 16px 15px;
  border: 1px solid rgba(226, 184, 107, .5);
  border-radius: 13px;
  background: linear-gradient(120deg, rgba(32, 24, 18, .87), rgba(18, 13, 10, .82));
  color: white;
  text-align: start;
  box-shadow: inset 0 0 16px rgba(255, 214, 147, .04);
  cursor: pointer;
}
#secondary-host .membership-plan.selected {
  border: 1.5px solid #ffe1a0;
  background: linear-gradient(120deg, rgba(66, 38, 16, .92), rgba(27, 17, 9, .91));
  box-shadow: 0 0 0 1px rgba(255, 185, 63, .62), 0 0 11px 2px rgba(255, 157, 45, .75), inset 0 0 14px rgba(255, 188, 74, .15);
}
#secondary-host .membership-dialog:not(.player-paywall-dialog) .membership-plan.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 224, 151, .05) 44%, rgba(255, 238, 183, .32) 50%, rgba(255, 224, 151, .05) 56%, transparent 65%);
  background-size: 260% 100%;
  pointer-events: none;
  animation: membership-gold-sweep 4.8s ease-in-out infinite;
}
#secondary-host .membership-plan-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
#secondary-host .membership-plan-main > strong { min-width: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: 750; line-height: 1.3; }
#secondary-host .membership-plan .secondary-money { flex: none; gap: 4px; color: #f8d684; white-space: nowrap; }
#secondary-host .membership-plan .secondary-money bdi { font-size: 23px; font-weight: 750; }
#secondary-host .membership-plan .secondary-money small { color: #fae8bd; font-size: 10px; }
#secondary-host .membership-plan > small { color: #c3b9b0; font-size: 12px; line-height: 1.2; }
#secondary-host .membership-recommend { position: absolute; bottom: calc(100% - 2px); inset-inline-start: 4px; display: inline-flex; align-items: center; gap: 6px; min-height: 21px; padding: 1px 12px; border: 1px solid #ffe59c; border-radius: 8px 8px 4px 4px; background: linear-gradient(110deg, #ffde81, #efad36); box-shadow: 0 2px 8px rgba(255, 185, 55, .45); color: #140f08; font-size: 10px; font-weight: 800; line-height: 1; }
#secondary-host .membership-recommend img { width: 13px; height: 13px; }
#secondary-host .membership-plan:has(.membership-recommend) { margin-top: 7px; }
#secondary-host .membership-dialog .secondary-sheet-actions { position: relative; z-index: 1; flex: none; display: block; padding: 14px 17px 18px; border: 0; background: transparent; }
#secondary-host .membership-review { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 8px 52px; border: 1px solid #fff0b9; border-radius: 14px; background: linear-gradient(110deg, #f8c357 0%, #ffe086 52%, #eaaa3a 100%); color: #130e08; box-shadow: inset 0 2px 2px rgba(255, 255, 224, .65), 0 0 15px rgba(246, 179, 53, .35); font-size: 18px; font-weight: 780; line-height: 1.25; cursor: pointer; }
#secondary-host .membership-review-arrow { position: absolute; inset-inline-end: 8px; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255, 240, 180, .8); border-radius: 50%; background: rgba(229, 156, 39, .19); }
#secondary-host .membership-review-arrow img { width: 20px; height: 20px; }
#secondary-host [dir='rtl'] .membership-review-arrow img { transform: scaleX(-1); }
#secondary-host [dir='rtl'] .membership-intro h2, #secondary-host [dir='rtl'] .membership-intro p, #secondary-host [dir='rtl'] .membership-perk { font-family: Tahoma, Arial, sans-serif; letter-spacing: 0; }
#secondary-host [dir='rtl'] .membership-intro p, #secondary-host [dir='rtl'] .membership-perk { font-weight: 400; }
#secondary-host .membership-dialog .secondary-state { background: rgba(16, 11, 7, .86); }
#secondary-host .membership-empty { padding: 13px; border: 1px solid rgba(226, 184, 107, .5); border-radius: 12px; background: rgba(18, 12, 7, .87); }
@media (max-width: 350px) {
  #secondary-host .membership-dialog .secondary-sheet-body { padding-top: 155px; }
  #secondary-host .membership-perks { gap: 3px; margin: 16px 0; }
  #secondary-host .membership-perk { gap: 4px; font-size: 9px; }
  #secondary-host .membership-perk + .membership-perk { padding-inline-start: 4px; }
  #secondary-host .membership-perk-icon { width: 28px; height: 28px; }
  #secondary-host .membership-perk-icon img { width: 16px; height: 16px; }
  #secondary-host .membership-plan-main > strong { font-size: 14px; }
  #secondary-host .membership-plan .secondary-money bdi { font-size: 20px; }
}
@media (max-height: 680px) {
  #secondary-host .membership-dialog .secondary-sheet-body { padding-top: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  #secondary-host .membership-dialog,
  #secondary-host .membership-dialog.is-entering:not(.player-paywall-dialog),
  #secondary-host .membership-dialog:not(.player-paywall-dialog) .membership-plan.selected::after { animation: none; }
  #secondary-host .membership-dialog.is-entering:not(.player-paywall-dialog) { scale: 1; opacity: 1; }
}
@keyframes membership-pop { 0% { opacity: 0; scale: .78; } 62% { opacity: 1; scale: 1.035; } 82% { scale: .985; } 100% { opacity: 1; scale: 1; } }
@keyframes membership-sway { 0%, 55%, 83%, 100% { rotate: 0deg; } 62% { rotate: .65deg; } 69% { rotate: -.5deg; } 76% { rotate: .25deg; } }
@keyframes membership-gold-sweep { 0%, 16% { background-position: 125% 0; opacity: 0; } 19% { opacity: 1; } 43% { background-position: -125% 0; opacity: 1; } 48%, 100% { background-position: -125% 0; opacity: 0; } }

/* The same membership artwork becomes the player's attached bottom sheet. */
#secondary-host .secondary-overlay:has(.player-paywall-dialog) {
  align-items: flex-end;
  padding: 0;
  background: rgba(8, 5, 3, .43);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
#secondary-host .membership-dialog.player-paywall-dialog {
  width: 100%;
  max-width: none;
  height: min(55dvh, 510px);
  max-height: none;
  border: 0;
  border-top: 1.2px solid #edbd67;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 44px rgba(0, 0, 0, .68);
}
#secondary-host .membership-dialog.player-paywall-dialog.is-entering { animation: player-membership-rise 420ms cubic-bezier(.2,.8,.2,1) var(--player-paywall-entry-delay, 0ms) both; }
#secondary-host .player-paywall-dialog .secondary-sheet-body { padding-top: clamp(130px, 16dvh, 145px); padding-bottom: 0; overflow-y: auto; overflow-x: hidden; }
#secondary-host .player-paywall-dialog .membership-intro h2 { font-size: clamp(29px, 8vw, 38px); }
#secondary-host .player-paywall-dialog .membership-perks { margin: 16px 0 21px; }
#secondary-host .player-paywall-dialog .membership-plans { gap: 20px; }
#secondary-host .player-paywall-dialog .secondary-sheet-actions { padding-bottom: calc(15px + var(--secondary-safe-bottom)); }
@media (max-width: 350px), (max-height: 690px) {
  #secondary-host .player-paywall-dialog .secondary-sheet-body { padding-top: 130px; }
  #secondary-host .player-paywall-dialog .membership-perks { margin: 12px 0 16px; }
  #secondary-host .player-paywall-dialog .membership-plans { gap: 18px; }
}
@media (max-width: 350px) {
  #secondary-host .membership-dialog.player-paywall-dialog { height: 62dvh; }
  #secondary-host .player-paywall-dialog .secondary-sheet-body { padding-top: 115px; }
}
@media (max-height: 690px) {
  #secondary-host .membership-dialog.player-paywall-dialog { height: 70dvh; }
  #secondary-host .player-paywall-dialog .secondary-sheet-body { padding-top: 80px; }
  #secondary-host .player-paywall-dialog .membership-intro h2 { font-size: 31px; }
  #secondary-host .player-paywall-dialog .membership-perks { margin: 8px 0 12px; }
  #secondary-host .player-paywall-dialog .membership-plans { gap: 12px; }
  #secondary-host .player-paywall-dialog .secondary-sheet-actions { padding-top: 10px; padding-bottom: calc(10px + var(--secondary-safe-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #secondary-host .membership-dialog.player-paywall-dialog.is-entering { animation: none; }
}
@keyframes player-membership-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
