:root {
  --pass-red: #E01933;
  --ink: #ffffff;
  --bg: #000000;
  --panel: #1c1c1e;
  --muted: #8e8e93;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}
.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
}
.chrome {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 4px 22px;
}
.chrome .circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 300;
}
/* ---- FLIP RIG ---- */
/* Fixed "poster" width so the pass always lays out identically (no cramped
   wrapping/overflow) — JS scales the whole thing down to fit narrower or
   shorter screens instead of letting its internal layout reflow. */
.flip-scene { width: 398px; margin: 0 auto; perspective: 1600px; }
.flip-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.22,.68,.32,1.02);
  cursor: pointer;
  transform: scale(var(--fit-scale, 1));
  transform-origin: top center;
}
.flip-card.flipped { transform: scale(var(--fit-scale, 1)) rotateY(180deg); }
.face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
}
.face.back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  overflow: hidden;
}

/* ---- FRONT: the pass ---- */
.pass {
  background: var(--pass-red);
  padding: 26px 24px 30px;
  position: relative;
  box-shadow: 0 0 60px rgba(224, 25, 51, 0.35);
}
.pass::before, .pass::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  background: var(--bg); border-radius: 50%;
  top: 172px;
}
.pass::before { left: -7px; }
.pass::after { right: -7px; }
.pass-head { display: flex; justify-content: space-between; align-items: flex-start; }
.airline { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.airline .tri {
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 16px solid #fff;
  transform: translateY(-1px);
  flex-shrink: 0;
}
.airline .name {
  font-size: 16px; font-weight: 800; letter-spacing: 2.5px;
  white-space: nowrap;
}
.airline .alliance {
  font-size: 7.5px; letter-spacing: .5px; opacity: .85;
  border: 1px solid rgba(255,255,255,.7); border-radius: 50%;
  width: 21px; height: 21px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-style: italic;
}
.flightno { text-align: right; line-height: 1.3; flex-shrink: 0; }
.flightno .no { font-size: 16px; font-weight: 800; white-space: nowrap; }
.route {
  margin-top: 26px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
.route .orig, .route .dest { min-width: 0; }
.city-label {
  font-size: 9.5px; letter-spacing: .6px; font-weight: 700;
  margin-bottom: 3px; white-space: nowrap;
}
.code {
  font-size: clamp(34px, 10.5vw, 46px);
  font-weight: 800; letter-spacing: 0; line-height: 1.05;
}
.time {
  font-size: 12.5px; font-weight: 500; margin-top: 4px;
  white-space: nowrap;
}
.route .dest { text-align: right; }
.plane { font-size: 19px; padding: 0 4px; margin-top: 26px; flex-shrink: 0; }
.pax { margin-top: 30px; font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.badges { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  background: #fff; color: var(--pass-red);
  font-size: 12.5px; font-weight: 800; letter-spacing: 1px;
  padding: 7px 13px; border-radius: 8px;
}
.datebar {
  margin-top: 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px;
}
.datebar .lab {
  font-size: 8.5px; letter-spacing: 1.4px; font-weight: 700;
  opacity: .85; margin-bottom: 5px;
}
.datebar .dmain { display: flex; align-items: center; gap: 8px; }
.datebar .dnum {
  font-size: 52px; font-weight: 800; line-height: 1;
  letter-spacing: -2px;
  margin-right: 2px; /* cancel the trailing negative letter-space */
}
.datebar .dstack {
  display: flex; flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  padding-top: 2px;
}
.datebar .dmon { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.datebar .dyr { font-size: 15px; font-weight: 600; opacity: .82; letter-spacing: 1.5px; }
.datebar .ddow {
  font-size: 9.5px; letter-spacing: 2.4px; font-weight: 700;
  margin-top: 7px; opacity: .9;
}
.datebar .right { text-align: right; flex-shrink: 0; }
.datebar .dres {
  font-size: 13px; font-weight: 800; line-height: 1.35;
  letter-spacing: .2px;
}
.precheck {
  margin-top: 24px; text-align: center;
  font-size: 15px; font-weight: 600; font-style: italic;
}
.precheck .check { color: #35C759; font-style: normal; font-weight: 800; }
.sticker-wrap {
  position: relative;
  margin: 14px auto 0; background: #fff;
  border-radius: 16px; padding: 10px; width: fit-content;
}
.couple-sticker { display: block; width: 224px; height: auto; }
/* QR finder-pattern corners — purely decorative now, but keep the sticker
   reading as "this used to be the QR" the way the original styling did */
.qr-corner {
  /* no z-index: positioned elements already paint above static ones, and an
     explicit z-index here makes iOS Safari leak this through a rotated-away
     .face.front onto the back (a known backface-visibility bug) */
  position: absolute;
  width: 26px; height: 26px;
  border: 4px solid var(--pass-red);
  border-radius: 6px;
  pointer-events: none;
}
.qr-corner::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 9px; height: 9px;
  background: var(--pass-red);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.qr-corner.tl { top: 6px; left: 6px; }
.qr-corner.tr { top: 6px; right: 6px; }
.qr-corner.bl { bottom: 6px; left: 6px; }

.sticker-credit {
  margin-top: 8px; text-align: center;
  font-size: 9.5px; letter-spacing: .2px;
  color: rgba(255,255,255,.7);
}
.sticker-credit a {
  color: #fff; text-decoration: underline;
  text-underline-offset: 2px;
}

/* flip affordance */
.flip-hint {
  position: absolute; bottom: 12px; right: 16px;
  font-size: 10.5px; letter-spacing: 1.2px; font-weight: 700;
  opacity: .75; display: flex; align-items: center; gap: 5px;
}

/* ---- BACK: wallet-pass flight details ---- */
.pass-back {
  position: relative;
  height: 100%;
  /* --panel, not --bg: needs contrast against the true-black page behind it
     or the card's silhouette disappears and it stops reading as a tappable card */
  background: var(--panel);
  box-shadow: 0 0 60px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
  padding: 24px 22px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.pb-head .airline .name { font-size: 14px; letter-spacing: 2px; }
.pb-label {
  font-size: 10px; letter-spacing: 1.6px; font-weight: 700;
  color: var(--muted);
}
.pb-callout {
  margin-top: 22px;
  background: rgba(0,0,0,.35);
  border-radius: 16px;
  padding: 18px 18px 20px;
  border: 1px solid rgba(224,25,51,.35);
}
.pb-callout--neutral { border-color: rgba(255,255,255,.14); }
.pb-callout--neutral .pb-callout-title { color: var(--muted); }
.pb-callout-title {
  font-size: 11.5px; letter-spacing: 1.4px; font-weight: 800;
  color: var(--pass-red);
  margin-bottom: 8px;
}
.pb-callout-body { font-size: 13.5px; line-height: 1.55; color: #e3e3e5; }
.pb-callout-body strong { color: #fff; }
.pb-callout-link {
  display: inline-block; margin-top: 12px;
  font-size: 13.5px; font-weight: 700;
  color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.4);
}

/* ---- calendar CTAs ---- */
.actions { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.btn-plan {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); border-radius: 20px;
  padding: 18px 20px;
  text-decoration: none; color: var(--ink);
}
.btn-plan .ico {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.btn-plan .ico-google { background: #fff; }
.btn-plan .ico-apple { background: #3a3a3c; }
.btn-plan .txt { flex: 1; }
.btn-plan .t1 { font-size: 18px; font-weight: 700; }
.btn-plan .t2 { font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.btn-plan:focus-visible, .flip-card:focus-visible { outline: 2px solid #0A84FF; outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .flip-card { transition: none; }
  #intro, #main { transition: none; }
}

/* ---- INTRO: iOS-style lock screen with a Live Activity countdown card ---- */
#intro {
  position: fixed; inset: 0; z-index: 50;
  background: #070707; /* matte black, no gloss */
  transition: opacity .3s ease;
  overflow: hidden;
  touch-action: none; /* we drive the swipe-up gesture ourselves */
  -webkit-user-select: none; user-select: none;
}
#intro.gone { opacity: 0; pointer-events: none; }
.bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%; /* favors the horizon/sunset band over a naive center-crop */
  z-index: 0;
  pointer-events: none;
}
/* dark scrim so the clock/date/Live Activity card stay legible over real footage */
#intro::after {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 40%, rgba(0,0,0,.6) 100%);
  pointer-events: none;
}

.lock {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 18px 24px;
}
.lock-time {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 26px;
  gap: 6px;
}
.lock-date {
  font-family: ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: .3px;
  color: rgba(255,255,255,.92);
}
.lock-clock {
  font-family: ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  font-size: 88px; font-weight: 600; line-height: 1; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

/* ---- Live Activity-style countdown card ---- */
.live-activity {
  display: block; width: 100%; max-width: 380px;
  background: rgba(28,28,30,.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: none; border-radius: 22px;
  padding: 16px 18px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  text-align: left; font-family: inherit; color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.live-activity:focus-visible { outline: 2px solid #0A84FF; outline-offset: 3px; }
.la-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.la-flight { display: flex; align-items: center; gap: 8px; }
.la-flight .tri {
  border-left-width: 7px; border-right-width: 7px; border-bottom-width: 12px;
}
.la-no { font-size: 13px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.la-status { padding: 5px 11px; font-size: 10.5px; }
.la-headline {
  margin-top: 14px;
  font-size: 22px; font-weight: 700; letter-spacing: .2px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.la-caption {
  margin-top: 4px;
  font-size: 13px; color: var(--muted);
}

#main { opacity: 0; transition: opacity .3s ease .05s; }
#main.shown { opacity: 1; }

/* desktop: the lock screen fills a much larger canvas, so scale the clock/
   date/card up to match — reuses the same breakpoint as the video source swap */
@media (min-width: 700px) {
  .lock-date { font-size: 22px; }
  .lock-clock { font-size: 132px; }

  .live-activity { max-width: 520px; padding: 22px 26px 26px; border-radius: 28px; }
  .la-no { font-size: 16px; }
  .la-status { font-size: 13px; padding: 7px 14px; }
  .la-headline { font-size: 30px; }
  .la-caption { font-size: 15px; }
}
