/* Safety - The Musical: the buyer's ticket pages (tickets/ "My tickets" and t/?c= one ticket). Loaded after buy.css
   (same night world, amber accents, same top bar and footer). The two fonts are self-hosted here so these pages
   make no request to any other host (TICKETS-DESIGN.md F.6). The QR and the Code 128 sit on a white plate with a
   quiet zone; js/tickets.js snaps both to whole device pixels so phone cameras and door scanners read them. */
/* fonts-1006: the two fonts (Brygada 1918 + Ysabeau Office, self-hosted in assets/fonts/, variable files declared with
   their 400-700 weight range so WebKit applies the weight) come from buy.css, loaded just before this file. */

.tk-body { overflow-x: hidden; }
.tk-main { padding-bottom: 32px; }
.tk-h1 { margin: 10px 0 0; }
.tk-lede { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.tk-all { margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.tk-all a { display: inline-block; padding: 6px 0; }
.tk-door { margin-top: 26px; padding: 14px 16px; border-color: rgba(242, 201, 135, 0.32); font-size: 14px; }
.tk-tip { margin: 10px 0 0; color: var(--amber-hi); font-size: 13px; font-weight: 600; }
.tk-door p { margin: 0 0 6px; }
.tk-door p:last-child { margin-bottom: 0; color: var(--muted); }
.tk-msg .b-btn { margin-top: 8px; }
.tk-msg p { color: var(--ink); }
/* fonts-1006 check: Brygada is wider, "yet" was left alone on the last line of the empty-state title on a 360px phone */
.tk-main h2 { text-wrap: balance; }
.tk-main p { text-wrap-style: pretty; }

/* ---------- one order ---------- */
.tk-order { margin: 28px 0 0; }
.tk-order.is-past { opacity: 0.82; }
.tk-ohead { display: flex; align-items: center; gap: 14px; }
.cimg.tk-cimg { width: 54px; height: 54px; }
.tk-city { margin: 0; font-family: var(--serif); font-size: clamp(26px, 6.6vw, 34px); font-weight: 600; line-height: 1.08; color: var(--cream); }
.tk-odate { margin: 4px 0 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.tk-ometa { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.tk-obtns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0 0; }
.tk-dl { min-height: 52px; }
.tk-open { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; padding: 8px 0; } /* 44 px touch target (test report L2) */

/* ---------- the ticket card ---------- */
.tk { position: relative; margin: 18px 0 0; border-radius: 22px; border: 1px solid rgba(242, 201, 135, 0.22); background: #0f1a31; overflow: hidden; box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9); }
.tk-head { position: relative; padding: 18px 20px 16px; background-color: #13213d; background-image: linear-gradient(180deg, rgba(6, 11, 23, 0.1) 0%, rgba(6, 11, 23, 0.86) 100%), url("../assets/og/og-share.webp?v=1"); background-size: cover; background-position: center 34%; }
.tk-head::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; border-bottom: 2px dashed rgba(242, 201, 135, 0.35); }
.tk-kicker { margin: 0; color: var(--amber-hi); font-size: 11px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; }
.tk-title { margin: 2px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.05; color: var(--cream); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
.tk-admit { margin: 6px 0 0; color: var(--cream); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.tk-test { display: inline-block; margin: 8px 0 0; padding: 3px 10px; border-radius: 999px; background: #b3261e; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.tk-badge { margin: 14px 20px 0; padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.tk-badge.is-used { border: 1px solid rgba(242, 201, 135, 0.5); background: rgba(242, 201, 135, 0.1); color: var(--amber-hi); }
.tk-void { margin: 16px 20px 0; padding: 14px 16px; border-radius: 14px; border: 2px solid rgba(240, 163, 163, 0.7); color: var(--bad); font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tk-void strong { display: block; font-size: 34px; line-height: 1; letter-spacing: 0.1em; }
.tk-void-sub { margin: 8px 20px 0; color: var(--muted); font-size: 13px; }

/* the white plate: QR on top, Code 128 under it, the code in large monospace */
.tk-codes { margin: 16px 14px 0; padding: 14px 12px 12px; border-radius: 16px; background: #fff; color: #111; text-align: center; }
.tk-qrbtn { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: #111; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.tk-qrbtn:focus-visible { outline: 3px solid #e0a458; outline-offset: 4px; border-radius: 6px; }
.tk-qr { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; aspect-ratio: 1 / 1; image-rendering: pixelated; }
.tk-tap { display: block; margin: 4px 0 0; color: #5b6170; font-size: 12px; font-weight: 600; }
.tk-c128wrap { margin: 10px auto 0; width: 100%; overflow: hidden; }
.tk-c128 { display: block; width: 100%; height: 64px; margin: 0 auto; }
.tk-code { margin: 6px 0 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; font-size: clamp(16px, 5vw, 21px); font-weight: 700; letter-spacing: 0.06em; color: #111; word-break: break-all; }

.tk-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 18px 20px 0; padding: 0; }
.tk-f { min-width: 0; }
.tk-f-wide { grid-column: 1 / -1; }
.tk-facts dt { margin: 0; color: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.tk-facts dd { margin: 2px 0 0; color: var(--cream); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.tk-sub { color: var(--ink); font-weight: 500; }
.tk-note { margin: 12px 20px 0; color: var(--amber-hi); font-size: 14px; }
.tk-perks { margin: 16px 20px 0; padding: 12px 14px 12px 30px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(6, 11, 23, 0.35); font-size: 14px; }
.tk-perks li { margin: 0 0 6px; }
.tk-perks li:last-child { margin-bottom: 0; }
.tk-perks li::marker { color: var(--amber); }
.tk-perks em { color: var(--muted); font-style: normal; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 20px 0; }
.tk-act { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(242, 201, 135, 0.55); background: transparent; color: var(--amber-hi); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.tk-act:hover { background: rgba(242, 201, 135, 0.12); color: var(--cream); }
.tk-fine { margin: 14px 20px 18px; color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.tk.is-void { border-color: rgba(240, 163, 163, 0.35); }
.tk.is-void .tk-head { filter: grayscale(0.7); }
.tk-voids { margin: 18px 0 0; }
.tk-voids > summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---------- waiting / empty / find / forget ---------- */
.tk-wait h2::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; border-radius: 50%; border: 2px solid var(--amber-hi); border-right-color: transparent; vertical-align: 2px; animation: tk-spin 1s linear infinite; }
@keyframes tk-spin { to { transform: rotate(360deg); } }
.tk-find .b-input { margin-bottom: 4px; }
.tk-find .b-label { margin-top: 14px; }
.tk-form .b-label:first-of-type { margin-top: 6px; }
.tk-hint { margin: 0 0 4px !important; color: var(--muted-2); font-size: 12.5px; }
.tk-forget { margin: 26px 0 0; text-align: center; }
.tk-forgetbtn { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tk-forgetbtn:hover { color: var(--cream); border-color: var(--line); }

/* ---------- the single-ticket page ---------- */
.tk-staff { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(242, 201, 135, 0.45); background: rgba(242, 201, 135, 0.08); color: var(--amber-hi); font-size: 14px; }
.tk-state { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.tk-door-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- full screen for the door ---------- */
.tk-zoom { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: #fff; color: #111; overflow-y: auto; }
.tk-zoom[hidden] { display: none !important; }
.tk-zoom-in { width: 100%; max-width: 560px; text-align: center; }
.tk-zoom-hint { margin: 0 0 10px; color: #6a5420; font-size: 14px; font-weight: 700; }
.tk-zoom-qr svg { display: block; width: 100%; height: auto; margin: 0 auto; aspect-ratio: 1 / 1; }
.tk-zoom-bar { margin: 14px auto 0; }
.tk-zoom-bar svg { display: block; width: 100%; height: 76px; margin: 0 auto; }
.tk-zoom-code { margin: 8px 0 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; font-size: clamp(18px, 5.6vw, 26px); font-weight: 800; letter-spacing: 0.06em; word-break: break-all; }
.tk-zoom-who { margin: 6px 0 0; color: #333; font-size: 15px; font-weight: 600; }
.tk-zoom-nav { display: flex; justify-content: center; gap: 10px; margin: 16px 0 0; }
.tk-zbtn { min-width: 96px; min-height: 48px; padding: 10px 16px; border-radius: 999px; border: 1px solid #c9c9c9; background: #f4f4f4; color: #111; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.tk-zbtn[hidden] { display: none; }
.tk-zbtn-x { background: #111; border-color: #111; color: #fff; }
html.tk-zoomed, html.tk-zoomed body { overflow: hidden; }

.tk-toast { position: fixed; z-index: 120; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 14px; background: #f3e9d2; color: #1b1206; font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8); }

@media (max-width: 380px) {
  .tk-facts { margin-left: 16px; margin-right: 16px; }
  .tk-head, .tk-fine, .tk-perks, .tk-actions { margin-left: 16px; margin-right: 16px; }
  .tk-head { margin: 0; }
  .tk-codes { margin-left: 10px; margin-right: 10px; }
}
@media print {
  .b-top, .b-foot, .tk-find, .tk-forget, .tk-actions, .tk-obtns, .tk-door, .tk-tap, .tk-zoom, .tk-toast { display: none !important; }
  body, .tk { background: #fff !important; color: #111 !important; }
  .tk { break-inside: avoid; border-color: #999; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-wait h2::before { animation: none; }
}
