/* ============================================================
   BXS — digital ticket platform
   Race-night black & red "Mobile ID" style, matching the opening splash.
   Always dark.
   Self-contained, no external assets (the display font is bundled).
   ============================================================ */

:root {
  color-scheme: dark;

  /* race-night black with F1-style red, like the opening splash */
  --bg1: #0b0b0d;
  --bg2: #000000;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #b4b4bb;
  --faint: #7d7d86;
  --accent: #e10600;
  --accent-strong: #b30500;
  --qr-bg: #ffffff;
  --qr-glow: rgba(225, 6, 0, 0.5);
  --good: #1fbf75;
  --warn: #e9c05a;
  --danger: #ff5a4f;
  --brandlogo: #ffffff;        /* logo ink — white */
  --card-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);

  --radius: 16px;
  --radius-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

/* display face for the R1 wordmark and the opening splash (SIL OFL, bundled) */
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/Unbounded-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg1);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 560px at 50% -8%, rgba(225, 6, 0, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.bxs-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 0 40px;
}

/* ================= Ticket header ================= */
.tk-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 10px 14px 8px;
  text-align: center;
}
.tk-brand {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 6px 16px -6px var(--qr-glow);
}
.tk-brand svg { width: 18px; height: 18px; color: #fff; }
/* text-only branding: no logo image -> empty slot, drop the tile background
   (keeps the event title centered between the two 40px side columns) */
.tk-brand:empty { background: none; box-shadow: none; }

/* minimal back chevron in the left header slot — mirrors the .tk-secure chip */
.tk-back {
  justify-self: start; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  transition: color .15s ease, background .15s ease;
}
.tk-back:hover { color: var(--text); }
.tk-back svg { width: 18px; height: 18px; }
.tk-head .tk-titles { min-width: 0; }
.tk-title { font-size: 19px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.15; text-wrap: balance; }
.tk-sub {
  font-size: 12px; color: var(--muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* one line, like the reference */
}
.tk-head .tk-secure {
  justify-self: end; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--good);
  background: var(--panel); border: 1px solid var(--line);
}
.tk-head .tk-secure svg { width: 16px; height: 16px; }

/* ================= Tabs ================= */
.tk-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin: 6px 0 0;
}
.tk-tab {
  padding: 12px 0; text-align: center; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tk-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tk-panel { padding: 22px 16px 0; }
.tk-panel[hidden] { display: none; }

/* ================= Scan / QR ================= */
.tk-scan {
  text-align: center; font-size: 13px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: 3px; margin-bottom: 20px;
}

/* ---- swipeable per-ticket carousel ---- */
.tk-carousel { position: relative; margin: 0 -16px; }
.tk-refresh {
  position: absolute; right: 16px; top: 116px; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.tk-refresh svg { width: 24px; height: 24px; transition: transform .65s ease; }
.tk-refresh.spin svg { transform: rotate(360deg); }
.tk-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 6px 0;
}
.tk-track::-webkit-scrollbar { display: none; }
.tk-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: flex; justify-content: center; padding: 6px 16px 2px;
}

/* animated gradient border sweeping around the QR (web ticket only —
   wallet passes are static and cannot animate) */
@property --tk-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.tk-qr {
  position: relative; width: 214px; height: 214px; border-radius: 24px; padding: 3px;
  background: conic-gradient(from var(--tk-angle),
    var(--accent) 0deg, #ffd3cf 35deg, var(--accent) 95deg, var(--accent-strong) 215deg, var(--accent) 360deg);
  animation: tk-rotate 3.4s linear infinite;
  box-shadow: 0 14px 30px -20px rgba(0,0,0,.45);
}
@keyframes tk-rotate { to { --tk-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .tk-qr { animation: none; background: var(--accent); } }
.tk-qr-inner {
  position: relative; width: 100%; height: 100%; border-radius: 21px; padding: 13px;
  background: var(--qr-bg); overflow: hidden;
}
/* the QR image (swapped on each rotation) fills the frame — not the brand chip */
.tk-qr-inner > .tk-qrimg { width: 100%; height: 100%; }
.tk-qrimg > svg, .tk-qrimg > img { width: 100%; height: 100%; display: block; }
.tk-qr-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  background: #000; border: 3px solid #fff;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
/* the QR chip is a black circle, so its logo/text is white in both themes */
.tk-qr-badge .bxs-wordmark {
  font-size: 11px; line-height: 1; letter-spacing: -.3px; white-space: nowrap;
  color: #fff; -webkit-text-fill-color: #fff; background: none;
}
.tk-qr-badge .bxs-brandlogo { color: #fff; line-height: 0; }
.tk-qr-badge .bxs-brandlogo svg { height: 12px; width: auto; }

/* ---- 60-second code-refresh animation (visual only) ---- */
/* diagonal light sweep across the code */
.tk-qr-shine {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.6) 50%, transparent 62%);
  transform: translateX(-120%);
}
.tk-qr-inner.refreshing .tk-qr-shine { animation: tk-shine .9s ease both; }
/* the QR briefly blurs/dips and snaps back — reads as "new code loaded" */
.tk-qr-inner.refreshing .tk-qrimg { animation: tk-qrpop .9s ease both; }
@keyframes tk-shine {
  0%   { opacity: 0; transform: translateX(-120%); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(120%); }
}
@keyframes tk-qrpop {
  0%   { opacity: 1;  transform: scale(1);     filter: blur(0); }
  28%  { opacity: .2; transform: scale(.93);   filter: blur(3.5px); }
  62%  { opacity: 1;  transform: scale(1.025); filter: blur(0); }
  100% {              transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tk-qr-inner.refreshing .tk-qr-shine { animation: none; }
  .tk-qr-inner.refreshing .tk-qrimg { animation: tk-qrfade .5s ease both; }
  @keyframes tk-qrfade { 0% { opacity: 1; } 40% { opacity: .45; } 100% { opacity: 1; } }
}

/* ---- race helmet ----
   Original neon racing-helmet artwork (assets/img/helmet.svg) set large
   behind the QR, the way the helmet sits behind the lockup on the race
   poster. Decorative only: the QR keeps its own white frame. */
.tk-carousel { isolation: isolate; }
.tk-carousel::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 50%; width: 540px; height: 415px; transform: translate(-50%, -50%);
  background: url("../img/helmet.svg") center / contain no-repeat;
  opacity: .5; filter: drop-shadow(0 0 30px rgba(224, 36, 122, .5));
}
.tk-scan { position: relative; z-index: 1; text-shadow: 0 1px 10px #000, 0 0 2px #000; }   /* stays readable over the helmet */

/* stacked seat cards (scroll up/down with the page) */
.tk-seats { display: grid; gap: 14px; margin-top: 24px; }

/* ---- carousel nav ---- */
.tk-nav { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.tk-dots { display: flex; gap: 7px; }
.tk-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--line-strong); border: none; padding: 0; cursor: pointer; transition: all .25s ease; }
.tk-dot.active { background: var(--accent); width: 24px; }
.tk-counter { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }

.tk-mobileid {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 24px; font-size: 19px; font-weight: 800; letter-spacing: .2px;
}
.tk-mobileid .m {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong)); display: grid; place-items: center;
}
.tk-mobileid .m svg { width: 13px; height: 13px; color: #fff; }
.tk-deter { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; padding: 0 8px; }

/* ================= Wallet buttons ================= */
.tk-wallet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 4px; }
@media (max-width: 360px) { .tk-wallet { grid-template-columns: 1fr; } }
.bxs-wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; border-radius: 12px; cursor: pointer;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.16);
  transition: transform .08s ease, filter .2s ease;
}
.bxs-wallet-btn:active { transform: scale(.98); }
.bxs-wallet-btn:hover { filter: brightness(1.15); }
.bxs-wallet-btn svg { height: 20px; width: auto; }
.bxs-wallet-btn .stack { text-align: left; line-height: 1.05; }
.bxs-wallet-btn .stack small { display: block; font-size: 9px; opacity: .7; }
.bxs-wallet-btn .stack b { font-size: 13px; font-weight: 700; }

/* ================= Seat cards ================= */
.tk-seatcard {
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(158deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px -16px rgba(0,0,0,.55);
}
/* hospitality benefits — deliberately small and understated */
.tk-perks { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.tk-perks-head { font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-bottom: 5px; }
.tk-perks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.tk-perks li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.tk-perks li svg { width: 12px; height: 12px; flex: 0 0 12px; color: var(--muted); opacity: .8; }
.tk-seatcard-entry {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  color: #fff; text-align: center; padding: 11px 12px;
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
}
.tk-seatcard-body { padding: 18px 20px; }
.tk-seatcard-note {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.tk-seatcard-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 17px; font-weight: 800; margin-bottom: 16px;
}
.tk-seatcard-top .a { color: var(--muted); font-weight: 600; font-size: 15px; }
.tk-seatcard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.tk-seatcard-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.tk-seatcard-grid.cols-1 { grid-template-columns: 1fr; }
.tk-seatcard-grid > div { min-width: 0; }
.tk-seatcard-grid .mid { text-align: center; }
.tk-seatcard-grid .end { text-align: right; }
.tk-seatcard-grid .k { font-size: 10px; letter-spacing: 1.5px; color: var(--faint); }
.tk-seatcard-grid .v { font-size: 26px; font-weight: 800; margin-top: 3px; letter-spacing: -0.5px; overflow-wrap: anywhere; }

/* ================= Event info panel (premium) ================= */
.tk-info { padding-top: 22px; }
.info-group {
  background: linear-gradient(158deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 4px 18px 8px; margin-bottom: 14px; box-shadow: var(--card-shadow);
}
.info-head { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); padding: 15px 0 6px; }
.info-line { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.info-line:first-of-type { border-top: none; }
.info-line .ic { flex: none; width: 36px; height: 36px; border-radius: 11px; background: rgba(225,6,0,.14); color: var(--accent); display: grid; place-items: center; }
.info-line .ic svg { width: 18px; height: 18px; }
.info-line .tx { min-width: 0; }
.info-line .tx .k { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.info-line .tx .v { font-size: 15px; font-weight: 700; margin-top: 1px; overflow-wrap: anywhere; }

/* ================= Page footer ================= */
.bxs-pagefoot {
  margin: 30px 16px 14px; text-align: center;
  font-size: 11.5px; color: var(--faint); line-height: 1.65;
}
.bxs-pagefoot b { color: var(--muted); }
.bxs-pagefoot .powered { display: block; margin-top: 6px; }
.foot-lockup {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--muted); opacity: .7;
}
.foot-lockup .foot-mark {
  width: 19px; height: 19px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center;
}
.foot-lockup .foot-mark svg { width: 11px; height: 11px; color: #fff; }

/* ================= Password gate ================= */
.bxs-gate {
  max-width: 400px; margin: 8vh auto 0;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 26px;
  box-shadow: var(--card-shadow); text-align: center;
}
.bxs-gate .lock {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 14px;
  background: rgba(225,6,0,0.14); border: 1px solid rgba(225,6,0,0.36);
  display: grid; place-items: center;
}
.bxs-gate .lock svg { width: 26px; height: 26px; color: var(--accent); }
.bxs-gate h2 { margin: 0 0 6px; font-size: 20px; }
.bxs-gate p { margin: 0 0 20px; font-size: 13px; color: var(--muted); }
.bxs-input {
  width: 100%; height: 50px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--panel-2);
  color: var(--text); font-size: 16px; padding: 0 16px; outline: none;
  transition: border-color .2s ease;
}
.bxs-input:focus { border-color: var(--accent); }
.bxs-error { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 16px; }
/* transient status (e.g. "Unlocking…") — not an error, so not red */
.bxs-error.bxs-status { color: var(--muted); }

.bxs-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; margin-top: 14px;
  transition: transform .08s ease, filter .2s ease;
}
.bxs-btn:active { transform: scale(.985); }
.bxs-btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff; box-shadow: 0 10px 28px -12px var(--qr-glow); }
.bxs-btn-primary:hover { filter: brightness(1.06); }
.bxs-btn-ghost { background: var(--panel); border: 1px solid var(--line); color: var(--text); }

/* ================= Loading / spinner ================= */
.bxs-center { min-height: 70dvh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.bxs-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: bxs-spin .8s linear infinite; margin: 0 auto 14px;
}
@keyframes bxs-spin { to { transform: rotate(360deg); } }

/* ================= Modal (wallet setup) ================= */
.bxs-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center; z-index: 90;
}
.bxs-modal-backdrop.open { display: flex; }
.bxs-modal {
  width: 100%; max-width: 460px; background: var(--bg1);
  border: 1px solid var(--line); border-bottom: none; border-radius: 22px 22px 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--card-shadow);
  animation: bxs-slideup .25s ease;
}
@keyframes bxs-slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.bxs-modal h3 { margin: 0 0 10px; font-size: 18px; }
.bxs-modal p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.bxs-modal code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); padding: 2px 6px; border-radius: 5px; color: var(--accent); }
.bxs-modal ol { margin: 4px 0 12px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.bxs-modal ol a { color: var(--accent); text-decoration: underline; }
.bxs-modal .cost { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; margin-bottom: 12px; }
.bxs-modal .cost.free { background: rgba(31,191,117,.15); color: var(--good); border: 1px solid rgba(31,191,117,.3); }
.bxs-modal .cost.paid { background: rgba(233,192,90,.14); color: var(--warn); border: 1px solid rgba(233,192,90,.3); }

.wp-card { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin: 4px 0 16px; background: var(--panel); }
.wp-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: linear-gradient(135deg, rgba(225,6,0,.55), rgba(0,0,0,.15)); font-weight: 800; letter-spacing: .5px; font-size: 13px; color:#fff; }
.wp-top .wp-mark { width: 20px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); display:grid; place-items:center; }
.wp-top .wp-mark svg { width: 13px; height: 13px; color:#fff; }
.wp-body { padding: 12px 14px; }
.wp-ev { font-size: 15px; font-weight: 800; }
.wp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wp-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 12px; }
.wp-grid .k { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.wp-grid .v { font-size: 15px; font-weight: 700; margin-top: 1px; }
.wp-foot { display:flex; justify-content:space-between; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.wp-foot .qr { width: 26px; height: 26px; border-radius: 4px; background: repeating-linear-gradient(90deg,#fff 0 2px,#000 2px 4px); opacity:.85; }

/* ================= Add-to-Wallet sheet ================= */
.bxs-sheet {
  position: fixed; inset: 0; z-index: 80; display: none;
  flex-direction: column; background: var(--bg1);
}
.bxs-sheet.open { display: flex; animation: bxs-fade .2s ease; }
@keyframes bxs-fade { from { opacity: 0; } to { opacity: 1; } }
.bxs-sheet .sheet-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px;
  width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; display: grid; place-items: center; z-index: 2;
}
.bxs-sheet .sheet-close svg { width: 18px; height: 18px; }
.bxs-sheet .sheet-body {
  flex: 1; overflow-y: auto; text-align: center;
  padding: calc(72px + env(safe-area-inset-top)) 24px 24px;
}
.bxs-sheet h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; margin: 8px auto 18px; max-width: 360px; }
.bxs-sheet .sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 380px; margin: 0 auto 30px; }
.bxs-sheet .add-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  padding: 22px 20px; max-width: 440px; margin: 0 auto; text-align: left; box-shadow: var(--card-shadow);
}
.bxs-sheet .add-card h3 { font-size: 19px; font-weight: 700; margin: 4px 0 20px; line-height: 1.3; }
.bxs-sheet .add-btn {
  display: block; width: 100%; height: 56px; border-radius: 999px; border: none;
  font-size: 16px; font-weight: 700; margin-bottom: 12px; cursor: pointer;
  background: var(--panel-2); color: var(--text); transition: filter .15s ease, transform .08s ease;
}
.bxs-sheet .add-btn:last-child { margin-bottom: 0; }
.bxs-sheet .add-btn:active { transform: scale(.99); }
.bxs-sheet .add-btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff; }
.bxs-sheet .sheet-continue { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.bxs-sheet .sheet-continue button {
  width: 100%; height: 54px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: .6px;
}

/* ================= Toast ================= */
.bxs-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 13px; opacity: 0;
  pointer-events: none; transition: all .25s ease; z-index: 60; box-shadow: var(--card-shadow);
}
.bxs-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= Landing page ================= */
.bxs-topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.bxs-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .5px; font-size: 20px; }
.bxs-logo .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); display: grid; place-items: center; box-shadow: 0 6px 16px -6px var(--qr-glow); }
.bxs-logo .mark svg { width: 18px; height: 18px; color: #fff; }
.bxs-secure-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 11.5px; color: var(--muted); }
.bxs-secure-pill svg { width: 12px; height: 12px; color: var(--good); }
.bxs-hero-lp { text-align: center; padding: 30px 16px 20px; }
.bxs-hero-lp h1 { font-size: 32px; font-weight: 900; letter-spacing: -1px; margin: 14px 0 10px; }
.bxs-hero-lp p { color: var(--muted); font-size: 15px; max-width: 340px; margin: 0 auto; line-height: 1.55; }
.bxs-feature { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 16px 0; }
.bxs-feature .ic { flex: none; width: 38px; height: 38px; border-radius: 10px; background: rgba(225,6,0,.14); display: grid; place-items: center; color: var(--accent); }
.bxs-feature .ic svg { width: 20px; height: 20px; }
.bxs-feature h4 { margin: 0 0 3px; font-size: 14px; }
.bxs-feature p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ================= Text wordmark logo =================
   The default brand treatment — the racing wordmark from the opening
   splash: heavy, slanted, red. Used in place of any icon tile (header,
   gate, QR-center chip, pass-label row, footer, wallet). */
.bxs-wordmark {
  display: inline-block; transform: skewX(-14deg); padding: 0 .08em;
  font-family: "Unbounded", var(--font); font-weight: 900; font-style: normal;
  line-height: 1; letter-spacing: -.04em;
  color: var(--accent); -webkit-text-fill-color: var(--accent);
}
/* speed lines cut through the letters where the mark is big enough to show them */
.bxs-logo .bxs-wordmark, .tk-mobileid .bxs-wordmark, .bxs-intro-mark .bxs-wordmark {
  background: linear-gradient(180deg, var(--accent) 0 37%, transparent 37% 43%,
    var(--accent) 43% 57%, transparent 57% 63%, var(--accent) 63%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* ================= Inline logo lockup =================
   Rendered when assets/config.js sets logoSvg (or logoUrl). The SVG uses
   fill="currentColor", so it has no background and takes the logo ink
   colour. Sized per context below. */
.bxs-brandlogo {
  display: inline-flex; align-items: center; vertical-align: middle;
  color: var(--brandlogo); line-height: 0;   /* white on the dark page */
}
.bxs-brandlogo svg { height: 1.5em; width: auto; display: block; fill: currentColor; }
.bxs-brandlogo .bxs-logo-img { height: 1.5em; width: auto; display: block; }
/* image logo (transparent PNG/WebP): shown as solid white on the dark page.
   Requires a transparent background. */
.bxs-logo-img { filter: brightness(0) invert(1); }

/* per-context logo sizing */
.bxs-logo .bxs-brandlogo svg { height: 30px; }        /* header + unlock gate */
.foot-lockup .bxs-brandlogo svg { height: 20px; }     /* ticket footer */
.tk-mobileid .bxs-brandlogo svg { height: 26px; }     /* pass-label row */
.wp-top .bxs-brandlogo svg { height: 15px; }          /* wallet preview */

/* ================= Ticket opening animation =================
   Race-night splash shown after a successful unlock (bxs-ticket.js →
   openWithIntro): black screen, twin red stripes, event lockup. On exit the
   stripes join, the two halves part like gates and the ticket rises in.
   Timings here pair with INTRO_HOLD / INTRO_REVEAL / INTRO_END in the JS. */
.bxs-intro {
  --sw: clamp(11px, 3.4vw, 24px);       /* stripe width */
  --sg: calc(var(--sw) * .22);          /* gap between the two stripes */
  --sh: 21vh;                           /* length of the shorter stripe */
  position: fixed; inset: 0; z-index: 200; overflow: hidden;
  color: #fff; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: bxs-intro-in .4s ease both;
}
.bxs-intro.out { pointer-events: none; }
@keyframes bxs-intro-in { from { opacity: 0; } }

/* two black halves; each carries one of the stripes */
.bxs-intro-half {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background: #000;
  transition: transform 1.4s cubic-bezier(.65, 0, .25, 1) .9s;
}
.bxs-intro-half.l { left: 0; }
.bxs-intro-half.r { right: 0; }

/* stripes: ends cut at 45°, arranged point-symmetrically like the poster */
.bxs-intro .st {
  position: absolute; width: var(--sw); background: #e10600;
  transition: height .7s cubic-bezier(.6, 0, .3, 1) .3s;
}
.bxs-intro-half.l .st { right: calc(var(--sg) / 2 + .5%); }
.bxs-intro-half.r .st { left: calc(var(--sg) / 2 + .5%); }
.bxs-intro .st.top {
  top: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--sw)));
  animation: bxs-st-down 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
.bxs-intro .st.bot {
  bottom: 0; clip-path: polygon(0 0, 100% var(--sw), 100% 100%, 0 100%);
  animation: bxs-st-up 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
.bxs-intro-half.l .st.top { height: var(--sh); }
.bxs-intro-half.r .st.top { height: calc(var(--sh) + var(--sw)); animation-delay: .15s; }
.bxs-intro-half.l .st.bot { height: calc(var(--sh) + var(--sw)); animation-delay: .15s; }
.bxs-intro-half.r .st.bot { height: var(--sh); }
@keyframes bxs-st-down { from { transform: translateY(-100%); } }
@keyframes bxs-st-up   { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: no-preference) {
  .bxs-intro.out .bxs-intro-half.l { transform: translateX(-100%); }
  .bxs-intro.out .bxs-intro-half.r { transform: translateX(100%); }
  .bxs-intro.out .bxs-intro-half .st.top,
  .bxs-intro.out .bxs-intro-half .st.bot { height: calc(100% + var(--sw)); }   /* beats the per-stripe heights */
}

/* the lockup: mark · title · date, in the poster's proportions */
.bxs-intro-lockup {
  position: absolute; inset: 0; z-index: 1; padding: 0 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  pointer-events: none; transition: opacity .6s ease, transform .6s ease;
}
.bxs-intro.out .bxs-intro-lockup { opacity: 0; transform: scale(.96); }

/* brand mark: heavy slanted racing wordmark with speed lines cut through it.
   It drives in from the left, trailing light streaks that fade as it stops. */
.bxs-intro-mark { position: relative; animation: bxs-mark-in 1.3s cubic-bezier(.12, .8, .2, 1) .6s both; }
.bxs-intro-mark .bxs-wordmark { font-size: clamp(48px, 16vw, 92px); letter-spacing: -.05em; }
.bxs-intro-mark .bxs-brandlogo { color: #fff; }
.bxs-intro-mark .bxs-brandlogo svg, .bxs-intro-mark .bxs-logo-img { height: clamp(40px, 13vw, 72px); }
.bxs-intro-mark::before {
  content: ""; position: absolute; right: 100%; top: 24%; height: 52%; width: 0; margin-right: 6px;
  background:
    linear-gradient(90deg, transparent, #e10600) 100% 0 / 100% 13% no-repeat,
    linear-gradient(90deg, transparent, #e10600) 100% 50% / 72% 13% no-repeat,
    linear-gradient(90deg, transparent, #e10600) 100% 100% / 46% 13% no-repeat;
  transform: skewX(-14deg);
  animation: bxs-mark-trail 1.3s cubic-bezier(.12, .8, .2, 1) .6s both;
}
@keyframes bxs-mark-in { from { opacity: 0; transform: translateX(-70vw); } 25% { opacity: 1; } }
@keyframes bxs-mark-trail { 0% { width: 60vw; opacity: 1; } 75% { opacity: .85; } 100% { width: 0; opacity: 0; } }

/* event name + date: one block, so both enter at the same moment */
.bxs-intro-event {
  display: flex; flex-direction: column; align-items: center;
  animation: bxs-intro-title 1.2s cubic-bezier(.2, .8, .2, 1) 1.4s both;
}
.bxs-intro-title {
  margin-top: 22px; max-width: 11em; transform: skewX(-6deg);
  font-family: "Unbounded", var(--font); font-weight: 900; text-transform: uppercase;
  font-size: clamp(30px, 10vw, 74px); line-height: .9; letter-spacing: -.01em;
}
.bxs-intro-title > span {          /* white text with a light sweep passing across it once */
  display: block;
  background: linear-gradient(100deg, #fff 42%, #ffb3b0 50%, #fff 58%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: bxs-intro-shine 1.6s ease-in-out 3.2s both;
}
/* brand logo standing in for the word "F1" inside event titles (header + splash) */
.bxs-title-logo { display: inline-block; vertical-align: -.1em; line-height: 0; color: #fff; -webkit-text-fill-color: #fff; }
.bxs-title-logo svg { height: .82em; width: auto; display: block; fill: currentColor; }
.bxs-intro-date {
  margin-top: 20px; font-family: var(--font); font-weight: 500;   /* system font: Unbounded draws B/E with slanted strokes */
  font-size: clamp(13px, 4.2vw, 30px); letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase;
  white-space: nowrap;               /* never wrap "2026" (or split the month) onto its own line */
  text-rendering: geometricPrecision; -webkit-font-smoothing: antialiased;
}
/* sponsor slot: pinned to the bottom of the splash so it never pushes the centred lockup */
.bxs-intro-sponsor {
  /* in the lockup's flow, under the date: it can never land on the title, and the lockup re-centres around it */
  position: relative; margin-top: clamp(18px, 4vh, 36px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: bxs-intro-fade 1s ease-out 2.6s both;
}
.bxs-sponsor-label {
  font-family: var(--font); font-weight: 600; text-transform: uppercase;
  font-size: clamp(9px, 2.6vw, 12px); letter-spacing: .3em; margin-right: -.3em; color: rgba(255, 255, 255, .6);
}
.bxs-sponsor-logo { display: flex; align-items: center; justify-content: center; height: clamp(28px, 8vw, 46px); max-width: 64vw; color: #fff; line-height: 0; }
.bxs-sponsor-logo svg, .bxs-sponsor-logo img { height: 100%; width: auto; max-width: 100%; display: block; fill: currentColor; }
.bxs-sponsor-logo.plate { box-sizing: border-box; background: #fff; border-radius: 10px; padding: 8px 16px; height: clamp(46px, 13vw, 70px); }
.bxs-sponsor-logo.ph {
  width: clamp(130px, 42vw, 220px); border: 1.5px dashed rgba(255, 255, 255, .35); border-radius: 8px;
  font-family: var(--font); font-weight: 600; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .5); line-height: 1;
}
@media (orientation: landscape) {  /* laptops/desktops: not enough height between the stripes, so the slot moves to the bottom-right corner */
  .bxs-intro-sponsor { position: absolute; margin: 0; right: clamp(16px, 3vw, 44px); bottom: clamp(14px, 4vh, 40px); align-items: flex-end; }
  .bxs-sponsor-logo.plate { height: clamp(40px, 7vh, 60px); }
}
@media (orientation: landscape) and (max-height: 700px) {   /* short laptop screens: scale the lockup by height so it fits between the stripes */
  .bxs-intro-mark .bxs-brandlogo svg, .bxs-intro-mark .bxs-logo-img { height: clamp(28px, 10vh, 72px); }
  .bxs-intro-mark .bxs-wordmark { font-size: clamp(32px, 12vh, 92px); }
  .bxs-intro-title { margin-top: 14px; font-size: clamp(22px, 11vh, 74px); }
  .bxs-intro-date { margin-top: 12px; font-size: clamp(11px, 4.6vh, 30px); }
}
@media (max-height: 520px) {      /* short landscape screens: slot goes to the bottom-right corner */
  .bxs-sponsor-label { display: none; }
  .bxs-intro-sponsor { position: absolute; margin: 0; bottom: 10px; right: 14px; align-items: flex-end; }
  .bxs-sponsor-logo, .bxs-sponsor-logo.plate { height: 34px; padding-top: 4px; padding-bottom: 4px; }
  .bxs-sponsor-logo.ph { width: 120px; }
  .bxs-intro-title { font-size: clamp(20px, 7vh, 74px); max-width: none; }   /* one line: there is width to spare, not height */
}
@media (max-height: 760px) and (orientation: portrait) {   /* compact phones: smaller plate, tighter gap */
  .bxs-sponsor-logo.plate { height: 42px; padding-top: 5px; padding-bottom: 5px; }
  .bxs-intro-sponsor { margin-top: 14px; gap: 8px; }
}
@media (max-height: 620px) and (orientation: portrait) { .bxs-sponsor-label { display: none; } .bxs-intro-sponsor { margin-top: 10px; } }
@keyframes bxs-intro-rise  { from { opacity: 0; transform: translateY(12px); } }
@keyframes bxs-intro-fade  { from { opacity: 0; } }
@keyframes bxs-intro-title { from { opacity: 0; transform: scale(1.12); } }
@keyframes bxs-intro-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* the ticket opening behind the gates */
.tk-opening .bxs-wrap { opacity: 0; }
.tk-open .bxs-wrap { animation: tk-open-wrap 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.tk-open .tk-carousel { transform-origin: 50% 0; animation: tk-open-flip 1.5s cubic-bezier(.2, .8, .2, 1) .2s both; }
.tk-open .tk-seats > * { animation: tk-open-rise 1s cubic-bezier(.2, .8, .2, 1) .6s both; }
.tk-open .tk-seats > :nth-child(2) { animation-delay: .8s; }
.tk-open .tk-seats > :nth-child(3) { animation-delay: 1s; }
.tk-open .tk-seats > :nth-child(n+4) { animation-delay: 1.2s; }
@keyframes tk-open-wrap { from { opacity: 0; transform: translateY(46px) scale(.94); } }
@keyframes tk-open-flip { from { opacity: 0; transform: perspective(900px) rotateX(-80deg); } }
@keyframes tk-open-rise { from { opacity: 0; transform: translateY(26px); } }

@media (prefers-reduced-motion: reduce) {
  /* no movement: the splash simply fades out and the ticket fades in */
  .bxs-intro *, .bxs-intro *::before, .bxs-intro-half { animation: none !important; transition: none !important; }
  .bxs-intro { transition: opacity .8s ease; }
  .bxs-intro.out { opacity: 0; }
  .tk-open .bxs-wrap, .tk-open .tk-carousel, .tk-open .tk-seats > * { animation: tk-open-fade .8s ease both; }
  @keyframes tk-open-fade { from { opacity: 0; } }
}
