/* =========================================================
   EVTM Premium — Boarding Pass menu (alternative to the Departures Board)
   Only takes effect when js/pass.js is the active menu (rail gets .rail--pass).
   ========================================================= */
:root { --paper: #f4ecd8; --paper-2: #ebe0c6; --ink: #0b0e3f; --ink-2: #4a4f7a; --foil: #b8893f; --stamp: #8c1d2c; }

/* ---- Rail: the ticket stub ---- */
.rail--pass .stub {
  position: relative; flex: 1; width: 70px; margin: 14px auto 6px; padding: 18px 6px 14px; border: 0; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(var(--paper), var(--paper-2)); border-radius: 10px;
  -webkit-mask: radial-gradient(circle 7px at 50% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 7px at 50% 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(184, 137, 63, .35);
  transition: transform .5s var(--ease), filter .4s;
}
.rail--pass .stub::after { content: ""; position: absolute; left: 8px; right: 8px; top: 48px; border-top: 2px dotted rgba(11, 14, 63, .25); }
.rail--pass .stub:hover { transform: translateX(-4px) rotate(-2deg); filter: drop-shadow(0 12px 24px rgba(232, 194, 122, .25)); }
.stub-top { display: flex; flex-direction: column; align-items: center; }
.stub-top b { font: 800 .8rem var(--font-display); letter-spacing: .08em; }
.stub-top small { font: 700 .42rem var(--font-display); letter-spacing: .24em; color: var(--foil); }
.stub-to { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; }
.stub-to small, .stub-seat small { font: 700 .46rem var(--font-display); letter-spacing: .24em; color: var(--ink-2); }
.stub-dest { writing-mode: vertical-rl; transform: rotate(180deg); font: 500 italic 1.45rem var(--font-lux); line-height: 1; color: var(--ink); white-space: nowrap; max-height: 230px; overflow: hidden; }
.stub-seat { display: flex; flex-direction: column; align-items: center; }
.stub-seat b { font: 700 1rem "JetBrains Mono", ui-monospace, Consolas, monospace; }
.stub-bars, .ps-bars { display: flex; align-items: stretch; }
.stub-bars { height: 30px; }
.stub-bars i, .ps-bars i { display: block; background: var(--ink); }
.stub-cta { font: 700 .5rem var(--font-display); letter-spacing: .26em; padding: 5px 8px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.rail--pass .stub.is-swap .stub-dest { animation: inkIn .6s var(--ease); }
.rail--pass .stub.is-swap .stub-no { animation: inkInFlat .6s var(--ease); }
@keyframes inkIn { from { opacity: 0; filter: blur(4px); transform: rotate(180deg) translateY(-10px); } }
@keyframes inkInFlat { from { opacity: 0; filter: blur(4px); } }

/* ---- Overlay: the full boarding pass ---- */
.pass { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: clamp(14px, 3vw, 40px); background: rgba(3, 4, 14, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .4s var(--ease); overflow-y: auto; perspective: 1600px; }
.pass.is-open { opacity: 1; }
.pass-ticket { display: flex; width: min(1060px, 100%); filter: drop-shadow(0 40px 90px rgba(0, 0, 0, .6)); }
.pass-main, .pass-stub { background: linear-gradient(160deg, var(--paper), var(--paper-2)); color: var(--ink); }
.pass-main { flex: 1; min-width: 0; padding: clamp(18px, 3vw, 34px); border-radius: 16px 0 0 16px; position: relative; transform-origin: right center; transform: rotateY(-88deg); opacity: 0; transition: transform .8s var(--ease) .12s, opacity .3s .12s; box-shadow: inset 0 0 0 1px rgba(184, 137, 63, .35); }
.pass-main::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184, 137, 63, .45); border-radius: 10px; pointer-events: none; }
.pass.is-open .pass-main { transform: none; opacity: 1; }
.pass-stub { position: relative; width: 170px; flex: none; border-radius: 0 16px 16px 0; padding: 26px 18px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; transform: translateX(60px); opacity: 0; transition: transform .6s var(--ease), opacity .4s; box-shadow: inset 0 0 0 1px rgba(184, 137, 63, .35); }
.pass.is-open .pass-stub { transform: none; opacity: 1; }
.pass.is-closing .pass-stub { transform: translate(40px, 30px) rotate(9deg); opacity: 0; transition: transform .4s var(--ease), opacity .4s; }
.pass.is-closing .pass-main { transform: rotateY(-88deg); opacity: 0; transition: transform .4s ease-in, opacity .3s; }
.ps-perf { position: absolute; left: -1px; top: 14px; bottom: 14px; border-left: 2px dashed rgba(11, 14, 63, .3); }
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; left: -12px; width: 24px; height: 24px; border-radius: 50%; background: #070816; }
.pass-stub::before { top: -12px; }
.pass-stub::after { bottom: -12px; }
.ps-brand { font: 800 1.3rem var(--font-display); letter-spacing: .06em; }
.ps-admit { font: 700 .7rem var(--font-display); letter-spacing: .3em; text-align: center; color: var(--foil); }
.ps-seat { display: flex; flex-direction: column; align-items: center; font: 700 2.2rem "JetBrains Mono", ui-monospace, Consolas, monospace; line-height: 1; }
.ps-seat small { font: 700 .6rem var(--font-display); letter-spacing: .26em; color: var(--ink-2); margin-bottom: 4px; }
.ps-bars { height: 54px; }
.pass-close { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 600 .8rem var(--font-body); cursor: pointer; }
.pass-close:hover { background: var(--ink); color: var(--paper); }

.pass-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(184, 137, 63, .5); }
.ph-brand { font: 800 1.1rem var(--font-display); letter-spacing: .06em; }
.ph-brand i { font: 500 italic 1.15rem var(--font-lux); color: var(--foil); }
.ph-title { font: 500 italic clamp(1.8rem, 4vw, 2.8rem) var(--font-lux); color: var(--ink); }
.ph-class { font: 700 .66rem var(--font-display); letter-spacing: .26em; text-transform: uppercase; color: var(--foil); }
.pass-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 18px 0 12px; }
.pass-route small, .pass-meta small, .pass-ports small { display: block; font: 700 .6rem var(--font-display); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); }
.pass-route b { display: block; font: 800 clamp(1.3rem, 2.6vw, 2rem) var(--font-display); letter-spacing: -.01em; }
.pass-route em { font: 700 .8rem "JetBrains Mono", ui-monospace, Consolas, monospace; font-style: normal; color: var(--foil); }
.pr-to { text-align: right; }
.pr-to b { font: 500 italic clamp(1.1rem, 2.2vw, 1.6rem) var(--font-lux); }
.pr-line { width: 100%; height: 30px; color: var(--foil); }
.pr-ship { fill: var(--ink); }
.pass-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 0 16px; border-bottom: 1px dashed rgba(11, 14, 63, .25); font: 600 .9rem var(--font-body); }
.fares { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fare { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(11, 14, 63, .18); background: rgba(255, 255, 255, .35); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .35s var(--ease), border-color .3s, background .3s; }
.fare:hover { transform: translateY(-3px); border-color: var(--ink); background: rgba(255, 255, 255, .6); }
.f-code { font: 700 1.25rem "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.f-name { font: 600 .95rem var(--font-display); }
.f-seat { font: 600 .62rem var(--font-display); letter-spacing: .14em; color: var(--ink-2); }
.f-here { position: absolute; top: 10px; right: 10px; font: 700 .52rem var(--font-display); letter-spacing: .18em; padding: 3px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.fare.is-here { border-color: var(--foil); background: rgba(232, 194, 122, .25); }
.stamp { position: absolute; left: 50%; top: 50%; padding: 4px 10px; border: 3px double var(--stamp); border-radius: 6px; color: var(--stamp); font: 800 1.05rem var(--font-display); letter-spacing: .22em; opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(2.6); pointer-events: none; mix-blend-mode: multiply; }
.fare.is-stamped .stamp { animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stampIn { 60% { opacity: .95; transform: translate(-50%, -50%) rotate(-14deg) scale(.92); } 100% { opacity: .9; transform: translate(-50%, -50%) rotate(-14deg) scale(1); } }
.fare.is-stamped { animation: thud .3s .25s; }
@keyframes thud { 50% { transform: translateY(2px) scale(.985); } }
.pass-ports { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(11, 14, 63, .25); }
.pass-ports ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.port { position: relative; display: flex; flex-direction: column; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(11, 14, 63, .15); text-decoration: none; color: var(--ink); transition: border-color .3s, background .3s; }
.port:hover { border-color: var(--ink); background: rgba(255, 255, 255, .5); }
.port b { font: 700 .9rem "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.port span { font: 600 .82rem var(--font-display); }
.port em { position: absolute; top: 6px; right: 8px; font: 700 .5rem var(--font-display); font-style: normal; letter-spacing: .18em; color: var(--foil); }

@media (max-width: 900px) {
  .rail--pass .stub { flex: none; flex-direction: row; width: auto; height: 44px; margin: 0 10px 0 0; padding: 0 10px; gap: 10px; -webkit-mask: none; mask: none; }
  .rail--pass .stub::after, .rail--pass .stub-top, .rail--pass .stub-seat, .rail--pass .stub-bars { display: none; }
  .rail--pass .stub-to { flex-direction: row; gap: 6px; align-items: baseline; }
  .rail--pass .stub-dest { writing-mode: horizontal-tb; transform: none; font-size: 1.1rem; max-width: 130px; text-overflow: ellipsis; }
  .rail--pass .stub.is-swap .stub-dest { animation-name: inkInFlat; }
  .pass { place-items: start center; }
  .pass-ticket { flex-direction: column; }
  .pass-main { border-radius: 16px 16px 0 0; transform-origin: bottom center; transform: rotateX(80deg); }
  .pass.is-closing .pass-main { transform: rotateX(80deg); }
  .pass-stub { width: 100%; flex-direction: row; flex-wrap: wrap; border-radius: 0 0 16px 16px; padding: 16px 18px; transform: translateY(40px); }
  .ps-perf { left: 14px; right: 14px; top: -1px; bottom: auto; border-left: 0; border-top: 2px dashed rgba(11, 14, 63, .3); }
  .pass-stub::before, .pass-stub::after { top: -12px; bottom: auto; }
  .pass-stub::before { left: -12px; }
  .pass-stub::after { left: auto; right: -12px; }
  .ps-admit, .ps-bars { display: none; }
  .ps-seat { font-size: 1.4rem; }
  .fares { grid-template-columns: 1fr 1fr; }
  .pass-ports ul { grid-template-columns: 1fr 1fr; }
  .pass-route { grid-template-columns: 1fr; gap: 6px; }
  .pr-to { text-align: left; }
}
