@font-face { font-family: 'TaYunBrush'; src: url('assets/ui/brush.woff2?v=v2026.11.24-0523') format('woff2'); font-display: swap; }
:root {
  --paper: #efe9dc; --paper2: #e6dfcf; --ink: #1d1b18; --ink2: #3b3832; --muted: #7a7366;
  --red: #b5302a; --red2: #8f2420; --jade: #5f8579; --gold: #c99a4b;
  --brush: 'TaYunBrush', 'STKaiti', 'KaiTi', 'Kaiti SC', serif;
  --sans: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --btn-scale: 1; --btn-alpha: 0.85;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd5d3; color: var(--ink); font-family: var(--sans);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.screen { position: fixed; inset: 0; display: none; }
.screen.show { display: block; }
.brush { font-family: var(--brush); font-weight: 400; letter-spacing: .04em; }

/* ---------- paper & ink primitives ---------- */
.paper { background:
  radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
  radial-gradient(90% 80% at 80% 90%, rgba(160,140,100,.12), rgba(0,0,0,0) 70%),
  var(--paper); box-shadow: 0 18px 50px rgba(30,25,15,.28), inset 0 0 0 1px rgba(80,60,30,.12), inset 0 0 60px rgba(150,120,80,.12); }
.seal { display: inline-grid; place-items: center; background: var(--red); color: #fbeee6; font-family: var(--brush); border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255,240,230,.35); filter: url(#stampRough); line-height: 1; }
.s-sm { width: 30px; height: 30px; font-size: 20px; }
.s-md { width: 54px; height: 54px; font-size: 22px; writing-mode: vertical-rl; letter-spacing: .1em; padding: 4px; }
.btn-ink { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 9.5em; padding: .62em 1.6em; margin: .32em;
  font-size: clamp(15px, 2.4vh + 6px, 22px); letter-spacing: .3em; text-indent: .3em; color: var(--ink);
  transition: transform .18s cubic-bezier(.2,.8,.2,1.4), color .2s; }
.btn-ink::before { content: ''; position: absolute; inset: 0; border-radius: 3px;
  background: linear-gradient(90deg, rgba(29,27,24,0) 0%, rgba(29,27,24,.10) 12%, rgba(29,27,24,.12) 88%, rgba(29,27,24,0) 100%);
  border-top: 1px solid rgba(29,27,24,.25); border-bottom: 1px solid rgba(29,27,24,.25); transition: background .25s, transform .25s; }
.btn-ink span { position: relative; }
.btn-ink.primary { color: #f6efe3; }
.btn-ink.primary::before { background: linear-gradient(90deg, rgba(29,27,24,0) 0%, rgba(29,27,24,.92) 10%, rgba(29,27,24,.92) 90%, rgba(29,27,24,0) 100%); border-color: transparent; filter: url(#inkEdge); }
.btn-ink:hover { transform: translateY(-1px) scale(1.03); }
.btn-ink:active { transform: scale(.96); }
.btn-ink.primary:hover::before { background: linear-gradient(90deg, rgba(150,35,30,0) 0%, rgba(150,35,30,.95) 10%, rgba(150,35,30,.95) 90%, rgba(150,35,30,0) 100%); }
.link { font-size: 14px; color: var(--ink2); opacity: .8; padding: 8px 12px; letter-spacing: .1em; transition: opacity .2s; }
.link:hover { opacity: 1; }
.ico-fs { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a352e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 9V3h6M21 9V3h-6M3 15v6h6M21 15v6h-6'/%3E%3C/svg%3E"); }
.row { display: flex; justify-content: center; flex-wrap: wrap; }

/* ---------- loading ---------- */
#loading { background: var(--paper); z-index: 50; transition: opacity .8s ease; }
#loading.hide { opacity: 0; pointer-events: none; }
.load-art { position: absolute; inset: 0; background: url('assets/ui/loading.webp?v=v2026.11.24-0523') right center / cover no-repeat; animation: drift 30s ease-in-out infinite alternate; }
.load-paper { position: absolute; inset: 0; background: linear-gradient(90deg, var(--paper) 0%, var(--paper) 30%, rgba(239,233,220,.85) 40%, rgba(239,233,220,0) 60%); }
@keyframes drift { from { transform: scale(1.04) translateX(0); } to { transform: scale(1.08) translateX(-1.5%); } }
.load-inner { position: absolute; left: calc(6vw + var(--sal)); top: 50%; transform: translateY(-50%); width: min(36vw, 420px); }
.vtitle { margin: 0; line-height: 1; }
.big { font-size: clamp(54px, 14vh, 120px); }
.load-inner .seal { position: absolute; left: clamp(160px, 22vw, 330px); top: 4px; }
.load-inner .sub { margin: .8em 0 2.2em; font-size: clamp(14px, 3vh, 20px); letter-spacing: .35em; color: var(--ink2); }
.ink-bar { position: relative; height: 10px; border-radius: 6px; background: rgba(29,27,24,.08); overflow: hidden; }
.ink-bar i { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, #2a2724, #121110); border-radius: 6px; transition: width .3s ease; filter: url(#inkEdge); }
.load-txt { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: .7em 0; letter-spacing: .1em; }
.tip { font-size: 13px; color: var(--ink2); opacity: .85; line-height: 1.7; min-height: 3.4em; }

/* ---------- rotate ---------- */
#rotate { z-index: 80; background: var(--paper); display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#rotate.show { display: flex; }
#rotate p { font-size: 17px; letter-spacing: .1em; }
.rot-phone { width: 64px; height: 104px; border: 4px solid var(--ink); border-radius: 12px; position: relative; animation: rot 2.2s ease-in-out infinite; margin-bottom: 26px; }
.rot-phone i { position: absolute; left: 50%; bottom: 6px; width: 14px; height: 4px; margin-left: -7px; background: var(--ink); border-radius: 2px; }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ---------- title ---------- */
#title { z-index: 20; }
.title-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(239,233,220,.0) 0%, rgba(239,233,220,0) 45%, rgba(239,233,220,.78) 72%, rgba(239,233,220,.92) 100%), linear-gradient(0deg, rgba(20,18,15,.18), rgba(0,0,0,0) 30%); }
.title-col { position: absolute; left: calc(5vw + var(--sal)); top: calc(7vh + var(--sat)); display: flex; align-items: flex-start; gap: 10px; animation: fadeUp 1.4s ease both .2s; }
.huge { font-size: clamp(64px, 20vh, 170px); writing-mode: vertical-rl; color: var(--ink); text-shadow: 0 0 30px rgba(255,250,240,.8), 0 0 4px rgba(255,250,240,.9); }
.title-col .seal { margin-top: .4em; }
.title-menu { position: absolute; right: calc(5vw + var(--sar)); top: 50%; transform: translateY(-50%); width: min(42vw, 440px); text-align: center; animation: fadeUp 1.2s ease both .5s; }
.chapter { font-size: clamp(22px, 5.4vh, 40px); margin: 0 0 .3em; }
.blurb { font-size: clamp(12px, 2.3vh, 15px); line-height: 1.9; color: var(--ink2); margin: 0 0 1.2em; letter-spacing: .06em; }
.best { min-height: 1.6em; font-size: 13px; color: var(--muted); margin-bottom: .6em; display: flex; gap: 8px; justify-content: center; align-items: center; }
.best .seal { width: 22px; height: 22px; font-size: 13px; opacity: .25; }
.best .seal.on { opacity: 1; }
.ver { position: absolute; left: calc(14px + var(--sal)); bottom: calc(10px + var(--sab)); font-size: 11px; color: rgba(29,27,24,.55); margin: 0; letter-spacing: .1em; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }
.title-menu { transform: translateY(-50%); }
@keyframes fadeUpC { from { opacity: 0; transform: translateY(calc(-50% + 14px)); } to { opacity: 1; transform: translateY(-50%); } }
.title-menu { animation-name: fadeUpC; }

/* ---------- intro ---------- */
#intro { z-index: 25; background: linear-gradient(0deg, rgba(239,233,220,.75), rgba(239,233,220,0) 45%); }
.intro-text { position: absolute; left: 50%; bottom: calc(12vh + var(--sab)); transform: translateX(-50%); width: min(80vw, 760px); text-align: center; font-family: var(--brush);
  font-size: clamp(20px, 5vh, 34px); line-height: 1.6; color: var(--ink); text-shadow: 0 0 18px rgba(255,250,240,.9), 0 0 3px rgba(255,250,240,1); }
.intro-text span { display: inline-block; opacity: 0; filter: blur(6px); animation: inkIn .9s ease forwards; }
@keyframes inkIn { to { opacity: 1; filter: blur(0); } }
.skip { position: absolute; right: calc(18px + var(--sar)); top: calc(14px + var(--sat)); font-size: 15px; }

/* ---------- HUD ---------- */
#hud { z-index: 10; pointer-events: none; }
#hud .btn, #hud #touch { pointer-events: auto; }
.hud-tl { position: absolute; left: calc(14px + var(--sal)); top: calc(10px + var(--sat)); display: flex; gap: 8px; align-items: center; }
.chip { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border-radius: 17px; background: rgba(239,233,220,.78);
  box-shadow: 0 2px 10px rgba(30,25,15,.15), inset 0 0 0 1px rgba(80,60,30,.12); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; letter-spacing: .02em; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.chip small { font-weight: 400; color: var(--muted); }
.chip.coins.pulse { animation: pulse .35s ease; }
@keyframes pulse { 50% { transform: scale(1.12); background: rgba(255,236,190,.95); } }
.chip.scroll { padding: 0 9px; opacity: .45; filter: grayscale(1); transition: all .4s; }
.chip.scroll.on { opacity: 1; filter: none; background: rgba(255,232,190,.92); }
.ico-time, .ico-coin, .ico-scroll, .ico-pause, .ico-hand, .ico-slide, .ico-jump { display: inline-block; width: 18px; height: 18px; background: center/contain no-repeat; }
.ico-time { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1b18' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l3 2M9 2h6'/%3E%3C/svg%3E"); }
.ico-coin { width: 20px; height: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23d4a24a' stroke='%23845a1c' stroke-width='1.5'/%3E%3Crect x='9' y='9' width='6' height='6' fill='%23efe9dc' stroke='%23845a1c' stroke-width='1.2'/%3E%3C/svg%3E"); }
.ico-scroll { width: 22px; height: 22px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='6' width='14' height='12' fill='%23eadcbc' stroke='%235a2a18' stroke-width='1.4'/%3E%3Crect x='3' y='5' width='3' height='14' rx='1.5' fill='%235a2a18'/%3E%3Crect x='18' y='5' width='3' height='14' rx='1.5' fill='%235a2a18'/%3E%3Cpath d='M8 10h8M8 13h6' stroke='%23b5302a' stroke-width='1.4'/%3E%3C/svg%3E"); }
.ico-pause { width: 16px; height: 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231d1b18'%3E%3Crect x='5' y='4' width='5' height='16' rx='1.5'/%3E%3Crect x='14' y='4' width='5' height='16' rx='1.5'/%3E%3C/svg%3E"); }
.ico-jump { width: 34%; height: 34%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6efe3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15l7-7 7 7'/%3E%3Cpath d='M5 21l7-7 7 7' opacity='.5'/%3E%3C/svg%3E"); }
.ico-slide { width: 38%; height: 38%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1b18' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18h12l5-5'/%3E%3Cpath d='M6 14h8M9 10h5' opacity='.55'/%3E%3C/svg%3E"); }
.ico-hand { width: 38%; height: 38%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6efe3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 12V5.5a1.5 1.5 0 013 0V11m0-1.5V4a1.5 1.5 0 013 0v6m0-4.5a1.5 1.5 0 013 0V13c0 4-2.5 7-6.5 7S6 18 5 15l-1-3a1.5 1.5 0 012.8-1L8 13'/%3E%3C/svg%3E"); }
#b-pause { position: absolute; right: calc(14px + var(--sar)); top: calc(10px + var(--sat)); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(239,233,220,.78); box-shadow: 0 2px 10px rgba(30,25,15,.15), inset 0 0 0 1px rgba(80,60,30,.12); transition: transform .15s; }
#b-pause:active, #b-pause.pressed { transform: scale(.9); }
.hint { position: absolute; left: 50%; top: calc(12px + var(--sat)); transform: translate(-50%, -140%); max-width: min(62vw, 560px); display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 12px;
  background: rgba(29,27,24,.80); color: #f3ecdf; border-radius: 22px; font-size: clamp(13px, 2.3vh + 4px, 16px); letter-spacing: .05em; line-height: 1.45; transition: transform .5s cubic-bezier(.2,.9,.25,1.2), opacity .4s; opacity: 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.hint.show { transform: translate(-50%, 0); opacity: 1; }
.hint { pointer-events: none; width: max-content; }
/* phones / small tablets: the centred hint would cover the timer/coin chips -> drop it below the chip row */
@media (max-width: 1100px) { .hint { top: calc(58px + var(--sat)); max-width: min(72vw, 560px); } }
.hint p { margin: 0; }
.hint-icons { display: flex; gap: 6px; }
.hint-icons i { width: 28px; height: 28px; border-radius: 50%; background: #b5302a center/58% no-repeat; flex: none; display: grid; place-items: center; font-style: normal; font-size: 13px; }
.toast { position: absolute; left: 50%; top: 30%; transform: translate(-50%, 10px) scale(.96); padding: 10px 26px; font-family: var(--brush); font-size: clamp(20px, 5vh, 32px);
  color: var(--ink); text-shadow: 0 0 14px rgba(255,250,240,1), 0 0 4px rgba(255,250,240,1); opacity: 0; transition: opacity .35s, transform .45s cubic-bezier(.2,.9,.25,1.3); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.gold { color: #6a3c0c; }
.fps { position: absolute; right: calc(64px + var(--sar)); top: calc(18px + var(--sat)); font: 12px/1 ui-monospace, monospace; color: rgba(29,27,24,.7); display: none; }
#touch { position: absolute; inset: 0; }
:root { --joy-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='47.6' fill='none' stroke='rgba(236,206,140,.55)' stroke-width='.6'/%3E%3Ccircle cx='50' cy='50' r='36.4' fill='none' stroke='rgba(236,206,140,.35)' stroke-width='.5'/%3E%3Cg fill='none' stroke='rgba(222,238,228,.42)' stroke-width='0.9' stroke-linecap='square'%3E%3Cpath transform='rotate(0.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(18.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(36.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(54.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(72.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(90.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(108.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(126.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(144.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(162.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(180.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(198.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(216.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(234.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(252.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(270.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(288.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(306.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(324.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(342.00 50 50) translate(50 8.200000000000003)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3C/g%3E%3Cpath transform='rotate(0 50 50)' d='M50 4.6 L52.3 7.4 L50 10.2 L47.7 7.4Z' fill='rgba(236,206,140,.9)'/%3E%3Cpath transform='rotate(90 50 50)' d='M50 4.6 L52.3 7.4 L50 10.2 L47.7 7.4Z' fill='rgba(236,206,140,.9)'/%3E%3Cpath transform='rotate(180 50 50)' d='M50 4.6 L52.3 7.4 L50 10.2 L47.7 7.4Z' fill='rgba(236,206,140,.9)'/%3E%3Cpath transform='rotate(270 50 50)' d='M50 4.6 L52.3 7.4 L50 10.2 L47.7 7.4Z' fill='rgba(236,206,140,.9)'/%3E%3C/svg%3E"); --rim-gold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='rgba(240,206,140,.75)' stroke-width='.7'/%3E%3Cg fill='none' stroke='rgba(240,206,140,.75)' stroke-width='0.75' stroke-linecap='square'%3E%3Cpath transform='rotate(0.00 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(13.85 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(27.69 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(41.54 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(55.38 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(69.23 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(83.08 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(96.92 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(110.77 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(124.62 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(138.46 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(152.31 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(166.15 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(180.00 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(193.85 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(207.69 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(221.54 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(235.38 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(249.23 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(263.08 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(276.92 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(290.77 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(304.62 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(318.46 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(332.31 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(346.15 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3C/g%3E%3C/svg%3E"); --rim-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='rgba(120,92,48,.55)' stroke-width='.7'/%3E%3Cg fill='none' stroke='rgba(120,92,48,.55)' stroke-width='0.75' stroke-linecap='square'%3E%3Cpath transform='rotate(0.00 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(13.85 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(27.69 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(41.54 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(55.38 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(69.23 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(83.08 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(96.92 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(110.77 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(124.62 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(138.46 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(152.31 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(166.15 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(180.00 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(193.85 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(207.69 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(221.54 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(235.38 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(249.23 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(263.08 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(276.92 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(290.77 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(304.62 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(318.46 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(332.31 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3Cpath transform='rotate(346.15 50 50) translate(50 3.3999999999999986)' d='M-5,2.6 L-5,-2.6 L5,-2.6 L5,1.4 L-1.6,1.4 L-1.6,-0.9 L2.2,-0.9'/%3E%3C/g%3E%3C/svg%3E"); --joy-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='rgba(46,86,72,.55)' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M8 25c-4 0-5-6 0-7 0-5 7-6 9-2 2-5 10-4 10 1 5 0 6 7 1 8z'/%3E%3Cpath d='M14 21c1-2 4-2 5 0M22 19c1.5-1.5 4-1 4.5 1'/%3E%3C/g%3E%3C/svg%3E"); }
/* fixed joystick: anchored in the bottom-left corner (safe-area aware), never moves. Jade/ink lacquer ring with a
   回纹 band, gold hairlines, inner bevel, direction glow; jade-white knob with highlight. */
#joy { --J: calc(clamp(112px, 30vh, 172px) * var(--btn-scale)); --a: 0deg; --m: 0;
  position: absolute; left: calc(var(--sal) + max(14px, 2.4vh)); bottom: calc(var(--sab) + max(12px, 2.6vh)); width: var(--J); height: var(--J);
  border-radius: 50%; pointer-events: none; opacity: calc(var(--btn-alpha) * .8); transition: opacity .18s, filter .18s;
  background: radial-gradient(circle at 50% 50%, rgba(16,34,30,.30) 0 50%, rgba(18,40,35,.50) 58%, rgba(52,96,82,.62) 66%, rgba(24,50,44,.72) 71%, rgba(12,26,22,.78) 72.5%, rgba(12,26,22,0) 73%),
    radial-gradient(circle at 50% 50%, rgba(28,58,50,.58) 0 73%, rgba(10,22,19,.72) 100%);
  box-shadow: 0 8px 22px rgba(10,16,14,.32), 0 1px 0 rgba(255,255,255,.12), inset 0 3px 6px rgba(225,245,235,.20), inset 0 -6px 12px rgba(0,0,0,.40), inset 0 0 0 1.5px rgba(230,198,128,.62); }
#joy::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: center/100% 100% no-repeat var(--joy-ring); }
#joy::after { content: ''; position: absolute; inset: 17%; border-radius: 50%; box-shadow: inset 0 2px 5px rgba(0,0,0,.35), 0 1px 0 rgba(230,245,238,.18); }
#joy .joy-dir { position: absolute; inset: 0; border-radius: 50%; opacity: calc(var(--m) * .95); transition: opacity .12s;
  background: conic-gradient(from calc(var(--a) - 42deg), rgba(255,222,150,0) 0deg, rgba(255,226,160,.95) 42deg, rgba(255,222,150,0) 84deg, rgba(255,222,150,0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 55%, #000 62% 72%, transparent 74%); mask: radial-gradient(circle, transparent 0 55%, #000 62% 72%, transparent 74%); filter: blur(.5px); }
#joy.on { opacity: var(--btn-alpha); filter: brightness(1.08); }
#joy.max .joy-dir { opacity: 1; filter: blur(.5px) brightness(1.2); }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; transform: translate(-50%, -50%); border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 36% 30%, #ffffff 0, #f6f3ea 14%, #dbe9df 46%, #9dbdae 82%, #6f9686 100%);
  box-shadow: 0 7px 14px rgba(0,0,0,.38), 0 2px 3px rgba(0,0,0,.25), inset 0 3px 4px rgba(255,255,255,.85), inset 0 -5px 9px rgba(36,72,60,.42), inset 0 0 0 1.5px rgba(214,170,92,.85);
  transition: box-shadow .12s, filter .12s; }
#joy-knob::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; box-shadow: inset 0 1px 2px rgba(40,80,66,.35), 0 1px 0 rgba(255,255,255,.7);
  background: center/78% no-repeat var(--joy-cloud); }
#joy-knob::after { content: ''; position: absolute; left: 20%; top: 12%; width: 34%; height: 20%; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.85), rgba(255,255,255,0) 70%); }
#joy.on #joy-knob { filter: brightness(1.06) saturate(1.1); box-shadow: 0 4px 9px rgba(0,0,0,.42), 0 0 14px rgba(255,220,150,calc(var(--m) * .55)), inset 0 3px 4px rgba(255,255,255,.85), inset 0 -5px 9px rgba(36,72,60,.42), inset 0 0 0 1.5px rgba(232,186,100,.95); }
.btns { position: absolute; right: calc(4vw + var(--sar)); bottom: calc(6vh + var(--sab)); width: calc(clamp(150px, 42vh, 240px) * var(--btn-scale)); aspect-ratio: 1; opacity: var(--btn-alpha); }
.btn.jump, .btn.slide, .btn.act { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; font-family: var(--brush);
  transition: transform .12s ease, box-shadow .12s, opacity .25s, filter .2s; touch-action: none; }
.btn.jump { right: 0; bottom: 0; width: 52%; height: 52%; color: #fbf3e6; font-size: calc(clamp(18px, 5vh, 28px) * var(--btn-scale)); text-shadow: 0 1px 2px rgba(60,6,4,.6);
  background: radial-gradient(circle at 38% 28%, #e8665a 0, #c13b31 34%, #9a271f 70%, #6e1712 100%);
  box-shadow: 0 8px 18px rgba(80,15,10,.42), inset 0 3px 5px rgba(255,214,196,.5), inset 0 -6px 12px rgba(50,4,2,.5), inset 0 0 0 2px rgba(236,196,120,.9); }
.btn.slide { left: 2%; bottom: 0; width: 36%; height: 36%; color: var(--ink); font-size: calc(clamp(15px, 4vh, 22px) * var(--btn-scale));
  background: radial-gradient(circle at 38% 28%, #ffffff 0, #f5efe2 30%, #dcd2bf 76%, #bfb39b 100%);
  box-shadow: 0 6px 14px rgba(30,25,15,.34), inset 0 3px 4px rgba(255,255,255,.9), inset 0 -5px 9px rgba(90,70,40,.3), inset 0 0 0 2px rgba(150,112,56,.75); }
.btn.act { right: 4%; top: 2%; width: 36%; height: 36%; color: #f6efe3; font-size: calc(clamp(13px, 3.4vh, 19px) * var(--btn-scale));
  background: radial-gradient(circle at 38% 28%, #8fb3a6 0, #5f8579 40%, #3b5a51 80%, #2a433c 100%);
  box-shadow: 0 6px 14px rgba(20,40,35,.38), inset 0 3px 4px rgba(220,245,235,.45), inset 0 -5px 9px rgba(10,30,24,.45), inset 0 0 0 2px rgba(230,196,124,.85); opacity: .0; transform: scale(.6); pointer-events: none; }
.btn.jump::before, .btn.slide::before, .btn.act::before { content: ''; position: absolute; inset: 3%; border-radius: 50%; pointer-events: none; background: center/100% 100% no-repeat var(--rim-gold); opacity: .9; }
.btn.slide::before { background-image: var(--rim-ink); }
.btn.jump > *, .btn.slide > *, .btn.act > * { position: relative; }
.btn.act.on { opacity: 1; transform: scale(1); pointer-events: auto; animation: actPulse 1.4s ease-in-out infinite; }
@keyframes actPulse { 50% { box-shadow: 0 0 0 8px rgba(95,133,121,.25), 0 5px 14px rgba(20,40,35,.35); } }
.btn.pressed { transform: scale(.92) translateY(1px) !important; filter: brightness(1.12); }
.btn.jump.pressed, .btn.slide.pressed, .btn.act.pressed { box-shadow: 0 3px 8px rgba(30,20,10,.4), inset 0 -2px 6px rgba(0,0,0,.3), inset 0 4px 10px rgba(0,0,0,.28), inset 0 0 0 2px rgba(240,206,140,.95), 0 0 16px rgba(255,214,150,.45); }
.btn span { line-height: 1; margin-top: 2px; }
body.swap .btns { right: auto; left: calc(4vw + var(--sal)); }
body.swap #joy { left: auto; right: calc(var(--sar) + max(14px, 2.4vh)); }
body.no-touch #touch .btns, body.no-touch #joy { display: none; }

/* ---------- modals ---------- */
.modal { z-index: 30; background: rgba(20,18,15,.38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal.show { display: grid; place-items: center; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.panel { width: min(86vw, 360px); max-height: calc(100vh - 24px - var(--sat) - var(--sab)); overflow: auto; padding: 18px 22px 20px; border-radius: 6px; text-align: center; display: flex; flex-direction: column; align-items: center;
  animation: popIn .35s cubic-bezier(.2,.9,.25,1.15); }
.panel.wide { width: min(92vw, 620px); }
@keyframes popIn { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.panel h2 { margin: 0 0 .3em; font-size: clamp(30px, 7vh, 44px); }
.panel .btn-ink { min-width: 11em; }
.set-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: center; width: 100%; margin: 4px 0 12px; text-align: left; font-size: 15px; }
.set-grid label { color: var(--ink2); letter-spacing: .1em; white-space: nowrap; }
.seg { display: flex; background: rgba(29,27,24,.07); border-radius: 18px; padding: 3px; }
.seg button { flex: 1; padding: 6px 4px; border-radius: 15px; font-size: 14px; transition: background .2s, color .2s; }
.seg button.on { background: var(--ink); color: var(--paper); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p, 50%), rgba(29,27,24,.15) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--red); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(29,27,24,.15); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--ink); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--red); }
.credits .cred-body { text-align: left; font-size: 13px; line-height: 1.75; color: var(--ink2); width: 100%; max-height: 52vh; overflow: auto; padding-right: 6px; }
.credits h4 { margin: .8em 0 .2em; font-size: 14px; color: var(--ink); letter-spacing: .1em; }
.credits a { color: var(--jade); }

/* results scroll */
.scrollpaper { width: min(92vw, 640px); padding: 16px 28px 16px; background:
  linear-gradient(90deg, #5a2a18 0, #7a3c22 10px, rgba(0,0,0,0) 10px, rgba(0,0,0,0) calc(100% - 10px), #7a3c22 calc(100% - 10px), #5a2a18 100%),
  radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%), var(--paper);
  box-shadow: 0 24px 60px rgba(30,25,15,.35), inset 0 0 70px rgba(150,120,80,.15); border-radius: 4px; animation: unroll .7s cubic-bezier(.2,.9,.25,1) both; }
@keyframes unroll { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
.huge2 { font-size: clamp(36px, 9vh, 58px) !important; margin: 0 !important; }
.r-sub { margin: 0 0 .6em; color: var(--muted); letter-spacing: .3em; font-size: 13px; }
.r-stats { display: flex; justify-content: center; gap: clamp(14px, 5vw, 44px); margin-bottom: .6em; }
.r-stats div { display: flex; flex-direction: column; align-items: center; }
.r-stats label { font-size: 12px; color: var(--muted); letter-spacing: .3em; }
.r-stats b { font-size: clamp(18px, 4.4vh, 26px); font-variant-numeric: tabular-nums; }
.r-stats small { font-size: 11px; color: var(--red); min-height: 1.2em; }
.seals { display: flex; justify-content: center; gap: clamp(16px, 4vw, 34px); margin: .2em 0 .5em; }
.seal-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seal-slot small { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.seal.big3 { width: clamp(48px, 12vh, 70px); height: clamp(48px, 12vh, 70px); font-size: clamp(17px, 4.2vh, 25px); writing-mode: vertical-rl; letter-spacing: .05em; opacity: .12; filter: grayscale(1) url(#stampRough); transform: rotate(-4deg); }
.seal.big3.on { animation: stamp .45s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.2) rotate(-12deg); filter: url(#stampRough); } 70% { opacity: 1; transform: scale(.92) rotate(-3deg); filter: url(#stampRough); } 100% { opacity: 1; transform: scale(1) rotate(-4deg); filter: url(#stampRough); } }
.story { font-family: var(--brush); font-size: clamp(14px, 3.2vh, 19px); color: var(--ink2); margin: .2em 0 .3em; }
.teaser { font-size: 12px; color: var(--muted); letter-spacing: .2em; margin: .3em 0 0; }

#fade { position: fixed; inset: 0; background: #efe9dc; opacity: 0; pointer-events: none; z-index: 40; transition: opacity .6s ease; }
#fade.on { opacity: 1; pointer-events: auto; }
#err { z-index: 90; background: var(--paper); display: none; place-items: center; text-align: center; padding: 20px; }
#err.show { display: grid; }
@media (max-height: 430px) {
  .panel { padding: 10px 18px 12px; }
  .panel h2 { font-size: 28px; }
  .panel .btn-ink { padding: .45em 1.4em; margin: .18em; font-size: 15px; }
  .set-grid { gap: 4px 14px; font-size: 13px; }
  .seg button { padding: 4px; font-size: 13px; }
  .scrollpaper { padding: 8px 24px; }
}
/* short landscape screens (phones): settings in two label/control columns so the whole panel fits without scrolling */
@media (max-height: 520px) and (min-width: 600px) {
  .panel.wide:not(.credits) { width: min(94vw, 780px); }
  .set-grid { grid-template-columns: auto 1fr auto 1fr; gap: 6px 12px; }
  .credits .cred-body { max-height: calc(100vh - 130px - var(--sat) - var(--sab)); }
}
@media (orientation: portrait) {
  .hint { max-width: 92vw; }
  #joy { --J: calc(clamp(112px, 22vw, 172px) * var(--btn-scale)); }
  .title-menu { right: 50%; transform: translate(50%, 0); top: auto; bottom: calc(6vh + var(--sab)); width: 88vw; animation: none; }
  .title-col { left: 50%; transform: translateX(-50%); top: calc(5vh + var(--sat)); align-items: center; }
  .title-col .huge { writing-mode: horizontal-tb; font-size: clamp(54px, 18vw, 110px); letter-spacing: .06em; white-space: nowrap; line-height: 1.05; }
  .title-col .seal { margin-top: 0; }
  .title-shade { background: linear-gradient(0deg, rgba(239,233,220,.92) 0%, rgba(239,233,220,.8) 45%, rgba(239,233,220,0) 75%); }
  .load-inner { left: 8vw; width: 84vw; top: auto; bottom: 8vh; transform: none; }
  .load-paper { background: linear-gradient(0deg, var(--paper) 0%, var(--paper) 40%, rgba(239,233,220,0) 70%); }
}

.set-ver { margin: 8px 0 0; font-size: 11px; letter-spacing: .08em; color: rgba(29,27,24,.5); font-family: var(--sans); }

/* ---------- character select (title) ---------- */
.hero-pick { display: flex; justify-content: center; gap: clamp(10px, 2.4vw, 22px); margin: 0 0 .5em; }
.hp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 6px 6px; border-radius: 6px; cursor: pointer;
  background: rgba(246,240,228,.6); box-shadow: inset 0 0 0 1px rgba(80,60,30,.18); transition: transform .2s, box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.hp-card .hp-img { display: block; width: clamp(52px, 13vh, 92px); aspect-ratio: 4 / 5; border-radius: 46% 46% 6px 6px / 38% 38% 6px 6px; overflow: hidden;
  background: linear-gradient(180deg, #e8e1d1, #d9cfbb); box-shadow: inset 0 0 0 1px rgba(60,45,25,.25); }
.hp-card img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.55) brightness(.96); opacity: .8; transition: filter .25s, opacity .25s; }
.hp-card b { font-size: clamp(16px, 3.6vh, 22px); line-height: 1.1; color: var(--ink2); }
.hp-card i { font-style: normal; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.hp-card.on { background: rgba(250,245,235,.92); box-shadow: inset 0 0 0 1.5px var(--red), 0 4px 14px rgba(120,40,20,.18); transform: translateY(-2px); }
.hp-card.on img { filter: none; opacity: 1; }
.hp-card.on b { color: var(--ink); }
.hp-card.on::after { content: '选'; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 3px; background: var(--red); color: #fbeee6;
  font-family: var(--brush); font-size: 13px; line-height: 18px; text-align: center; transform: rotate(6deg); }
.hero-pick.busy .hp-card.on img { animation: hpPulse 1s ease-in-out infinite; }
@keyframes hpPulse { 50% { opacity: .55; } }
@media (max-height: 430px) { .hero-pick { margin-bottom: .2em; } .hp-card i { display: none; } .title-menu .blurb { margin-bottom: .6em; } }

.ext-links{display:flex;justify-content:center;gap:1.1em;flex-wrap:wrap}
.ext-links a.link{text-decoration:none}
