@font-face { font-family: 'Big Shoulders Display'; font-weight: 800; font-display: swap; src: url(fonts/big-shoulders-display-latin-800-normal.woff2) format('woff2'); 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; }
@font-face { font-family: 'Big Shoulders Display'; font-weight: 800; font-display: swap; src: url(fonts/big-shoulders-display-latin-ext-800-normal.woff2) format('woff2'); 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: 'Big Shoulders Display'; font-weight: 900; font-display: swap; src: url(fonts/big-shoulders-display-latin-900-normal.woff2) format('woff2'); 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; }
@font-face { font-family: 'Big Shoulders Display'; font-weight: 900; font-display: swap; src: url(fonts/big-shoulders-display-latin-ext-900-normal.woff2) format('woff2'); 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: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); 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; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2'); 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: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); 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; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); 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: 'IBM Plex Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-italic.woff2) format('woff2'); 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; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-400-italic.woff2) format('woff2'); 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: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); 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; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); 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; }

:root {
  --bg: #0d0b09; --row: #1a1612; --row-2: #221d18;
  --paper: #f1e7d3; --ink: #17120d; --cream: #efe6d4; --muted: #9c907e; --paper-muted: #7a6d5d;
  --amber: #f0a63a; --red: #b8331c;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; background: var(--bg); color: var(--cream); font: 400 16px/1.4 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body::before { content: ''; position: fixed; inset: -20vh -30vw auto; height: 70vh; background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(240,166,58,.22), rgba(240,166,58,.06) 45%, transparent 70%); pointer-events: none; }
body.no-scroll { overflow: hidden; }
button { font: inherit; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { position: relative; max-width: 480px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom)); }

header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { font: 900 26px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.brand span { color: var(--amber); }
.count { font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.offline { display: none; color: var(--amber); }
body.is-offline .offline { display: inline; }

.running { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 11px 14px; background: var(--row); border-radius: 6px; font: 400 14px/1.35 var(--sans); color: var(--cream); }
.running i { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--amber); animation: blink 1.6s ease-in-out infinite; }
.running b { font-weight: 600; }
@keyframes blink { 50% { opacity: .25; } }

/* jegyszelvény: kivágás a perforáció magasságában (--cut a JS-ből) */
.stub { --cut: 250px; position: relative; display: block; width: 100%; text-align: left; border: 0; cursor: pointer; color: var(--ink); background: var(--paper); border-radius: 6px; padding: 18px 18px 16px;
  -webkit-mask: radial-gradient(circle 11px at 0 var(--cut), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--cut), #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 var(--cut), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--cut), #0000 98%, #000) right / 51% 100% no-repeat;
  box-shadow: 0 30px 80px -30px rgba(240,166,58,.45); font-family: var(--sans); transition: transform .15s var(--ease); }
.stub:active { transform: scale(.99); }
.stub:focus-visible, .row:focus-visible, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.stub-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tag { border: 1.5px solid currentColor; padding: 5px 8px 4px; border-radius: 3px; font: 500 12.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.stub h1 { font: 900 clamp(44px, 14vw, 64px)/.86 var(--display); text-transform: uppercase; letter-spacing: .005em; margin: 18px 0 8px; min-height: 112px; display: flex; align-items: flex-end; overflow-wrap: anywhere; }
.stub h1.long { font-size: clamp(38px, 11.5vw, 52px); }
.alt { font: italic 400 15px/1.3 var(--sans); color: #5d5245; min-height: 20px; }
.facts { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.facts dt { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); margin-bottom: 5px; }
.facts dd { font: 800 24px/1 var(--display); letter-spacing: .02em; margin: 0; }
.perf { margin: 20px 4px 18px; border-top: 2px dashed rgba(23,18,13,.28); }
.stub-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cd-label { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); margin-bottom: 6px; }
.cd { font: 800 30px/1 var(--display); letter-spacing: .01em; }
.cd.urgent { color: var(--red); }
.btn-qr { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ink); color: var(--paper); padding: 13px 16px; border: 0; border-radius: 6px; font: 600 15px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.btn-qr svg { width: 20px; height: 20px; }
.credits { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(23,18,13,.14); font: 400 14px/1.4 var(--sans); color: #4c4237; }
.stub-end h1 { min-height: 0; margin-top: 10px; }

.day { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 10px; }
.day h2 { font: 800 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.day small { font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: .06em; }
.row { display: grid; grid-template-columns: 64px 1fr 18px; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; cursor: pointer; color: inherit; background: var(--row); padding: 14px 16px; border-radius: 6px; margin-bottom: 8px; font-family: var(--sans);
  -webkit-mask: radial-gradient(circle 7px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 7px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat; }
.row:active { background: var(--row-2); }
.row time { font: 500 19px/1 var(--mono); color: var(--amber); }
.row b { display: block; font: 600 17px/1.2 var(--sans); }
.row span { display: block; font: 400 14px/1.3 var(--sans); color: var(--muted); margin-top: 3px; }
.row svg { width: 16px; height: 16px; color: var(--muted); }
.row.past { opacity: .42; }
.row.past time { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.row.is-next { box-shadow: inset 0 0 0 1.5px var(--amber); }

footer { margin-top: 34px; display: flex; justify-content: space-between; gap: 12px; font: 500 13px/1.4 var(--mono); color: var(--muted); }
.link { background: none; border: 0; padding: 6px 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* belépés */
.stub-login { --cut: 0px; cursor: default; -webkit-mask: none; mask: none; }
.stub-login:active { transform: none; }
.stub-login h1 { min-height: 0; margin: 22px 0 8px; }
.field { display: block; margin-top: 22px; }
.field span { display: block; font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--paper-muted); margin-bottom: 8px; }
.field input { width: 100%; padding: 14px 14px; border: 1.5px solid var(--ink); border-radius: 6px; background: #fbf6ec; color: var(--ink); font: 500 18px/1.2 var(--mono); }
.field input:focus { outline: 2px solid var(--amber); outline-offset: 2px; }
.err { margin-top: 12px; padding: 10px 12px; background: #f6d7cd; color: #7c1f0e; border-radius: 6px; font: 600 14px/1.35 var(--sans); }
.btn-wide { width: 100%; padding: 16px; font-size: 16px; }

/* QR-nézet: teljes fehér lap a legjobb olvashatóságért */
.qr { position: fixed; inset: 0; z-index: 10; background: #fff; color: var(--ink); display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  opacity: 0; transform: translateY(24px); transition: opacity .22s ease, transform .32s var(--ease); }
.qr.open { opacity: 1; transform: none; }
.qr[hidden], .modal[hidden] { display: none; }
.qr:not(.open) { pointer-events: none; }
.qr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.qr-head h2 { font: 900 38px/.9 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.qr-head p { font: 500 14px/1.3 var(--mono); letter-spacing: .04em; margin-top: 8px; text-transform: uppercase; }
.x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.x svg { width: 20px; height: 20px; }
.qr-code { flex: 1; display: grid; place-items: center; min-height: 0; }
.qr-code img { display: block; width: min(88vw, 60vh, 440px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-code .miss { font: 400 15px/1.4 var(--sans); text-align: center; color: #6b6257; max-width: 280px; }
.qr-no { text-align: center; font: 500 15px/1 var(--mono); letter-spacing: .08em; }
.qr-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 12px; }
.qr-foot .hint { display: flex; align-items: center; gap: 6px; font: 400 13px/1.3 var(--sans); color: #6b6257; }
.qr-foot .hint svg { flex: none; width: 16px; height: 16px; }
.btn { border: 1.5px solid var(--ink); background: #fff; color: var(--ink); padding: 11px 14px; border-radius: 6px; font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.qr.full .qr-code { place-items: start center; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 12px -20px 0; padding: 0 20px; }
.qr.full .qr-code img { width: min(100%, 480px); aspect-ratio: auto; image-rendering: auto; }
.qr.full .qr-no { display: none; }

/* app-on belüli megerősítés */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; padding: 16px; background: rgba(5,4,3,.6); opacity: 0; transition: opacity .2s ease; }
.modal.open { opacity: 1; }
.modal-box { width: min(100%, 448px); background: var(--paper); color: var(--ink); border-radius: 6px; padding: 20px 18px 16px; transform: translateY(20px); transition: transform .28s var(--ease); margin-bottom: env(safe-area-inset-bottom); }
.modal.open .modal-box { transform: none; }
.modal-box h3 { font: 900 30px/1 var(--display); text-transform: uppercase; }
.modal-box p { margin-top: 8px; font: 400 15px/1.4 var(--sans); color: #4c4237; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .btn { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
@media (min-width: 560px) {
  .modal { place-items: center; }
}
