/* Kooheji Jewellery · Muharraq Nights 2026 map (v2, 3 Dec 2026).
   The room experience's recipe (public/ui.css, public/story.css): midnight frost glass with a fine bright rim, Cairo, one white light.
   The map itself is Kooheji's Confident Blue (#1B2A4A), a step lighter than v1; the ways in are a road of warm light.
   One grid: 12 px from every screen edge (as the room's sheet and bar), 16 px inside the card, 12 px between things. */
/* the room's own Cairo, the same file (public/fonts/cairo.ttf, OFL licence beside it) */
@font-face { font-family: 'Cairo'; font-weight: 200 1000; font-display: swap; src: url('fonts/cairo.ttf') format('truetype'); }
:root {
  /* the room's tokens, unchanged */
  --night: #05070C; --ink: #111722; --paper: #F6F7F9;
  --text-2: rgba(246, 247, 249, .74); --text-3: rgba(246, 247, 249, .56);
  --frost-rgb: 150, 176, 214; --fire-cool: #8FB8FF; --fire-warm: #FFB061;
  --glass-solid: rgba(17, 23, 34, .95);
  --veil-a: .42; --bar-a: .3; --blur: blur(28px) saturate(170%);
  --ease: cubic-bezier(.2, .8, .2, 1); --spring-ui: cubic-bezier(.2, .9, .25, 1.04); --t-ui: .45s;
  /* the map's grid */
  --edge: 12px; --pad: 16px; --gap: 12px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #1B2A4A; color: var(--paper);
  font-family: 'Cairo', 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, a { font: inherit; color: inherit; }
h1 { font: inherit; }
#map, #poster { position: fixed; inset: 0; width: 100%; height: 100%; }
#poster { object-fit: cover; }
.maplibregl-canvas:focus-visible { outline: none; }
.maplibregl-ctrl-attrib { display: none !important; }
.maplibregl-map { font-family: 'Cairo', 'Helvetica Neue', Arial, sans-serif; }

/* ---------- frost: the room's glass (a tint of midnight over the blurred map, a cool sheen, a fine bright rim) ---------- */
.frost, .gl {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(var(--frost-rgb), .16), rgba(var(--frost-rgb), .06)), rgba(16, 22, 34, var(--bar-a));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 -8px 12px -10px rgba(255, 255, 255, .14), 0 10px 24px -12px rgba(0, 0, 0, .7);
}
.frost::before, .gl::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1.25px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .58) 0%, rgba(255, 255, 255, .12) 34%, rgba(255, 255, 255, .05) 64%, rgba(255, 255, 255, .3) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}

/* ---------- controls: capsules and circles of glass ---------- */
.gl { -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer; color: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
  border-radius: 999px; font-size: 15px; font-weight: 500; line-height: 1.2;
  transition: transform var(--t-ui) var(--spring-ui), box-shadow .3s ease, opacity .35s ease;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.gl:active { transform: scale(.96); transition-duration: .12s, .12s, .35s;
  box-shadow: inset 0 -9px 14px -11px rgba(255, 255, 255, .16), 0 12px 30px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .22), 0 0 28px rgba(255, 246, 230, .26); }
.gl:active::before { background: rgba(255, 255, 255, .9); }
.gl:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
/* the main action: a little more light in the glass (room: .gl-primary) */
.gl-primary { background: linear-gradient(180deg, rgba(var(--frost-rgb), .36), rgba(var(--frost-rgb), .18)), rgba(16, 22, 34, var(--bar-a)); font-weight: 600; }
html[lang=ar] .gl { font-size: 16px; line-height: 1.5; }

.cap { position: fixed; top: calc(var(--sat) + var(--edge)); inset-inline-end: var(--edge); z-index: 5; height: 44px; min-width: 76px; padding: 0 18px; }
.round { width: 44px; height: 44px; padding: 0; }
.round svg { width: 20px; height: 20px; }
#tools { position: fixed; inset-inline-end: var(--edge); bottom: calc(var(--card-h, 148px) + var(--sab) + var(--edge) + var(--gap));
  display: flex; flex-direction: column; gap: var(--gap); z-index: 5; transition: bottom .35s var(--ease); }
#me.on { color: var(--fire-cool); }

/* ---------- the card: the room's frosted sheet ---------- */
#card { position: fixed; left: var(--edge); right: var(--edge); bottom: calc(var(--sab) + var(--edge)); z-index: 6; max-width: 420px; margin: 0 auto;
  padding: var(--pad); border-radius: 28px;
  background: linear-gradient(180deg, rgba(var(--frost-rgb), .1), rgba(var(--frost-rgb), .03)), rgba(14, 20, 32, var(--veil-a));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26), inset 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 50px rgba(0, 0, 0, .45);
  transform: translateY(calc(100% + 40px)); transition: transform .7s var(--ease); }
body.ready #card { transform: none; }
.pane { display: flex; flex-direction: column; gap: var(--gap); }
.pane[hidden] { display: none; }
/* one header height in both states, so the card never jumps */
.head { display: flex; align-items: center; gap: 14px; min-height: 56px; }
#logo { height: 56px; width: auto; flex: none; display: block; }
.titles { flex: 1; min-width: 0; }
.titles h1 { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titles p { font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--text-2); margin-top: 2px; }
html[lang=ar] .titles h1 { font-size: 18px; line-height: 1.45; }
html[lang=ar] .titles p { font-size: 14px; line-height: 1.5; margin-top: 0; }
.actions { display: flex; gap: 10px; }
.btn { height: 48px; padding: 0 22px; }
.btn.gl-primary { flex: 1; }
#svcIc { width: 45px; height: 45px; margin: 0; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--paper); }
#svcIc .p { font-size: 18px; font-weight: 700; line-height: 1; }
#svcIc svg { width: 20px; height: 20px; }

/* ---------- on the map ---------- */
/* the door: the room's white light, its beam, and the name in glass */
.m-door { display: flex; flex-direction: column; align-items: center; pointer-events: auto; cursor: pointer; }
.m-tag { display: flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; white-space: nowrap; margin-bottom: 8px;
  font-size: 14px; font-weight: 600; color: var(--paper); }
html[lang=ar] .m-tag { font-size: 15px; }
.kj-beam { width: 2px; height: 104px; border-radius: 1px; background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, .6), 0 0 22px 5px rgba(220, 232, 255, .2); animation: kj-breathe 3.4s ease-in-out infinite alternate; }
.kj-dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, .55), 0 0 22px 6px rgba(220, 232, 255, .22); animation: kj-pulse 1.5s ease-out infinite; }
.m-door .kj-dot { margin-top: -1px; }
@keyframes kj-pulse { 0% { transform: scale(1); } 12% { transform: scale(1.25); box-shadow: 0 0 10px 4px rgba(255, 255, 255, .8), 0 0 34px 12px rgba(220, 232, 255, .34); }
  30% { transform: scale(1.04); } 36% { transform: scale(1.12); } 70%, 100% { transform: scale(1); } }
@keyframes kj-breathe { from { opacity: .82; } to { opacity: 1; } }

/* the ways in: a glass circle on the road, its name and walk under it */
.m-svc { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 0; pointer-events: auto;
  transition: opacity .3s ease; }
.m-svc .ic { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--paper); }
.m-svc .lb { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 5px 12px 6px; border-radius: 14px; }
/* the name beside the circle, level with it, when it would cover another way in */
.m-svc.bes-r .lb { transform: translate(calc(50% + 25px), -45px); }
.m-svc.bes-l .lb { transform: translate(calc(-50% - 25px), -45px); }
.m-svc b { font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.m-svc small { font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--text-2); white-space: nowrap; }
html[lang=ar] .m-svc b { font-size: 14px; line-height: 1.4; }
html[lang=ar] .m-svc small { font-size: 12.5px; line-height: 1.4; }
.m-svc.on .ic { background: var(--paper); color: #111722; }
.m-svc.off { visibility: hidden; pointer-events: none; }
.ic svg { width: 18px; height: 18px; }
.ic .p { font-weight: 700; font-size: 16px; line-height: 1; }

/* landmarks: a small warm light and the name in quieter glass */
.m-lm { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.m-lm span { display: block; padding: 3px 10px 4px; border-radius: 999px; white-space: nowrap; margin-bottom: 6px;
  font-size: 12px; font-weight: 500; line-height: 1.3; color: rgba(246, 247, 249, .88); }
html[lang=ar] .m-lm span { font-size: 13px; line-height: 1.4; padding: 2px 10px 3px; }
/* when the name would cover something, it moves beside or under its light (the dot stays on the building) */
.m-lm.lm-r span { transform: translate(calc(50% + 9px), calc(50% + 9px)); }
.m-lm.lm-l span { transform: translate(calc(-50% - 9px), calc(50% + 9px)); }
.m-lm.lm-b span { transform: translate(0, calc(100% + 18px)); }
.m-lm i { width: 6px; height: 6px; border-radius: 50%; background: #FFE7A8; box-shadow: 0 0 8px 2px rgba(255, 200, 90, .55); }

/* you, when the visitor asks */
.m-me { width: 16px; height: 16px; border-radius: 50%; background: var(--fire-cool); border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(143, 184, 255, .22); }

/* the map credit (OpenStreetMap's licence): small and quiet, on the card's starting edge, just above it */
#credit { position: fixed; left: calc(var(--edge) + var(--pad)); bottom: calc(var(--card-h, 148px) + var(--sab) + var(--edge) + 6px); z-index: 4;
  font-size: 10px; line-height: 1.3; color: var(--text-3); direction: ltr; transition: bottom .35s var(--ease); }
/* #credit is written left to right, so its side is set from the page's direction, not its own */
html[dir=rtl] #credit { left: auto; right: calc(var(--edge) + var(--pad)); }
#credit a { color: inherit; text-decoration: none; }

/* ---------- the door screen while the map loads: the room's own first words ---------- */
#door { position: fixed; inset: 0; z-index: 9; background: #111A2E; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; transition: opacity .9s ease, visibility .9s; }
#door p { font-size: 17px; font-weight: 400; color: var(--text-2); letter-spacing: .01em; }
html[lang=ar] #door p { font-size: 19px; }
body.ready #door { opacity: 0; visibility: hidden; }
body.fail #door p { max-width: 280px; text-align: center; }

#toast { position: fixed; left: 50%; top: calc(var(--sat) + var(--edge) + 56px); transform: translate(-50%, -8px); z-index: 8; opacity: 0;
  pointer-events: none; border-radius: 18px; padding: 9px 18px; font-size: 14px; font-weight: 500; line-height: 1.45;
  background: rgba(16, 22, 34, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: opacity .3s ease, transform .3s var(--ease); max-width: calc(100% - 40px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
html[lang=ar] #toast { font-size: 15px; }

/* ---------- solid surfaces: no blur support, or less transparency asked for (the room's fallback) ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .frost, .gl, #card { background: var(--glass-solid); } }
@media (prefers-reduced-transparency: reduce) { .frost, .gl, #card { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); } }
@media (prefers-reduced-motion: reduce) { .kj-dot, .kj-beam { animation: none; } #card, #door { transition: none; } .gl:active { transform: none; } }
@media (prefers-contrast: more) { :root { --text-2: #FAF8F4; --text-3: rgba(250, 248, 244, .86); } .frost::before, .gl::before { background: rgba(255, 255, 255, .8); } }
/* larger screens: the card stays a phone's width, at the bottom centre */
@media (min-width: 720px) { #card { left: 50%; right: auto; width: 420px; margin: 0; transform: translate(-50%, calc(100% + 40px)); } body.ready #card { transform: translateX(-50%); } }

/* the share picture (rendered once with ?shot=1): the map, the light and the name, nothing else */
body.shot #card, body.shot #tools, body.shot #lang, body.shot #toast, body.shot #credit, body.shot-og .m-svc { display: none !important; }
#lockup { display: none; }
body.shot-og #lockup { display: flex; position: fixed; left: 56px; bottom: 50px; align-items: center; gap: 26px; z-index: 7; }
#lockup img { height: 168px; width: auto; }
#lockup .t { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid rgba(255,255,255,.28); padding-left: 26px; }
#lockup .t span { font-size: 31px; font-weight: 600; letter-spacing: .01em; }
#lockup .t span.ar { font-size: 33px; text-align: left; }
#lockup .t i { font-style: normal; font-size: 21px; color: var(--text-2); margin-top: 6px; }
#lockup .t b { font-weight: 400; }
