/* Catvegas's Bar — real-time viewer chrome.
   One deliberate night look for every viewer theme (the scene is a night interior),
   so the tokens below are the dark palette; color-scheme tells the UA to match. */
:root {
  --bg: #0b0706;
  --ink: #f4ebdf;
  --ink-dim: rgba(244, 235, 223, .74);
  --ink-faint: rgba(244, 235, 223, .46);
  --line: rgba(244, 235, 223, .13);
  --glass: rgba(17, 10, 8, .56);
  --glass-strong: rgba(17, 10, 8, .74);
  --neon: #ff8a3d;
  --neon-hot: #ffd9b8;
  --neon-glow: rgba(255, 138, 61, .55);
  --gutter: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  --top: max(16px, env(safe-area-inset-top));
  --bottom: max(16px, env(safe-area-inset-bottom));
  /* Archivo / Plex Mono cover Latin (Plex also Cyrillic); the faces after them only ever draw what those lack:
     Fira Sans Extra Condensed = Cyrillic titles, Cairo = Arabic (index.html; unicode-range, loaded on first use).
     CJK uses the system's own heavy faces (below). No face is ever faked bold (font-synthesis: none on html). */
  --display: "Archivo", "Fira Sans Extra Condensed", "Cairo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Archivo", "Cairo", ui-sans-serif, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "Cairo", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sys: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;     /* language names: no download */
  color-scheme: dark;
}
/* CJK: the platform fonts in the right regional form, heaviest faces available (PingFang SC tops out at Semibold,
   Hiragino Sans / Apple SD Gothic Neo / Noto Sans CJK go to Black) */
:lang(zh) { --cjk: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif; }
:lang(ja) { --cjk: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Noto Sans JP", "Source Han Sans JP", "Yu Gothic", Meiryo, sans-serif; }
:lang(ko) { --cjk: "Apple SD Gothic Neo", "Noto Sans CJK KR", "Noto Sans KR", "Source Han Sans KR", "Malgun Gothic", sans-serif; }
:lang(zh), :lang(ja), :lang(ko) {
  --display: "Archivo", var(--cjk);
  --text: "Archivo", var(--cjk);
  --mono: "IBM Plex Mono", var(--cjk);
  --sys: system-ui, var(--cjk);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { color-scheme: dark; } }
:root[data-theme="dark"], :root[data-theme="light"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 400 15px/1.45 var(--text); font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; font-synthesis: none;
}
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; outline: none; }
#stage.dragging { cursor: grabbing; }
#stage.can-walk { cursor: pointer; }
#stage:focus-visible { box-shadow: inset 0 0 0 2px var(--neon); }
#stage canvas { display: block; width: 100%; height: 100%; }

.glass {
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}

/* ------------------------------------------------------------------ floating section signs */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.sign {
  position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; padding: 0; margin: 0;
  background: none; cursor: pointer; will-change: transform, opacity; opacity: 0;
  transition: opacity .35s ease; display: flex; flex-direction: column; align-items: center;
  /* the anchor point is the bottom of the stem */
  transform: translate3d(-9999px, 0, 0);
}
.sign[data-on="1"] { opacity: 1; }
.sign[data-on="0"] { pointer-events: none; }
.sign-pill {
  position: relative; left: var(--dx, 0px);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: rgba(14, 8, 6, .62); border: 1.5px solid rgba(255, 138, 61, .78);
  box-shadow: 0 0 0 1px rgba(255, 138, 61, .12), 0 0 14px rgba(255, 138, 61, .28), inset 0 0 10px rgba(255, 138, 61, .14);
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--neon-hot);
  text-shadow: 0 0 8px rgba(255, 138, 61, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s, background .2s, border-color .2s;
}
.sign-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff3e6;
  box-shadow: 0 0 6px 2px rgba(255, 138, 61, .9); flex: none; }
.sign-stem { width: 1.5px; height: 22px; background: linear-gradient(rgba(255, 138, 61, .85), rgba(255, 138, 61, 0)); }
.sign:hover .sign-pill, .sign:focus-visible .sign-pill {
  transform: translateY(-2px); background: rgba(40, 18, 10, .78); border-color: var(--neon);
  box-shadow: 0 0 0 1px rgba(255, 138, 61, .3), 0 0 22px rgba(255, 138, 61, .55), inset 0 0 12px rgba(255, 138, 61, .25);
}
.sign:focus-visible { outline: none; }
.sign:focus-visible .sign-pill { outline: 2px solid var(--neon-hot); outline-offset: 3px; }
.sign[aria-current="location"] .sign-pill { border-color: rgba(255, 217, 184, .9); }

/* ------------------------------------------------------------------ top bar: Places (where you are) + Tour */
.topbar { position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter-r); top: var(--top);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.menu { position: relative; min-width: 0; flex: 0 1 auto; }
.places-btn { display: flex; align-items: center; gap: 11px; min-height: 52px; max-width: 100%; padding: 7px 14px 8px 12px;
  border-radius: 16px; cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.pb-name[dir="auto"] { text-align: start; }
.places-btn:hover, .places-btn[aria-expanded="true"] { border-color: rgba(255, 138, 61, .7); background: rgba(30, 14, 9, .72); }
.places-btn:focus-visible { outline: 2px solid var(--neon-hot); outline-offset: 3px; }
.pb-pin { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--neon); stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(255, 138, 61, .55)); }
.pb-text { display: flex; flex-direction: column; min-width: 0; }
.pb-kicker { display: flex; align-items: baseline; gap: 6px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .16em;
  text-transform: uppercase; color: var(--neon); }
.pb-count { color: var(--ink-faint); letter-spacing: .08em; }
.pb-name { display: block; margin-top: 3px; font: 900 22px/1 var(--display); font-variation-settings: "wdth" 62;
  font-stretch: 62%; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-chev { width: 16px; height: 16px; flex: none; margin-left: 2px; fill: none; stroke: var(--ink-dim); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.places-btn[aria-expanded="true"] .pb-chev { transform: rotate(180deg); }

.places { position: absolute; left: 0; top: calc(100% + 8px); width: min(340px, calc(100vw - 32px));
  /* the whole screen below the top bar (a 640 px cap hid 6 of 16 places at 1440×900 with nothing to say so) */
  max-height: calc(100dvh - var(--top) - 60px - var(--bottom)); overflow: auto; overscroll-behavior: contain; border-radius: 18px; padding: 6px;
  background: rgba(17, 10, 8, .86); transform-origin: top left; animation: pop .22s cubic-bezier(.2, .8, .2, 1); }
.places[hidden] { display: none; }
/* still taller than the screen: the lower edge fades out until the end of the list is reached (main.js menuMore) */
.places.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 64px), rgba(0, 0, 0, .12));
  mask-image: linear-gradient(#000 calc(100% - 64px), rgba(0, 0, 0, .12)); }
.places-sec { break-inside: avoid; }
/* mouse screens: two columns, every place in sight at once */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .places { width: 608px; }
  #placesItems { columns: 2; column-gap: 4px; }
  .places-sec { padding-top: 1px; }
}
.places-tour { width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; cursor: pointer; min-height: 56px;
  margin: 0 0 4px; padding: 10px 12px; border-radius: 13px; border: 1.5px solid rgba(255, 138, 61, .55);
  background: rgba(255, 138, 61, .10); }
.places-tour svg { width: 26px; height: 26px; flex: none; padding: 5px; border-radius: 50%; background: var(--neon); fill: #1a0d07; }
.places-tour > span { display: flex; flex-direction: column; gap: 3px; }
.pt-title { font: 900 19px/1 var(--display); font-variation-settings: "wdth" 62; font-stretch: 62%; text-transform: uppercase; letter-spacing: .02em; }
.pt-meta { font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.places-tour:hover, .places-tour:focus-visible { background: rgba(255, 138, 61, .2); border-color: var(--neon); outline: none; }
.places-tour:focus-visible { box-shadow: 0 0 0 2px var(--neon-hot); }
.places-group { margin: 12px 12px 4px; font: 500 10px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }
.places ul { list-style: none; margin: 0; padding: 0; }
.places li button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: start; border: 0; background: none;
  padding: 10px 12px; border-radius: 11px; cursor: pointer; min-height: 48px; }
.places li button span { font: 800 18px/1.05 var(--display); font-variation-settings: "wdth" 62; font-stretch: 62%; text-transform: uppercase; letter-spacing: .02em; }
.places li button::after { content: ""; margin-inline-start: -2px; width: 7px; height: 7px; border-radius: 50%; flex: none; }   /* final round (lang judge #4): the dot sits right after its own name — at `auto` it landed beside the NEXT column's name */
.places li button:hover, .places li button:focus-visible { background: rgba(255, 138, 61, .13); outline: none; }
.places li button:focus-visible { box-shadow: inset 0 0 0 1.5px var(--neon); }
.places li button[aria-current="location"] span { color: var(--neon-hot); }
.places li button[aria-current="location"]::after { background: var(--neon); box-shadow: 0 0 8px 2px rgba(255, 138, 61, .7); }
.places-keys { margin: 10px 12px 6px; font: 500 10px/1.5 var(--mono); letter-spacing: .06em; color: var(--ink-faint); }
@media (hover: none), (pointer: coarse) { .places-keys { display: none; } }

.tourctl { flex: none; display: flex; }
.tour-start { display: inline-flex; align-items: center; gap: 9px; height: 52px; padding: 0 18px 0 12px; border-radius: 999px; cursor: pointer;
  font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; border-color: rgba(255, 138, 61, .55);
  transition: border-color .2s, background .2s; }
.tour-start svg { width: 26px; height: 26px; padding: 6px; border-radius: 50%; background: var(--neon); fill: #1a0d07;
  box-shadow: 0 0 12px rgba(255, 138, 61, .55); }
.tour-start:hover { border-color: var(--neon); background: rgba(30, 14, 9, .72); }
.tour-start:focus-visible, .tr-btn:focus-visible { outline: 2px solid var(--neon-hot); outline-offset: 3px; }
.tour-start[hidden], .tour-run[hidden] { display: none; }
.tour-run { position: relative; display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 4px; border-radius: 999px; border-color: rgba(255, 138, 61, .55); }
.tr-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.tr-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tr-btn .i-play { fill: var(--ink); stroke: none; display: none; }
.tour-run.is-paused .tr-btn .i-pause { display: none; }
.tour-run.is-paused .tr-btn .i-play { display: block; }
.tr-btn:hover { background: rgba(255, 255, 255, .08); }
.tr-count { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 46px; font: 500 12px/1 var(--mono); letter-spacing: .06em; }
.tr-num { white-space: nowrap; }
.tr-of { color: var(--ink-faint); }
.tr-bar { display: block; width: 40px; height: 2px; border-radius: 2px; background: rgba(244, 235, 223, .16); overflow: hidden; }
.tr-bar i { display: block; height: 100%; width: 100%; background: var(--neon); box-shadow: 0 0 6px rgba(255, 138, 61, .8);
  transform-origin: left center; transform: scaleX(0); }
.tour-run.is-paused .tr-bar i { animation-play-state: paused !important; }
@keyframes tourfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* desktop: what a click on an object would do */
.tip { position: absolute; z-index: 3; left: 0; top: 0; margin: 0; padding: 6px 10px; border-radius: 999px; pointer-events: none;
  background: rgba(14, 8, 6, .78); border: 1px solid rgba(255, 138, 61, .55); color: var(--neon-hot);
  font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.tip[hidden] { display: none; }
#stage.can-look { cursor: zoom-in; }

/* ------------------------------------------------------------------ card */
.card { position: absolute; z-index: 4; left: var(--gutter); bottom: var(--bottom); width: min(380px, calc(100vw - 32px));
  border-radius: 20px; padding: 22px 22px 14px; overflow: hidden; background: rgba(17, 10, 8, .64); outline: none;
  animation: rise .42s cubic-bezier(.2, .8, .2, 1); }
.card[hidden] { display: none; }
.card.closing { animation: sink .26s ease forwards; }
.card-glow { position: absolute; left: 22px; right: 22px; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 138, 61, 0), var(--neon) 18%, var(--neon-hot) 50%, var(--neon) 82%, rgba(255, 138, 61, 0));
  box-shadow: 0 0 14px 2px rgba(255, 138, 61, .55); }
.card-kicker { margin: 0 0 8px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--neon); }
.card-title { margin-block: 0 10px; margin-inline: 0 36px; font: 900 38px/.92 var(--display); font-variation-settings: "wdth" 62; font-stretch: 62%;
  text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
.card-text { margin: 0; color: var(--ink-dim); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-count { font: 500 11px/1 var(--mono); letter-spacing: .12em; color: var(--ink-faint); }
.card-step, .card-close { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.card-step svg, .card-close svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-step:hover, .card-close:hover { background: rgba(255, 255, 255, .07); }
.card-step:focus-visible, .card-close:focus-visible { outline: 2px solid var(--neon-hot); outline-offset: 1px; }
.card-close { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; }
/* Arabic card (dir=rtl): close button top-left, previous / next arrows point the reading way */
.card[dir="rtl"] .card-step svg { transform: scaleX(-1); }

/* ------------------------------------------------------------------ hint */
.hint { position: absolute; z-index: 3; left: 50%; bottom: calc(var(--bottom) + 4px); transform: translateX(-50%);
  margin: 0; padding: 9px 16px; border-radius: 999px; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-dim); white-space: nowrap; pointer-events: none; transition: opacity .8s ease; }
.hint.gone { opacity: 0; }
.hint-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .hint-touch { display: none; } .hint-mouse { display: inline; } }

/* ------------------------------------------------------------------ cut through black (menu jumps) */
.fade { position: absolute; inset: 0; z-index: 6; background: #000; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.fade.on { opacity: 1; }

/* ------------------------------------------------------------------ boot */
.boot { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 45%, rgba(40, 18, 10, .35), rgba(11, 7, 6, .96) 70%), var(--bg);
  transition: opacity .9s ease, background-color .6s ease; }
.boot.see-through { background: radial-gradient(120% 90% at 50% 45%, rgba(20, 10, 6, .25), rgba(11, 7, 6, .82) 75%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.boot.done { opacity: 0; pointer-events: none; }
.boot-center { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
.mug { width: 108px; height: 108px; overflow: visible; }
.mug-ghost { fill: rgba(255, 138, 61, .14); }
.mug-lit { fill: var(--neon); filter: drop-shadow(0 0 6px rgba(255, 138, 61, .85)) drop-shadow(0 0 18px rgba(255, 107, 44, .5)); }
.boot-title { margin: 22px 0 6px; font: 900 34px/1 var(--display); font-variation-settings: "wdth" 62; font-stretch: 62%;
  text-transform: uppercase; letter-spacing: .02em; }
.boot-sub { margin: 0; font: 500 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.boot-pct { color: var(--neon); display: inline-block; min-width: 4ch; text-align: left; }
.boot-error { position: absolute; left: 50%; bottom: max(48px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(380px, calc(100vw - 32px)); text-align: center; }
.boot-error[hidden] { display: none; }
.boot-error-title { margin: 0 0 6px; font: 900 22px/1 var(--display); font-variation-settings: "wdth" 62; font-stretch: 62%; text-transform: uppercase; }
.boot-error-text { margin: 0 0 14px; color: var(--ink-dim); font-size: 14px; }
.boot-retry, #paused button { height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--neon); background: rgba(255, 138, 61, .12);
  font: 500 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.boot-retry:focus-visible, #paused button:focus-visible { outline: 2px solid var(--neon-hot); outline-offset: 3px; }
/* the graphics-card-lost notice (#paused). An id, not the class: a paused tour pill carried class "paused" and got
   these rules — absolute, centred in the top bar over the Places button, its buttons turned into ringed pills */
#paused { position: absolute; z-index: 11; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 20px 22px; border-radius: 18px; text-align: center; }
#paused[hidden] { display: none; }
#paused p { margin: 0 0 12px; }

.debug { position: absolute; z-index: 20; right: var(--gutter-r); bottom: calc(var(--bottom) + 52px); margin: 0; padding: 8px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .66); color: #cfe; font: 11px/1.35 var(--mono); pointer-events: none; white-space: pre; }
.debug[hidden] { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sink { to { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ language (top row of the Places menu, js/i18n.js) */
.lang { margin: 0 0 4px; }
.lang-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; text-align: left; color: var(--ink-dim); }
.lang-btn:hover, .lang-btn:focus-visible, .lang.open .lang-btn { background: rgba(255, 255, 255, .06); color: var(--ink); outline: none; }
.lang-btn:focus-visible { box-shadow: inset 0 0 0 1.5px var(--neon); }
.lang-globe { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--neon); stroke-width: 1.4;
  filter: drop-shadow(0 0 3px rgba(255, 138, 61, .45)); }
.lang-kicker { font: 500 10.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.lang-cur { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 14.5px/1.3 var(--sys); color: var(--ink); }
.lang-chev { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--ink-dim); stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; transition: transform .2s; }
.lang.open .lang-chev { transform: rotate(180deg); }
.lang-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin: 2px 0 6px; padding: 0 0 6px;
  border-bottom: 1px solid var(--line); }
.lang-list[hidden] { display: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { .lang-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lang-opt { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 11px;
  background: none; cursor: pointer; text-align: left; color: var(--ink-dim); }
.lang-opt:hover, .lang-opt:focus-visible { background: rgba(255, 138, 61, .13); color: var(--ink); outline: none; }
.lang-opt:focus-visible { box-shadow: inset 0 0 0 1.5px var(--neon); }
.lang-code { flex: none; width: 2.2em; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.lang-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15px/1.3 var(--sys); }
.lang-opt[aria-current] { color: var(--neon-hot); }
.lang-opt[aria-current] .lang-code { color: var(--neon); }
.lang-opt[aria-current]::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--neon); box-shadow: 0 0 8px 2px rgba(255, 138, 61, .7); }
.lang[aria-busy="true"] .lang-list { opacity: .55; pointer-events: none; }

/* ------------------------------------------------------------------ scripts other than Latin / Cyrillic */
/* Arabic is joined writing: letter-spacing tears the letters apart (DILLER.jpg) → none anywhere */
:is(.sign-pill, .pb-kicker, .pb-count, .pb-name, .pt-title, .pt-meta, .places-group, .places-keys, .places li button span, .tour-start,
  .tr-count, .tip, .card-kicker, .card-title, .card-count, .hint, .boot-title, .boot-sub, .boot-error-title, .boot-retry, #paused button,
  .lang-kicker):lang(ar) { letter-spacing: 0; }
/* CJK has no case and no tracking tradition: the wide mono tracking only spaced the characters out */
:is(.sign-pill, .pb-kicker, .pt-meta, .places-group, .tour-start, .tip, .card-kicker, .card-count, .hint, .boot-sub, .boot-retry,
  #paused button, .lang-kicker):is(:lang(zh), :lang(ja), :lang(ko)) { letter-spacing: .04em; }
/* the 10–11 px mono labels: CJK and Arabic need a little more size to stay legible */
:is(.pb-kicker, .pt-meta, .places-group, .places-keys, .tip, .card-kicker, .card-count, .boot-sub, .lang-kicker):is(:lang(zh), :lang(ja), :lang(ko), :lang(ar)) { font-size: 12px; }
:is(.sign-pill, .hint, .tour-start):is(:lang(zh), :lang(ja), :lang(ko), :lang(ar)) { font-size: 12.5px; }
/* taller glyphs: the .92–1.05 display line heights clipped CJK / Arabic (diacritics) */
:is(.card-title, .pb-name, .pt-title, .boot-title, .boot-error-title):is(:lang(zh), :lang(ja), :lang(ko)) { line-height: 1.14; }
.places li button span:is(:lang(zh), :lang(ja), :lang(ko)) { line-height: 1.25; }
:is(.card-title, .pt-title, .boot-title, .boot-error-title, .places li button span):lang(ar) { line-height: 1.32; }
.pb-name:lang(ar) { line-height: 1.24; }
.card-title:lang(ar) { font-size: 31px; font-weight: 800; }
.card-text:is(:lang(zh), :lang(ja), :lang(ko)) { line-height: 1.62; }
.card-text:lang(ar) { line-height: 1.62; }

/* ------------------------------------------------------------------ phones */
@media (max-width: 600px) {
  .places-btn { padding: 6px 12px 7px 10px; gap: 9px; }
  .pb-name { font-size: 19px; }
  /* a long place name wraps onto a second line instead of being cut ("LUCKY H…" beside the running tour) */
  .pb-name { white-space: normal; text-overflow: clip; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.02; }
  .tour-start { padding: 0 14px 0 10px; }
  .places { width: calc(100vw - 32px); }
  .card { left: var(--gutter); right: var(--gutter-r); width: auto; padding: 18px 18px 10px; border-radius: 18px; }
  .card-title { font-size: 32px; }
  .card-title:lang(ar) { font-size: 27px; }
  .card-text { font-size: 14.5px; }
  .hint { bottom: calc(var(--bottom) + 2px); font-size: 10.5px; }
  .sign-pill { padding: 5px 10px 5px 9px; font-size: 10.5px; }
}
/* narrow phones while the tour runs: the step counter gives way to the place name; the progress stays as a line
   along the bottom of the tour pill (194 px → 144 px) */
@media (max-width: 420px) {
  .touring .tr-count { position: absolute; left: 18px; right: 18px; bottom: 5px; min-width: 0; gap: 0; }
  .touring .tr-num { display: none; }
  .touring .tr-bar { width: 100%; }
  .touring .places-btn { padding-right: 10px; gap: 8px; }
}
/* phone held sideways: the hint moves to the bottom-right corner (centred it hid the waiting arrow's floor ring, at
   the top it would run into the Places button on a 667 px screen); the card keeps clear of the top bar (it was 298–321
   of 390 px tall and touched it) */
@media (max-height: 460px) and (orientation: landscape) {
  .card { width: min(340px, 46vw); max-height: min(70vh, calc(100vh - 104px)); overflow: auto; padding: 16px 18px 8px; }
  .card-title { font-size: 26px; margin-bottom: 8px; }
  .card-title:lang(ar) { font-size: 23px; }
  .card-text { font-size: 14px; line-height: 1.42; }
  .card-actions { margin-top: 10px; padding-top: 6px; }
  .hint { left: auto; right: var(--gutter-r); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .places { animation: none; }
  .tr-bar i { animation: none !important; transform: scaleX(1); opacity: .5; }
  .pb-chev { transition: none; }
  .card.closing { animation: none; opacity: 0; }
  .sign, .sign-pill, .boot, .hint { transition: none; }
}

/* ?clean — comparison screenshots: the 3D view only */
.clean #labels, .clean .topbar, .clean .hint, .clean .card, .clean .debug, .clean .tip { display: none !important; }
