@font-face { font-family: "Figtree"; src: url("fonts/Figtree-var.woff2") format("woff2"); font-weight: 300 900; font-display: block; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-var.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "Space Mono"; src: url("fonts/SpaceMono-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Space Mono"; src: url("fonts/SpaceMono-700.woff2") format("woff2"); font-weight: 700; font-display: block; }

:root {
  --bg: #021320;
  --card: rgba(9, 59, 95, 0.32);
  --card-2: rgba(2, 19, 32, 0.6);
  --line: rgba(0, 200, 149, 0.18);
  --green: #00c895;
  --bright: #abff88;
  --amber: #ffb547;
  --red: #ff6b6b;
  --blue: #6cc8ff;
  --ink: #ffffff;
  --muted: #8fa8bc;
  --faint: #5d7488;
  --mono: "Space Mono", ui-monospace, monospace;
  --sans: "Figtree", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --gap: clamp(10px, 1.1vw, 18px);
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 600px at 8% -15%, rgba(0, 200, 149, 0.13), transparent 60%),
    radial-gradient(900px 700px at 105% 115%, rgba(9, 59, 95, 0.85), transparent 60%);
}
#app { position: relative; z-index: 1; display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--gap); padding: clamp(12px, 1.5vw, 26px); max-width: 1920px; margin: 0 auto; }
@media (min-width: 1100px) and (min-height: 700px) {
  html, body { height: 100%; overflow: hidden; }
  #app { height: 100vh; }
}

/* header */
header { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { height: clamp(20px, 1.8vw, 28px); flex: none; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(20px, 1.9vw, 30px); letter-spacing: -0.01em; white-space: nowrap; }
h1 .ap { font-family: var(--mono); font-size: 0.45em; font-weight: 700; letter-spacing: 0.16em; color: var(--green); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.status { margin-left: auto; display: flex; align-items: center; gap: clamp(10px, 1.4vw, 22px); }
.dot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.on i { background: var(--green); animation: beat 2.2s infinite; }
.dot.off i { background: var(--red); }
.clock { font-family: var(--mono); font-size: clamp(18px, 1.6vw, 26px); letter-spacing: 0.06em; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(0, 200, 149, 0.6); } 70% { box-shadow: 0 0 0 9px rgba(0, 200, 149, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 200, 149, 0); } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: clamp(10px, 1vw, 16px) clamp(12px, 1.2vw, 20px); border-radius: var(--radius); background: var(--card); min-width: 0; }
.kpi .l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { font-family: var(--serif); font-weight: 300; font-size: clamp(26px, 2.6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.kpi .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn b { color: var(--amber); }
.kpi.hot { background: linear-gradient(135deg, rgba(0, 200, 149, 0.2), rgba(9, 59, 95, 0.35)); }
.kpi.hot b { color: var(--bright); }
.kpi.bump { animation: bump 0.8s ease; }
@keyframes bump { 30% { box-shadow: 0 0 0 2px var(--bright), 0 0 36px rgba(0, 200, 149, 0.45); } }

/* layout */
main { display: grid; grid-template-columns: minmax(330px, 3.5fr) minmax(0, 6.5fr); gap: var(--gap); min-height: 0; }
.left { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--gap); min-height: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: clamp(12px, 1.1vw, 18px); min-height: 0; min-width: 0; overflow: hidden; }
.card h2 { display: flex; align-items: baseline; gap: 10px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); font-weight: 700; margin-bottom: 10px; }
.card h2 .sub { margin-left: auto; color: var(--faint); font-weight: 400; letter-spacing: 0.04em; text-transform: none; white-space: nowrap; }

/* departures */
.deps { display: flex; flex-direction: column; }
.list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.dep { display: grid; grid-template-columns: 62px minmax(0, 1fr) 54px 92px; align-items: center; gap: 12px; height: 50px; padding: 0 12px; border-radius: 12px; background: var(--card-2); flex: none; }
.dep .tm { font-family: var(--mono); font-weight: 700; font-size: 16px; line-height: 1.1; }
.dep .tm small { display: block; font-size: 12px; font-weight: 400; color: var(--amber); }
.dep .ds { min-width: 0; }
.dep .ds b { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep .ds b em { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: #032; background: var(--bright); border-radius: 4px; padding: 1px 4px; margin-left: 6px; vertical-align: 2px; }
.dep .ds small { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep .gt { font-family: var(--mono); font-weight: 700; font-size: 14px; text-align: center; padding: 3px 0; border-radius: 8px; background: rgba(255, 255, 255, 0.05); color: #cfe0ec; }
.dep .st { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.dep.late { box-shadow: inset 3px 0 0 var(--amber); } .dep.late .st { color: var(--amber); }
.dep.cx { box-shadow: inset 3px 0 0 var(--red); } .dep.cx .st { color: var(--red); }
.dep.board .st { color: var(--bright); }
.dep.promo .st::before { content: "✦ "; color: var(--bright); }
.dep.sim .st::after { content: " · sim"; color: var(--amber); font-family: var(--mono); font-size: 10px; }
.dep.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: rgba(171, 255, 136, 0.28); } 100% { background: var(--card-2); } }

/* event mesh list */
.events { display: flex; flex-direction: column; gap: 6px; }
.ev { display: grid; grid-template-columns: 58px auto minmax(0, 1fr); align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--card-2); font-size: 13px; animation: slidein 0.4s ease; }
@keyframes slidein { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.ev time { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ev .ty { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 5px; background: #2d5878; color: #fff; text-transform: uppercase; white-space: nowrap; }
.ev .tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dbe8f1; }
.ev .tx code { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 6px; }
.ev.delayed .ty { background: var(--amber); color: #2a1a00; }
.ev.cancelled .ty { background: var(--red); }
.ev.gate-changed .ty, .ev.signage .ty { background: var(--blue); color: #001a2a; }
.ev.promotion .ty { background: var(--bright); color: #032; }
.ev.samrun .ty { background: #c9a7ff; color: #1b0a33; }
.ev .tag { font-family: var(--mono); font-size: 9.5px; color: var(--amber); margin-left: 6px; }
.empty { color: var(--faint); font-size: 13px; padding: 8px 2px; }

/* stage */
.stage { display: grid; grid-template-rows: auto minmax(160px, 1fr) auto; gap: var(--gap); }
.moment { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px; border-radius: 14px; background: var(--card-2); transition: background 0.4s, box-shadow 0.4s; }
.m-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 200, 149, 0.12); }
.m-icon i { width: 14px; height: 14px; border-radius: 50%; background: var(--green); animation: beat 2.2s infinite; }
.m-body { min-width: 0; }
.m-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
.m-title { font-size: clamp(16px, 1.45vw, 22px); font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub code { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.m-state { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.m-state:empty { display: none; }
.m-state.run { color: #032; background: var(--bright); animation: pulse 1s ease-in-out infinite; }
.m-state.done { color: var(--bright); border: 1px solid rgba(171, 255, 136, 0.5); }
@keyframes pulse { 50% { opacity: 0.55; } }
.moment.delayed { box-shadow: inset 4px 0 0 var(--amber); } .moment.delayed .m-kicker { color: var(--amber); } .moment.delayed .m-icon { background: rgba(255, 181, 71, 0.16); } .moment.delayed .m-icon i { background: var(--amber); }
.moment.cancelled { box-shadow: inset 4px 0 0 var(--red); } .moment.cancelled .m-kicker { color: var(--red); } .moment.cancelled .m-icon { background: rgba(255, 107, 107, 0.16); } .moment.cancelled .m-icon i { background: var(--red); }
.moment.gate-changed { box-shadow: inset 4px 0 0 var(--blue); } .moment.gate-changed .m-kicker { color: var(--blue); } .moment.gate-changed .m-icon i { background: var(--blue); }
.moment .simtag { font-family: var(--mono); font-size: 10px; color: var(--amber); border: 1px solid rgba(255, 181, 71, 0.5); border-radius: 4px; padding: 0 5px; margin-left: 8px; vertical-align: 3px; }

/* map */
.map-wrap { position: relative; min-height: 0; display: flex; }
#map { width: 100%; height: 100%; }
#map .pier { fill: rgba(9, 59, 95, 0.85); stroke: rgba(0, 200, 149, 0.25); stroke-width: 1.2; }
#map .plaza { fill: rgba(0, 200, 149, 0.08); stroke: rgba(0, 200, 149, 0.55); stroke-width: 1.2; }
#map .lbl { font-family: var(--mono); font-size: 10px; font-weight: 700; fill: #4f7a95; letter-spacing: 0.2em; }
#map .gate { fill: #2b5674; }
#map .gate.late { fill: var(--amber); }
#map .gate.cx { fill: var(--red); }
#map .store rect { fill: #062a44; stroke: rgba(0, 200, 149, 0.6); stroke-width: 1.4; transition: all 0.4s; }
#map .store text { font-family: var(--sans); font-size: 11.5px; font-weight: 700; fill: #e6f3fb; }
#map .store .cnt { font-family: var(--mono); font-size: 10px; fill: var(--bright); font-weight: 400; }
#map .store.lit rect { fill: rgba(0, 200, 149, 0.32); stroke: var(--bright); stroke-width: 2.2; }
#map .active-ring { fill: none; stroke: var(--bright); stroke-width: 2; }
#map .active-lbl rect { fill: #021320; stroke: var(--amber); stroke-width: 1.2; }
#map .active-lbl text { font-family: var(--mono); font-size: 11px; font-weight: 700; fill: #fff; }
#map .beam { fill: none; stroke: var(--bright); stroke-width: 3; stroke-linecap: round; }

/* offer card */
.step .lat { margin-left: auto; float: right; font-family: var(--mono); font-size: 11px; color: var(--bright); letter-spacing: 0.04em; text-transform: none; }
.ot { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ot b { font-size: clamp(15px, 1.2vw, 18px); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ot .pct { font-family: var(--serif); font-size: clamp(20px, 1.7vw, 26px); color: var(--bright); line-height: 1; white-space: nowrap; }
.items { display: flex; flex-direction: column; gap: 2px; }
.it { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; font-size: 13px; line-height: 1.3; }
.it span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dbe8f1; }
.it s { color: var(--faint); font-family: var(--mono); font-size: 11.5px; }
.it b { font-family: var(--mono); font-size: 12.5px; color: var(--bright); }
.of { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofrow { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: auto; }
.ofrow .of { flex: 1; min-width: 0; }
.checks { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; flex: none; max-width: 60%; }
.checks span { flex: none; font-family: var(--mono); font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 200, 149, 0.14); color: #c9f5e2; white-space: nowrap; }
.checks span.warn { background: rgba(255, 181, 71, 0.14); color: #ffe2b0; }

/* decision steps */
.steps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2.1fr); gap: 10px; }
.step { position: relative; display: flex; flex-direction: column; gap: 6px; height: clamp(156px, 18vh, 184px); padding: 12px 14px; border-radius: 14px; background: var(--card-2); overflow: hidden; opacity: 0.55; transition: opacity 0.4s, box-shadow 0.4s; }
.step.on { opacity: 1; box-shadow: inset 0 0 0 1px rgba(0, 200, 149, 0.45); }
.step .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); white-space: nowrap; }
.step .n em { font-style: normal; color: var(--faint); margin-left: 4px; text-transform: none; letter-spacing: 0; }
.step .body { font-size: 13px; line-height: 1.4; color: #cfe0ec; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.step .body.text { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.step .big { font-family: var(--serif); font-weight: 300; font-size: clamp(22px, 2vw, 30px); line-height: 1.05; color: var(--bright); }
.step .big.amber { color: var(--amber); }
.step .line { font-size: 13px; color: #cfe0ec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .muted { color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.bar { display: grid; grid-template-columns: 62px minmax(24px, 1fr) 30px; align-items: center; gap: 6px; font-size: 12px; }
.bar span { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar .fill { height: 100%; width: 0; background: #3d6f93; border-radius: 4px; transition: width 0.9s cubic-bezier(.2, .8, .2, 1); }
.bar.win span { color: var(--bright); font-weight: 700; }
.bar.win .fill { background: linear-gradient(90deg, var(--green), var(--bright)); }
.bar b { font-family: var(--mono); font-size: 11px; text-align: right; }
.notif { margin-top: auto; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.93); color: #0b2238; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.notif b { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #3d6377; margin-right: 4px; }

footer { display: flex; gap: 18px; font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; }
footer .key { margin-left: auto; }
kbd { font-family: var(--mono); border: 1px solid #2d5878; border-radius: 4px; padding: 0 5px; color: var(--muted); }

/* presenter */
#presenter { position: fixed; left: 50%; bottom: 20px; width: min(900px, calc(100vw - 32px)); transform: translate(-50%, calc(100% + 40px)); z-index: 40; padding: 14px 16px; border-radius: 16px; background: #04263f; border: 1px solid rgba(255, 181, 71, 0.6); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6); transition: transform 0.35s ease, visibility 0.35s; visibility: hidden; }
#presenter.show { transform: translate(-50%, 0); visibility: visible; }
.p-head { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.p-head span { font-weight: 400; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.p-head .x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.p-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
#presenter select { flex: 1; min-width: 240px; }
#presenter select, #presenter input { background: var(--bg); color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; }
#presenter input { width: 64px; }
#presenter label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#presenter button[data-k] { background: #08385b; color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-family: var(--sans); font-weight: 700; font-size: 13px; cursor: pointer; }
#presenter button.d { border-color: var(--amber); } #presenter button.c { border-color: var(--red); } #presenter button.g { border-color: var(--blue); } #presenter button.r { border-color: var(--green); }
#presenter .msg { font-family: var(--mono); font-size: 12px; color: var(--bright); margin-left: 6px; }

/* smaller screens: stack and scroll instead of squeezing */
@media (max-width: 1099px) {
  main { grid-template-columns: 1fr; }
  .stage { order: -1; }
  .left { grid-template-rows: auto auto; }
  .list { max-height: 560px; }
  .map-wrap { height: 260px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step.offer { grid-column: span 2; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { flex-wrap: wrap; white-space: normal; }
}
@media (max-width: 560px) {
  header { flex-wrap: wrap; }
  .status { margin-left: 0; width: 100%; justify-content: space-between; }
  .steps { grid-template-columns: 1fr; }
  .step.offer { grid-column: auto; }
  .step { height: auto; min-height: 110px; }
  .dep { grid-template-columns: 52px minmax(0, 1fr) 48px; height: auto; padding: 8px 10px; row-gap: 2px; }
  .dep .st { grid-column: 2 / 4; text-align: left; }
  .moment { grid-template-columns: 36px minmax(0, 1fr); }
  .m-state { grid-column: 1 / 3; justify-self: start; }
  .m-icon { width: 36px; height: 36px; }
}

/* audience QR overlay */
#qr { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(1, 12, 22, 0.86); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
#qr.show { opacity: 1; visibility: visible; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: clamp(20px, 3vw, 40px); border-radius: 28px; background: #04263f; border: 1px solid rgba(0, 200, 149, 0.5); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); max-width: min(560px, 92vw); text-align: center; }
.qr-k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--green); }
.qr-t { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 38px); }
#qr-img { width: min(46vh, 380px); height: min(46vh, 380px); border-radius: 18px; background: #fff; padding: 10px; }
.qr-u { font-family: var(--mono); font-size: 13px; color: var(--muted); word-break: break-all; }
.qr-s { font-size: 14px; color: var(--muted); max-width: 420px; }
#presenter button.q { border-color: var(--bright); }
/* coupon type badge in the offer card */
.ctype { flex: none; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--bright); color: #032; }
