/* Lit Point identity (Drive, Brand, Identity, Lit Point v1) in the version 8 palette (D-011).
   Faction colour is a frame, never a fill. Green is only ever "you". */
:root {
  color-scheme: dark;
  --ground: #010409; --panel: #06111A; --line: #0F3646; --cyan: #18D8FF; --white: #F2FCFF;
  --text: #E8F6FF; --muted: #8FB3C8; --unlit: #1C4456;
  --mk: #C04DFF; --ho: #FFD84A; --ru: #FF2E63; --you: #00FF9C;
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --ui: 'Chakra Petch', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ground); color: var(--text); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--cyan); }

.app { max-width: 460px; margin: 0 auto; min-height: 100dvh; padding: 0 16px 40px; display: flex; flex-direction: column; }
.app.wide { max-width: 960px; }

/* Launch: the mark on the faint tilted grid with faction streaks lighting sets. */
.splash { position: fixed; inset: 0; z-index: 50; background: var(--ground); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 34px; transition: opacity .5s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash .vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 85% at 50% 50%, rgba(1,4,9,0) 0%, rgba(1,4,9,.15) 45%, rgba(1,4,9,.7) 80%, rgba(1,4,9,.95) 100%); }
.splash > :not(canvas):not(.vig) { position: relative; }

/* Wordmark: RWG in Unbounded 900, REAL WORLD GAME in Plex Mono tracked to its width. */
.lock { display: inline-flex; flex-direction: column; align-items: stretch; gap: .5em; color: var(--white); }
.lock .rwg { font: 900 var(--size, 56px)/.8 var(--display); letter-spacing: -.02em; text-shadow: 0 0 22px rgba(24,216,255,.45), 0 0 2px rgba(242,252,255,.8); }
.lock .sub { font: 600 calc(var(--size, 56px) * .13)/1 var(--mono); display: flex; justify-content: space-between; opacity: .92; }

/* The mark always sits on the faint grid from 32 px up. */
.gridmark { position: relative; display: inline-flex; align-items: center; justify-content: center; isolation: isolate; }
.gridmark::before { content: ""; position: absolute; inset: -34%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(24,216,255,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(24,216,255,.28) 1px, transparent 1px);
  background-size: 18px 18px; background-position: center; transform: rotate(-18deg);
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,.6) 38%, transparent 68%);
  mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,.6) 38%, transparent 68%); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.top .brand .lock { --size: 22px; }
.top .brand .lock .sub { display: none; }
.chip { font: 600 10.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 7px 9px; border-radius: 999px; white-space: nowrap; }
.chip.dev { color: var(--ho); border-color: #5a3a12; }

.eyebrow { font: 600 11px/1.4 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
h1 { font: 800 clamp(26px, 7vw, 34px)/1.08 var(--display); color: var(--white); margin: 6px 0 10px; text-wrap: balance; }
h2 { font: 600 20px/1.2 var(--ui); color: var(--white); margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stack { display: grid; gap: 14px; }
.screen { display: grid; gap: 16px; padding-top: 10px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

label { display: grid; gap: 6px; font: 600 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
input { width: 100%; font: 500 17px/1.2 var(--ui); color: var(--white); background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(24,216,255,.18); }

.btn { appearance: none; border: 1px solid var(--cyan); background: rgba(24,216,255,.1); color: var(--white); font: 600 15px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; padding: 16px 18px; border-radius: 10px; cursor: pointer; width: 100%; box-shadow: 0 0 18px rgba(24,216,255,.18) inset; }
.btn:hover, .btn:focus-visible { background: rgba(24,216,255,.18); outline: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { border-color: var(--line); background: transparent; box-shadow: none; color: var(--muted); }

/* Faction cards: shape carries meaning (Makers square, Hosts round, Runners broken). */
.factions { display: grid; gap: 10px; }
.faction { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; text-align: left; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.faction svg { width: 56px; height: 56px; }
.faction b { display: block; font: 600 17px/1.2 var(--ui); color: var(--white); letter-spacing: .04em; }
.faction span { font-size: 13px; color: var(--muted); }
.faction[aria-pressed="true"] { border-color: var(--fc); box-shadow: 0 0 0 1px var(--fc), 0 0 22px color-mix(in srgb, var(--fc) 30%, transparent); }
.faction.KEEP { --fc: var(--mk); color: var(--mk); }
.faction.GATHER { --fc: var(--ho); color: var(--ho); }
.faction.GO_FIRST { --fc: var(--ru); color: var(--ru); }

/* Me */
.me { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.me svg { width: 64px; height: 64px; }
.me .you { font: 600 11px/1 var(--mono); letter-spacing: .18em; color: var(--you); }
.wallet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wallet .cur { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; min-width: 0; }
.wallet .cur .k { font: 600 10px/1 var(--mono); letter-spacing: .2em; color: var(--muted); }
.wallet .cur .v { font: 800 24px/1.1 var(--display); color: var(--white); margin-top: 8px; overflow-wrap: anywhere; }

.scan { position: relative; overflow: hidden; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; }
.scan svg { width: 76px; height: 76px; }

.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li:last-child { border-bottom: 0; }
.history .amt { font: 600 14px/1.4 var(--mono); color: var(--white); white-space: nowrap; }
.history .when { color: var(--muted); font-size: 12px; }

/* Check-in result: one check-in, seven things moved. */
.lit { display: flex; justify-content: center; padding: 18px 0 4px; }
.lit .pin { position: relative; width: 150px; height: 150px; }
.lit .pin svg { width: 150px; height: 150px; position: relative; }
.lit .pin::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid var(--white); opacity: 0; }
.lit.on .pin::after { animation: ping 1.4s ease-out .2s 2; }
@keyframes ping { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.7); } }
.moves { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.moves li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; animation: rise .4s ease both; }
.moves li .n { font: 600 11px/1 var(--mono); color: var(--cyan); }
.moves li .t { font: 600 15px/1.25 var(--ui); color: var(--white); }
.moves li .t small { display: block; font: 400 12px/1.4 var(--body); color: var(--muted); margin-top: 2px; }
.moves li .d { font: 600 15px/1 var(--mono); color: var(--white); white-space: nowrap; }
.moves li.zero .d { color: var(--muted); }

.note { border: 1px solid #5a3a12; background: #140d03; border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.note b { color: var(--ho); font: 600 11px/1.4 var(--mono); letter-spacing: .14em; display: block; margin-bottom: 2px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(430px, calc(100% - 32px)); z-index: 60; background: #1a0710; border: 1px solid var(--ru); color: var(--text); padding: 12px 14px; border-radius: 10px; font-size: 14px; }

/* Kiosk: the rotating code, big enough to scan across a counter. */
.kiosk { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 20px 0; }
.kiosk .qr { position: relative; background: var(--white); border-radius: 18px; padding: 22px; aspect-ratio: 1; box-shadow: 0 0 0 1px var(--cyan), 0 0 50px rgba(24,216,255,.35); }
.kiosk .qr svg { width: 100%; height: 100%; display: block; }
.kiosk .ring { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 16px; }
.kiosk .ring i { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); transform-origin: left; }
.kiosk .venue { font: 800 clamp(28px, 4.4vw, 46px)/1.05 var(--display); color: var(--white); margin: 10px 0 16px; text-wrap: balance; }
@media (max-width: 760px) { .kiosk { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* The map (ADR 0026): full screen under the header, with floating controls and sheets. */
.mapscreen { position: fixed; inset: 0; top: 66px; z-index: 1; }
.map { position: absolute; inset: 0; background: var(--ground); }
.map-top { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.cities { display: flex; gap: 6px; flex-wrap: wrap; }
.cities button, .mebtn { font: 600 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text); background: rgba(6,17,26,.88); border: 1px solid var(--line); border-radius: 999px; padding: 10px 13px; cursor: pointer; backdrop-filter: blur(6px); }
.cities button[aria-pressed="true"] { border-color: var(--cyan); color: var(--white); box-shadow: 0 0 14px rgba(24,216,255,.25); }
.mebtn { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; }
.mebtn svg { width: 26px; height: 26px; }
.fab { position: absolute; right: 14px; bottom: 34px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(6,17,26,.92); color: var(--you); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.fab svg { width: 26px; height: 26px; }
.fab.off { color: var(--muted); }
.locnote { position: absolute; left: 12px; right: 76px; bottom: 34px; background: rgba(6,17,26,.94); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.6); animation: rise .25s ease both; z-index: 3; }
.sheet.tall { max-height: 82%; overflow-y: auto; }
.sheet .close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.maplibregl-ctrl-attrib { background: rgba(1,4,9,.72) !important; color: var(--muted) !important; font: 10px/1.4 var(--mono) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
select { width: 100%; font: 500 16px/1.2 var(--ui); color: var(--white); background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 13px 12px; }
select:focus { outline: none; border-color: var(--cyan); }

/* Utilities. The pages' CSP forbids style attributes, so every one-off style lives here. */
.defs { position: absolute; }
.lock-64 { --size: 64px; }
.entry { display: grid; gap: 10px; width: min(320px, calc(100vw - 32px)); margin-top: 12px; }
a.btn { display: block; text-align: center; text-decoration: none; }
.btn.inline { width: auto; margin-top: 16px; }
.gap-top { margin-top: 6px; }
.gap-bottom { margin-bottom: 6px; }
.flush { margin: 0; }
.centred { text-align: center; }
.narrow { max-width: 460px; }
.command { margin-top: 8px; word-break: break-all; color: var(--white); }
#v-dist { margin: 6px 0 10px; }
