/* 星涡信使 · interface, direction C "星夜电影" (a film over the painting)
   The painting is the screen. Text sits on it like film titles: light weights, wide tracking, one gold hairline accent.
   Type: Noto Sans SC (Chinese UI, light), Playfair Display (numbers, English titles), Manrope (small labels),
   Noto Serif SC (painting and story titles). Surfaces are dark glass with no rounded "app" boxes. */
:root {
  --ink: #f4efe2; --ink-2: rgba(244, 239, 226, .76); --ink-3: rgba(244, 239, 226, .52);
  --gold: #f0d48a; --gold-2: #d6b064; --gold-line: rgba(240, 212, 138, .72); --gold-soft: rgba(240, 212, 138, .26);
  --night: #050816; --glass: rgba(4, 6, 18, .62); --glass-2: rgba(4, 6, 18, .42); --line: rgba(244, 239, 226, .16);
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --display: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --label: "Manrope", "Noto Sans SC", "PingFang SC", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --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);
  color-scheme: dark;
}
html:lang(en) { --sans: "Manrope", "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink);
  font: 300 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "kern", "palt";
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

/* stage */
#stage { position: fixed; inset: 0; touch-action: none; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 58%, rgba(4, 6, 18, .42) 100%); }
#flash { position: fixed; inset: 0; background: #fff8dc; opacity: 0; pointer-events: none; z-index: 8; transition: opacity .5s; }
#flash.on { opacity: 1; transition: opacity .35s; }

/* ------------------------------------------------------------------ HUD: film credits in the corners */
#hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5; pointer-events: none;
  padding: calc(18px + var(--safe-t)) calc(24px + var(--safe-r)) 40px calc(24px + var(--safe-l));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px;
  background: linear-gradient(180deg, rgba(4, 6, 18, .42), rgba(4, 6, 18, 0));
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}
.hud-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 2px; }
.hud-right { display: flex; justify-content: flex-end; align-items: flex-start; gap: 22px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.stat small { font: 500 10px/1 var(--label); letter-spacing: .28em; color: var(--ink-3); }
html:lang(en) .stat small { font-size: 9px; letter-spacing: .32em; text-transform: uppercase; }
.stat b { font: 500 20px/1 var(--display); color: #fff; font-variant-numeric: lining-nums tabular-nums; }
.stat b i { font-style: normal; color: var(--ink-3); margin: 0 1px; font-weight: 400; }
.stat.score { align-items: flex-start; }
.stat.score b { font-size: 34px; letter-spacing: .01em; }
.stat.basket { transition: transform .15s var(--ease); transform-origin: right center; }
.stat.basket.bump { transform: scale(1.1); }
.stat.basket.full b { color: var(--gold); }
.stat.basket.full small { color: var(--gold); }
.hud-world { font: 400 11px/1.4 var(--sans); letter-spacing: .24em; color: var(--ink-2); }
html:lang(en) .hud-world { font: italic 500 14px/1.3 var(--display); letter-spacing: .02em; }
.easel { position: relative; width: 66px; height: 66px; margin-top: 6px; padding: 0; opacity: .9; outline: 1px solid var(--gold-soft); outline-offset: 3px; }
.easel canvas { display: block; width: 100%; height: 100%; background: #1a2140; }
.easel .pct { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font: 500 10px var(--label); color: var(--gold); white-space: nowrap; }
.easel .pct[hidden] { display: none; }
.icon-btn { pointer-events: auto; width: 34px; height: 34px; margin-top: 2px; border-radius: 50%; border: 1px solid rgba(244, 239, 226, .4); display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: rgba(4, 6, 18, .25); transition: border-color .2s, background .2s; }
.icon-btn span { width: 2px; height: 11px; background: var(--ink); }
.icon-btn:hover { border-color: var(--gold); background: rgba(4, 6, 18, .45); }

/* compass + what to do now */
.compass { display: flex; align-items: center; gap: 10px; }
.compass .arrow { width: 22px; height: 22px; display: grid; place-items: center; color: var(--gold); transform: rotate(-90deg); transition: transform .1s linear; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .6)); }
.compass .arrow svg { width: 22px; height: 22px; display: block; }
.compass .cdist { font: 500 22px/1 var(--display); color: var(--gold); letter-spacing: .04em; font-variant-numeric: lining-nums tabular-nums; }
.compass.portal .arrow, .compass.portal .cdist { color: #fff; }
.goal-line { font: 400 13px/1.5 var(--sans); letter-spacing: .22em; color: #fff; text-align: center; max-width: min(46vw, 520px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:lang(en) .goal-line { letter-spacing: .06em; font-size: 13px; font-weight: 500; }
.goal-line:empty { display: none; }
.goal-line.portal { color: var(--gold); }
.goal-line.pulse { animation: rise .6s var(--ease); }

/* flight energy: one hairline */
#energy { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 5; pointer-events: none; display: flex; align-items: center; gap: 12px; white-space: nowrap; font: 500 10px var(--label); letter-spacing: .3em; color: var(--ink-3); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
#energy .bar { width: min(34vw, 200px); height: 2px; background: rgba(244, 239, 226, .2); overflow: hidden; }
#energy .fill { height: 100%; width: 50%; background: linear-gradient(90deg, #9cc0ff, #f4efe2); }

/* touch: a thin ring and a gold circle */
#joyZone { position: fixed; left: 0; bottom: 0; width: 58vw; height: 70vh; z-index: 3; touch-action: none; }
#joyBase { position: fixed; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; z-index: 4; pointer-events: none; border: 1px solid rgba(244, 239, 226, .4); background: radial-gradient(circle, rgba(4, 6, 18, .18), rgba(4, 6, 18, 0) 70%); opacity: .6; transition: opacity .2s; }
#joyBase.active { opacity: 1; border-color: var(--gold-line); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(244, 239, 226, .82); box-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
#joyHint { position: fixed; left: calc(24px + var(--safe-l)); bottom: calc(214px + var(--safe-b)); z-index: 4; pointer-events: none; font: 400 11px var(--sans); letter-spacing: .2em; color: var(--ink-2); text-shadow: 0 1px 6px rgba(0, 0, 0, .9); transition: opacity 1s; }
#btnAct { position: fixed; right: calc(28px + var(--safe-r)); bottom: calc(30px + var(--safe-b)); width: 88px; height: 88px; border-radius: 50%; z-index: 5; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--gold); border: 1px solid var(--gold-line); background: rgba(4, 6, 18, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); transition: transform .12s, background .2s; }
#btnAct .a1 { font: 400 18px/1 var(--sans); letter-spacing: .3em; margin-left: .3em; }
#btnAct .a2 { font: 400 10px/1 var(--sans); letter-spacing: .2em; color: var(--ink-2); }
html:lang(en) #btnAct .a1 { font: 500 13px var(--label); letter-spacing: .2em; text-transform: uppercase; margin-left: .2em; }
#btnAct.on { transform: scale(.94); background: rgba(240, 212, 138, .28); color: #fff; }

/* ------------------------------------------------------------------ messages on the painting */
.toast { position: fixed; left: 50%; top: calc(24% + var(--safe-t)); transform: translate(-50%, -8px); z-index: 6; pointer-events: none; opacity: 0; transition: opacity .35s, transform .35s var(--ease); width: max-content; max-width: min(86vw, 560px); padding: 10px 26px; text-align: center; font: 300 16px/1.6 var(--sans); letter-spacing: .16em; color: #fff; background: radial-gradient(ellipse at center, rgba(4, 6, 18, .62), rgba(4, 6, 18, 0) 72%); text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
html:lang(en) .toast { font: italic 500 18px/1.5 var(--display); letter-spacing: .01em; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.banner { position: fixed; left: 50%; top: calc(20% + var(--safe-t)); transform: translate(-50%, -8px); z-index: 7; pointer-events: none; opacity: 0; transition: opacity .6s, transform .6s var(--ease); text-align: center; max-width: 86vw; padding: 18px 40px 20px; background: radial-gradient(ellipse at center, rgba(4, 6, 18, .7), rgba(4, 6, 18, 0) 74%); }
.banner.show { opacity: 1; transform: translate(-50%, 0); }
.banner-k { font: 500 10px var(--label); letter-spacing: .5em; color: var(--gold); text-transform: uppercase; }
.banner-t { margin-top: 10px; font: 300 22px/1.4 var(--sans); letter-spacing: .2em; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
html:lang(en) .banner-t { font: italic 500 26px/1.3 var(--display); letter-spacing: .01em; }
.banner-t::after { content: ""; display: block; width: 40px; height: 1px; margin: 12px auto 0; background: var(--gold-line); }

.coach { position: fixed; left: 50%; bottom: calc(26% + var(--safe-b)); transform: translate(-50%, 8px); z-index: 7; pointer-events: none; opacity: 0; transition: opacity .4s, transform .4s var(--ease); width: max-content; max-width: min(84vw, 560px); display: flex; align-items: center; gap: 12px; padding: 12px 30px 14px; font: 300 16px/1.55 var(--sans); letter-spacing: .18em; color: #fff; text-align: center; background: radial-gradient(ellipse at center, rgba(4, 6, 18, .6), rgba(4, 6, 18, 0) 72%); text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
html:lang(en) .coach { letter-spacing: .04em; font-weight: 400; }
.coach::after { content: ""; position: absolute; left: 30px; right: 30px; bottom: 6px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); }
.coach.on { opacity: 1; transform: translate(-50%, 0); }
.coach-dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: dot 1.8s ease-out infinite; }
@keyframes dot { 0% { box-shadow: 0 0 0 0 rgba(240, 212, 138, .7); } 100% { box-shadow: 0 0 0 9px rgba(240, 212, 138, 0); } }

/* what the townsfolk say: small cards over their heads */
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.npc-bubble { position: absolute; left: 0; top: 0; display: none; padding: 5px 12px 6px; border-radius: 2px; background: rgba(250, 246, 234, .94); color: #1d1a2e; font: 400 13px/1.25 var(--sans); letter-spacing: .06em; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: opacity .25s; will-change: transform; }
html:lang(en) .npc-bubble { font: italic 500 15px/1.2 var(--display); letter-spacing: 0; }

.shop-prompt { position: fixed; left: 50%; bottom: calc(118px + var(--safe-b)); transform: translateX(-50%); z-index: 6; padding: 12px 30px; white-space: nowrap; font: 400 14px/1.2 var(--sans); letter-spacing: .3em; color: var(--gold); border: 1px solid var(--gold-line); background: rgba(4, 6, 18, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); animation: breathe 2.4s ease-in-out infinite; }
html:lang(en) .shop-prompt { letter-spacing: .12em; font-weight: 500; }
@keyframes breathe { 50% { border-color: rgba(240, 212, 138, .3); } }

/* a found story slides in beside the road; the ride goes on */
.lore-toast { position: fixed; left: calc(24px + var(--safe-l)); bottom: calc(60px + var(--safe-b)); z-index: 7; width: min(560px, calc(100vw - 48px)); display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: end; padding: 0; cursor: pointer; opacity: 0; transform: translateX(-24px); transition: opacity .45s, transform .55s var(--ease); pointer-events: none; }
.lore-toast::before { content: ""; position: absolute; left: -60px; right: -80px; top: -60px; bottom: -40px; z-index: -1; background: radial-gradient(ellipse at 30% 70%, rgba(4, 6, 18, .72), rgba(4, 6, 18, 0) 70%); }
.lore-toast.on { opacity: 1; transform: none; pointer-events: auto; }
.lt-art img { display: block; width: 100%; height: 112px; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.lt-body { text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.lt-k { font: 500 10px var(--label); letter-spacing: .38em; color: var(--gold); text-transform: uppercase; }
.lt-t { margin-top: 8px; font: 400 24px/1.3 var(--serif); letter-spacing: .1em; color: #fff; }
html:lang(en) .lt-t { font: 500 26px/1.2 var(--display); letter-spacing: 0; }
.lt-x { margin: 8px 0 0; font: 300 13px/1.8 var(--sans); color: rgba(255, 255, 255, .88); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
html:lang(en) .lt-x { font: 400 13px/1.65 var(--label); }
.lt-bar { position: absolute; left: 172px; right: 0; bottom: -10px; height: 1px; background: var(--gold-line); transform-origin: left; transform: scaleX(0); }
.lore-toast.on .lt-bar { animation: ltBar 11s linear forwards; }
@keyframes ltBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (pointer: coarse), (max-width: 760px) {
  /* touch: keep it clear of the stick (left) and the action button (bottom right) */
  .lore-toast { left: auto; right: calc(16px + var(--safe-r)); bottom: auto; top: calc(96px + var(--safe-t)); width: min(340px, calc(100vw - 32px)); grid-template-columns: 84px 1fr; gap: 14px; align-items: start; transform: translateX(24px); }
  .lore-toast::before { left: -40px; right: -30px; top: -30px; bottom: -40px; background: radial-gradient(ellipse at 60% 40%, rgba(4, 6, 18, .78), rgba(4, 6, 18, 0) 72%); }
  .lt-art img { height: 84px; }
  .lt-t { font-size: 18px; margin-top: 6px; } html:lang(en) .lt-t { font-size: 20px; }
  .lt-x { font-size: 12px; line-height: 1.7; -webkit-line-clamp: 3; }
  .lt-bar { left: 98px; bottom: -8px; }
}

/* ------------------------------------------------------------------ painting intro */
.intro { position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(4, 6, 18, .45), rgba(4, 6, 18, 0) 70%); }
.intro.run { animation: introFade 3.1s ease forwards; }
.intro.run .frame { animation: introZoom 3.1s cubic-bezier(.6, 0, .7, 1) forwards; }
.frame { max-width: 72vw; outline: 1px solid var(--gold-line); outline-offset: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.frame-inner { position: relative; background: #111; line-height: 0; }
.frame-inner img, .frame-inner canvas { display: block; max-width: 72vw; max-height: 44vh; width: auto; height: auto; }
.frame-inner img[src=""], .frame-inner img:not([src]) { display: none; }
.intro-text { margin-top: 28px; text-align: center; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.intro-kicker { font: 500 10px var(--label); letter-spacing: .5em; color: var(--ink-2); text-transform: uppercase; }
.intro-title { margin-top: 12px; font: 300 34px/1.2 var(--sans); letter-spacing: .32em; color: #fff; }
html:lang(en) .intro-title { font: 500 38px/1.15 var(--display); letter-spacing: .01em; }
.intro-year { margin-top: 8px; font: italic 500 16px var(--display); color: var(--gold); letter-spacing: .08em; }
.intro-goal { margin-top: 14px; max-width: 80vw; font: 300 14px/1.6 var(--sans); letter-spacing: .16em; color: var(--ink); }
@keyframes introFade { 0% { opacity: 0 } 10% { opacity: 1 } 62% { opacity: 1 } 100% { opacity: 0 } }
@keyframes introZoom { 0% { transform: scale(.86) } 55% { transform: scale(1) } 100% { transform: scale(3); filter: blur(4px) } }

/* ------------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); }
#loading { background: radial-gradient(ellipse at 50% 42%, #142554, #050816 72%); }
.loader { display: flex; flex-direction: column; align-items: center; gap: 18px; font: 300 13px var(--sans); letter-spacing: .4em; color: var(--ink-2); }
.spin { width: 120px; height: 1px; background: rgba(244, 239, 226, .16); position: relative; overflow: hidden; }
.spin::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { from { left: -40%; } to { left: 100%; } }
.fatal { text-align: center; line-height: 1.8; letter-spacing: .06em; color: var(--ink); margin: 0; max-width: 420px; }

/* main menu: title card over the street */
#menu { justify-content: space-between; padding-top: calc(20px + var(--safe-t)); padding-bottom: calc(26px + var(--safe-b)); background: radial-gradient(ellipse 60% 42% at 50% 44%, rgba(4, 6, 18, .5), rgba(4, 6, 18, 0) 100%), linear-gradient(180deg, rgba(4, 6, 18, .55), rgba(4, 6, 18, .08) 30%, rgba(4, 6, 18, .1) 52%, rgba(4, 6, 18, .86)); }
.topbar { align-self: stretch; display: flex; justify-content: flex-end; gap: 6px; }
.nav { padding: 8px 12px; font: 400 12px/1 var(--sans); letter-spacing: .3em; color: var(--ink-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); transition: color .2s; position: relative; }
html:lang(en) .nav { font: 500 11px/1 var(--label); letter-spacing: .24em; text-transform: uppercase; }
.nav:hover { color: var(--gold); }
.nav + .nav::before { content: ""; position: absolute; left: -3px; top: 50%; width: 1px; height: 10px; margin-top: -5px; background: var(--line); }
.menu-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: min(94vw, 760px); text-align: center; text-shadow: 0 2px 24px rgba(0, 0, 0, .55); }
.menu-k { font: 500 11px var(--label); letter-spacing: .55em; margin-right: -.55em; color: var(--ink-2); }
.logo { margin-top: 22px; }
.logo-zh { font: 300 clamp(48px, 11vw, 96px)/1 var(--sans); letter-spacing: .4em; margin-right: -.4em; color: #fff; text-shadow: 0 4px 40px rgba(0, 0, 0, .5); }
html:lang(en) .logo-zh { font: 400 clamp(40px, 8.4vw, 84px)/1 var(--display); letter-spacing: .02em; margin-right: 0; }
.logo-en { margin-top: 16px; font: italic 500 clamp(20px, 4vw, 30px)/1.1 var(--display); letter-spacing: .06em; color: var(--gold); }
html:lang(en) .logo-en { font: 300 clamp(14px, 2.6vw, 18px)/1 "Noto Sans SC", "PingFang SC", sans-serif; letter-spacing: .6em; margin-right: -.6em; }
.tagline { margin: 18px 0 0; font: 300 15px/1.6 var(--sans); letter-spacing: .3em; margin-right: -.3em; color: var(--ink); opacity: .9; }
html:lang(en) .tagline { font: italic 400 18px/1.5 var(--display); letter-spacing: .02em; margin-right: 0; }
.chal { margin-top: 22px; max-width: min(88vw, 460px); display: flex; gap: 14px; align-items: center; padding: 12px 18px; text-align: left; font: 300 14px/1.6 var(--sans); letter-spacing: .06em; color: #fff; border-top: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft); background: radial-gradient(ellipse at center, rgba(4, 6, 18, .5), rgba(4, 6, 18, 0) 80%); }
html:lang(en) .chal { font: italic 400 17px/1.45 var(--display); }
.chal-ic { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); font-size: 0; }
.menu-body .btn.cta { margin-top: 34px; }
.best { margin-top: 16px; font: 500 10px var(--label); letter-spacing: .32em; color: var(--ink-2); }
html:lang(en) .best { text-transform: uppercase; }
.best b { font: 500 13px var(--display); letter-spacing: .04em; color: var(--ink); margin: 0 2px; }

/* the six paintings: a strip of film along the bottom */
.menu-levels { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.levels-k { font: 400 11px var(--sans); letter-spacing: .36em; color: var(--ink-2); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
html:lang(en) .levels-k { font: 500 10px var(--label); letter-spacing: .3em; text-transform: uppercase; }
.levels { display: flex; gap: 3px; max-width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 6px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.levels::-webkit-scrollbar { display: none; }
.lv { flex: 0 0 168px; height: 100px; position: relative; overflow: visible; scroll-snap-align: center; text-align: left; color: #fff; }
.lv-art { position: absolute; inset: 0; overflow: hidden; background: #111; }
.lv-art img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .86; transform: scale(1.02); transition: opacity .3s, transform .6s var(--ease); }
.lv-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 6, 18, .5), rgba(4, 6, 18, 0) 34%, rgba(4, 6, 18, 0) 42%, rgba(4, 6, 18, .82)); }
.lv::after { content: ""; position: absolute; inset: -4px; border: 1px solid transparent; pointer-events: none; transition: border-color .25s; }
.lv:hover .lv-art img, .lv:focus-visible .lv-art img { opacity: 1; transform: scale(1.07); }
.lv:hover::after, .lv:focus-visible::after { border-color: var(--gold-line); }
.lv:focus-visible { outline: none; }
.lv-no { position: absolute; left: 12px; top: 10px; font: 500 10px/1 var(--label); letter-spacing: .24em; color: var(--gold); }
.lv-name { position: absolute; left: 12px; right: 10px; bottom: 9px; font: 400 13px/1.25 var(--sans); letter-spacing: .08em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html:lang(en) .lv-name { font: 500 14px/1.15 var(--display); letter-spacing: .01em; }
.lv-meta { position: absolute; right: 10px; top: 10px; font: 500 9px/1 var(--label); letter-spacing: .16em; color: rgba(255, 255, 255, .78); text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.lv.locked { color: var(--ink-3); }
.lv.locked .lv-art img { filter: grayscale(1) brightness(.5); opacity: .7; }
.lv.locked .lv-no { color: var(--ink-3); }
.lv-lock { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); color: rgba(244, 239, 226, .7); line-height: 0; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-width: 128px; padding: 12px 24px; font: 400 14px/1.2 var(--sans); letter-spacing: .3em; color: var(--ink); text-decoration: none; border: 1px solid rgba(244, 239, 226, .3); background: rgba(4, 6, 18, .3); transition: border-color .2s, color .2s, background .2s, transform .1s; }
html:lang(en) .btn { font: 500 12px/1.2 var(--label); letter-spacing: .2em; text-transform: uppercase; }
.btn:hover { border-color: rgba(244, 239, 226, .7); }
.btn:active { transform: scale(.98); }
.btn.primary { min-width: 200px; padding: 15px 40px; font-weight: 500; color: var(--gold); border-color: var(--gold-line); background: rgba(4, 6, 18, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.primary:hover { background: rgba(240, 212, 138, .14); border-color: var(--gold); color: #fff3cf; }
.btn.cta { padding: 17px 48px; font-size: 15px; letter-spacing: .5em; }
html:lang(en) .btn.cta { font-size: 13px; letter-spacing: .3em; }
.btn.cta::after { content: "→"; letter-spacing: 0; font-family: var(--label); transition: transform .25s var(--ease); }
.btn.cta:hover::after { transform: translateX(4px); }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------------ panels: a dark title card, hairline frame */
.modal { background: rgba(4, 6, 18, .62); backdrop-filter: blur(10px) saturate(1.05); -webkit-backdrop-filter: blur(10px) saturate(1.05); }
.card { position: relative; width: min(92vw, 440px); max-height: calc(100dvh - 32px); overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 34px 28px 28px; background: linear-gradient(180deg, rgba(10, 14, 34, .9), rgba(5, 8, 22, .94)); border: 1px solid var(--line); box-shadow: 0 40px 100px rgba(0, 0, 0, .6); scrollbar-width: thin; scrollbar-color: var(--gold-soft) transparent; }
.card::before { content: ""; position: absolute; left: 50%; top: 0; width: 64px; height: 1px; margin-left: -32px; background: var(--gold); }
.card.wide { width: min(94vw, 720px); }
.card h2 { margin: 0; font: 300 22px/1.3 var(--sans); letter-spacing: .4em; margin-right: -.4em; color: #fff; }
html:lang(en) .card h2 { font: 500 30px/1.2 var(--display); letter-spacing: .01em; margin-right: 0; }
.muted { margin: 0; font: 300 12px/1.6 var(--sans); letter-spacing: .14em; color: var(--ink-3); }
html:lang(en) .muted { font: 500 12px/1.5 var(--label); letter-spacing: .06em; }

.how-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; text-align: left; font: 300 14px/1.75 var(--sans); letter-spacing: .04em; color: var(--ink); }
html:lang(en) .how-list { font: 400 14px/1.6 var(--label); letter-spacing: 0; }
.how-list li { display: flex; gap: 16px; align-items: baseline; }
.how-list .ic { flex: 0 0 22px; font: italic 500 15px/1 var(--display); color: var(--gold); }

.gallery-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; }
@media (max-width: 460px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.g-item { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: left; }
.g-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #111; }
.g-thumb img, .g-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.g-item:hover .g-thumb img { transform: scale(1.05); }
.g-thumb::after { content: ""; position: absolute; inset: 0; border: 1px solid transparent; transition: border-color .25s; }
.g-item:hover .g-thumb::after { border-color: var(--gold-line); }
.g-item.locked img, .g-item.locked canvas { filter: grayscale(1) blur(5px) brightness(.45); }
.g-lock { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); line-height: 0; }
.g-name { font: 400 13px/1.35 var(--sans); letter-spacing: .12em; color: var(--ink); }
html:lang(en) .g-name { font: 500 15px/1.25 var(--display); letter-spacing: 0; }
.g-item.locked .g-name { color: var(--ink-3); }
.g-year { font: italic 500 12px var(--display); color: var(--gold); }
.detail-art { width: 100%; line-height: 0; outline: 1px solid var(--gold-soft); outline-offset: 6px; margin: 6px 0 4px; }
.detail-art img, .detail-art canvas { width: 100%; max-height: 44vh; object-fit: contain; background: #0a0c18; }
#detailTitle { font: 400 26px/1.3 var(--serif); letter-spacing: .16em; margin-right: -.16em; }
html:lang(en) #detailTitle { font: 500 30px/1.2 var(--display); letter-spacing: 0; margin-right: 0; }
.fact { margin: 0; text-align: left; font: 300 14.5px/1.9 var(--sans); letter-spacing: .03em; color: var(--ink); }
html:lang(en) .fact { font: 400 14.5px/1.7 var(--label); letter-spacing: 0; }
.detail-lore { width: 100%; display: flex; flex-direction: column; gap: 0; margin: 4px 0 8px; text-align: left; }
.detail-lore .lore-head { padding-bottom: 10px; font: 500 10px var(--label); letter-spacing: .32em; color: var(--gold); border-bottom: 1px solid var(--line); }
.lore-row { padding: 12px 0; border-bottom: 1px solid var(--line); font: 300 13px/1.75 var(--sans); color: var(--ink-2); }
.lore-row b { display: block; margin-bottom: 3px; font: 400 15px/1.4 var(--serif); letter-spacing: .08em; color: #fff; }
html:lang(en) .lore-row { font: 400 13px/1.6 var(--label); } html:lang(en) .lore-row b { font: 500 17px/1.3 var(--display); letter-spacing: 0; }
.lore-row.locked { opacity: .5; }

/* end of a ride */
.newbest { font: 500 10px var(--label); letter-spacing: .5em; color: var(--gold); text-transform: uppercase; animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .6 } to { opacity: 1 } }
.chal-result { margin: 0; font: 400 15px/1.6 var(--sans); letter-spacing: .1em; color: var(--gold); }
.keepsake { display: block; width: min(100%, 230px); margin: 2px auto; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.big-score { font: 400 64px/1 var(--display); color: #fff; letter-spacing: .01em; font-variant-numeric: lining-nums; }
.stats { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats > div { display: flex; flex-direction: column-reverse; gap: 6px; padding: 14px 4px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { font: 500 22px/1 var(--display); color: #fff; font-variant-numeric: lining-nums; }
.stats span { font: 400 10px/1.3 var(--sans); letter-spacing: .2em; color: var(--ink-3); }
html:lang(en) .stats span { font: 500 9px/1.3 var(--label); letter-spacing: .16em; text-transform: uppercase; }
.unlocks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.unlocks .u { padding: 5px 12px; font: 400 12px var(--sans); letter-spacing: .14em; color: var(--gold); border: 1px solid var(--gold-soft); }
.save-link { display: block; margin-top: 2px; font: 400 12px var(--sans); letter-spacing: .24em; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--gold-soft); padding-bottom: 3px; }
.save-link:hover { color: var(--gold); }

/* shops: the maker's apps and the units to let */
.shop-card { width: min(94vw, 820px); max-height: 92vh; display: flex; flex-direction: column; gap: 14px; padding: 24px 24px 20px; }
.shop-head { align-self: stretch; display: flex; align-items: center; gap: 16px; text-align: left; }
.shop-head h2 { margin: 0; font: 300 20px/1.3 var(--sans); letter-spacing: .2em; margin-right: 0; }
html:lang(en) .shop-head h2 { font: 500 26px/1.2 var(--display); letter-spacing: 0; }
.shop-head .muted { margin-top: 4px; }
.shop-icon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; font-size: 28px; background: color-mix(in srgb, var(--shop, #2f6fd0) 32%, #0a0c18); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.shop-icon img { width: 100%; height: 100%; object-fit: cover; }
.shop-body { position: relative; align-self: stretch; flex: 1; min-height: 46vh; overflow: hidden; display: flex; background: rgba(0, 0, 0, .3); outline: 1px solid var(--line); }
.shop-body iframe { flex: 1; width: 100%; min-height: 46vh; border: 0; background: #0a0c18; }
.shop-wait { position: absolute; inset: 0; display: grid; place-items: center; font: 300 12px var(--sans); letter-spacing: .4em; color: var(--ink-3); pointer-events: none; }
.shop-empty { margin: auto; padding: 28px; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.shop-empty img { max-width: 100%; max-height: 40vh; }
.shop-empty p { margin: 0; font: 300 14px/1.8 var(--sans); color: var(--ink); }
.shop-empty.rent { max-width: 440px; gap: 12px; }
.rent-k { font: 500 10px var(--label); letter-spacing: .5em; margin-right: -.5em; color: var(--gold); padding: 6px 0 8px; border-bottom: 1px solid var(--gold-line); }
.shop-empty.rent h3 { margin: 8px 0 0; font: 300 24px/1.3 var(--sans); letter-spacing: .3em; margin-right: -.3em; color: #fff; }
html:lang(en) .shop-empty.rent h3 { font: 500 30px/1.2 var(--display); letter-spacing: 0; margin-right: 0; }
.shop-empty.rent p { color: var(--ink-2); }
.rent-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; font: 300 13px/1.6 var(--sans); letter-spacing: .06em; color: var(--ink-2); }
html:lang(en) .rent-list { font: 400 13px/1.5 var(--label); letter-spacing: 0; }
.rent-list li { display: flex; gap: 12px; align-items: baseline; }
.rent-list li::before { content: ""; flex: none; width: 14px; height: 1px; background: var(--gold); transform: translateY(-4px); }

/* ------------------------------------------------------------------ motion: titles fade up, nothing bounces */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal:not(.hidden) { animation: fadeIn .3s ease-out; }
.modal:not(.hidden) .card { animation: rise .45s var(--ease); }
#menu:not(.hidden) .menu-body > *, #menu:not(.hidden) .menu-levels, #menu:not(.hidden) .topbar { animation: rise .9s var(--ease) both; }
#menu:not(.hidden) .menu-body > :nth-child(2) { animation-delay: .1s; }
#menu:not(.hidden) .menu-body > :nth-child(3) { animation-delay: .2s; }
#menu:not(.hidden) .menu-body > :nth-child(n+4) { animation-delay: .3s; }
#menu:not(.hidden) .menu-levels { animation-delay: .45s; }
#menu:not(.hidden) .topbar { animation-delay: .5s; }
@media (prefers-reduced-motion: reduce) {
  .modal:not(.hidden), .modal:not(.hidden) .card, #menu:not(.hidden) .menu-body > *, #menu:not(.hidden) .menu-levels, #menu:not(.hidden) .topbar, .shop-prompt, .goal-line.pulse { animation: none; }
  .toast, .banner, .coach, .lore-toast { transition: opacity .2s; }
}

/* ------------------------------------------------------------------ small screens */
@media (max-width: 640px) {
  #hud { padding: calc(12px + var(--safe-t)) calc(14px + var(--safe-r)) 28px calc(14px + var(--safe-l)); gap: 10px 8px; grid-template-columns: auto 1fr; grid-template-areas: "l r" "l m"; }
  .hud-left { grid-area: l; } .hud-right { grid-area: r; } .hud-mid { grid-area: m; align-items: flex-end; padding-top: 0; }
  .goal-line { text-align: right; }
  .toast { top: calc(38% + var(--safe-t)); } .banner { top: calc(34% + var(--safe-t)); }
  .lore-toast { top: calc(150px + var(--safe-t)); }
  .hud-right { gap: 12px; }
  .stat b { font-size: 16px; } .stat.score b { font-size: 26px; }
  .stat small { font-size: 9px; letter-spacing: .18em; }
  .hud-world { font-size: 10px; letter-spacing: .14em; }
  .easel { width: 52px; height: 52px; }
  .compass .cdist { font-size: 18px; }
  .goal-line { font-size: 11.5px; letter-spacing: .12em; max-width: 100%; white-space: normal; line-height: 1.45; }
  .hud-mid { min-width: 0; }
  .icon-btn { width: 30px; height: 30px; }
  .logo-zh { letter-spacing: .3em; margin-right: -.3em; }
  .menu-k { font-size: 9px; letter-spacing: .4em; margin-right: -.4em; }
  .tagline { font-size: 13px; letter-spacing: .2em; margin-right: -.2em; }
  .lv { flex-basis: 132px; height: 84px; }
  .btn.cta { padding: 15px 36px; }
  .card { padding: 30px 20px 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .coach { font-size: 14px; letter-spacing: .1em; padding: 10px 18px 12px; }
  .toast { font-size: 14px; letter-spacing: .1em; }
  .banner-t { font-size: 18px; letter-spacing: .12em; }
}
@media (max-width: 400px) { .hud-right { gap: 9px; } #hSecBox { display: none !important; } }
@media (max-height: 520px) and (orientation: landscape) {
  #menu { padding-top: calc(8px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .logo { margin-top: 10px; }
  .logo-zh { font-size: 46px; }
  .logo-en { margin-top: 8px; font-size: 18px; }
  .tagline { margin-top: 8px; font-size: 13px; }
  .menu-body .btn.cta { margin-top: 16px; padding: 12px 36px; }
  .best { margin-top: 8px; }
  .lv { flex-basis: 124px; height: 72px; }
  .menu-levels { gap: 6px; }
  .card { padding: 22px 18px 16px; gap: 10px; }
  .big-score { font-size: 44px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .frame-inner img, .frame-inner canvas { max-height: 50vh; }
  .intro-text { margin-top: 14px; }
  .toast { top: calc(30% + var(--safe-t)); }
  #btnAct { width: 78px; height: 78px; right: calc(20px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); }
  #joyHint { bottom: calc(176px + var(--safe-b)); }
  #joyZone { height: 80vh; width: 50vw; }
  .easel { width: 48px; height: 48px; }
  .coach { bottom: calc(30% + var(--safe-b)); }
  .lore-toast { top: calc(70px + var(--safe-t)); }
}

/* inside panels the actions form one even column */
.card > .btn.primary { align-self: stretch; }
.card > .row { align-self: stretch; flex-wrap: nowrap; }
.card > .row > .btn { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; }
.card .btn.ghost { border-color: var(--line); color: var(--ink-3); }
