/* Results screen (results/screen.js). Shares the palette and base pieces (.q-head, .cta, .lockup) with styles.css. */
  .r-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding-block: 14px 6px; }
  .r-title { text-align: center; display: grid; gap: 4px; }
  .r-title h1 { font-size: clamp(24px, 3vw, 40px); line-height: 1.2; font-weight: 800; outline: none; }
  .r-title p { color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); }
  .r-stage { position: relative; width: 100%; max-width: 1120px; min-height: 360px; }

  /* the visitor's vacation DNA (client spec: style %) */
  .dna { display: grid; gap: 6px; justify-items: center; min-height: 58px; opacity: 0; transition: opacity .5s ease; }
  .dna.in { opacity: 1; }
  .dna-t { font-size: 14px; color: var(--gold); font-weight: 700; }
  .dna-row { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); gap: 10px; width: 100%; justify-content: center; }
  .dna-ax { display: grid; gap: 4px; font-size: 13px; color: var(--muted); text-align: center; }
  .dna-ax b { color: var(--white); font-size: 16px; font-weight: 800; }
  .dna-ax i { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
  .dna-ax s { display: block; height: 100%; width: 0; background: var(--peach); border-radius: 3px; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
  .dna-x { font-size: 12px; color: var(--peach); }
  /* a card opens big in the middle, then flies to its place */
  .spot { position: fixed; inset: 0; z-index: 25; background: rgba(7,24,80,0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background .38s ease, backdrop-filter .38s ease, -webkit-backdrop-filter .38s ease; }
  .spot.on { background: rgba(7,24,80,.68); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  #row > .held { visibility: hidden; }
  #row > .pass, #row > .flip { opacity: 1; transform: none; animation: none; }
  .spot-card { transform-origin: center center; z-index: 26; will-change: transform; }
  .spot-card.flip { opacity: 1; }
  /* the compass working it out */
  .r-scan { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
            color: var(--gold); transition: opacity .45s ease, visibility .45s; }
  .r-scan.done { opacity: 0; visibility: hidden; }
  .r-scan .mini-compass { width: 120px; height: 120px; animation: spin 4.6s cubic-bezier(.45,-0.2,.3,1.3) both; }
  @keyframes spin { 0% { transform: rotate(0); } 20% { transform: rotate(320deg); } 38% { transform: rotate(140deg); } 56% { transform: rotate(410deg); } 74% { transform: rotate(250deg); } 88% { transform: rotate(345deg); } 100% { transform: rotate(315deg); } }
  .r-scan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--white); font-size: 17px; }
  .r-scan li { display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(6px); transition: all .3s ease; }
  .r-scan li.on { opacity: 1; transform: none; }
  .r-scan li .check { width: 22px; height: 22px; }

  /* three passes side by side; on a phone they sit in one row you swipe through */
  .r-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
  @media (max-width: 860px) {
    .r-row { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding: 6px 16px 10px; }
    .r-row::-webkit-scrollbar { display: none; }
    .r-row > * { flex: 0 0 84%; scroll-snap-align: center; }
  }
  .r-dots { display: none; justify-content: center; gap: 8px; margin-top: 2px; }
  .r-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); transition: all .3s; }
  .r-dots i.on { width: 22px; border-radius: 4px; background: var(--peach); }
  @media (max-width: 860px) { .r-dots { display: flex; } }
  .r-dots:not(.ready) { visibility: hidden; }

  .pass { position: relative; display: flex; flex-direction: column; background: var(--white); color: var(--ink); border-radius: 20px; overflow: hidden;
          box-shadow: 0 14px 34px rgba(7,34,75,.3); opacity: 0; transform: translateY(46px) rotate(-2deg) scale(.95); }
  .pass.in { animation: deal .7s cubic-bezier(.2,1.3,.4,1) forwards; }
  @keyframes deal { to { opacity: 1; transform: none; } }
  .band { position: relative; height: 70px; flex: none; overflow: hidden; }
  .band svg.art { position: absolute; inset: 0; width: 100%; height: 100%; }
  .band .label { position: absolute; top: 10px; right: 12px; z-index: 1; background: var(--navy); color: var(--white); font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 999px; }
  .pass.top .band .label { background: var(--peach); color: var(--navy); }
  .band .code { position: absolute; bottom: 7px; right: 14px; z-index: 1; display: flex; align-items: center; gap: 5px; direction: ltr; font-size: 12px; font-weight: 800; color: #fff; }
  .p-body { padding: 12px 16px 8px; display: grid; gap: 6px; flex: 1; align-content: start; }
  .p-body h2 { font-size: 21px; line-height: 1.15; font-weight: 800; }
  .p-body .tag { color: #44527A; font-size: 14px; }
  .p-body .lead { font-size: 14px; line-height: 1.45; }
  .p-body ul { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
  .p-body li { position: relative; padding-inline-start: 24px; font-size: 14px; line-height: 1.4; opacity: 0; transition: opacity .35s ease; }
  .p-body li.on { opacity: 1; }
  .p-body li .check { position: absolute; right: 0; top: 1px; width: 17px; height: 17px; }
  .perf { position: relative; height: 16px; flex: none; }
  .perf::before { content: ''; position: absolute; left: 16px; right: 16px; top: 50%; border-top: 2px dashed #DCE4FA; }
  .perf::after, .perf b { content: ''; position: absolute; top: 0; width: 16px; height: 16px; border-radius: 50%; background: #2350E0; }
  .perf::after { left: -8px; } .perf b { right: -8px; }
  .stub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 2px 14px 12px; flex: none; }
  .stub div { background: #F2F5FF; border-radius: 10px; padding: 6px 4px; text-align: center; }
  .stub strong { display: block; font-size: 16px; font-weight: 800; color: var(--navy); }
  .stub span { font-size: 11.5px; color: #44527A; }
  .stub strong.dest { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stub strong.dest small { font-size: 12px; color: #44527A; font-weight: 700; }
  .p-note { margin: 0 14px 12px; border-radius: 10px; padding: 7px 10px; font-size: 13px; line-height: 1.35; flex: none; }
  .p-note.charter { background: var(--navy); color: var(--white); }
  .p-note.stretch { background: #FFF4E6; color: #7A4300; }
  .p-note.soft { background: #EEF3FF; color: var(--ink); }
  .stamp { position: absolute; left: 12px; top: 14px; z-index: 2; width: 70px; height: 70px; border-radius: 50%; border: 3px solid #E2574C; color: #E2574C; background: rgba(255,255,255,.88);
           display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 12px; line-height: 1.1; transform: rotate(-14deg) scale(2.4); opacity: 0; }
  .stamp.in { animation: stamp .45s cubic-bezier(.5,0,.6,1.6) forwards; }
  @keyframes stamp { 60% { opacity: 1; transform: rotate(-14deg) scale(.9); } 100% { opacity: .95; transform: rotate(-14deg) scale(1); } }

  /* the sealed surprise */
  .flip { position: relative; perspective: 1200px; opacity: 0; transform: translateY(46px) rotate(2deg) scale(.95); }
  .flip.in { animation: deal .7s cubic-bezier(.2,1.3,.4,1) forwards; }
  .flip .inner { position: relative; height: 100%; transition: transform .9s cubic-bezier(.3,1.3,.5,1); transform-style: preserve-3d; }
  .flip.open .inner { transform: rotateY(180deg); }
  .flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  .flip .back { transform: rotateY(180deg); }
  .flip .back .pass { opacity: 1; transform: none; height: 100%; }
  .flip .sizer { visibility: hidden; }
  .sealed { width: 100%; height: 100%; border: 0; border-radius: 20px; cursor: pointer; color: var(--navy); position: relative; overflow: hidden; font-family: inherit;
            background: linear-gradient(140deg, #FFE0B8, #F9BC7E 45%, #EDBB78); box-shadow: 0 14px 34px rgba(7,34,75,.3);
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; font-size: 15px; }
  .sealed .qm { width: 76px; height: 76px; border-radius: 50%; background: var(--navy); color: var(--peach); display: grid; place-items: center; font-size: 42px; font-weight: 800; }
  .sealed strong { font-size: 21px; font-weight: 800; }
  .sealed .tap { background: var(--navy); color: var(--white); border-radius: 999px; padding: 8px 18px; font-weight: 700; margin-top: 4px; }
  .sealed::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.6) 50%, transparent 60%); animation: shine 2.4s ease-in-out infinite; }
  .flip.in:not(.open) .sealed, .spot-card.flip:not(.open) .sealed { animation: wiggle 2.6s ease-in-out 1.2s infinite; }
  @keyframes shine { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
  @keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-2.5deg); } 90% { transform: rotate(2.5deg); } 95% { transform: rotate(-1deg); } }

  .r-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; opacity: 0; transform: translateY(12px); transition: all .5s ease; }
  .r-actions.in { opacity: 1; transform: none; }
  .r-actions .cta { min-width: 280px; }
  .r-actions small { width: 100%; text-align: center; color: var(--muted); font-size: 13px; }
  @media (max-width: 860px) { .r-actions .cta { width: 100%; min-width: 0; } .r-actions .ghost { display: none; } .r-main { justify-content: flex-start; gap: 12px; } .r-stage { min-height: 380px; } }
  @media (max-height: 720px) and (max-width: 860px) { .r-title p { display: none; } .stub span { font-size: 11px; } }
  .bar.done > span { width: 100% !important; }
  .land { display: inline-flex; align-items: center; gap: 6px; }
  canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
  @media (prefers-reduced-motion: reduce) { .pass, .flip { opacity: 1; transform: none; } .stamp { opacity: .95; transform: rotate(-14deg); } .p-body li { opacity: 1; } }

/* Short screens (small or older phones, landscape tablets): a tighter card and a one-line DNA, so the whole
   screen still fits without scrolling. */
@media (max-height: 760px) {
  .r-main { gap: 8px; padding-block: 8px 4px; }
  .r-title h1 { font-size: clamp(20px, 2.4vw, 30px); }
  .dna { min-height: 40px; gap: 2px; align-content: center; }
  .dna-t, .dna-ax i, .dna-x { display: none; }
  .dna-row { gap: 4px 12px; display: flex; flex-wrap: wrap; justify-content: center; }
  .dna-ax { font-size: 12px; } .dna-ax b { font-size: 14px; }
  .band { height: 54px; }
  .band .label { top: 8px; font-size: 12px; padding: 2px 9px; }
  .band .code { bottom: 5px; font-size: 11px; }
  .p-body { padding: 9px 14px 6px; gap: 4px; }
  .p-body h2 { font-size: 18px; }
  .p-body .tag, .p-body .lead, .p-body li { font-size: 13px; }
  .stub { padding: 0 12px 9px; }
  .stub div { padding: 4px; } .stub strong { font-size: 14px; } .stub span { font-size: 11px; }
  .p-note { margin: 0 12px 9px; padding: 5px 9px; font-size: 12px; }
  .stamp { width: 56px; height: 56px; font-size: 10px; top: 8px; }
  .r-stage { min-height: 300px; }
  .r-actions small { display: none; }
  .r-actions .cta { padding: 13px; font-size: 17px; }
}
@media (max-height: 620px) {
  .p-body .tag { display: none; }
  .r-title h1 { font-size: 19px; }
  /* the "landed" progress line is decoration: on very short screens it gives its room to the cards */
  .r-head .progress { display: none; }
  .pass.top li:nth-child(n+2) { display: none; }
  .r-stage { min-height: 260px; }
  .r-main { gap: 5px; padding-block: 2px; }
  .r-row { padding-top: 2px; padding-bottom: 4px; }
  .r-actions .cta { padding: 11px; font-size: 16px; }
  .p-body .lead { font-size: 12.5px; line-height: 1.38; }
}
@media (max-width: 360px) {
  .r-row > * { flex-basis: 88%; }
}
/* Tablets in portrait: narrower passes, so the next one clearly peeks in and the card keeps a ticket shape. */
@media (min-width: 600px) and (max-width: 860px) {
  .r-row > * { flex-basis: 58%; }
}
