:root {
  --paper: #F7F8FA;
  --ink: #0B0D17;
  --surface: #121422;
  --surface-2: #181B2D;
  --line: rgba(247, 248, 250, 0.09);
  --line-strong: rgba(247, 248, 250, 0.16);
  --muted: rgba(247, 248, 250, 0.64);
  --faint: rgba(247, 248, 250, 0.42);
  --indigo: #4540DA;
  --blue: #3157FF;
  --grad: linear-gradient(135deg, #4540DA 0%, #3157FF 100%);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 6px 0 10px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #8FA3FF; }
.muted { color: var(--muted); margin: 0 0 18px; }
.fine { color: var(--faint); font-size: 13px; margin: 14px 0 0; }
.error { color: #FF9AA8; font-size: 14px; margin: 12px 0 0; }

.screen { min-height: 100svh; }
#gate, #lobby, #notice { display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); position: relative; overflow: hidden; }
.panel.narrow { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.panel.center { text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; padding: 14px 20px; font-weight: 700; font-size: 16px; min-height: 52px; transition: transform .12s ease, opacity .2s ease, box-shadow .2s ease; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(49, 87, 255, .7); }
.btn.big { width: 100%; min-height: 58px; font-size: 17px; margin-top: 22px; }
.btn.ghost { background: transparent; border: 1px solid var(--line-strong); }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: default; }

/* Gate */
#gate-form { display: grid; gap: 12px; margin-top: 8px; }
#gate-form input { width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--paper); padding: 0 16px; font: inherit; }
#gate-form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Lobby */
.lobby-glow { position: absolute; inset: -30% -40% auto; height: 70%; background: radial-gradient(closest-side, rgba(69, 64, 218, .45), transparent 70%); filter: blur(10px); animation: drift 12s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.lobby-panel { text-align: left; }
.countdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
.countdown div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 8px 12px; text-align: center; }
.countdown span { display: block; font-size: clamp(34px, 11vw, 46px); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown small { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.when { margin: 0; color: var(--muted); font-size: 14px; }
#enter.ready { background: var(--surface-2); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Stage */
#stage { display: flex; flex-direction: column; height: 100svh; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; letter-spacing: .01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(49, 87, 255, .18); }
.session { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.session svg { width: 15px; height: 15px; }

.stage-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.theatre { flex: none; display: flex; flex-direction: column; }
.frame {
  position: relative; background: #000; margin: 0 auto; width: 100%;
  /* Portrait masters stay legible but leave room for chat on a phone. */
  height: min(44svh, calc(100vw * 16 / 9));
  max-height: 44svh;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.shield { position: absolute; inset: 0; z-index: 1; -webkit-touch-callout: none; touch-action: manipulation; }
.captions { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 2; display: flex; justify-content: center; pointer-events: none; }
.captions span { max-width: 92%; background: rgba(11, 13, 23, .82); color: #fff; font-weight: 600; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.35; padding: 6px 12px; border-radius: 10px; text-align: center; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.captions span:empty { display: none; }
.frame-tools { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(11, 13, 23, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.unmute { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 22px; background: var(--paper); color: var(--ink); font-weight: 800; box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(247, 248, 250, .12), 0 16px 40px -12px rgba(0,0,0,.7); } }
.overlay { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cue cards sit below the picture, never over it, so captions and the buy
   button cannot collide. */
.cue-slot { padding: 0 12px; }
.cue-slot:empty { display: none; }
.cue { margin-top: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: 36px 1fr; gap: 4px 12px; align-items: start; animation: rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.cue .icon { grid-row: span 2; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(69, 64, 218, .2); color: #A9B6FF; }
.cue .kind { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8FA3FF; }
.cue .text { font-weight: 600; font-size: 15px; line-height: 1.4; }
.cue .actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cue .actions a, .cue .actions button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line-strong); background: transparent; font-size: 14px; font-weight: 600; color: var(--paper); }
.cue .actions button.chosen { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cue.offer { background: linear-gradient(160deg, rgba(69, 64, 218, .32), rgba(49, 87, 255, .12)), var(--surface); border-color: rgba(49, 87, 255, .5); grid-template-columns: 1fr; }
.cue.offer .icon { display: none; }
.cue.offer .text { font-size: 17px; font-weight: 700; }
.cue.offer .actions { grid-column: 1; }
.buy { width: 100%; justify-content: center; min-height: 52px; border: 0 !important; background: var(--grad) !important; color: #fff !important; font-size: 16px !important; font-weight: 800 !important; border-radius: 14px !important; box-shadow: 0 10px 30px -10px rgba(49, 87, 255, .8); }
.buy[aria-disabled="true"] { opacity: .5; box-shadow: none; }

/* After its moment the offer stays as a slim bar so chat keeps its room. */
.cue.offer.compact { grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; animation: none; }
.cue.offer.compact .kind { display: none; }
.cue.offer.compact .text { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cue.offer.compact .actions { grid-column: 2; margin: 0; }
.cue.offer.compact .buy { width: auto; min-height: 42px; padding: 0 16px !important; font-size: 14px !important; white-space: nowrap; }

/* Chat */
.talk { flex: 1; min-height: 190px; display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); background: var(--ink); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 12px 0; gap: 6px; }
.tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 10px 8px; border-radius: 12px 12px 0 0; font-weight: 700; font-size: 14px; color: var(--faint); border-bottom: 2px solid transparent; }
.tabs button svg { width: 14px; height: 14px; }
.tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--blue); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.feed.private { background: linear-gradient(180deg, rgba(69, 64, 218, .08), transparent 40%); }
.private-intro { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.private-intro svg { width: 15px; height: 15px; }
.empty { margin: auto; text-align: center; color: var(--faint); font-size: 14px; padding: 20px; }
.msg { max-width: 88%; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--faint); margin: 0 0 3px 2px; }
.msg .body { background: var(--surface); border: 1px solid var(--line); padding: 9px 12px; border-radius: 14px 14px 14px 4px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; }
.msg.mine .who { text-align: right; margin-right: 2px; }
.msg.mine .body { background: var(--surface-2); border-radius: 14px 14px 4px 14px; }
.msg.host .body { background: var(--grad); border: 0; color: #fff; }
.msg.host .who { color: #A9B6FF; }
.msg.pinned .body { box-shadow: 0 0 0 1px rgba(49, 87, 255, .6); }
.msg .status { font-size: 11px; color: var(--faint); margin: 3px 2px 0; text-align: right; }

.composer { padding: 8px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--ink); }
.mode-note { margin: 0 2px 8px; font-size: 12px; color: var(--faint); }
.mode-note:empty { display: none; }
.compose-row { display: flex; gap: 8px; align-items: center; }
.compose-row input[type="text"] { flex: 1; min-width: 0; min-height: 46px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--paper); padding: 0 14px; font: inherit; font-size: 16px; }
.compose-row input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.send { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; }
.private-toggle { display: inline-flex; }
.private-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.private-toggle span { display: inline-flex; align-items: center; gap: 5px; min-height: 46px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.private-toggle span svg { width: 14px; height: 14px; }
.private-toggle input:checked + span { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.private-toggle input:focus-visible + span { outline: 2px solid var(--blue); }

/* Notice */
.notice-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: #A9B6FF; }
.notice-icon svg { width: 28px; height: 28px; }

/* Connection banner */
.conn { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 20; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: rgba(18, 20, 34, .94); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0,0,0,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.conn svg { width: 16px; height: 16px; }
.conn.reconnecting svg { animation: spin 1.2s linear infinite; }

/* Wider screens: picture left, conversation right. */
/* ------------------------------------------------------------ checkout */
/* Read by the ClickFunnels SDK from the document root when the card fields
   mount. Payments AI honors only the text-level ones. */
:root {
  --cfsdk-checkout-color-scheme: dark;
  --cfsdk-checkout-color-primary: #3157FF;
  --cfsdk-checkout-color-text: #F7F8FA;
  --cfsdk-checkout-color-danger: #FF9AA8;
  --cfsdk-checkout-color-placeholder: rgba(247, 248, 250, .42);
  --cfsdk-checkout-color-background: #121422;
  --cfsdk-checkout-color-border: rgba(247, 248, 250, .16);
  --cfsdk-checkout-border-radius: 14px;
  --cfsdk-checkout-font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --cfsdk-checkout-font-size: 16px;
}
.buy.done { background: rgba(247, 248, 250, .08) !important; box-shadow: none; border: 1px solid var(--line-strong) !important; }
.sheet { position: fixed; inset: 0; z-index: 40; visibility: hidden; pointer-events: none; }
.sheet.open { visibility: visible; pointer-events: auto; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(5, 6, 12, .6); opacity: 0; transition: opacity .25s ease; }
.sheet.open .sheet-scrim { opacity: 1; }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88svh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--ink); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(18px + var(--safe-b)); transform: translateY(104%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -24px 60px -20px rgba(49, 87, 255, .35); }
.sheet.open .sheet-card { transform: none; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.sheet-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; display: grid; place-items: center; flex: none; }
.summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 14px 0 6px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(69, 64, 218, .28), rgba(49, 87, 255, .1)), var(--surface); border: 1px solid rgba(49, 87, 255, .45); }
.summary span { color: var(--muted); font-size: 14px; font-weight: 600; }
.summary strong { font-size: 22px; font-weight: 800; }
.checkout-form label, .checkout-form h3 { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.checkout-form h3 { margin-top: 18px; font-size: 14px; color: var(--paper); }
.checkout-form input:not([type="checkbox"]), .checkout-form select { width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--paper); padding: 0 14px; font: inherit; font-size: 16px; }
.checkout-form input:focus, .checkout-form select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkout-errors { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 154, 168, .1); border: 1px solid rgba(255, 154, 168, .4); color: #FFC2CB; font-size: 14px; }
.secure { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; margin: 12px 0 0; text-align: center; }
.secure svg { width: 15px; height: 15px; }
/* Address blocks show only while the cart or gateway needs them. */
#shipping-section, #billing-section { display: none; }
#shipping-section:has([data-cf-element="shipping"] *):not(:has([data-cf-element="shipping"][hidden])) { display: block; }
#billing-section:has([data-cf-element="billing"] *):not(:has([data-cf-element="billing"][hidden])) { display: block; }
/* Payments AI card fields: drop FramePay's own box, draw ours. */
.cf-sdk-card-field .rebilly-framepay.rebilly-input { border: 0; background: transparent; box-shadow: none; padding: 0; }
/* The FramePay frames are light documents. Inside this dark page the browser
   would paint an opaque white backdrop behind them; matching the scheme on
   the wrapper keeps them transparent. */
.cf-sdk-card-field { color-scheme: light; }
.cf-sdk-card-field { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); padding: 6px 14px; min-height: 48px; margin-bottom: 10px; }
.cf-sdk-card-field:has(.rebilly-framepay-focus) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.cf-sdk-card-field:has(.rebilly-framepay-invalid) { border-color: #FF9AA8; }
a.btn { text-decoration: none; }
.thanks { min-height: 100svh; display: grid; place-items: center; padding: 24px 20px calc(24px + var(--safe-b)); }
.thanks .checkout-done { width: 100%; max-width: 420px; }
.checkout-done { text-align: center; padding: 18px 4px 4px; }
.checkout-done h2 { margin: 12px 0 6px; font-size: 24px; font-weight: 800; }
.done-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.done-icon svg { width: 26px; height: 26px; }

@media (min-width: 900px) {
  .sheet-card { left: auto; top: 0; width: 440px; max-height: none; border-radius: 0; border-bottom: 1px solid var(--line-strong); border-right: 0; transform: translateX(104%); padding-top: 18px; }
  .sheet-grab { display: none; }
  .stage-grid { flex-direction: row; padding: 16px; gap: 16px; }
  .theatre { flex: 1; min-width: 0; }
  .frame { height: calc(100svh - 230px); max-height: none; border-radius: var(--radius); overflow: hidden; }
  .cue-slot { padding: 0; }
  .talk { flex: none; width: 380px; margin-top: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
