/* v14 Pro League Passport: tokens, the layers, paper, type, buttons, stamps. */
:root {
  --navy: #0f1e3d; --navy2: #172b55; --navy3: #0a1530;
  --gold: #d4af5a; --gold-hi: #f4dfa0; --gold-lo: #9c7a30;
  --paper: #f6f1e4; --paper2: #ece4cf; --ink: #18213b; --muted: #5a6175; --line: rgba(24, 33, 59, .14);
  --good: #1d7a4a; --slow: #a8650f; --bad: #b3261e; --visa: #1f4f9c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", ui-serif, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;
  --stampf: "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", Impact, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--navy3); color: var(--ink); font-family: var(--sans); overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
img { display: block; }

/* ---- layers ---- */
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background: var(--g-gold) center / min(1100px, 170vw) no-repeat, var(--g-wave-gold) repeat,
    radial-gradient(ellipse 90% 70% at 50% 40%, #1b305d 0%, #0f1e3d 55%, #081127 100%);
}
#stage { position: fixed; inset: 0; z-index: 1; }
body:not([data-phase="landing"]):not([data-phase="play"]):not([data-phase="reveal"]) #stage { visibility: hidden; }
body[data-phase="reveal"] #stage { visibility: hidden; background: transparent; }
body[data-phase="reveal"] #stage > .pt-clip { visibility: visible; }
.veil {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; display: none;
  background: linear-gradient(180deg, rgba(8, 17, 39, .62) 0%, rgba(8, 17, 39, .22) 26%, rgba(8, 17, 39, .55) 52%, rgba(8, 17, 39, .94) 78%, #081127 100%);
}
body[data-phase="landing"] .veil { display: block; }
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.screen { position: fixed; inset: 0; z-index: 4; overflow-y: auto; overflow-x: clip; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.screen[hidden] { display: none; }

/* ---- the passport page ---- */
.pg { min-height: 100%; display: grid; place-items: center; padding: calc(var(--st) + 16px) 14px calc(var(--sb) + 20px); overflow-x: clip; }
.pg.is-out .book, .pg.is-out .land, .pg.is-out .letter { animation: turnOut .26s ease-in forwards; }
.paper, .leaf, .letter {
  background: var(--g-rose) no-repeat right -190px top -170px / 520px, var(--g-wave) repeat, linear-gradient(170deg, var(--paper), var(--paper2));
}
.book {
  width: 100%; max-width: 460px; border-radius: 18px; overflow: hidden; position: relative;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 30px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(212, 175, 90, .25);
  transform-origin: left center; animation: turnIn .55s cubic-bezier(.2, .8, .2, 1) both;
}
.leaf { padding: 22px 20px; position: relative; }
.leaf--r { border-top: 2px dashed rgba(24, 33, 59, .16); }
@media (min-width: 900px) {
  .book { max-width: 1060px; display: grid; grid-template-columns: 1fr 1fr; min-height: 580px; }
  .book--one { display: block; max-width: 560px; min-height: 0; }
  .leaf { padding: 46px 50px; }
  .leaf--l { box-shadow: inset -30px 0 30px -30px rgba(0, 0, 0, .28); }
  .leaf--r { border-top: 0; box-shadow: inset 30px 0 30px -30px rgba(0, 0, 0, .28); }
}
@keyframes turnIn { from { opacity: 0; transform: perspective(1600px) rotateY(-28deg) translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes turnOut { to { opacity: 0; transform: perspective(1600px) rotateY(18deg) translateX(-30px); } }

/* ---- type ---- */
.kicker { font: 700 12px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.h1 { font: 700 34px/1.08 var(--serif); margin: 0; letter-spacing: -.01em; }
.h2 { font: 700 34px/1.08 var(--serif); margin: 8px 0 6px; letter-spacing: -.01em; }
.h3 { font: 700 23px/1.15 var(--serif); margin: 4px 0 8px; }
.lead { font: 500 17px/1.45 var(--sans); margin: 0 0 6px; }
.lead--light { color: rgba(255, 255, 255, .84); }
.meta { font: 500 14px/1.4 var(--sans); color: var(--muted); margin: 6px 0 0; }
.k { font: 700 11.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
@media (min-width: 900px) { .h1 { font-size: 56px; } .h2 { font-size: 46px; } .lead { font-size: 18px; } }

/* ---- buttons ---- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px;
  padding: 12px 22px; border: 0; border-radius: 14px; cursor: pointer; font: 700 18px/1.1 var(--sans); letter-spacing: .01em;
  transition: transform .12s ease, opacity .2s ease, filter .2s ease; touch-action: manipulation;
}
.btn svg { width: 22px; height: 22px; flex: none; transition: transform .2s ease; }
.btn:not(:disabled):hover svg { transform: translateX(3px); }
.btn:not(:disabled):active { transform: translateY(2px) scale(.985); }
.btn:disabled { cursor: default; }
.btn--gold { background: linear-gradient(180deg, #f4dc96 0%, #d4af5a 55%, #b8933f 100%); color: #1d1606; box-shadow: 0 2px 0 #8a6a25, 0 14px 30px rgba(212, 175, 90, .28); }
.btn--ink { background: linear-gradient(180deg, #1d3566, var(--navy)); color: #fff; box-shadow: 0 2px 0 #050b1a, 0 12px 26px rgba(15, 30, 61, .3); }
.btn--ink svg { color: var(--gold-hi); }
.btn:disabled:not(.is-done) { filter: saturate(.55); opacity: .72; }
.btn.is-pulse { animation: pulse 1.1s ease-in-out 3; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.035); } }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---- stamps, slots, MRZ ---- */
.stamp { display: block; width: 100%; height: auto; overflow: visible; }
.slot { display: block; width: 100%; height: auto; color: rgba(24, 33, 59, .3); }
@keyframes slam {
  0% { opacity: 0; transform: scale(2.2) rotate(var(--r, -10deg)); }
  55% { opacity: 1; transform: scale(.93) rotate(var(--r, -10deg)); }
  75% { transform: scale(1.03) rotate(var(--r, -10deg)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--r, -10deg)); }
}
.mrz { font: 500 11px/1.55 var(--mono); letter-spacing: .07em; color: rgba(24, 33, 59, .58); overflow: hidden; white-space: pre; }
.mrz span { display: block; overflow: hidden; text-overflow: clip; }

/* ---- the turn wipe + mute ---- */
.turn { display: none; }
.mute {
  position: fixed; z-index: 6; top: calc(var(--st) + 10px); right: 10px; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(212, 175, 90, .45); background: rgba(10, 21, 48, .78); color: var(--gold-hi); display: grid; place-items: center; cursor: pointer;
}
.mute svg { width: 22px; height: 22px; }
.mute[hidden] { display: none; }
body:not([data-phase="landing"]):not([data-phase="play"]):not([data-phase="reveal"]) .mute { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
body:not([data-phase="reveal"]) .backdrop { background: var(--g-wave-gold) repeat, radial-gradient(ellipse 90% 70% at 50% 40%, #1b305d 0%, #0f1e3d 55%, #081127 100%); }
@media (min-width: 900px) { body[data-phase="reveal"] .backdrop { background: var(--g-wave-gold) repeat, radial-gradient(ellipse 90% 70% at 50% 40%, #1b305d 0%, #0f1e3d 55%, #081127 100%); } }
