/* Trailerterem – nézőoldal
   VOICE: sötét terem, halk felület, a vászon a főszereplő
   IDEA: a mozijegy-pénztár helytérképe + a terem saját fényei
   PICTURE: a kódból épített 3D terem tölti ki a képernyőt
   COLOUR/TYPE: bársonyvörös, elefántcsont, éjfekete · Big Shoulders Display + rendszerbetű
   LAYOUT: teljes képes színpad, oldalsó (telefonon alsó) helyválasztó, alsó vezérlősáv */

@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal; 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-style: normal; 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;
}

:root {
  color-scheme: dark;
  --ink: #f3ebdf;
  --mute: rgba(243, 235, 223, 0.62);
  --line: rgba(243, 235, 223, 0.12);
  --panel: rgba(14, 11, 12, 0.88);
  --velvet: #c42f40;
  --velvet-deep: #5b1a25;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body {
  margin: 0; background: #000; color: var(--ink);
  font: 16px/1.45 var(--body); overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- színpad -------------------------------------------------------- */
.stage { position: fixed; inset: 0; }
.css3d { position: absolute !important; inset: 0; z-index: 1; pointer-events: none; }
.gl { position: absolute; inset: 0; z-index: 2; display: block; }
/* v8: a videó a vászon VALÓS képarányú (FLAT 1,85:1 / SCOPE 2,39:1) konténerében fut: a vászon mérete és aránya
   akkor is megmarad, ha a videó képaránya más (pl. 16:9 → oldalt fekete sáv). A magasságot a JS állítja (720 px). */
.screen-host { height: 720px; background: #000; display: grid; place-items: center; }
.screen-player { width: 1280px; height: 720px; background: #000; }
.screen-player iframe, .screen-player > div { width: 100%; height: 100%; border: 0; display: block; }
.screen-host.off, .screen-host.far { visibility: hidden; }
.look { position: absolute; inset: 0; z-index: 3; touch-action: none; }
body.playing .look { cursor: grab; }
body.playing .look:active { cursor: grabbing; }
body.interactive .look, body.interactive .gl { pointer-events: none; }

/* ---- betöltés --------------------------------------------------------- */
.loading {
  position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #1d1418, #070506 70%);
  transition: opacity .8s ease;
}
.loading.gone { opacity: 0; pointer-events: none; }
.loading-title { font: 800 clamp(44px, 9vw, 92px)/1 var(--display); }
.loading-sub { color: var(--mute); margin-top: 10px; max-width: 34ch; }

/* ---- márkajel --------------------------------------------------------- */
.brand {
  position: fixed; z-index: 20; top: calc(14px + var(--sat)); left: calc(18px + var(--sal));
  display: flex; align-items: baseline; gap: 10px; pointer-events: none;
  transition: opacity .6s ease; text-shadow: 0 1px 12px rgba(0,0,0,.7);
}
.brand-name { font: 800 26px/1 var(--display); }
.brand-hall { color: var(--mute); font-size: 14px; }
.brand.dim { opacity: 0; }
.back-btn { pointer-events: auto; margin-left: 6px; align-self: center; background: rgba(14,11,12,.6); backdrop-filter: blur(6px); }
body[data-mode="foyer"] .back-btn { display: none; }
body[data-mode="hall"] .foyer-ui { display: none; }
body[data-mode="foyer"] .picker, body[data-mode="foyer"] .hud, body[data-mode="foyer"] .gate { visibility: hidden; pointer-events: none; opacity: 0; }

/* ---- előtér ----------------------------------------------------------- */
.foyer-ui {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(18px + var(--sab));
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.foyer-ui > * { pointer-events: auto; }
.foyer-hint { margin: 0; color: var(--mute); font-size: 14px; text-shadow: 0 1px 10px #000; text-align: center; padding: 0 16px; }
.foyer-enter { min-width: min(86vw, 340px); box-shadow: 0 10px 40px rgba(196,47,64,.35); }
.fade { position: fixed; inset: 0; z-index: 50; background: #000; opacity: 0; pointer-events: none; transition: opacity .36s ease; }
.fade.on { opacity: 1; pointer-events: auto; }
.portal-flash { position: fixed; inset: 0; z-index: 49; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,246,220,.95) 0%, rgba(255,196,90,.75) 35%, rgba(120,70,10,0) 75%); }
body.entering .foyer-ui, body.entering .brand { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.portal-flash.on { animation: portalFlash .75s ease-out; }
.portal-flash.hold { opacity: 1; transition: opacity .25s ease-in; background: radial-gradient(ellipse at 50% 50%, #fff6dc 0%, #ffc45a 45%, #6a3e08 100%); }
@keyframes portalFlash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
body[data-mode="foyer"] .look { cursor: default; }

/* ---- a lebegő tábla (CSS3D) ------------------------------------------- */
.tb {
  position: relative; width: 1600px; height: 900px; overflow: hidden; color: var(--ink);
  font-family: var(--body); background: radial-gradient(ellipse at 30% 0%, #1b2038 0%, #0b0d17 62%, #07080d 100%);
  border-radius: 6px; user-select: none; -webkit-user-select: none;
}
.tb > * { position: absolute; }
/* indulási tábla (split-flap) */
.fb { background: linear-gradient(180deg, #121316 0%, #0a0b0d 100%); box-shadow: inset 0 0 0 10px #1c1d21, inset 0 0 0 12px #2a2b30; border-radius: 10px; }
.fb-head { left: 48px; right: 48px; top: 34px; height: 92px; display: flex; align-items: center; justify-content: space-between; }
.fb-title { display: flex; flex-direction: column; gap: 8px; }
.fb-t1 { font: 800 70px/0.9 var(--display); letter-spacing: .06em; color: #ffc23a; }
.fb-t2 { font: 700 20px/1 var(--body); letter-spacing: .32em; color: rgba(243,235,223,.62); }
.fb-clock { display: flex; gap: 6px; }
.fb-cols { height: 30px; display: flex; font: 700 19px/30px var(--body); letter-spacing: .22em; color: rgba(255,194,58,.8); border-bottom: 2px solid rgba(255,194,58,.25); }
.fb-col.a { width: 120px; padding-left: 4px; }
.fb-col.b { margin-left: 0; }
.fb-row { display: flex; align-items: center; padding: 0 0 0 4px; border-radius: 8px; }
.fb-row.focus { background: rgba(255,194,58,.13); box-shadow: inset 0 0 0 2px rgba(255,194,58,.55); }
.fb-no { display: flex; gap: 5px; }
.fb-ttl { display: flex; gap: 3px; margin-left: 18px; }
.fl.tx { width: 26px; height: 42px; border-radius: 3px; }
.fl.tx .fl-c { font-size: 30px; }
.fb-row.empty .fl.tx .fl-c { color: rgba(244,239,228,.38); }
.fb-dot { position: absolute; right: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #2a2b30; }
.fb-row.focus .fb-dot { background: #ffc23a; box-shadow: 0 0 14px #ffc23a; animation: fbBlink 1.1s steps(2) infinite; }
@keyframes fbBlink { 50% { opacity: .25; } }
.fl {
  position: relative; width: 44px; height: 54px; border-radius: 5px; overflow: hidden;
  background: linear-gradient(180deg, #2b2c31 0%, #232428 49.2%, #0b0b0d 49.2%, #0b0b0d 50.8%, #1e1f23 50.8%, #18191c 100%);
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255,255,255,.06);
}
.fl.sm { width: 40px; height: 52px; }
.fl-c { position: absolute; inset: 0; display: grid; place-content: center; font: 800 44px/1 var(--display); color: #f4efe4; text-shadow: 0 1px 0 #000; }
.fl.sm .fl-c { font-size: 40px; color: #ffc23a; }
.fb-row.focus .fl-c { color: #ffc23a; }
.fl::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: linear-gradient(180deg, #34353b, #26272b); transform-origin: 50% 100%; transform: scaleY(0); pointer-events: none; }
.fl.flip::after { animation: flap 62ms linear; }
.fl.flip .fl-c { animation: flapText 62ms linear; }
@keyframes flap { 0% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes flapText { 0% { opacity: .35; } 100% { opacity: 1; } }
.fb-foot { left: 48px; top: 816px; width: 1120px; height: 62px; display: flex; align-items: center; gap: 18px; border-top: 2px solid rgba(255,194,58,.25); padding-top: 8px; }
.fb-fno { font: 800 46px/1 var(--display); color: #ffc23a; min-width: 56px; }
.fb-ftxt { font: 700 22px/1.2 var(--body); letter-spacing: .14em; color: rgba(243,235,223,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb.compact .fb-cols { display: none; }
.fb.compact .fb-head { top: 12px; height: 72px; }
.fb.compact .fb-t1 { font-size: 58px; }
.fb.compact .fb-t2 { display: none; }
.fb.compact .fl { width: 48px; height: 66px; }
.fb.compact .fl-c { font-size: 56px; }
.fb.compact .fl.sm { width: 46px; height: 60px; }
.fb.compact .fl.sm .fl-c { font-size: 50px; }
.fb.compact .fl.tx { width: 34px; height: 62px; }
.fb.compact .fl.tx .fl-c { font-size: 46px; }
.fb.compact .fb-ttl { gap: 3px; margin-left: 14px; }
.fb.compact .fb-foot { top: 842px; height: 52px; padding-top: 4px; }
.fb.compact .fb-fno { font-size: 50px; }
.fb.compact .fb-ftxt { font-size: 28px; }
.fb.compact .fb-enter { font-size: 38px; }
body.foyer-compact .foyer-ui { display: none; }
.fb-enter { display: grid; place-content: center; background: #ffc23a; color: #111; border-radius: 8px; font: 800 30px/1 var(--display); letter-spacing: .12em; box-shadow: 0 6px 26px rgba(255,194,58,.35); }

/* ---- helyválasztó: kompakt sáv alul + felugró teremkép ------------------------ */
.picker {
  position: fixed; z-index: 20; left: 50%; bottom: calc(14px + var(--sab));
  width: min(760px, calc(100vw - 28px)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 16px; background: rgba(14,12,14,.78); border: 1px solid var(--line); border-radius: 16px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
}
.picker.closed { transform: translate(-50%, calc(100% + 30px)); opacity: 0; pointer-events: none; }
.picker-info { flex: 1 1 260px; min-width: 0; }
.picker h1 { margin: 0; font: 800 28px/1 var(--display); }
.picker-sub { margin: 4px 0 0; color: var(--mute); font-size: 13px; line-height: 1.35; }
.picker-info .btn { margin-top: 6px; }
.seat-info { font-size: 15px; margin-top: 6px; }
.picker-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.mappop {
  position: fixed; z-index: 19; left: 50%; top: calc(58px + var(--sat)); transform: translateX(-50%);
  width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 235px - var(--sat) - var(--sab)); overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 12px;
  background: rgba(12,10,13,.58); border: 1px solid rgba(243,235,223,.16); border-radius: 18px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.mappop[hidden] { display: none; }
.mappop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mappop-ttl { display: grid; gap: 4px; min-width: 0; }
.mappop-title { font: 800 22px/1 var(--display); letter-spacing: .03em; }
.mappop-spec { font-size: 13px; color: var(--mute); }
.seatmap-wrap { border-radius: 12px; background: rgba(0,0,0,.22); padding: 6px 4px; }
.seatmap { display: block; width: 100%; height: auto; max-height: calc(100dvh - 300px); user-select: none; }
.sm-screen { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: .75; }
.sm-screen-label { fill: var(--mute); font: 600 11px var(--body); }
.sm-row { fill: rgba(243,235,223,.5); font: 600 11px var(--body); }
.sm-best { fill: rgba(243,235,223,.04); stroke: rgba(243,235,223,.3); stroke-dasharray: 4 4; }
/* a székek színe a teremhez igazodik (inline --c, lásd seatmap.js) */
.sm-seat { fill: var(--c, var(--velvet-deep)); stroke: rgba(0,0,0,.5); stroke-width: 1; cursor: pointer; transition: fill .15s ease, filter .15s ease; outline: none; }
.sm-seat.wheel { fill: #1f4fae; }
.sm-seat.best { stroke: rgba(255, 207, 140, .85); stroke-width: 1.5; }
.sm-seat.hov { filter: brightness(1.45); stroke: #fff; }
.sm-seat.off { opacity: .28; cursor: not-allowed; }
.sm-gal { fill: #ffc23a; font: 700 10px var(--body); letter-spacing: .08em; }
.sm-gal-line { stroke: rgba(255,194,58,.5); stroke-dasharray: 3 3; }
.sm-seat.sel { fill: #fff; stroke: #ffc23a; stroke-width: 2; }
.sm-seat:focus-visible { stroke: #fff; stroke-width: 2.5; }
.sm-wheel { fill: #fff; pointer-events: none; }
.sm-door { fill: var(--mute); font: 600 10px var(--body); }
.sm-door-mark { fill: #19d36b; }
.sm-stair { fill: rgba(61,240,166,.22); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--mute); font-size: 13px; }
.lg::before { content: ''; display: inline-block; width: 12px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.lg-free::before { background: var(--lg-free, var(--velvet-deep)); }
.lg-best::before { background: var(--lg-free, var(--velvet-deep)); outline: 1.5px solid rgba(255,207,140,.85); }
.lg-sel::before { background: #fff; outline: 1.5px solid #ffc23a; }
.program { font-size: 14px; color: var(--mute); }
.program summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.program ol { margin: 4px 0 0; padding-left: 22px; max-height: 140px; overflow: auto; }
.program li { padding: 2px 0; overflow-wrap: anywhere; }


/* ---- gombok ----------------------------------------------------------- */
.btn {
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 650; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--velvet); color: #fff; }
.btn.primary:hover { background: #d63a4b; }
.btn.primary:disabled { opacity: .38; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(243,235,223,.28); }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 14px; }
.btn.big { min-height: 58px; font-size: 18px; padding: 0 30px; }
.btn:focus-visible, .ic:focus-visible, .pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- vezérlősáv ------------------------------------------------------- */
.hud {
  position: fixed; z-index: 20; left: 50%; bottom: calc(12px + var(--sab)); transform: translateX(-50%);
  width: min(800px, calc(100vw - 24px - var(--sal) - var(--sar)));
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px;
  background: rgba(12, 10, 11, .8); border: 1px solid var(--line); border-radius: 16px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity .6s ease;
}
.hud.dim { opacity: 0; pointer-events: none; }
.hud-now { flex: 1; }
.hud-kicker { font-size: 12px; color: var(--mute); }
.hud-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-progress { height: 3px; margin-top: 6px; background: rgba(243,235,223,.14); border-radius: 2px; overflow: hidden; }
.hud-progress span { display: block; height: 100%; width: 0; background: var(--velvet); transition: width .25s linear; }
.hud-ctrl { display: flex; align-items: center; gap: 2px; flex: none; }
.ic {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.ic:hover { background: rgba(243,235,223,.1); }
.ic svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ic.wide { width: auto; padding: 0 12px; font-size: 14px; font-weight: 600; }
.ic.on { background: rgba(255,194,58,.18); color: #ffc23a; }
.i-pause, .i-mute { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }
.is-muted .i-vol { display: none; }
.is-muted .i-mute { display: block; }
.vol { width: 92px; accent-color: var(--velvet); margin: 0 6px; }

/* ---- lebegő elemek ---------------------------------------------------- */
.pill {
  position: fixed; z-index: 25; top: calc(14px + var(--sat)); left: 50%; transform: translateX(-50%);
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #141012; font-weight: 700; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.pill svg { width: 20px; height: 20px; fill: currentColor; }
.gate {
  position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: rgba(0,0,0,.42); text-align: center; padding: 24px;
}
.gate-note { margin: 0; color: var(--mute); max-width: 36ch; }
.toast, .hint {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 12px;
  background: rgba(22, 17, 19, .95); border: 1px solid var(--line); font-size: 15px; text-align: center;
}
.toast { bottom: calc(92px + var(--sab)); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.toast.show { opacity: 1; }
.hint { top: calc(64px + var(--sat)); }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; background: #000; color: var(--ink); }

/* ---- kis kijelzők ----------------------------------------------------- */
@media (max-width: 760px) and (min-height: 521px) {
  .picker { left: 0; right: 0; bottom: 0; width: auto; transform: none; border-radius: 18px 18px 0 0; padding: 10px 14px calc(10px + var(--sab)); }
  .picker.closed { transform: translateY(105%); }
  .picker h1 { font-size: 24px; }
  .mappop { top: calc(62px + var(--sat)); max-height: calc(100dvh - 250px - var(--sat) - var(--sab)); }
}
@media (max-height: 520px) {
  .picker { bottom: calc(6px + var(--sab)); padding: 8px 12px; gap: 6px 12px; }
  .picker h1 { font-size: 20px; }
  .picker-sub { display: none; }
  .seat-info { margin-top: 2px; font-size: 14px; }
  .mappop { top: calc(54px + var(--sat)); max-height: calc(100dvh - 132px - var(--sat) - var(--sab)); padding: 8px 12px; gap: 6px; }
  .seatmap { max-height: calc(100dvh - 230px); }
  .legend { display: none; }
  .brand-hall { display: none; }
}
@media (max-width: 620px) {
  .ic.wide span { display: none; }
  .ic.wide { width: 44px; padding: 0; }
  .vol { display: none; }
  .hud { gap: 6px; padding-left: 12px; }
}
@media (max-width: 420px) {
  #centerBtn, #fsBtn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media (max-height: 500px) {
  .foyer-hint { display: none; }
}
