@font-face { font-family: "Noto Sans Devanagari"; src: url("./assets/fonts/NotoSansDevanagari.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
/* calligraphic cover headings, one per UI language (SIL OFL 1.1, see ATTRIBUTION.md) */
@font-face { font-family: "Galada"; src: url("./assets/fonts/Galada-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Yatra One"; src: url("./assets/fonts/YatraOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url("./assets/fonts/GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }

/* Apple-style "Liquid Glass" UI. System fonts only; Bengali uses the platform's Bengali face. */
:root {
  --ink: rgba(255, 255, 255, 0.96); --ink-2: rgba(235, 235, 245, 0.66); --ink-3: rgba(235, 235, 245, 0.42);
  --night: #0f0d16; --accent: #ffb340; /* used sparingly: counts, active state */
  --glass-bg: rgba(40, 38, 48, 0.38); --glass-bg-strong: rgba(32, 30, 40, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.16); --glass-spec: rgba(255, 255, 255, 0.34);
  --glass-blur: blur(22px) saturate(1.7);
  --shadow: 0 1px 1px rgba(0,0,0,.12), 0 12px 40px rgba(0,0,0,.28);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --bn: "Kohinoor Bangla", "Bangla Sangam MN", "Noto Sans Bengali", "Nirmala UI", "Vrinda", -apple-system, sans-serif;
  --hi: "Kohinoor Devanagari", "Noto Sans Devanagari", -apple-system, sans-serif;
  --ui: var(--bn); /* follows <html lang>: বাংলা / हिन्दी / English */
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
:root[lang="hi"] { --ui: var(--hi); }
:root[lang="en"] { --ui: var(--sans); }
body { font-family: var(--ui); }
[lang="bn"] { font-family: var(--bn); }
[lang="hi"] { font-family: var(--hi); }
[lang="en"] { font-family: var(--sans); }
canvas#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid rgba(255, 255, 255, .55); outline-offset: 3px; }
.touch, .touch-only { display: none; }
@media (pointer: coarse) { .desk { display: none !important; } .touch { display: inline; } }

/* ---------------- the glass material */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-spec), inset 0 -1px 0 rgba(255,255,255,.04), var(--shadow);
}
kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px;
  font: 600 12px/1 var(--sans); color: var(--ink); border-radius: 7px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 2px rgba(0,0,0,.25);
}
kbd:lang(bn), kbd:lang(hi) { font-family: var(--ui); }

/* ---------------- intro / cover */
/* cover: a full-bleed hero over the blurred live scene, no card */
#intro { position: fixed; inset: 0; z-index: 30; display: flex; padding: clamp(24px, 6vw, 96px); padding-left: max(clamp(24px, 7vw, 120px), var(--safe-l, 0px)); overflow-y: auto; transition: opacity .6s ease, visibility .6s; }
#intro::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10, 8, 16, .78) 0%, rgba(10, 8, 16, .52) 45%, rgba(10, 8, 16, .18) 100%), linear-gradient(0deg, rgba(10, 8, 16, .55), rgba(10, 8, 16, 0) 40%);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
body.playing #intro { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-card { position: relative; width: min(900px, 100%); margin: auto 0; }
.intro-eyebrow { margin: 0 0 18px; font-size: clamp(14px, 1.6vw, 17px); font-weight: 600; letter-spacing: .01em; color: #f2c14e; }
/* the heading: "Shubho Durga Puja" in calligraphy for each language, warm marigold-gold ink */
#intro-title {
  margin: 0 0 0 -.06em; padding: .08em .12em .1em .06em; /* room for swashes, matras and descenders */
  font-weight: 400; letter-spacing: 0; color: #f4cf86;
  background: linear-gradient(176deg, #fde9bd 8%, #f1c473 52%, #d99a45 96%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0,0,0,.45));
  text-wrap: balance; overflow-wrap: normal;
}
:root[lang="bn"] #intro-title { font-family: "Galada", var(--bn); font-size: clamp(60px, min(10.5vw, 15vh), 132px); line-height: 1.38; }
:root[lang="hi"] #intro-title { font-family: "Yatra One", var(--hi); font-size: clamp(54px, min(9.2vw, 13.5vh), 116px); line-height: 1.42; }
:root[lang="en"] #intro-title { font-family: "Great Vibes", Georgia, serif; font-size: clamp(64px, min(8.4vw, 14vh), 114px); line-height: 1.25; padding-right: .2em; }
/* language switch (cover top-right, and in Settings) */
.lang-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.lang-switch button { border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; min-height: 34px; padding: 0 13px; font-size: 14px; font-weight: 600; line-height: 1; transition: background .2s, color .2s; }
.lang-switch button[lang="bn"] { font-family: var(--bn); } .lang-switch button[lang="hi"] { font-family: var(--hi); } .lang-switch button[lang="en"] { font-family: var(--sans); }
.lang-switch button:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.lang-switch button[aria-checked="true"] { background: rgba(255,255,255,.92); color: #16121e; }
.cover-lang { position: absolute; z-index: 2; top: calc(18px + var(--safe-t)); right: calc(18px + var(--safe-r)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: rgba(20,16,28,.35); }
.intro-en { margin: 18px 0 0; font-size: clamp(16px, 2vw, 22px); font-weight: 500; color: rgba(255,255,255,.72); letter-spacing: -0.01em; }
.intro-copy { margin: 22px 0 30px; font-size: clamp(16px, 1.9vw, 20px); line-height: 1.6; color: rgba(255,255,255,.82); max-width: 40ch; }
.intro-entry { display: grid; gap: 14px; max-width: 420px; }
#go {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: fit-content; min-width: 240px; min-height: 56px; padding: 0 32px;
  border: 0; border-radius: 999px; background: rgba(255,255,255,.94); color: #111;
  font-family: var(--ui); font-size: 18px; font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 20px rgba(0,0,0,.25);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), background .3s, color .3s, opacity .3s;
}
#go:disabled { background: rgba(255,255,255,.12); color: var(--ink-3); cursor: progress; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
#go:not(:disabled):hover { transform: scale(1.012); }
#go:not(:disabled):active { transform: scale(.985); }
.loading { display: grid; gap: 7px; }
#loadlabel { font-size: 12px; color: var(--ink-3); min-height: 1.3em; }
.stripe { height: 2px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
#bar { height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: rgba(255,255,255,.8); transition: transform .3s ease; }
.intro-keys { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 32px; font-family:var(--ui); font-size: 13.5px; color: var(--ink-2); }
.intro-keys > span { display: inline-flex; align-items: center; gap: 7px; }
.intro-keys .kc-row { display: inline-flex; gap: 3px; }
.intro-keys kbd { min-width: 24px; height: 24px; font-size: 11.5px; }
.intro-keys.touch { display: none; }
@media (pointer: coarse) { .intro-keys.touch { display: flex; } .intro-keys.desk { display: none; } }
.intro-note { margin: 18px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-3); }

/* ---------------- HUD */
.hud { position: fixed; z-index: 10; opacity: 0; pointer-events: none; transition: opacity .4s; }
body.playing .hud { opacity: 1; pointer-events: auto; }
body.playing.noui .hud, body.in-activity #minimap, body.in-activity #prompt, body.in-activity #cross, body.in-activity #touch-act, body.in-activity #keyguide { opacity: 0 !important; pointer-events: none !important; }
body.capture .hud, body.capture #aim, body.capture #fade, body.capture #stats, body.capture #stick, body.capture #activity { display: none !important; }
#brand { top: calc(14px + var(--safe-t)); left: calc(16px + var(--safe-l)); display: flex; flex-direction: column; gap: 1px; pointer-events: none !important; text-shadow: 0 1px 10px rgba(0,0,0,.55); }
.brand-bn { font-family: var(--ui); font-weight: 700; font-size: 19px; line-height: 1.15; color: #fff; }
.brand-en { font-size: 11px; font-weight: 500; color: var(--ink-2); }
#area { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; flex-direction: column; }
#area .hi, #area .bn { font-family: var(--ui); font-size: 15px; font-weight: 600; color: #fff; }
#corner { top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 0 15px; min-height: 38px; font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--ink); transition: background .2s, transform .15s; }
.chip small { font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--ink-3); }
.chip:hover { background: rgba(70, 68, 80, .45); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { color: #ff9f8f; }
.chip b { font-family: var(--sans); font-size: 12px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; }
#minimap { bottom: calc(14px + var(--safe-b)); left: calc(14px + var(--safe-l)); width: 220px; height: 150px; border-radius: 20px; padding: 0; cursor: pointer; }
#toast { top: 20%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none !important; opacity: 0 !important; transition: opacity .6s ease; width: max-content; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1 !important; }
.t-main { font-family: var(--ui); font-weight: 700; font-size: clamp(26px, 5vw, 38px); line-height: 1.2; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.t-sub { margin-top: 4px; font-size: clamp(13px, 2.2vw, 15px); font-weight: 500; color: var(--ink-2); text-shadow: 0 1px 10px rgba(0,0,0,.8); }
#prompt { bottom: calc(26% + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px; }
#prompt-btn { border-radius: 999px; padding: 0 20px 0 8px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; min-height: 48px; }
#prompt-btn kbd { width: 32px; height: 32px; border-radius: 999px; font-size: 13px; }
#prompt-btn .touch { font-size: 20px; padding-left: 8px; }
#prompt small { font-size: 12px; color: var(--ink-2); text-shadow: 0 1px 6px #000; }
#cross { top: 50%; left: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.3); pointer-events: none !important; }
#aim { position: fixed; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 12; display: none; pointer-events: none; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.4); }
#aim::before, #aim::after { content: ""; position: absolute; background: rgba(255,255,255,.95); }
#aim::before { left: 50%; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; }
#aim::after { top: 50%; left: -8px; right: -8px; height: 2px; margin-top: -1px; }
body.aiming #aim { display: block; }

/* ---------------- WASD guide (bottom-right, clear of minimap and the centred prompt/activity) */
#keyguide { right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); pointer-events: none !important; transition: opacity .8s ease; }
body.playing #keyguide.dim { opacity: .38; }
body.playing #keyguide.off, body.overlay-open #keyguide { opacity: 0 !important; }
.kg-desk { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: 22px; }
.kg-wasd { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(2, 34px); gap: 4px; }
.kg-wasd kbd[data-k="w"] { grid-column: 2; grid-row: 1; }
.kg-wasd kbd[data-k="a"] { grid-column: 1; grid-row: 2; }
.kg-wasd kbd[data-k="s"] { grid-column: 2; grid-row: 2; }
.kg-wasd kbd[data-k="d"] { grid-column: 3; grid-row: 2; }
#keyguide kbd { width: 34px; min-width: 0; height: 34px; padding: 0; border-radius: 9px; font-size: 13px; transition: background .12s, color .12s, transform .12s; }
#keyguide kbd.on { background: rgba(255,255,255,.9); color: #111; transform: translateY(1px); box-shadow: 0 0 0 1px rgba(255,255,255,.6); }
.kg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink); }
.kg-list li { display: flex; align-items: center; gap: 9px; }
.kg-list kbd { width: 26px !important; height: 26px !important; border-radius: 7px !important; font-size: 12px !important; }
.kg-list small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
.kg-mouse i { display: block; width: 10px; height: 14px; border: 1.5px solid currentColor; border-radius: 6px; position: relative; }
.kg-mouse i::after { content: ""; position: absolute; left: 50%; top: 2px; width: 1.5px; height: 3.5px; margin-left: -.75px; background: currentColor; border-radius: 1px; }
.kg-touch { display: none; padding: 9px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
@media (pointer: coarse) {
  .kg-desk { display: none; }
  .kg-touch { display: block; }
  /* phones: centred above the minimap row, between minimap and ◉; hidden whenever a prompt takes that spot */
  #keyguide { right: auto; left: 50%; bottom: calc(130px + var(--safe-b)); transform: translateX(-50%); }
  body.playing #keyguide.dim { opacity: 0; }
  body.prompting #keyguide { opacity: 0 !important; }
}
@media (max-width: 900px) and (pointer: fine) { .kg-list small { display: none; } }
@media (max-width: 640px) and (pointer: fine) { .kg-list { display: none; } }

/* ---------------- activity panel */
#activity { position: fixed; z-index: 15; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 16px 18px; border-radius: 26px; display: grid; gap: 10px; background: var(--glass-bg-strong); }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#act-title { font-weight: 700; font-size: 17px; color: #fff; }
.exit { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.10); border-radius: 999px; padding: 0 18px; font-weight: 600; min-height: 44px; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.exit:hover { background: rgba(255,255,255,.16); }
#act-hint { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
#act-score { display: flex; gap: 16px; align-items: center; font-size: 15px; font-variant-numeric: tabular-nums; }
#act-score:empty { display: none; }
#act-score .shots { letter-spacing: .25em; color: var(--accent); font-size: 18px; }
#act-progress { height: 3px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
#act-progress i { display: block; height: 100%; background: rgba(255,255,255,.85); transform-origin: left; transform: scaleX(0); }
#act-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
#act-buttons:empty { display: none; }
#act-buttons button { border: 0; border-radius: 999px; padding: 0 22px; font-weight: 600; color: #111; background: rgba(255,255,255,.92); min-height: 46px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#act-buttons button.touch-btn { display: none; }
@media (pointer: coarse) { #act-buttons button.touch-btn { display: inline-block; flex: 1; font-size: 18px; } }

/* ---------------- touch joystick + act button */
#stick { position: fixed; z-index: 11; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: none; pointer-events: none; }
#stick.active { display: block; }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 2px 10px rgba(0,0,0,.25); transform: translate(-50%, -50%); }
@media (pointer: coarse) {
  #touch-act { display: grid; place-items: center; right: calc(22px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 68px; height: 68px; border-radius: 50%; font-size: 28px; color: #fff; }
  #prompt { bottom: calc(130px + var(--safe-b)); } /* clear of the 102 px minimap */
  #prompt small { max-width: 70vw; text-align: center; }
  #minimap { width: 150px; height: 102px; border-radius: 16px; }
  .chip { padding: 0 12px; font-size: 13px; min-height: 36px; }
  .chip small { display: none; }
}

/* ---------------- overlays / sheets */
.overlay { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 14, .32); }
.sheet { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px 22px; border-radius: 30px; background: rgba(30, 28, 38, .58); }
.map-sheet { width: min(960px, 100%); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet h2 { margin: 0; display: flex; flex-direction: column; gap: 1px; font-size: 22px; font-weight: 700; }
.sheet h2 span { font-family: var(--ui); }
.sheet h2 small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.close { font-family: var(--ui); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.10); border-radius: 999px; padding: 0 16px; min-height: 36px; font-size: 14px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.close:hover { background: rgba(255,255,255,.16); }
#bigmap { width: 100%; height: auto; border-radius: 18px; background: #120d20; display: block; }
.landmarks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 12px; }
.landmarks button { text-align: left; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.06); border-radius: 16px; padding: 9px 12px; min-height: 50px; display: flex; gap: 10px; align-items: center; transition: background .15s; }
.landmarks button:hover, .landmarks button:focus-visible { background: rgba(255,255,255,.14); }
.landmarks kbd { flex: none; }
.landmarks .lm-name { display: flex; flex-direction: column-reverse; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.landmarks .lm-name i { font-style: normal; font-family: var(--ui); color: #fff; font-weight: 600; font-size: 14px; }
.group { border-radius: 16px; background: rgba(255,255,255,.06); padding: 0 14px; margin-bottom: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; min-height: 48px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 15px; }
.group .row:last-child { border-bottom: 0; }
.row > span small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.row select, .row input[type=range] { width: 48%; accent-color: #fff; }
.row select { background: rgba(255,255,255,.10); color: var(--ink); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }
.row select option { color: #111; }
/* iOS-style switch */
.row.check input { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: rgba(120,120,128,.36); position: relative; cursor: pointer; transition: background .2s; }
.row.check input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.row.check input:checked { background: #34c759; }
.row.check input:checked::after { transform: translateX(20px); }
.fine { font-size: 12px; color: var(--ink-3); margin: 4px 2px 0; line-height: 1.5; }
#bag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#bag-list li { padding: 11px 14px; border-radius: 16px; background: rgba(255,255,255,.06); display: grid; gap: 2px; }
#bag-list li b { color: #fff; font-weight: 600; }
#bag-list li span { font-size: 12px; color: var(--ink-3); }
#bag-list li.empty span:first-child { font-size: 15px; color: var(--ink-2); }
#fade { position: fixed; inset: 0; z-index: 20; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#fade.on { opacity: 1; }
#stats { position: fixed; z-index: 40; left: 50%; top: calc(8px + var(--safe-t)); transform: translateX(-50%); font: 600 11px/1.3 ui-monospace, Menlo, monospace; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.55); color: #c8ffc8; white-space: nowrap; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

@media (max-width: 520px) {
  #brand { top: calc(62px + var(--safe-t)); } /* below the chips row */
  #brand .brand-bn, #brand .brand-en { display: none; }
  #corner { max-width: calc(100vw - 24px); gap: 6px; }
  #area { margin-top: 0; }
  #intro { padding: calc(72px + var(--safe-t, 0px)) 16px calc(28px + var(--safe-b, 0px)); }
  .cover-lang { top: calc(14px + var(--safe-t)); right: calc(16px + var(--safe-r)); }
  .lang-switch button { padding: 0 11px; }
  .intro-copy { margin: 16px 0 24px; }
  .intro-card { margin: auto 0 0; }
  #go { width: 100%; }
  .intro-keys { gap: 8px 14px; }
}
/* short landscape phones: activity panel to the side, clear of the aim point; compact cover */
@media (max-height: 520px) and (orientation: landscape) {
  #activity { left: auto; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); transform: none; width: min(340px, 42vw); padding: 10px 12px; gap: 6px; }
  #act-hint { font-size: 12.5px; line-height: 1.35; }
  .intro-card { margin: 0; }
  :root[lang] #intro-title { font-size: clamp(40px, 12vh, 72px); }
  .intro-copy { margin: 10px 0 14px; font-size: 15px; }
  .intro-keys { margin-top: 14px; }
}

/* accessibility: solid surfaces when transparency is reduced, no motion when motion is reduced */
@media (prefers-reduced-transparency: reduce) {
  .glass, .sheet, #activity, #stick { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: #24222c !important; }
  #intro::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(12,10,20,.86); }
  .overlay { background: rgba(8,6,14,.7); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .sheet, #activity { background: rgba(30, 28, 38, .92); }
  #intro::before { background: rgba(12,10,20,.8); }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation: none !important; } }

