/* Helyi Kupon közös stílusok */
:root {
  --orange: #ff5a36;
  --orange-text: #c93c1b;
  --orange-soft: #ffe9e3;
  --ink: #141414;
  --ink-2: #5f5f5f;
  --bg: #f4f4f2;
  --tile: #fdfdfc;
  --line: #e4e4e0;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.logo { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 21px; letter-spacing: -0.04em; }
.logo svg { flex: none; transition: transform .35s var(--ease); }
.logo:hover svg { transform: rotate(-8deg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--ink); color: var(--tile); border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; cursor: pointer; transition: background-color .12s var(--ease), transform .12s var(--ease); }
.btn:hover { background: #333; }
.btn:active { transform: scale(.96); }
.btn.orange { background: var(--orange); color: var(--ink); }
.btn.orange:hover { background: #ff7656; }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.line:hover { background: var(--bg); }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; transition: background-color .15s, transform .12s var(--ease); }
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(.9); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; font-weight: 800; font-size: 15px; border: 0; cursor: pointer; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; font-weight: 600; background: var(--bg); border-radius: 6px; padding: 3px 8px; display: inline-flex; gap: 5px; align-items: center; }
.chip.student { background: var(--ink); color: var(--tile); }

/* kupon csempe (vízszintes sorokhoz) */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 262px; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 8px; margin: -2px -2px 0; cursor: grab; }
.row::-webkit-scrollbar { display: none; }
.row.dragging { cursor: grabbing; scroll-snap-type: none; }
.row.dragging .tile { pointer-events: none; }
.tile { background: var(--tile); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; border: 0; padding: 0; text-align: left; scroll-snap-align: start; transition: transform .15s var(--ease); }
.tile:active { transform: scale(.97); }
.tile .ph { aspect-ratio: 16 / 10; background: var(--line) center / cover no-repeat; position: relative; overflow: hidden; }
.tile .tag { position: absolute; left: 0; top: 0; background: var(--tile); font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 0 0 12px 0; max-width: 85%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--orange); color: var(--ink); font-weight: 800; }
.tile .badge { position: absolute; left: 0; bottom: 0; font-size: 16px; padding: 5px 11px; border-radius: 0 12px 0 0; transition: transform .2s var(--ease); transform-origin: left bottom; }
.tile:hover .badge { transform: scale(1.08); }
.tile .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.tile .what { font-weight: 600; font-size: 14px; line-height: 1.35; margin: 0; min-height: 2.7em; }
.status { font-weight: 700; color: var(--ink-2); font-size: 14px; }
.status.live { color: var(--orange-text); }
.tile .status { margin-top: auto; }
.left-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.left-bar span { display: block; height: 100%; background: var(--orange); border-radius: 2px; transform-origin: left; transition: transform .6s var(--ease); }
.tile.dim .ph { opacity: .5; }
.tile.dim .badge { background: var(--line); }

/* lapok */
dialog { border: 0; padding: 0; background: var(--tile); color: var(--ink); }
dialog::backdrop { background: rgba(20, 20, 20, .55); }
.x { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink); cursor: pointer; font-size: 0; line-height: 0; flex: none; transition: transform .2s var(--ease); }
/* az X két vonalból, hogy pontosan középen legyen (a × betű minden betűtípusban máshol ül) */
.x::before, .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 2.2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.x:hover { transform: rotate(90deg); }

#sheet { width: min(430px, 100%); max-width: 100%; border-radius: 22px; margin: auto; overflow: hidden; }
.s-wrap { padding: 14px 14px 18px; display: grid; gap: 16px; outline: none; }
.s-body { display: grid; gap: 8px; touch-action: pan-y; }
.s-body.out-l { animation: outL .16s var(--ease) forwards; }
.s-body.out-r { animation: outR .16s var(--ease) forwards; }
.s-body.in-l { animation: inL .22s var(--ease); }
.s-body.in-r { animation: inR .22s var(--ease); }
@keyframes outL { to { transform: translateX(-40px); opacity: 0; } }
@keyframes outR { to { transform: translateX(40px); opacity: 0; } }
@keyframes inL { from { transform: translateX(40px); opacity: 0; } }
@keyframes inR { from { transform: translateX(-40px); opacity: 0; } }
.s-photo { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; background: var(--line) center / cover; overflow: hidden; }
.s-photo .badge { position: absolute; left: 0; bottom: 0; font-size: 30px; letter-spacing: -0.03em; padding: 6px 16px; border-radius: 0 14px 0 0; }
.s-photo .x { position: absolute; right: 10px; top: 10px; background: rgba(253,253,252,.92); width: 44px; height: 44px; }
.s-what { margin: 2px 0 0; font-size: 23px; line-height: 1.2; letter-spacing: -0.025em; font-weight: 800; }
.s-place { justify-self: start; border: 0; background: none; padding: 8px 0; min-height: 44px; font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.s-when { margin: 0; font-size: 16px; color: var(--ink-2); }
.s-when.live { color: var(--orange-text); font-weight: 700; }
.s-student { margin: 0; justify-self: start; background: var(--orange-soft); color: var(--orange-text); font-weight: 700; font-size: 15px; border-radius: 8px; padding: 5px 10px; }
.s-student[hidden] { display: none; }
.s-student.only { background: var(--orange); color: var(--ink); }
.s-credit { margin: 0; font-size: 12px; color: var(--ink-2); } .s-credit:empty { display: none; } .s-credit a { text-decoration: underline; }
.s-more { margin: 0; font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.tq-student { margin: 10px 0 0; font-size: 15px; font-weight: 700; background: rgba(20,20,20,.12); border-radius: 8px; padding: 6px 10px; display: inline-block; }
.tq-student[hidden] { display: none; }
.swipe { position: relative; height: 58px; border-radius: 14px; background: var(--ink); overflow: hidden; user-select: none; touch-action: none; }
.swipe .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--orange); }
.swipe .label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 50px; font-weight: 700; font-size: 15px; pointer-events: none; background: linear-gradient(90deg, var(--tile) 0, var(--tile) 40%, #9a9a96 50%, var(--tile) 60%, var(--tile) 100%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.6s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.swipe .knob { position: absolute; left: 5px; top: 5px; width: 48px; height: 48px; border-radius: 10px; border: 0; background: var(--orange); display: grid; place-items: center; cursor: grab; touch-action: none; }
.swipe .knob:active { cursor: grabbing; }
.swipe.off { background: var(--line); }
.swipe.off .label { color: var(--ink-2); padding-left: 0; animation: none; background: none; }
.swipe.off .knob { display: none; }
.swipe.back .knob, .swipe.back .fill { transition: transform .25s var(--ease), width .25s var(--ease); }

#qrView { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; background: var(--ink); color: var(--ink); }
.qr-stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); overflow: hidden; }
/* a jegy: felül narancs fejléc, perforált vágás, alul a kód */
.ticket-qr { width: min(360px, 100%); filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }
.tq-top { background: var(--orange); border-radius: 22px 22px 0 0; padding: 22px 24px 20px; }
.tq-place { margin: 0 0 10px; font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.tq-deal { margin: 0; font-size: 52px; line-height: .95; font-weight: 900; letter-spacing: -0.05em; }
.tq-what { margin: 8px 0 0; font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
.tq-cut { height: 24px; background:
    radial-gradient(circle at 0 50%, transparent 12px, var(--tile) 12.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 12px, var(--tile) 12.5px) right / 51% 100% no-repeat;
  position: relative; }
.tq-cut::after { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; border-top: 2px dashed var(--line); }
.tq-bottom { background: var(--tile); border-radius: 0 0 22px 22px; padding: 8px 24px 22px; text-align: center; }
.qr-code svg { width: 100%; max-width: 250px; height: auto; display: block; margin: 0 auto; }
.tq-code { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); letter-spacing: .04em; }
.tq-code b { color: var(--ink); font-size: 17px; letter-spacing: .12em; }
.tq-help { margin: 8px 0 2px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.tq-time { margin: 0; font-size: 16px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tq-done { min-width: 200px; padding: 16px 28px; font-size: 18px; background: var(--tile); color: var(--ink); border-radius: 14px; }
.tq-done:hover { background: #fff; }
@media (prefers-reduced-motion: no-preference) {
  #qrView[open] { animation: fadeIn .25s var(--ease); }
  .ticket-qr.in { animation: ticketIn .7s cubic-bezier(.16, 1, .3, 1) both; }
  .ticket-qr.in .tq-top > * { animation: up .45s .35s var(--ease) both; }
  .ticket-qr.in .tq-deal { animation-delay: .42s; }
  .ticket-qr.in .tq-what { animation-delay: .48s; }
  .ticket-qr.in .qr-code { animation: wipe .6s .5s cubic-bezier(.65, 0, .35, 1) both; }
  .ticket-qr.in .tq-help, .ticket-qr.in .tq-time { animation: up .4s .9s var(--ease) both; }
  #qrView[open] .tq-done { animation: up .4s 1s var(--ease) both; }
}
@keyframes ticketIn { from { transform: translateY(110vh) rotate(-8deg); } 70% { transform: translateY(-6px) rotate(.6deg); } }
@keyframes wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2147483647; }

.count { font-size: 14px; font-weight: 700; color: var(--orange-text); }

@media (max-width: 860px) {
  .row { grid-auto-columns: 78%; }
  #sheet { margin: auto 0 0; width: 100%; border-radius: 22px 22px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #sheet[open] { animation: sheetIn .32s var(--ease); }
  #qrView[open] { animation: fadeIn .2s var(--ease); }
  dialog[open]::backdrop { animation: fadeIn .25s var(--ease); }
  .row.reveal .tile { animation: tileIn .45s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 860px) { @keyframes sheetIn { from { transform: translateY(100%); } } }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes tileIn { from { transform: translateX(28px); opacity: 0; } }
@keyframes up { from { transform: translateY(14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .swipe .label { animation: none; background: none; color: var(--tile); } }

/* "Szólj, ha indul" a kuponlapon */
.s-notify { justify-self: start; margin: 4px 0 0; border: 2px solid var(--ink); background: var(--tile); border-radius: 12px; padding: 11px 16px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.s-notify.on { background: var(--ink); color: var(--tile); }
/* visszajelzés alul */
.toast { position: fixed; inset: auto; margin: 0; border: 0; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 1000; width: min(440px, calc(100% - 32px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--tile); border-radius: 14px; padding: 14px 16px; font-size: 16px; font-weight: 600; line-height: 1.35; transition: opacity .2s, transform .2s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.status, .card .meta .live { white-space: nowrap; }
