/* =====================================================================
   v11: upgraded border gate (flip card, hologram, fingerprint, face align,
   boarding pass, ticker) + district bar for the bigger city
   ===================================================================== */
.idcard { grid-template-rows: 1fr; cursor: pointer; }
.ic-front { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-height: 0; }
.ic-back { position: absolute; inset: 0; padding: 22px 24px 18px; display: none; grid-template-rows: auto 1fr auto; gap: 12px; }
.idcard.back .ic-front { visibility: hidden; }
.idcard.back .ic-back { display: grid; }
.idcard.flipping { animation: cardFlip .56s var(--ease); }
@keyframes cardFlip { 0% { transform: rotateY(0); } 46% { transform: rotateY(90deg) scale(.96); } 54% { transform: rotateY(-90deg) scale(.96); } 100% { transform: rotateY(0); } }
.ib-stripe { height: 38px; margin: 0 -24px; background: linear-gradient(180deg, #111 0%, #2a2a2a 45%, #0c0c0c 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.ib-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; min-height: 0; }
.ib-qr { width: 92px; height: 92px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 20px rgba(0,229,255,.25); }
.ib-qr svg, .tk-qr svg { width: 100%; height: 100%; display: block; }
.ib-txt b { font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; color: var(--cyan); }
.ib-txt p { font-size: .74rem; color: #c9d6de; line-height: 1.4; margin: .3rem 0; }
.ib-txt small { font-family: var(--mono); font-size: .56rem; color: #8fa6b8; letter-spacing: .08em; word-break: break-all; }
.ib-sig { display: flex; align-items: flex-end; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 6px; }
.ib-sig span { font-family: var(--mono); font-size: .52rem; letter-spacing: .2em; color: #8fa6b8; }
.ib-sig b { margin-left: auto; font-family: "Brush Script MT", "Segoe Script", cursive; font-weight: 400; font-size: 1.4rem; color: #dfe9ff; }
.ic-holo { position: absolute; right: 2px; bottom: 2px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  background: conic-gradient(from calc(var(--fx) * 3.6deg), #ff5fa2, #ffd23f, #39ff88, #00e5ff, #a06bff, #ff5fa2); opacity: .55; mix-blend-mode: screen;
  -webkit-mask: radial-gradient(circle, #000 55%, transparent 56%, transparent 62%, #000 63%); mask: radial-gradient(circle, #000 55%, transparent 56%, transparent 62%, #000 63%); }
.ic-holo span { font-family: var(--mono); font-size: .6rem; font-weight: 900; color: #04060a; letter-spacing: .1em; }

/* gear strip: your face in every operative's kit */
.gear-strip { width: min(500px, 92vw); text-align: center; animation: wsIn .5s var(--ease); }
.gear-strip small { font-family: var(--mono); font-size: .6rem; letter-spacing: .25em; color: var(--cyan); }
#gear-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: .4rem; }
#gear-row span { position: relative; display: grid; justify-items: center; gap: 2px; opacity: 0; animation: gearIn .5s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms); }
#gear-row svg { width: 100%; height: auto; border-radius: 50%; box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
#gear-row em { font-style: normal; font-family: var(--mono); font-size: .5rem; letter-spacing: .1em; color: var(--c); }
@keyframes gearIn { from { opacity: 0; transform: translateY(10px) scale(.8); } to { opacity: 1; transform: none; } }

/* header status */
.gate-status { font-family: var(--mono); font-size: .68rem; letter-spacing: .15em; color: #9fb3c2; display: inline-flex; align-items: center; gap: .4rem; }
.gate-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.6s steps(1) infinite; }
.gate-status b { color: var(--yellow); }
@media (max-width: 760px) { .gate-status { display: none; } }

/* fingerprint scanner next to the submit button */
.gf-submit { display: flex; align-items: stretch; gap: .7rem; margin-top: .4rem; }
.gf-submit .gf-go { flex: 1; margin: 0; }
.fp { position: relative; width: 58px; flex: 0 0 58px; border-radius: 14px; border: 1px solid rgba(0,229,255,.35); background: radial-gradient(circle at 50% 40%, rgba(0,229,255,.12), #060810 70%); overflow: hidden; display: grid; place-items: center; }
.fp svg { width: 40px; height: 40px; }
.fp path { fill: none; stroke-width: 3; stroke-linecap: round; }
.fp-base { stroke: rgba(0,229,255,.25); }
.fp-fill { stroke: var(--cyan); stroke-dasharray: 600; stroke-dashoffset: 600; filter: drop-shadow(0 0 4px var(--cyan)); }
.fp-line { position: absolute; left: 6px; right: 6px; height: 2px; top: 10%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); opacity: 0; }
.fp.scanning .fp-fill { animation: fpFill 1.2s ease-in-out forwards; }
.fp.scanning .fp-line { opacity: 1; animation: fpLine .6s ease-in-out infinite alternate; }
.fp.ok { border-color: var(--green); box-shadow: 0 0 24px rgba(57,255,136,.4); }
.fp.ok .fp-fill { stroke: var(--green); stroke-dashoffset: 0; filter: drop-shadow(0 0 5px var(--green)); }
.fp.bad { border-color: var(--red); animation: shake .4s; }
.fp.bad .fp-fill { stroke: var(--red); stroke-dashoffset: 0; }
@keyframes fpFill { to { stroke-dashoffset: 0; } }
@keyframes fpLine { from { top: 10%; } to { top: 86%; } }

/* face alignment overlay */
.align { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(2,3,8,.78); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.align.on { opacity: 1; }
.align[hidden] { display: none; }
.al-box { display: grid; justify-items: center; gap: .6rem; padding: 1.4rem; border-radius: 20px; border: 1px solid rgba(0,229,255,.35); background: linear-gradient(160deg, #0b1220, #120a1e); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 50px rgba(0,229,255,.15); }
.al-box > b { font-family: var(--mono); font-size: .72rem; letter-spacing: .3em; color: var(--cyan); }
.al-stage { position: relative; width: min(300px, 80vw); aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: grab; touch-action: none; border: 1px solid rgba(255,255,255,.1); }
.al-stage canvas { width: 100%; height: 100%; display: block; }
.al-oval { position: absolute; left: 22%; top: 12%; width: 56%; height: 72%; border-radius: 50%; border: 2px dashed var(--cyan); box-shadow: 0 0 0 999px rgba(2,4,10,.6), inset 0 0 18px rgba(0,229,255,.4); pointer-events: none; }
.al-oval::after { content: ""; position: absolute; left: 12%; right: 12%; top: 42%; border-top: 1px dashed rgba(255,210,63,.8); }
.al-scan { position: absolute; left: 0; right: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: bioScan 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes bioScan { 0%, 100% { top: 8%; } 50% { top: 90%; } }
.al-marks i { position: absolute; width: 18px; height: 18px; border: 2px solid var(--magenta); pointer-events: none; }
.al-marks i:nth-child(1) { left: 8px; top: 8px; border-right: 0; border-bottom: 0; } .al-marks i:nth-child(2) { right: 8px; top: 8px; border-left: 0; border-bottom: 0; }
.al-marks i:nth-child(3) { left: 8px; bottom: 8px; border-right: 0; border-top: 0; } .al-marks i:nth-child(4) { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }
.al-box p { font-size: .78rem; color: #b8c6d0; max-width: 34ch; text-align: center; }
#al-zoom { width: min(280px, 74vw); accent-color: var(--cyan); }
.al-btns { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.gf-pb.ok { background: var(--cyan); color: #04060a; border-color: var(--cyan); }

/* boarding pass printed from the card slot */
.ticket-wrap { width: 100%; max-width: 560px; overflow: hidden; margin-top: -10px; }
@media (max-width: 1100px) and (min-width: 901px) { .ticket { grid-template-columns: 1fr 100px; } .tk-grid { grid-template-columns: repeat(2, 1fr); } }
.ticket { display: none; grid-template-columns: 1fr 120px; color: #1a1626; background: #f4f1ea; border-radius: 0 0 16px 16px; box-shadow: 0 30px 60px rgba(0,0,0,.5);
  background-image: radial-gradient(circle at 0 50%, transparent 10px, #f4f1ea 11px), linear-gradient(90deg, transparent, transparent); font-family: var(--mono); position: relative; }
.ticket.printed { display: grid; animation: tkPrint 1.6s steps(24) forwards; }
@keyframes tkPrint { from { transform: translateY(-100%); } to { transform: none; } }
.ticket::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, #f4f1ea 0 6px, transparent 6px 12px); transform: translateY(-100%); }
.tk-main { padding: 14px 16px; display: grid; gap: 10px; border-right: 2px dashed #b9b2a3; }
.tk-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; border-bottom: 2px solid #1a1626; padding-bottom: 6px; }
.tk-head b { font-size: .8rem; letter-spacing: .2em; }
.tk-head span { font-size: .56rem; letter-spacing: .18em; color: #6c6478; }
.tk-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; }
.tk-route small { display: block; font-size: .5rem; letter-spacing: .2em; color: #6c6478; }
.tk-route strong { display: block; font-size: 1.8rem; line-height: 1; letter-spacing: .04em; }
.tk-route em { font-style: normal; font-size: .6rem; color: #4b4458; }
.tk-route > div:last-child { text-align: right; }
.tk-train { text-align: center; color: #c2185b; font-size: .8rem; white-space: nowrap; overflow: hidden; }
.tk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
.tk-grid label { font-size: .48rem; letter-spacing: .18em; color: #6c6478; }
.tk-grid b { display: block; font-size: .78rem; color: #1a1626; letter-spacing: .04em; }
.tk-dest small { font-size: .5rem; letter-spacing: .2em; color: #6c6478; }
.tk-dest div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tk-dest button { font: inherit; font-size: .6rem; padding: .25rem .5rem; border-radius: 99px; border: 1px solid #c9c2b2; background: #fff; color: #1a1626; cursor: pointer; transition: all .15s; }
.tk-dest button:hover { border-color: var(--c); }
.tk-dest button.on { background: #1a1626; color: var(--c); border-color: #1a1626; box-shadow: 0 0 0 2px var(--c); }
.tk-stub { padding: 14px 12px; display: grid; justify-items: center; align-content: center; gap: 8px; }
.tk-qr { width: 88px; height: 88px; }
.tk-stub small { font-size: .52rem; letter-spacing: .1em; color: #4b4458; text-align: center; }
.tk-board { font: inherit; font-weight: 800; font-size: .8rem; letter-spacing: .08em; color: #f4f1ea; background: #1a1626; border: 0; border-radius: 10px; padding: .55rem .9rem; cursor: pointer; box-shadow: 0 0 0 0 rgba(255,95,162,.6); animation: boardPulse 1.6s ease-out infinite; }
.tk-board:hover { background: #c2185b; }
@keyframes boardPulse { 70% { box-shadow: 0 0 0 12px rgba(255,95,162,0); } }
.ticket.torn .tk-stub { animation: tearStub .8s var(--ease) forwards; }
.ticket.torn .tk-main { animation: tkAway .8s var(--ease) .1s forwards; }
@keyframes tearStub { to { transform: translate(60px, 40px) rotate(18deg); opacity: 0; } }
@keyframes tkAway { to { transform: translateY(-30px); opacity: 0; } }
.gate.has-ticket .card-hint { display: none; }
@media (max-width: 560px) { .ticket { grid-template-columns: 1fr; } .tk-main { border-right: 0; border-bottom: 2px dashed #b9b2a3; } .tk-grid { grid-template-columns: repeat(2, 1fr); } }

/* scrolling ticker */
.gate-ticker { position: sticky; bottom: 0; z-index: 3; overflow: hidden; border-top: 1px solid rgba(255,95,162,.3); background: rgba(4,3,12,.85); backdrop-filter: blur(6px); }
.gt-track { display: flex; gap: 2.4rem; width: max-content; padding: .45rem 0; animation: tick 60s linear infinite; }
.gt-track span { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; color: #9fb3c2; white-space: nowrap; }
.gt-track span:nth-child(3n) { color: var(--magenta); }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- bigger city: district bar ---------- */
.dist-bar { position: absolute; left: 5vw; top: 214px; z-index: 6; display: flex; gap: .3rem; flex-wrap: wrap; max-width: min(460px, 40vw); }
.dist-bar::before { content: "FLY TO DISTRICT"; flex-basis: 100%; font-family: var(--mono); font-size: .58rem; letter-spacing: .25em; color: #8fa6b8; }
.dist-bar button { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; padding: .32rem .7rem; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: rgba(4,6,10,.66); color: #d4dfe4; cursor: pointer; backdrop-filter: blur(6px); transition: all .15s; }
.dist-bar button:hover, .dist-bar button.on { color: #04060a; background: var(--c); border-color: var(--c); }
.city.walking .dist-bar { display: none; }
@media (max-width: 900px) { .dist-bar { top: auto; bottom: 4.6rem; max-width: 92vw; } }

/* city map grouped by district */
.dir-dist { grid-column: 1 / -1; display: flex; align-items: baseline; gap: .8rem; margin: 1.2rem 0 .2rem; padding-bottom: .4rem; border-bottom: 1px solid color-mix(in srgb, var(--c) 40%, transparent); cursor: pointer; font-family: var(--mono); }
.dir-dist span { color: var(--c); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; }
.dir-dist small { color: var(--muted); font-size: .68rem; }
.dir-dist:hover small { color: #fff; }
