/* JAI'S PHONE — paid layer: offer sheet, episode 02 and archive surfaces.
   Self-contained: Episode 01's stylesheets are never edited. Class names prefixed jai-gate- / jai-e2-. */

/* ---------- offer / sheet ---------- */
.jai-gate-sheet {
  position: fixed;
  inset: 0;
  /* Above everything in-story: the sheet opens over the arrival blackout
     (#jai-arrival-blackout, z-index 300) and must render and receive clicks
     on top of it. Only devtools sits higher. */
  z-index: 2147482000;
  /* The sheet is opened while the story's blackout layer may still exist.
     Make the ownership of pointer input explicit instead of relying on the
     default hit-testing behavior of an absolutely positioned container. */
  pointer-events: auto;
  touch-action: manipulation;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
}
.jai-gate-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  pointer-events: auto;
}
.jai-gate-card {
  position: absolute;
  inset: auto 0 0;
  left: 50%;
  width: min(100%, 430px);
  transform: translateX(-50%);
  max-height: 92%;
  overflow-y: auto;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #15172a, #0d0e17 60%);
  color: #f4f5fb;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.1);
  animation: jai-gate-up 0.34s cubic-bezier(0.22, 0.9, 0.24, 1);
  pointer-events: auto;
  touch-action: manipulation;
}
@keyframes jai-gate-up {
  from {
    transform: translate(-50%, 14%);
    opacity: 0.4;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}
.jai-gate-grabber {
  display: block;
  width: 38px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.26);
}
.jai-gate-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e9eaf3;
  display: grid;
  place-items: center;
}
.jai-gate-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.jai-gate-head {
  padding-right: 34px;
}
.jai-gate-kicker {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #8d93b8;
}
.jai-gate-head h2 {
  margin: 6px 0 4px;
  font-size: 21px;
  letter-spacing: -0.3px;
}
.jai-gate-head p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #a7adcd;
}
.jai-gate-tiers {
  display: grid;
  gap: 9px;
}
.jai-gate-tier {
  position: relative;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
}
/* Featured keeps a subtle tint only — the blue ring belongs to is-selected
   alone, so the selection is unambiguous when it moves. */
.jai-gate-tier.is-featured {
  background: linear-gradient(160deg, rgba(48, 120, 190, 0.22), rgba(20, 24, 40, 0.12));
}
.jai-gate-tier.is-selected {
  border-color: #7fd4ff;
  box-shadow: 0 0 0 1px #7fd4ff;
}
.jai-gate-tier.is-selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #7fd4ff;
}
.jai-gate-tier.is-owned {
  opacity: 0.55;
}
.jai-gate-tier-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.jai-gate-tier strong {
  font-size: 15px;
}
.jai-gate-price {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.jai-gate-tier p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #b9bfdd;
}
.jai-gate-tier .jai-gate-sub {
  color: #8f96ba;
}
.jai-gate-buy {
  width: 100%;
  margin: 2px 0 12px;
  padding: 13px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(120deg, #2b7fd8, #1d4f77);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.jai-gate-field {
  display: block;
  margin: 16px 0 8px;
}
.jai-gate-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9aa1c4;
}
.jai-gate-field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 15px;
}
.jai-gate-field.is-error span {
  color: #ff9aa4;
}
.jai-gate-field.is-error input {
  border-color: #ff6f80;
}
.jai-gate-fine {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #7d84a8;
}
.jai-gate-refund-note {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(241, 139, 169, 0.3);
  border-radius: 10px;
  color: #f4dce5;
  background: rgba(241, 139, 169, 0.1);
  font-size: 12px;
}
.jai-gate-link {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #cfd6f5;
  font-size: 13px;
}
.jai-gate-archive {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.jai-gate-archive h3 {
  margin: 0 0 6px;
  color: #f4f5fb;
  font-size: 15px;
}
.jai-gate-archive .jai-gate-link + .jai-gate-link {
  margin-top: 6px;
}
.jai-gate-archive .jai-gate-link:disabled {
  cursor: wait;
  opacity: 0.55;
}
/* ---------- home entry ---------- */
#jai-gate-pill {
  position: absolute;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  z-index: 45;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 16, 28, 0.82);
  color: #eaf3ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
#jai-gate-pill.is-locked {
  background: linear-gradient(120deg, #1d4f77, #2b2f57);
}
#jai-gate-mine {
  position: absolute;
  left: 14px;
  bottom: 84px;
  z-index: 45;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(14, 16, 28, 0.7);
  color: #cfe8ff;
  font-size: 14px;
}

/* ---------- episode 02 surfaces ---------- */
.jai-e2-blackout {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: #000;
  animation: jai-e2-fade 0.5s ease both;
}
.jai-e2-title {
  position: absolute;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  background: #000;
  color: #f2f4ff;
  font-size: 17px;
  letter-spacing: 0.4px;
  animation: jai-e2-fade 0.7s ease both;
}
@keyframes jai-e2-fade {
  from {
    opacity: 0;
  }
}
.jai-e2-incoming {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 34px 20px;
  background: linear-gradient(180deg, #14161f 0%, #05060a 100%);
  color: #fff;
  text-align: center;
}
.jai-e2-incoming h2 {
  margin: 10px 0 0;
  font-size: 26px;
  font-weight: 600;
}
.jai-e2-incoming p {
  margin: 2px 0 26px;
  font-size: 13px;
  color: #a9afc9;
}
.jai-e2-actions {
  display: flex;
  gap: 46px;
}
.jai-e2-actions button {
  width: 64px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 11px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.jai-e2-actions span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.jai-e2-actions svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.jai-e2-decline span {
  background: #ff3b30;
}
.jai-e2-answer span {
  background: #30d158;
}
.jai-e2-end {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 40px;
  z-index: 96;
  padding: 18px;
  border-radius: 20px;
  background: rgba(12, 14, 26, 0.94);
  color: #eef1ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.jai-e2-end-kicker {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #8d93b8;
}
.jai-e2-end strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 20px;
}
.jai-e2-end p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #a7adcd;
}
.jai-e2-end button {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #eaf0ff;
  font-size: 13px;
}
.jai-e2-ask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 96px;
  z-index: 60;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #7fd4ff;
  animation: jai-e2-fade 0.5s ease both;
}
