/* The door: inspection screen layout, queue, documents, rule card, decision slips. */

.door { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; height: 100vh; height: 100dvh; background: radial-gradient(900px 300px at 50% 0, color-mix(in srgb, var(--glow) 14%, transparent), transparent), var(--venue-bg); }

/* HUD */
.hud { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; padding: .5rem 1rem; border-bottom: 1px solid var(--line); background: #0b0716cc; }
.hud-venue { display: flex; align-items: baseline; gap: .6rem; }
.neon-mini { font-family: 'Monoton', var(--font); color: #fff; text-shadow: 0 0 4px var(--glow), 0 0 14px var(--glow); font-size: 1.15rem; }
.hud-title { color: var(--muted); font-size: .85rem; }
.hud-clock { display: flex; align-items: baseline; gap: .5rem; }
.hud-clock b { font: 600 1.5rem var(--mono); color: var(--warn); text-shadow: 0 0 10px #ffc24b55; }
.hud-clock .clock { font-size: .8rem; color: var(--muted); }
.hud-timer { display: flex; align-items: center; gap: .5rem; flex: 1 1 140px; min-width: 120px; }
.hud-timer .bar { flex: 1; height: 8px; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.hud-timer i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s linear; }
.hud-timer i.late { background: var(--bad); }
.hud-timer span { font: 600 .85rem var(--mono); color: var(--muted); min-width: 3.2em; }
.hud-stat { display: flex; flex-direction: column; line-height: 1.1; }
.hud-stat span { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hud-stat b { font: 600 1.05rem var(--mono); }
.hud-stat b.full { color: var(--bad); }
.pip { display: inline-block; width: 11px; height: 11px; margin-right: 3px; border-radius: 50%; border: 2px solid var(--muted); vertical-align: middle; }
.pip.last { border-color: var(--bad); }
.pip.hit { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 8px var(--bad); }
.hud-actions { display: flex; gap: .4rem; margin-left: auto; }

.banner { position: absolute; z-index: 30; top: 64px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); padding: .7rem 1rem; border-radius: 12px; font-weight: 500; animation: rise .25s; box-shadow: 0 14px 40px #000c; }
.banner[hidden], .reasons[hidden] { display: none !important; }
.banner.warn { background: #2a2010; border: 2px solid var(--warn); }
.banner.info { background: #0f2228; border: 2px dashed var(--cyan); }
.banner b { font-family: var(--mono); margin-right: .5em; color: var(--warn); }
.banner.info b { color: var(--cyan); }

/* Queue */
.queue { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem; min-height: 74px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #00000055, transparent 40%); overflow: hidden; }
.door-frame-mini { flex: none; width: 14px; height: 54px; border: 3px solid var(--glow); border-right: 0; border-radius: 6px 0 0 6px; box-shadow: 0 0 10px var(--glow); }
#queue { display: flex; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.q { --p: 1; position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--ring, var(--good)) calc(var(--p) * 360deg), #ffffff12 0); padding: 3px; animation: rise .3s; }
.q svg { width: 100%; height: 100%; border-radius: 50%; background: var(--panel-2); }
.q.mid { --ring: var(--warn); } .q.low { --ring: var(--bad); }
.q.low svg { animation: shake .5s infinite; }
@keyframes shake { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }
.queue-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Desk */
.desk { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(300px, 370px); gap: 14px; padding: 12px 1rem; min-height: 0; overflow: hidden; }
.desk > section, .desk > aside { min-height: 0; overflow: auto; }
.desk.flash-good { animation: fgood .5s; } .desk.flash-bad { animation: fbad .6s; }
@keyframes fgood { 30% { box-shadow: inset 0 0 0 3px var(--good); } }
@keyframes fbad { 20%, 60% { box-shadow: inset 0 0 0 4px var(--bad); } 40% { transform: translateX(3px); } }

.guest { display: flex; flex-direction: column; gap: .7rem; }
.guest-stage { position: relative; height: 330px; flex: none; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #ffffff0a, #00000040), repeating-linear-gradient(90deg, #ffffff05 0 2px, transparent 2px 60px), var(--panel); border: 1px solid var(--line); box-shadow: inset 0 0 0 10px #00000033; }
.ruler { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; pointer-events: none; }
.ruler span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #ffffff30; }
.ruler span::before { content: ''; position: absolute; left: 0; top: -2px; width: 22px; border-top: 3px solid var(--warn); }
.ruler span::after { content: attr(data-h); position: absolute; left: 26px; top: -.62rem; font: 600 .66rem var(--mono); color: #ffffffb0; background: #0b071699; padding: 0 3px; border-radius: 3px; }
.guest-figure { position: absolute; inset: 0; }
.fig { position: absolute; left: 50%; transform: translateX(-46%); aspect-ratio: 200 / 240; animation: step-in .35s ease-out; }
.fig svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 18px #000a); }
@keyframes step-in { from { opacity: 0; transform: translateX(-30%); } }
.empty-door { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.bubble { position: absolute; left: 10px; right: 10px; top: 10px; background: #fff; color: #1a1220; border-radius: 14px; padding: .5em .8em; font-weight: 500; font-size: .95rem; box-shadow: 0 6px 18px #0006; }
.bubble:empty { display: none; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.guest-info { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; font-size: .92rem; }
.guest-info:empty { display: none; }
.desc { margin-bottom: .5rem; }
.cue { color: var(--warn); font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .7rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .8rem; padding-top: .15em; } .facts dd { margin: 0; }
.chip { display: inline-block; padding: .05em .5em; margin: 0 .25em .25em 0; border-radius: 99px; background: #ffffff12; border: 1px solid var(--line); font-size: .85rem; }

/* Documents */
.papers-inner { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 14px; padding: 4px; position: relative; }
.papers-empty { padding: 2rem; }
.doc { position: relative; color: #1a1220; border-radius: 14px; box-shadow: 0 12px 26px -10px #000c, 0 2px 0 #0003; animation: deal .3s ease-out; }
@keyframes deal { from { transform: translateY(12px) rotate(-1.5deg); opacity: 0; } }
.fv { all: unset; cursor: default; font-family: var(--mono); font-weight: 600; font-size: .95rem; border-radius: 4px; }
.comparing .fv { cursor: pointer; outline: 2px dashed #5cf2ff99; outline-offset: 1px; }
.comparing .fv:hover { background: #5cf2ff33; }
.fv.picked { background: var(--cyan) !important; color: #031015; }
.fv.inline { font-size: .85rem; color: var(--cyan); margin-right: .9em; text-decoration: underline dotted; }
.fl { display: block; font: 600 .62rem var(--font); text-transform: uppercase; letter-spacing: .08em; opacity: .65; }

.id-card { width: min(470px, 100%); background: linear-gradient(135deg, color-mix(in srgb, var(--card) 22%, #f8f4ea), color-mix(in srgb, var(--card) 38%, #efe8da)); border: 3px solid var(--card); overflow: hidden; }
.id-card::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 80% 30%, transparent 0 9px, color-mix(in srgb, var(--card) 14%, transparent) 9px 10px); pointer-events: none; }
.id-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem .8rem; background: var(--card); color: #fff; }
.id-header { font-weight: 700; letter-spacing: .06em; font-size: .95rem; }
.id-kind { font: 600 .7rem var(--mono); text-transform: uppercase; opacity: .9; }
.id-body { position: relative; display: grid; grid-template-columns: 118px 1fr; gap: .8rem; padding: .7rem .8rem .3rem; }
.id-photo { width: 118px; height: 142px; border: 2px solid #1a122055; border-radius: 6px; overflow: hidden; background: #c9dbe6; }
.id-photo svg { width: 100%; height: 100%; display: block; }
.id-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .6rem; align-content: start; }
.f.wide { grid-column: 1 / -1; }
.id-foot { position: relative; display: flex; justify-content: space-between; align-items: center; padding: .1rem .8rem .5rem; font-size: .72rem; }
.id-addr { opacity: .7; font-family: var(--mono); }
.holo { width: 52px; height: 52px; display: grid; place-items: center; }
.emblem { width: 100%; height: 100%; opacity: .28; filter: saturate(.6); }
.holo.uv .emblem, .emblem.strong { opacity: 1; filter: drop-shadow(0 0 4px #b9f) saturate(1.4); }
.no-holo { display: block; width: 40px; height: 40px; border-radius: 50%; border: 2px dashed #1a122022; }
.id-card.zoomable .id-photo { cursor: zoom-in; }
.id-card.zoomed { width: min(680px, 100%); font-size: 1.25em; z-index: 2; }
.id-card.zoomed .id-body { grid-template-columns: 180px 1fr; } .id-card.zoomed .id-photo { width: 180px; height: 216px; cursor: zoom-out; }
.doc-none, .doc-note { padding: .8rem 1rem; background: #ffffff10; color: var(--text); border: 2px dashed var(--line); border-radius: 12px; margin: 0; }
.doc-note.bribe { border-color: var(--warn); color: var(--warn); }

.ticket { display: grid; grid-template-columns: 1fr 120px; width: min(430px, 100%); background: #fff7e0; border-radius: 10px; overflow: hidden; }
.tk-main { padding: .6rem .8rem; background: linear-gradient(135deg, #fff7e0, #ffe7a8); }
.tk-label { font: 700 .62rem var(--mono); letter-spacing: .2em; color: #b02a3a; }
.tk-event .fv { font: 700 1.15rem var(--font); letter-spacing: .02em; }
.tk-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .3rem; }
.tk-tier { display: inline-block; margin-top: .3rem; font: 600 .62rem var(--mono); background: #1a1220; color: #fff7e0; padding: .1em .5em; border-radius: 4px; }
.tk-stub { padding: .6rem; border-left: 3px dashed #1a122044; display: flex; flex-direction: column; justify-content: space-between; gap: .4rem; background: #fff0c8; }
.tk-stub .fv { font-size: .82rem; }
.barcode { height: 34px; background: repeating-linear-gradient(90deg, #1a1220 0 2px, transparent 2px 4px, #1a1220 4px 5px, transparent 5px 8px); }
.member { width: min(360px, 100%); padding: .7rem .9rem; background: linear-gradient(135deg, #2a1236, #4a2058); color: #f6e6ff; border: 2px solid #c9a646; }
.member header { display: flex; justify-content: space-between; margin-bottom: .3rem; font: 700 .7rem var(--mono); letter-spacing: .12em; color: #e8c86a; }
.member .fl { opacity: .7; }
.member .f { margin-bottom: .2rem; }
.wristband { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .9rem; background: #f4f4f8; width: min(240px, 100%); }
.band { width: 180px; height: 40px; }

/* Side: slip + rules */
.side { display: flex; flex-direction: column; gap: 12px; }
.slip-slot { min-height: 0; }
.slip-slot > .muted { margin: 0; font-size: .85rem; }
.slip { border-radius: var(--radius); padding: .75rem .85rem; background: var(--panel); border: 2px solid var(--line); animation: rise .25s; font-size: .88rem; }
.slip.good { border-color: color-mix(in srgb, var(--good) 70%, var(--line)); } .slip.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.slip-head { display: grid; grid-template-columns: 54px 1fr; gap: .6rem; align-items: center; }
.slip-face svg { width: 54px; height: 64px; }
.slip-verdict { font: 700 .7rem var(--mono); letter-spacing: .14em; }
.slip.good .slip-verdict { color: var(--good); } .slip.bad .slip-verdict { color: var(--bad); }
.slip-headline { font-weight: 700; margin: .1rem 0; font-size: .95rem; }
.slip-quote { color: var(--muted); font-style: italic; margin: 0; }
.slip ul { padding-left: 1em; margin: .5rem 0 .3rem; } .slip li { margin: .15rem 0; }
.slip-money { font-family: var(--mono); font-size: .8rem; color: var(--warn); margin: 0; }
.rules-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; }
.rules-card h2 { font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; }
.rule-list { list-style: none; padding: 0; margin: 0 0 .6rem; }
.rule { display: grid; grid-template-columns: 26px 1fr; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid #ffffff0d; }
.rule p { margin: 0; color: var(--muted); font-size: .86rem; }
.rule-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #ffffff12; font: 700 .8rem var(--mono); }
.rule.is-new .rule-n { background: var(--neon); color: #1a0518; }
.rule.is-changed { background: #ffc24b14; border-radius: 8px; } .rule.is-changed .rule-n { background: var(--warn); color: #261800; }
.hint-chip { display: inline-flex; align-items: center; gap: .35rem; margin-top: .3rem; padding: .15em .55em; border-radius: 8px; background: #5cf2ff14; border: 1px solid #5cf2ff44; font-size: .8rem; }
.hint-chip.warn { background: #ffc24b14; border-color: var(--warn); color: var(--warn); }
.band-chip .band { width: 64px; height: 16px; }
.lists .tab { font-size: .78rem; }
.list-body { max-height: 260px; overflow: auto; }
.name-list { columns: 2; padding-left: 1.1em; margin: 0; font-size: .88rem; }
.res-table { width: 100%; border-collapse: collapse; font-size: .86rem; } .res-table td, .res-table th { text-align: left; padding: .2rem .3rem; border-bottom: 1px solid #ffffff0d; } .res-table th { color: var(--muted); font-weight: 500; }
.banned-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mug { margin: 0; text-align: center; font-size: .75rem; }
.mug svg { width: 100%; border-radius: 8px; border: 2px solid var(--bad); }
.mug b { display: block; } .mug span { color: var(--muted); }

.coach { flex: 1 1 100%; background: #ff4fd814; border: 2px solid var(--neon); border-radius: 14px; padding: .8rem 1rem; color: var(--text); animation: rise .3s; }
.coach b { color: #ffb8f0; } .coach p { margin: .3rem 0; font-size: .92rem; }

/* Actions */
.actions { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0b0716e6; }
.btn.stamp { min-width: 200px; min-height: 58px; font-size: 1.25rem; letter-spacing: .14em; border-radius: 14px; border-width: 3px; }
.btn.admit { background: var(--good); border-color: var(--good); color: #052014; }
.btn.refuse { background: var(--bad); border-color: var(--bad); color: #fff; }
.refuse-wrap { position: relative; }
.reasons { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; min-width: 260px; padding: .4rem; background: var(--panel-2); border: 2px solid var(--bad); border-radius: 14px; box-shadow: 0 18px 40px #000a; animation: rise .15s; }
.reasons button { all: unset; cursor: pointer; padding: .55rem .7rem; border-radius: 9px; font-size: .95rem; }
.reasons button:hover, .reasons button:focus-visible { background: #ff5c6c22; outline: none; }

.incident { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.inc-face svg { width: 96px; height: 116px; }
.inc-result { font-size: 1.02rem; padding: .7rem .9rem; border-left: 3px solid var(--accent); background: #ffffff08; border-radius: 0 10px 10px 0; }

/* Rulebook */
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rb-body { max-height: 65vh; overflow: auto; }
.rb-rule { padding: .5rem 0; border-bottom: 1px solid #ffffff0d; } .rb-rule small { color: var(--muted); font-weight: 400; font-size: .75rem; margin-left: .5em; }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: .8rem 0; }
.sample { display: grid; grid-template-columns: 110px 1fr; gap: .7rem; align-items: center; padding: .6rem; border-radius: 12px; background: #ffffff08; }
.sample-card { position: relative; height: 72px; border-radius: 8px; background: color-mix(in srgb, var(--card) 30%, #f4efe4); border: 3px solid var(--card); color: #1a1220; padding: 4px 6px; overflow: hidden; }
.sample-card .id-header { display: block; font-size: .5rem; background: var(--card); color: #fff; margin: -4px -6px 2px; padding: 2px 6px; }
.sample-card .id-kind { font-size: .45rem; }
.sample-card .emblem { position: absolute; right: 4px; bottom: 4px; width: 30px; height: 30px; }
.sample dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem .5rem; margin: 0; font-size: .8rem; } .sample dt { color: var(--muted); } .sample dd { margin: 0; }

/* Narrow screens: stack the desk, keep the stamps in reach */
@media (max-width: 980px) {
  .door { height: auto; min-height: 100vh; }
  .desk { grid-template-columns: 1fr; overflow: visible; }
  .desk > section, .desk > aside { overflow: visible; }
  .guest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .actions { position: sticky; bottom: 0; z-index: 15; }
  .hud-actions { margin-left: 0; }
}
@media (max-width: 600px) {
  .guest { grid-template-columns: 1fr; }
  .guest-stage { height: 300px; }
  .btn.stamp { min-width: 0; flex: 1; font-size: 1.05rem; }
  .refuse-wrap { flex: 1; display: flex; } .refuse-wrap .btn { width: 100%; }
  .id-body { grid-template-columns: 92px 1fr; } .id-photo { width: 92px; height: 110px; }
  .id-fields { grid-template-columns: 1fr; }
  .ticket { grid-template-columns: 1fr; } .tk-stub { border-left: 0; border-top: 3px dashed #1a122044; }
  .incident { grid-template-columns: 1fr; }
  .hud { gap: .4rem .8rem; }
  .reasons { left: auto; right: 0; transform: none; }
}
