@font-face { font-family: "Geist"; src: url("fonts/geist-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; src: url("fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --accent: #FF6A1A;
  --ink: #14161A;
  --muted: #8B9099;
  --line: #E6E7EA;
  --paper: #FFFFFF;
  --vip: #17181C;
  --vip-price: #F1DDB4;
  --ok: #2FA864;
  --low: #F08A24;
  --none: #E5484D;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #07090C; overflow: hidden; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; }
#viewport { position: absolute; inset: 0; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#backdrop { position: absolute; inset: -8%; background: #07090C center / cover no-repeat; filter: blur(36px) brightness(.5) saturate(1.1); }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; will-change: transform; transition: filter .45s var(--ease); }
#app[data-ticket] #stage { filter: blur(9px) brightness(.86) saturate(.9); }
.world { position: absolute; inset: 0; opacity: 0; }
.world.on { opacity: 1; }
.world img, .world canvas, #glow, #clip { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.world img { object-fit: cover; }
.world canvas.fade { opacity: 0; transition: opacity .55s ease; }
.world canvas.fade.in { opacity: 1; }
#glow { opacity: 0; transition: opacity .16s ease; pointer-events: none; }
#glow.in { opacity: 1; }
#clip { object-fit: cover; opacity: 0; transition: opacity .34s ease; pointer-events: none; background: transparent; }
#clip.on { opacity: 1; transition-duration: .12s; }

/* naglowek, powrot, podpowiedz */
#brand { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(10, 12, 16, .5); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); color: #fff; pointer-events: none; transition: opacity .3s; }
#brand img { width: 30px; height: 30px; object-fit: contain; }
#brand div { display: flex; flex-direction: column; line-height: 1.15; }
#brand strong { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
#brand span { font-size: 11px; opacity: .72; }
#back { position: absolute; right: max(18px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .94); font-size: 13px; font-weight: 550; box-shadow: 0 6px 22px rgba(0, 0, 0, .22); transition: transform .2s var(--ease), opacity .2s; }
#back svg { width: 16px; height: 16px; }
#back:hover { transform: translateX(-2px); }
#app[data-busy] #back { opacity: 0; pointer-events: none; }
#hint { position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); margin: 0; padding: 10px 18px; border-radius: 999px; background: rgba(10, 12, 16, .58); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #fff; font-size: 13.5px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; opacity: 0; transform: translate(-50%, 8px); transition: opacity .35s, transform .35s var(--ease); pointer-events: none; }
#hint.in { opacity: 1; transform: translate(-50%, 0); }
#app[data-ticket] #hint, #app[data-ticket] #back { opacity: 0; pointer-events: none; }

/* karta przy obszarze */
.eyebrow { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
#card, .final-card { position: absolute; left: 0; top: 0; display: flex; align-items: stretch; background: var(--paper); border-radius: 13px; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 14px 40px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .12); pointer-events: none; white-space: nowrap; }
#card { opacity: 0; transition: opacity .14s ease; z-index: 5; }
#card.in { opacity: 1; }
.card-thumb { width: 56px; height: 44px; margin: 8px 0 8px 8px; border-radius: 7px; object-fit: cover; align-self: center; }
.card-main { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 16px 10px 14px; }
.card-main strong { font-size: 17px; font-weight: 620; letter-spacing: -.012em; line-height: 1.15; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 550; color: var(--muted); }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.status em { font-style: normal; }
.status.ok { color: #23824D; }
.status.low { color: #C96A0F; }
.status.low i { background: var(--low); }
.status.none { color: var(--none); }
.status.none i { background: var(--none); }
.card-price { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 2px; padding: 10px 15px; border-left: 1px solid var(--line); min-width: 66px; }
.card-price strong { font-size: 18px; font-weight: 680; letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.card-price.muted strong { color: #B8BBC2; }

/* bilet */
#ticketLayer { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; perspective: 1700px; opacity: 0; transition: opacity .3s ease; z-index: 8; }
#ticketLayer.in { opacity: 1; }
.ticket { width: min(660px, 100%); aspect-ratio: 660 / 268; transform: translateY(26px) scale(.94); transition: transform .55s var(--ease); }
#ticketLayer.in .ticket { transform: none; }
.ticket-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.5, .05, .2, 1); }
.ticket.flipped .ticket-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: grid; grid-template-columns: 40% 1fr 19%; border-radius: 18px; overflow: hidden; background: var(--paper); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 4px 14px rgba(0, 0, 0, .2); }
.face.vip { transform: rotateY(180deg); background: var(--vip); color: #fff; }
.face figure { position: relative; margin: 0; }
.face figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face figcaption { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(12, 14, 18, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-size: 10.5px; font-weight: 600; }
.face figcaption i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.t-main { display: flex; flex-direction: column; align-items: flex-start; padding: 20px 20px 16px 22px; min-width: 0; }
.t-main h2 { margin: 3px 0 0; font-size: 25px; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.t-main dl { display: flex; gap: 22px; margin: auto 0; padding: 6px 0; }
.t-main dt { font-size: 9.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.t-main dd { margin: 1px 0 0; font-size: 27px; font-weight: 640; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.vip .eyebrow, .vip dt { color: #8F939C; }
.ask { margin-bottom: 6px; }
.pill { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 620; letter-spacing: -.005em; white-space: nowrap; transition: transform .18s var(--ease), box-shadow .18s, filter .18s; }
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: translateY(0) scale(.98); }
.pill.accent { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.pill.accent:hover { filter: brightness(1.06); }
.pill.light { background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.pill:focus-visible, .link:focus-visible, #back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.link { margin-top: 8px; font-size: 11.5px; font-weight: 550; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: color .15s, text-decoration-color .15s; }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }
.vip .link:hover { color: #fff; }
.t-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 20px 10px 18px; border-left: 2px dashed #D9DBE0; }
.vip .t-stub { border-left-color: #3A3C43; }
.t-stub::before, .t-stub::after { content: ""; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%; background: #5C6068; }
.t-stub::before { top: -9px; }
.t-stub::after { bottom: -9px; }
.barcode { flex: 1; width: 34px; margin: 12px 0; border-radius: 2px; opacity: .78; background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px, currentColor 8px 11px, transparent 11px 12px, currentColor 12px 13px, transparent 13px 17px); }
.t-stub strong { font-size: 23px; font-weight: 680; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.vip .t-stub strong { color: var(--vip-price); }

/* koniec sciezki */
#final { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s ease; z-index: 6; }
#final.in { opacity: 1; }
.final-card { left: 50%; top: max(74px, calc(env(safe-area-inset-top) + 64px)); transform: translateX(-50%); }
.final-actions { position: absolute; left: 50%; bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px)); transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.final-actions .pill { height: 44px; padding: 0 22px; font-size: 14px; }
#done { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(7, 9, 12, .62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); opacity: 0; transition: opacity .35s ease; z-index: 9; }
#done.in { opacity: 1; }
.done-box { width: min(420px, 100%); padding: 34px 30px 28px; border-radius: 22px; background: var(--paper); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); transform: translateY(14px); transition: transform .5s var(--ease); }
#done.in .done-box { transform: none; }
.done-box svg { width: 52px; height: 52px; color: var(--ok); }
.done-box h2 { margin: 14px 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.done-box p { margin: 0; font-size: 15px; font-weight: 550; }
.done-box .note { margin: 10px 0 22px; font-size: 12.5px; font-weight: 450; color: var(--muted); line-height: 1.45; }

#toast { position: absolute; left: 50%; bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px)); max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 12px; background: rgba(12, 14, 18, .88); color: #fff; font-size: 13px; font-weight: 500; text-align: center; opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s, transform .3s var(--ease); pointer-events: none; z-index: 10; }
#toast.in { opacity: 1; transform: translate(-50%, 0); }

#loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: #07090C; color: #fff; opacity: 0; pointer-events: none; transition: opacity .5s ease; z-index: 20; }
#app[data-loading] #loader { opacity: 1; pointer-events: auto; }
#loader span { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .18); border-top-color: var(--accent); animation: spin .8s linear infinite; }
#loader p { margin: 0; font-size: 13px; font-weight: 500; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* telefon */
@media (max-width: 640px) {
  #brand span { display: none; }
  #hint { font-size: 12.5px; white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 32px); }
  .card-main strong { font-size: 15px; }
  .card-price strong { font-size: 16px; }
  .ticket { width: min(340px, 100%); aspect-ratio: auto; height: min(560px, calc(100dvh - 60px)); }
  .face { grid-template-columns: 1fr; grid-template-rows: 38% 1fr auto; }
  .t-main { padding: 18px 20px 14px; }
  .t-main dl { margin: 12px 0; }
  .t-stub { flex-direction: row; padding: 12px 20px; border-left: 0; border-top: 2px dashed #D9DBE0; }
  .vip .t-stub { border-top-color: #3A3C43; }
  .t-stub::before, .t-stub::after { top: -10px; bottom: auto; }
  .t-stub::before { left: -9px; }
  .t-stub::after { left: auto; right: -9px; }
  .barcode { flex: 0 0 120px; width: 120px; height: 26px; margin: 0 12px; background: repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px, currentColor 8px 11px, transparent 11px 12px, currentColor 12px 13px, transparent 13px 17px); }
  .final-actions { flex-direction: column; width: calc(100% - 40px); }
}
@media (prefers-reduced-motion: reduce) {
  .ticket-inner, .ticket, #hint, #card, #glow, .world canvas.fade { transition-duration: .01s; }
}
