:root {
  --navy: #12233d;
  --ink: #1c2b44;
  --sun: #ffc83d;
  --sun-dark: #e5a800;
  --teal: #19b5a5;
  --coral: #f2605a;
  --paper: #fffaf0;
  --line: #e6dcc6;
  --muted: #6b7890;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--ink); background: var(--navy); }
body.game { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* the join card's background: still shots that cross-fade and drift slowly (main.js, joinShots) */
#joinBg { position: fixed; inset: 0; overflow: hidden; background: #12233d; }
#joinBg .shot { position: absolute; inset: -4%; background: center / cover no-repeat; opacity: 0; transition: opacity 1.8s ease; }
#joinBg .shot.on { opacity: 1; animation: joinDrift 10s linear both; }
@keyframes joinDrift { from { transform: scale(1) translateX(0); } to { transform: scale(1.07) translateX(-1.5%); } }
@media (prefers-reduced-motion: reduce) { #joinBg .shot.on { animation: none; } }
/* the loading screen (loading.js): over everything, the night town softly behind it */
.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(rgba(12, 22, 42, .72), rgba(12, 22, 42, .92)), url(/img/join/join-5.jpg) center / cover #12233d;
  color: #fff; transition: opacity .45s ease; }
.loading.gone { opacity: 0; pointer-events: none; }
.loading[hidden] { display: none; }
.loadBox { width: min(88vw, 420px); text-align: center; }
/* the brand lockup: the event's masthead on a white card, or the logo on a white tile, above the game's name;
   with a masthead, the logo moves to a small "Presented by" line at the foot of the screen */
.loadHero { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 4px; }
.loadMastCard { background: rgba(255, 255, 255, .97); border-radius: 18px; padding: 12px 20px; box-shadow: 0 14px 38px rgba(0, 0, 0, .38); }
.loadMastCard img { display: block; max-width: min(70vw, 320px); max-height: 70px; object-fit: contain; }
.loadLogoTile { width: 68px; height: 68px; border-radius: 20px; background: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .38); }
.loadLogoTile img { max-width: 50px; max-height: 50px; object-fit: contain; }
.loadMastCard[hidden], .loadLogoTile[hidden], .loadFoot[hidden] { display: none; }
.loadTitle { font-size: 2rem; font-weight: 900; letter-spacing: -.5px; line-height: 1.1; }
.loadFoot { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 10px;
  font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.loadFoot img { height: 24px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 7px; padding: 4px 7px; }
.loadMsg { margin: 6px 0 16px; opacity: .85; }
.loadBar { position: relative; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.loadBar i { position: absolute; left: 0; top: 0; bottom: 0; width: 12%; border-radius: 99px; background: #ffc83d; transition: width .4s ease; overflow: hidden; }
.loadBar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: loadShine 1.3s linear infinite; }
@keyframes loadShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.loadGo { display: block; width: min(80vw, 280px); margin: 18px auto 0; animation: loadPulse 1.6s ease-in-out infinite; }
.loadGo[hidden] { display: none; }
@keyframes loadPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 61, .6); } 50% { box-shadow: 0 0 0 14px rgba(255, 200, 61, 0); } }   /* a glow ring only: the button itself never moves under a finger */
@media (prefers-reduced-motion: reduce) { .loadGo { animation: none; } }
/* branding from the admin page: a slim masthead strip, and a small logo beside the game's name */
.brandMast { display: block; width: 100%; max-width: 360px; height: auto; max-height: 64px; object-fit: contain; margin: 0 auto 10px; border-radius: 8px; }
.brandMast[hidden], .brandLogo[hidden] { display: none; }
.brandRow { display: flex; align-items: center; gap: 9px; }
.join h1.long { font-size: 1.5rem; letter-spacing: -.3px; }   /* a long event name on one line */
.brandLogo { display: block; height: 34px; width: auto; max-width: 90px; object-fit: contain; flex: none; }
.heroLogo { height: 34px; max-width: 110px; margin: 0 auto 6px; padding: 5px; border-radius: 10px; background: #fff; box-sizing: content-box; }   /* on a white tile: dark logos stay visible on the coloured banner */
.intro .brandMast { margin-bottom: 8px; }
.loadTip { margin: 22px auto 0; max-width: 360px; min-height: 3.2em; line-height: 1.45; font-size: .98rem; }
.loadTip .tipLabel { display: inline-block; background: #ffc83d; color: #12233d; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; padding: 1px 8px; border-radius: 99px; margin-right: 6px; }
.loadTip .tipText { transition: opacity .35s ease; }
.loadTip .tipText.fade { opacity: 0; }

.card { background: var(--paper); border-radius: 22px; box-shadow: 0 18px 50px rgba(8, 20, 40, .35); }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 800; cursor: pointer; background: #e9e1cf; color: var(--ink); }
.btn.primary { background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sun-dark); }
.btn.danger { background: #fbe1df; color: #a52620; }
.btn.big { width: 100%; padding: 16px; font-size: 1.15rem; }
.btn:disabled { opacity: .5; cursor: default; }

/* join */
.join { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 430px); max-height: 94vh; overflow: auto; padding: 22px; }
.join h1 { margin: 0; font-size: 1.9rem; font-weight: 900; letter-spacing: -.5px; color: var(--navy); }
.join .sub { margin: 6px 0 14px; color: var(--muted); }
.lbl { display: block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.stepper { display: flex; gap: 8px; }
.stepper button { width: 56px; border: 0; border-radius: 14px; font-size: 1.6rem; font-weight: 800; background: #efe6d2; color: var(--ink); cursor: pointer; }
.stepper input { flex: 1; min-width: 0; text-align: center; font: inherit; font-size: 1.7rem; font-weight: 900; padding: 8px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.nameIn { width: 100%; text-align: center; font: inherit; font-size: 1.25rem; font-weight: 800; padding: 9px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); }
.rejoin { margin: 0 0 14px; background: var(--teal); color: #fff; white-space: normal; line-height: 1.25; }
.teamGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; max-height: 172px; overflow-y: auto; padding: 2px; }
.teamChip { position: relative; border: 3px solid transparent; border-radius: 12px; background: #efe6d2; padding: 7px 0 5px; cursor: pointer; font: inherit; font-size: 1.05rem; font-weight: 900; color: var(--ink); line-height: 1; }
.teamChip i { display: block; width: 12px; height: 12px; border-radius: 50%; margin: 0 auto 4px; }
.teamChip small { display: block; margin-top: 3px; font-size: .62rem; font-weight: 700; color: var(--muted); min-height: .8em; }
.teamChip.sel { border-color: var(--teal); background: #dff5f1; }
.teamWho { margin: 8px 0 14px; font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.teamWho b { color: var(--ink); }
.hats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.hat { border: 3px solid transparent; border-radius: 16px; background: #efe6d2; padding: 4px 2px 6px; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; color: var(--ink); }
.hat img { width: 100%; aspect-ratio: 1; display: block; }
.hat.sel { border-color: var(--teal); background: #dff5f1; }

/* hud */
.topbar { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: calc(100vw - 170px); pointer-events: none; }
.tbRow { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tbRow:empty { display: none; }
.pill.stats { display: inline-flex; gap: 12px; }
.pill.stats .st { white-space: nowrap; }
.iconBtn { pointer-events: auto; border: 0; font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; min-width: 36px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.iconBtn small { font-size: .72rem; font-weight: 800; }
.langMenu { position: relative; pointer-events: auto; }
.langList { position: absolute; right: 0; top: calc(100% + 6px); display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(18, 35, 61, .94); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); z-index: 5; }
.langList[hidden] { display: none; }
.langList button { border: 0; border-radius: 10px; padding: 8px 18px; font: inherit; font-weight: 800; font-size: .9rem; color: #fff; background: transparent; cursor: pointer; white-space: nowrap; }
.langList button.on { background: var(--sun); color: var(--navy); }
/* the Graphics choice on the join card, in the same tiles as the hats */
.gfxPick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gfxChip { border: 3px solid transparent; border-radius: 16px; background: #efe6d2; padding: 9px 4px; font: inherit; font-size: .9rem; font-weight: 800; color: var(--ink); cursor: pointer; }
.gfxChip.on { border-color: var(--teal); background: #dff5f1; }
.gfxHint { margin: 6px 0 18px; font-size: .78rem; color: var(--muted); text-align: center; }
.langList .listHead { padding: 4px 10px 2px; font-size: .72rem; font-weight: 800; color: #9fb3cc; text-transform: uppercase; letter-spacing: .06em; }
.pill { padding: 6px 12px; border-radius: 99px; font-weight: 800; font-size: .85rem; color: #fff; background: var(--teal); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); white-space: nowrap; }
.pill.dark { background: rgba(18, 35, 61, .82); }
.madeBy { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 14px; font-size: .72rem; font-weight: 700; text-align: center; opacity: .9; }
.madeBy img { height: 34px; width: auto; background: none; }
.watermark { position: fixed; left: 50%; bottom: max(6px, env(safe-area-inset-bottom)); transform: translateX(-50%); height: 20px; opacity: .55; pointer-events: none; }
.soundBtn { pointer-events: auto; border: 0; font-family: inherit; cursor: pointer; }
.soundBtn.off { opacity: .7; }
#map { position: fixed; left: 10px; top: max(10px, env(safe-area-inset-top)); width: 150px; height: 145px; border-radius: 14px; background: rgba(18, 35, 61, .78); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); cursor: pointer; }
/* the GPS pill: which way to turn and how far to the mission (guide.js) */
.guidePill { position: fixed; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 190px); display: flex; align-items: center; gap: 8px; max-width: min(78vw, 340px); padding: 6px 6px 6px 8px; border-radius: 14px; background: #1e88e5; color: #fff; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); border: 2px solid #fff; }
.guidePill .gArrow { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #1e88e5; font-weight: 900; font-size: 1.3rem; line-height: 1; }
.guidePill .gText { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.guidePill b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guidePill small { font-size: .78rem; font-weight: 700; opacity: .9; }
.guidePill .gStop { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #fff; font: 900 1.1rem/1 inherit; cursor: pointer; }
.mapGo { margin-left: 8px; vertical-align: middle; }
.mapGuiding { display: inline-block; margin-top: 4px; color: #1565c0; font-weight: 700; }
/* a paragraph in a dialog fills the dialog (the welcome card's .intro width would push it past the edge) */
.sheet .intro { width: auto; }
.streetName { position: fixed; left: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 153px); padding: 5px 12px; border-radius: 8px; border: 2px solid #fff; background: #0b3d91; color: #fff; font-weight: 800; font-size: .78rem; letter-spacing: .04em; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.hint { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; background: rgba(18, 35, 61, .7); color: #fff; font-size: .8rem; pointer-events: none; white-space: nowrap; }
.open { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); font-size: 1.05rem; padding: 14px 22px; max-width: 86vw; }
.open:active { transform: translateX(-50%) translateY(3px); }
.btn.primary.bus { bottom: 146px; background: #1e88e5; color: #fff; box-shadow: 0 4px 0 #125a9c; }
.btn.primary.bus:disabled { opacity: .85; background: rgba(18, 35, 61, .85); box-shadow: none; }
/* phones upright: the action button sits above the joystick and the Run and Jump pads, not over them */
@media (pointer: coarse) and (orientation: portrait) { .open { bottom: calc(max(28px, env(safe-area-inset-bottom)) + 150px); } .btn.primary.bus { bottom: calc(max(28px, env(safe-area-inset-bottom)) + 214px); } }
#mapBig { display: block; width: 100%; height: auto; border-radius: 14px; background: #1b2d4a; }
.routes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.routeChip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid #d8cfba; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 800; background: #fff; color: var(--ink); cursor: pointer; opacity: .55; }
.routeChip.on { opacity: 1; border-color: var(--navy); }
.routeChip i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.joy { position: fixed; left: 24px; bottom: max(28px, env(safe-area-inset-bottom)); width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .22); border: 2px solid rgba(255, 255, 255, .55); touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: var(--sun); box-shadow: 0 3px 8px rgba(0, 0, 0, .35); pointer-events: none; }
.toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); padding: 10px 18px; border-radius: 14px; background: rgba(18, 35, 61, .92); color: #fff; font-weight: 700; z-index: 30; max-width: 86vw; text-align: center; }

/* mission modal */
.modal { position: fixed; inset: 0; background: rgba(8, 18, 34, .6); display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 20; touch-action: auto; user-select: text; -webkit-user-select: text; }
.sheet { position: relative; width: min(100%, 560px); max-height: 92vh; overflow: auto; padding: 22px; touch-action: pan-y; }
.x { position: absolute; right: 12px; top: 10px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #efe6d2; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink); }
.sheet h2 { margin: 0 44px 4px 0; font-size: 1.45rem; font-weight: 900; color: var(--navy); }
.sheet .where { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.sheet .intro { white-space: pre-wrap; margin: 0 0 14px; line-height: 1.45; }
.sheet .media { width: 100%; max-height: 46vh; border-radius: 14px; background: #000; object-fit: contain; display: block; margin-bottom: 14px; }
.q { border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: #fff; }
.q .qt { font-weight: 800; margin-bottom: 10px; }
.q .pts { float: right; font-size: .75rem; font-weight: 800; color: var(--sun-dark); margin-left: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: #f6f0e2; margin-top: 6px; cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.q textarea { width: 100%; min-height: 84px; font: inherit; padding: 10px; border: 2px solid var(--line); border-radius: 12px; resize: vertical; }
.q.ok { border-color: #37b46b; background: #effaf2; }
.q.no { border-color: var(--coral); background: #fff1f0; }
.result { text-align: center; padding: 8px 0 14px; }
.result .num { font-size: 3rem; font-weight: 900; color: var(--teal); line-height: 1; }
.result .of { color: var(--muted); font-weight: 700; }

/* admin + host */
html:has(body.admin), body.admin { background: #f3ecdb; min-height: 100%; }
.bar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.bar h1 { margin: 0 12px 0 0; font-size: 1.15rem; font-weight: 900; }
.tabs { display: flex; gap: 6px; }
.tab { border: 0; background: transparent; color: #c9d4e6; font: inherit; font-weight: 800; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.tab.on { background: var(--sun); color: var(--navy); }
.wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 16px; padding: 16px; align-items: start; }
@media (max-width: 900px) { .wrap { grid-template-columns: 1fr; } }
.pane { padding: 18px; min-width: 0; overflow-x: auto; }   /* a wide table scrolls inside its card instead of pushing the page sideways */
.barGap { flex: 1; }
.barLinks { display: contents; }
.moreBtn { display: none; }
/* Admin on a phone: title, then one row of tabs you can swipe, then the timer on one line, then
   night mode; the laptop links fold away behind More. */
@media (max-width: 700px) {
  .bar { gap: 8px; padding: 10px 12px 12px; }
  .bar h1 { font-size: 1.02rem; margin: 0; }
  .bar > img { height: 20px !important; margin-left: auto; }
  .tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 4px; background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; white-space: nowrap; padding: 9px 7px; font-size: .84rem; }
  .barGap { display: none; }
  .timerBox { order: 4; width: 100%; flex-wrap: nowrap; }
  .timerBox #timerMin { width: 58px !important; }
  #modeBtn { order: 5; }
  .moreBtn { display: inline-block; order: 6; }
  .barLinks { display: none; order: 7; width: 100%; gap: 8px; flex-wrap: wrap; }
  .bar.showLinks .barLinks { display: flex; }
  .wrap { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .pane { padding: 14px; }
  table { font-size: .82rem; }
  th, td { padding: 7px 6px; }
}
.pane h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 900; color: var(--navy); }
.pane .note { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
#cityMap { width: 100%; height: auto; display: block; border-radius: 14px; background: #4a4d52; }
#cityMap .lot { cursor: pointer; stroke: rgba(0, 0, 0, .25); stroke-width: .2; }
#cityMap .lot:hover { stroke: #fff; stroke-width: .7; }
#cityMap .lot.has { stroke: #12233d; stroke-width: .9; }
#cityMap .lot.sel { stroke: #fff; stroke-width: 1.3; }
#cityMap text { pointer-events: none; font-weight: 800; }
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 5px; }
.in, .field textarea, .field select { width: 100%; font: inherit; padding: 9px 11px; border: 2px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); }
.field textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 0; }
.qbox { border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fff; }
.qbox .in { margin-bottom: 8px; }
.optrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.optrow input[type=checkbox], .optrow input[type=radio] { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.mini { padding: 6px 10px; border-radius: 9px; font-size: .82rem; }
.preview { max-width: 100%; max-height: 220px; border-radius: 12px; display: block; margin-top: 8px; background: #000; }
.status { font-weight: 700; color: var(--teal); min-height: 1.2em; }
.status.err { color: #c0392b; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
td.n { font-variant-numeric: tabular-nums; font-weight: 800; }
.login { width: min(92vw, 360px); margin: 12vh auto; padding: 24px; }
.qr { width: min(100%, 420px); display: block; margin: 0 auto; border-radius: 16px; background: #fff; }
.url { font-size: 1.3rem; font-weight: 900; text-align: center; word-break: break-all; color: var(--navy); margin: 10px 0; }

body.host { background: var(--navy); color: #fff; min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; padding: 4vw; }
@media (max-width: 800px) { body.host { grid-template-columns: 1fr; } }
.host h1 { font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 900; margin: 0 0 .2em; letter-spacing: -1px; }
.host h1 span { color: var(--sun); }
.host .url { color: #fff; font-size: clamp(1.1rem, 2.2vw, 2rem); }
.host .qr { width: min(100%, 62vh); }
.host table { font-size: clamp(1rem, 1.8vw, 1.6rem); }
.host th, .host td { border-color: rgba(255, 255, 255, .15); }
.host th { color: #9fb1cc; }
.dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .5em; vertical-align: -.05em; }

.pads { position: fixed; right: 20px; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 14px; }
.pad { width: 74px; height: 74px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .22); color: #fff; font: inherit; font-weight: 800; font-size: .9rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); touch-action: none; -webkit-user-select: none; user-select: none; }
.pad.jump { width: 88px; height: 88px; }
.pad.on { background: var(--sun); color: var(--ink); text-shadow: none; border-color: #fff; }
.pad:active { background: rgba(255, 255, 255, .45); }

/* welcome screen (index.html #intro): bright step cards, like a game's first screen */
.intro { width: min(94vw, 560px); line-height: 1.4; color: var(--ink); }
.intro .hero { margin: -4px -4px 14px; padding: 18px 16px 16px; border-radius: 18px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #5b2ca0 0%, #c2185b 55%, #ff8f00 100%); box-shadow: 0 6px 18px rgba(91, 44, 160, .35); }
.intro .hero .badge { font-size: 2.4rem; line-height: 1; margin-bottom: 4px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.intro .hero h1 { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: .5px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.intro .hero .tag { margin: 6px 0 0; font-weight: 700; font-size: 1.02rem; color: #fff7e0; }
.intro .quest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.intro .q { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 10px 12px;
  border-radius: 16px; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.intro .q .n { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9); color: #222; font-weight: 900; font-size: .85rem; display: grid; place-items: center; }
.intro .q .em { font-size: 2.1rem; line-height: 1.1; }
.intro .q b { font-size: 1.15rem; font-weight: 900; }
.intro .q small { font-size: .82rem; font-weight: 600; opacity: .95; }
.intro .q1 { background: linear-gradient(160deg, #ffb300, #f57c00); }
.intro .q2 { background: linear-gradient(160deg, #29b6f6, #1565c0); }
.intro .q3 { background: linear-gradient(160deg, #ab47bc, #5b2ca0); }
.intro .q4 { background: linear-gradient(160deg, #66bb6a, #1b8a3e); }
.intro .clock { margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #ffe7e3; border: 2px dashed #e53935; font-weight: 600; text-align: center; }
.intro .clock b { color: #c62828; }
.intro .tips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.intro .tips span { padding: 6px 10px; border-radius: 999px; background: #eef4ff; font-size: .85rem; }
.intro h2 { margin: 16px 0 6px; font-size: 1rem; font-weight: 900; color: var(--navy); }
.intro .icons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.intro .icons li { display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 12px; background: #fff7e0; font-size: .8rem; line-height: 1.15; }
.intro .ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(#ffd257, #f08a00); color: #3a1d00; font-weight: 900; font-size: .95rem; }
.intro .ic.done { background: linear-gradient(#8ff5bd, #1fa860); color: #0b3b23; }
.intro .more { margin: 10px 0 0; border-radius: 14px; background: #f4f1fb; padding: 2px 12px; }
.intro .more summary { cursor: pointer; padding: 10px 0; font-weight: 800; color: var(--navy); list-style: none; }
.intro .more summary::-webkit-details-marker { display: none; }
.intro .more[open] { padding-bottom: 12px; }
.introVideo { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 16 / 9; display: block; }
.intro .why { margin: 0; padding-left: 18px; font-size: .9rem; }
.intro .why li { margin: 0 0 6px; }
.intro .guide { margin: 8px 0 0; font-size: .9rem; font-weight: 700; }
.intro .guide a { color: var(--navy); }
.intro #introGo { position: sticky; bottom: -22px; margin-top: 16px; width: 100%; font-size: 1.2rem;      /* down into the card's padding, so nothing scrolls past underneath */
  box-shadow: 0 -12px 14px 4px var(--paper), 0 14px 0 14px var(--paper), 0 4px 0 rgba(0,0,0,.18); }
@media (max-height: 500px) { .intro #introGo { bottom: -12px; } }
.howBtn { width: 100%; margin-top: 8px; }

.infoList { display: grid; gap: 8px; max-height: 58vh; overflow-y: auto; margin-top: 6px; }
.infoRow { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #f4f1fb; }
.infoRow.done { opacity: .55; }
.infoRow .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #5b2ca0; color: #ffc83d; font-weight: 900; font-size: 1.05rem; }
.infoRow b { display: block; }
.infoRow small { color: var(--muted); }
.infoRow .arrow { display: inline-block; font-weight: 900; color: #5b2ca0; margin-right: 4px; }
.mapInfo { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff4d6; font-size: .92rem; }

/* the language switch: EN · BM · 中文 */
.langSwitch { display: flex; gap: 4px; justify-content: flex-end; margin: -6px 0 6px; }
.langSwitch button { border: 0; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; background: #e9e1cf; color: var(--ink); }
.langSwitch button.on { background: var(--navy); color: #fff; }
.langSwitch.hud { margin: 0; display: inline-flex; pointer-events: auto; }
.langSwitch.hud button { background: rgba(18, 35, 61, .78); color: #fff; padding: 6px 9px; }
.langSwitch.hud button.on { background: var(--sun); color: var(--navy); }

/* Phones held sideways (landscape): a wider, shorter join card with all eight hats in one row, so
   Enter fits without scrolling; and the controls kept clear of an iPhone's notch on either side. */
@media (orientation: landscape) and (max-height: 500px) {
  .join { width: min(94vw, 720px); max-height: 96vh; padding: 12px 18px; }
  .join h1 { font-size: 1.4rem; }
  .join .sub { margin: 2px 0 6px; font-size: .9rem; }
  .lbl { margin: 6px 0 4px; }
  .stepper input { font-size: 1.3rem; padding: 4px; }
  .hats { grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 10px; }
  .hat { font-size: .62rem; padding: 2px 1px 4px; }
  .btn.big { padding: 11px; }
  .joy { left: max(24px, env(safe-area-inset-left)); width: 116px; height: 116px; bottom: max(18px, env(safe-area-inset-bottom)); }
  .pads { right: max(20px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); }
  #map { left: max(10px, env(safe-area-inset-left)); width: 128px; height: 118px; }
  .streetName { left: max(10px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 125px); }
  .guidePill { left: max(10px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 160px); }
  .open { bottom: max(18px, env(safe-area-inset-bottom)); }
  .topbar { right: max(10px, env(safe-area-inset-right)); }
}

/* the admin page's game session picker */
.sessBox { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sessBox select { width: auto; padding: 5px 8px; max-width: 260px; }
.sessPin { padding: 4px 10px; border-radius: 999px; background: #ffc83d; color: #12233d; font: 900 .95rem Consolas, monospace; letter-spacing: 2px; }
/* the session PIN on the join card */
.pinIn { width: 100%; text-align: center; font: 900 1.4rem Consolas, monospace; letter-spacing: 6px; }
.pinHint { margin: 4px 0 0; font-size: .78rem; color: var(--muted); text-align: center; }
.pinMode { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #eef4ff; font-size: .88rem; text-align: center; }
.pinMode.event { background: #e7f7ec; }
#sessionPill.demo { background: #f08a00; }
.pinErr { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: #ffe3e0; color: #b3261e; font-weight: 700; font-size: .88rem; text-align: center; }
/* switching between the player side and the admin side */
.topRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 8px; }
.topRow .langSwitch { margin: 0; }
.adminPill { padding: 5px 12px; border-radius: 999px; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.adminPill:hover { filter: brightness(1.15); }
.switchSide { text-decoration: none; white-space: nowrap; }
.login .switchSide { display: block; margin-top: 12px; text-align: center; }
.demoPin { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff4d6; border: 2px dashed #f0a500; text-align: center; font-weight: 700; }
.demoPin b { font: 900 1.3rem Consolas, monospace; letter-spacing: 3px; color: #8a4b00; }
#bonusBtn.on { background: #ffc83d; color: #12233d; }

/* observer mode: a teammate watching a player's screen (main.js, "observer") */
.obsBtn { cursor: pointer; }
.obsBar { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(18,35,61,.9); color: #fff; font-weight: 700; font-size: .9rem; z-index: 6; white-space: nowrap; max-width: calc(100vw - 20px); }
.obsBar .btn { padding: 5px 10px; }
body.observer #openBtn, body.observer #talkBtn, body.observer #busBtn, body.observer #pads, body.observer #obsBtn { display: none !important; }
#modal.mirror .x { display: none; }
#modal.mirror .sheet::before { content: attr(data-label); display: block; margin: -4px 0 8px; padding: 4px 10px; border-radius: 999px; background: #ffc83d; color: #12233d; font-weight: 800; font-size: .8rem; width: max-content; }
.obsQr { display: block; width: min(300px, 70vw); margin: 10px auto; border-radius: 12px; }
.obsUrl { font: 600 .8rem Consolas, monospace; text-align: center; word-break: break-all; color: var(--muted); }

/* the 3D model credits on the join card, folded away until tapped */
.credits { margin: 8px 0 0; text-align: center; font-size: .72rem; opacity: .6; }
.credits summary { cursor: pointer; list-style: none; text-decoration: underline; }
.credits summary::-webkit-details-marker { display: none; }
.credits p { margin: 6px 0 0; }

/* ---------- the admin page, arranged by how an event runs: 1 Set up · 2 Run · 3 After · Advanced ---------- */
.adminBar { gap: 10px 14px; }
.adminBar .tabs { order: 10; width: 100%; }
.adminBar .barLbl { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #9fb3cc; }
.adminBar .ppBadge { height: 26px; }
.tabs.steps { gap: 8px; }
.tabs.steps .tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 1rem; background: rgba(255, 255, 255, .07); }
.tabs.steps .tab i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .16); font-size: .8rem; }
.tabs.steps .tab.on { background: var(--sun); color: var(--navy); }
.tabs.steps .tab.on i { background: var(--navy); color: var(--sun); }
.tabs.steps .tab[data-tab=advanced] { margin-left: auto; }
.timerMini { font: 800 1rem Consolas, monospace; color: var(--sun); white-space: nowrap; }
.helpBtn { background: #fff; }
.page { padding-bottom: 30px; }
.secHead { margin: 18px 16px 0; font-size: 1.25rem; font-weight: 900; color: var(--navy); }
.secHead small { display: block; font-size: .88rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.page > .wrap + .wrap { padding-top: 0; }
.widePane { grid-column: 1 / -1; }
.subHead { margin: 16px 0 8px; font-size: 1rem; font-weight: 900; color: var(--navy); }
.countPill { display: inline-block; min-width: 1.8em; padding: 1px 8px; border-radius: 99px; background: var(--navy); color: #fff; font-size: .8rem; text-align: center; }
.missionList { max-height: 290px; overflow-y: auto; padding: 2px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.missionChip { text-align: left; border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 7px 10px; font: inherit; cursor: pointer; color: var(--ink); min-width: 0; }
.missionChip b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missionChip small { display: block; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missionChip.off { opacity: .6; }
.missionChip.sel { border-color: var(--teal); background: #dff5f1; }
.qbox.fold > summary { cursor: pointer; list-style: none; }
.qbox.fold > summary::-webkit-details-marker { display: none; }
.qbox.fold > summary::before { content: '▸ '; color: var(--muted); }
.qbox.fold[open] > summary::before { content: '▾ '; }
.qbox.fold[open] > summary { margin-bottom: 8px; }
details.fold:not(.qbox) { margin-top: 12px; }
details.fold:not(.qbox) > summary { cursor: pointer; font-weight: 800; color: var(--navy); }
/* the checklist */
.checklist { margin: 16px 16px 0; border: 3px solid var(--sun); }
.checkCount { padding: 4px 12px; border-radius: 99px; background: #efe6d2; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.checkCount.all { background: #37b46b; color: #fff; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; counter-reset: ck; }
@media (max-width: 1150px) { .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .checks { grid-template-columns: minmax(0, 1fr); } }
.checks li { counter-increment: ck; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--line); min-width: 0; }
.checks li .grow { flex: 1; min-width: 0; }
.checks li b { display: block; }
.checks li small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.tickMark { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #cfc3a6; display: grid; place-items: center; font-weight: 900; color: var(--muted); }
.tickMark::before { content: counter(ck); }
.checks li.done { border-color: #37b46b; background: #effaf2; }
.checks li.done .tickMark { background: #37b46b; border-color: #37b46b; color: #fff; }
.checks li.done .tickMark::before { content: '✓'; }
.checkDone { margin: 10px 0 0; font-weight: 700; color: #17803d; }
.linkBtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--navy); text-decoration: underline; cursor: pointer; }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--sun), 0 18px 50px rgba(8, 20, 40, .35); } 100% { box-shadow: 0 18px 50px rgba(8, 20, 40, .35); } }
/* Run: the timer, the big screens, the live controls */
.bigTimer { font: 900 3.4rem/1 Consolas, monospace; color: var(--navy); margin: 4px 0 14px; }
.bigTimer.running { color: #e5560f; }
.bigTimer.idle { font-size: 1.6rem; color: var(--muted); }
#tab-run .qr { width: min(100%, 300px); }
.timerRow { font-weight: 700; }
.screenBtns { display: grid; gap: 8px; }
.screenBtns .btn { display: block; text-decoration: none; text-align: left; }
.screenBtns .btn small { display: block; font-weight: 600; font-size: .8rem; opacity: .8; margin-top: 2px; }
.ctlRow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.status.muted { color: var(--muted); }
tr.winner td { background: #fff4d6; font-weight: 800; }
.roomNow { margin: 0 0 10px; }
/* the "?" beside a control, and its bubble */
.qh { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #dfe7f3; color: var(--navy); font: 900 .78rem/1 inherit; cursor: pointer; vertical-align: middle; flex: none; text-transform: none; letter-spacing: 0; }
.qh:hover, .qh:focus-visible { background: var(--sun); }
.bar .qh { background: rgba(255, 255, 255, .2); color: #fff; }
.hintPop { position: fixed; z-index: 60; padding: 10px 12px; border-radius: 12px; background: var(--navy); color: #fff; font-size: .88rem; line-height: 1.4; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
/* Help for organisers: a panel down the right side (the whole screen on a phone) */
.helpPanel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(460px, 100%); display: flex; flex-direction: column; background: var(--paper); box-shadow: -10px 0 40px rgba(8, 20, 40, .35); }
.helpHead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--navy); color: #fff; }
.helpHead h2 { margin: 0; font-size: 1.2rem; }
.helpHead .x { position: static; }
.helpBody { padding: 14px 18px 30px; overflow-y: auto; overscroll-behavior: contain; line-height: 1.45; }
.helpBody h3 { margin: 6px 0 8px; font-size: 1rem; color: var(--navy); }
.helpSteps { margin: 0 0 16px; padding-left: 22px; font-size: .92rem; }
.helpSteps li { margin-bottom: 6px; }
.faq { border: 2px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 8px; padding: 0 12px; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 800; color: var(--navy); }
.faq[open] { padding-bottom: 6px; }
.faq p, .faq ul { margin: 0 0 8px; font-size: .92rem; }
.faq ul { padding-left: 20px; }
.faq li { margin-bottom: 4px; }
@media (max-width: 700px) {
  .adminBar .sessBox { width: 100%; }
  .adminBar .sessBox select { flex: 1; min-width: 0; max-width: none; }
  .adminBar .ppBadge { display: none; }
  .tabs.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .tabs.steps .tab { justify-content: center; padding: 9px 2px; font-size: .82rem; gap: 4px; min-width: 0; }
  .tabs.steps .tab i { width: 18px; height: 18px; font-size: .7rem; }
  .tabs.steps .tab[data-tab=advanced] { margin-left: 0; }
  .tabs.steps .tab[data-tab=advanced] i { display: none; }
  .secHead { margin: 14px 10px 0; }
  .checklist { margin: 10px 10px 0; }
  .bigTimer { font-size: 2.8rem; }
}

/* player help (index.html #playerHelp): the join card's ❓ Help and the game's ? button */
.helpRow { display: flex; gap: 8px; margin-top: 8px; }
.helpRow .howBtn { flex: 1; width: auto; margin-top: 0; padding-left: 8px; padding-right: 8px; }
#playerHelp { z-index: 40; }
#playerHelp .helpLang .langSwitch { justify-content: flex-start; margin: 0 0 8px; }
#playerHelp .faq summary { font-size: 1rem; }
#playerHelp .faq p { font-size: .95rem; line-height: 1.5; }
/* the admin's "Every answer" table fits a phone without sideways scrolling */
#subs td { overflow-wrap: anywhere; }
@media (max-width: 700px) { #subs th, #subs td { padding: 6px 4px; font-size: .76rem; } #subs th { letter-spacing: 0; } }
