/* ============ 呼噜寺 UI v2 · 萌系禅寺 ============
   rice-paper cream + matcha green + peach pink + a little gold. Fat, round, soft.
   Every art-backed piece is drawn in pure CSS first; when game/assets/ui/<name>.png exists, ui.js adds html.a-<name>
   and the image takes over (see the "ART OVERRIDES" block at the bottom). */

/* ---- fonts: subset woff2 built by tools/build_fonts.py (ZCOOL KuaiLe, OFL). Missing file = system rounded fonts. ---- */
@font-face { font-family: "HuluCute"; src: url("/assets/fonts/cute.woff2") format("woff2"); font-display: swap; }
/* @font-face { font-family: "HuluBody"; src: url("/assets/fonts/body.woff2") format("woff2"); font-display: swap; }   <- reserved for a rounded body font */

:root {
  --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px);
  --font-title: "HuluCute","ZCOOL KuaiLe","Yuanti SC","Hiragino Maru Gothic ProN","PingFang SC","Noto Sans SC",sans-serif;
  --font-body: "HuluBody","Yuanti SC","Hiragino Maru Gothic ProN","PingFang SC","Noto Sans SC","Microsoft YaHei",sans-serif;
  /* type scale (title 22 / button 15 / body 13 / small 11 at phone width) */
  --fs-title: clamp(20px, 1vw + 18px, 26px);
  --fs-btn: clamp(14px, .3vw + 13.5px, 16px);
  --fs-body: clamp(13px, .2vw + 12.4px, 14px);
  --fs-small: clamp(11px, .15vw + 10.4px, 12px);
  --fs-hero: clamp(34px, 3vw + 24px, 52px);
  --ink: #5b3f30; --ink-2: #92735f; --ink-3: #b99b86;
  --paper: #fff6e3; --paper-2: #fdebc8; --paper-edge: #ecd0a0;
  --matcha: #8fb67e; --matcha-d: #66906a; --matcha-l: #c9e0b8;
  --peach: #f7aaa0; --peach-d: #ee8a86; --peach-l: #fddcd4;
  --gold: #eab84e; --gold-d: #c58f2e; --wood: #94603c; --wood-l: #b27a4d;
  --shadow: 0 6px 14px rgba(104,66,38,.24), 0 1px 3px rgba(104,66,38,.18);
  --shadow-s: 0 3px 8px rgba(104,66,38,.2);
  --soft: inset 0 2px 0 rgba(255,255,255,.75), inset 0 -3px 0 rgba(150,100,60,.12);
  --edge: 10px;
  --om-w: clamp(84px, 24vw, 112px); --om-ar: 1.28; --om-h: calc(var(--om-w) * var(--om-ar));
  --dock-h: calc(var(--om-h) + 24px + var(--safe-b));
  --top-h: 66px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3a2a24; touch-action: none; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none; font-family: var(--font-body); color: var(--ink); font-size: var(--fs-body); line-height: 1.5; }
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; }
b { font-weight: 700; font-variant-numeric: tabular-nums; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ico { display: inline-block; background: center / contain no-repeat; }
.ico svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 1px 0 rgba(255,255,255,.6)); }

/* ---------- shared surfaces ---------- */
.frame, .card, .cloud { background: linear-gradient(180deg, #fffaf0, var(--paper)); border: 3px solid var(--paper-edge); border-radius: 26px; box-shadow: var(--shadow), var(--soft); }
.cloud { border-radius: 30px; }
.ui-pill { background: linear-gradient(180deg, #fffaf0, var(--paper)); border: 2.5px solid var(--paper-edge); box-shadow: var(--shadow-s), var(--soft); }

/* ---------- buttons ---------- */
.btn { pointer-events: auto; position: relative; border: 2.5px solid var(--paper-edge); border-radius: 999px; min-height: 42px; padding: 0 18px; font: inherit; font-family: var(--font-title); font-size: var(--fs-btn); color: var(--ink);
  background: linear-gradient(180deg, #fffdf6, #fbeccb); box-shadow: var(--shadow-s), var(--soft); cursor: pointer; white-space: nowrap; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .16s cubic-bezier(.3,1.7,.5,1); }
.btn:active { transform: scale(.9); }
.btn.primary { color: #fff; border-color: #fbd6cd; text-shadow: 0 1px 0 rgba(150,60,50,.45); background: linear-gradient(180deg, #fbb3a8, var(--peach-d)); }
.btn.matcha { color: #fff; border-color: #dcebcf; text-shadow: 0 1px 0 rgba(50,90,50,.4); background: linear-gradient(180deg, #a9cc97, var(--matcha-d)); }

/* ---------- prompt (someone wants to pet you) + cat menu ---------- */
#prompt, #menu { position: absolute; z-index: 5; pointer-events: auto; padding: 16px 18px 16px; text-align: center; animation: pop .42s cubic-bezier(.3,1.5,.5,1); }
#prompt { left: 0; right: 0; margin: 0 auto; bottom: calc(var(--dock-h) + 10px); width: min(330px, calc(100vw - 24px)); }
#prompt .paw-tag { position: absolute; width: 30px; height: 30px; left: 50%; top: -17px; margin-left: -15px; padding: 5px; border-radius: 50%; background: #fff6e3; border: 2.5px solid var(--paper-edge); box-shadow: var(--shadow-s); }
#prompt-text { font-family: var(--font-title); font-size: var(--fs-title); line-height: 1.3; margin: 6px 0 12px; overflow-wrap: anywhere; text-wrap: balance; }
.row { display: flex; gap: 10px; justify-content: center; }
.row .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.timer { height: 8px; background: rgba(150,110,70,.16); border-radius: 6px; margin-top: 14px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(100,60,30,.2); }
.timer i { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(90deg, #f4c85a 0 10px, #f8d98a 10px 12px); border-radius: 6px; }
#menu { left: 0; top: 0; transform-origin: 50% 100%; width: max-content; min-width: 190px; max-width: min(270px, calc(100vw - 24px)); padding: 12px 14px 14px; border-radius: 26px; }
#menu::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px; margin-left: -8px; background: #fdefd0; border-right: 3px solid var(--paper-edge); border-bottom: 3px solid var(--paper-edge); transform: rotate(45deg); border-radius: 0 0 6px 0; }
.ribbon-name { display: block; max-width: 100%; margin: 0 auto 10px; padding: 2px 14px 3px; width: fit-content; border-radius: 10px; background: linear-gradient(180deg, #fde1da, #f9c8bd); border: 2px solid #f3b4a8; font-family: var(--font-title); font-size: var(--fs-btn); color: #7a3f34; overflow-wrap: anywhere; text-wrap: balance; }
@keyframes pop { from { transform: scale(.82) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
#menu.pop-in { animation: pop .3s cubic-bezier(.3,1.5,.5,1); }

/* ---------- fortune slip ---------- */
/* Producer-chosen art (slip_card.webp, 854x1599, cat ears + bell + sakura). Everything is laid out in art pixels via --k (screen px per art px), so the
   card never stretches. Measured in the art: paper (inside the gold line) x 61..796, y 334..1459; safe text area = paper shrunk ~6% (x 105..752, y 378..1415).
   Pill y 384..479, text x 141..711 y 524..1194, buttons y 1234..1334 (portrait). Short landscape: card fitted to height, text horizontal, buttons beside the card. */
#fortune { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(70,40,24,.46); animation: tin .3s; }
#slip { --k: min(calc(92vh / 1599), calc((100vw - 24px) / 854), calc(900px / 1599)); position: relative; width: calc(854 * var(--k)); height: calc(1599 * var(--k)); flex: none;
  background: url(/assets/ui/slip_card.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 12px 22px rgba(90,40,30,.4)); animation: slipin .6s cubic-bezier(.3,1.35,.5,1); }
.slip-top { position: absolute; left: 0; right: 0; top: calc(384 * var(--k)); height: calc(95 * var(--k)); display: flex; align-items: center; justify-content: center; }
.slip-no { display: none; }
#fo-tier { font-family: var(--font-title); font-weight: 400; font-size: max(14px, calc(54 * var(--k))); line-height: 1; height: 100%; display: flex; align-items: center; padding: 0 max(8px, calc(40 * var(--k))); border-radius: 999px; color: #fff9e8; letter-spacing: .1em; text-indent: .1em; white-space: nowrap;
  background: linear-gradient(180deg, #ffadbd, #f37f97); box-shadow: 0 3px 0 #d9607a, inset 0 2px 0 rgba(255,255,255,.45); text-shadow: 0 2px 0 rgba(170,60,85,.45); border: 2.5px solid #fff3f0; }
#slip[data-t="0"] #fo-tier { background: linear-gradient(180deg, #ffd27a, #f5a742); box-shadow: 0 3px 0 #d3852a, inset 0 2px 0 rgba(255,255,255,.5); text-shadow: 0 2px 0 rgba(160,90,20,.45); }
#fo-body { position: absolute; left: calc(141 * var(--k)); top: calc(524 * var(--k)); width: calc(570 * var(--k)); height: calc(670 * var(--k)); display: flex; justify-content: center; align-items: center; overflow: hidden; }
#fo-cols { writing-mode: vertical-rl; font-family: var(--font-title); color: #7a4a3a; line-height: 1.25; max-height: 100%; max-width: 100%; }
#fo-cols .fl { display: block; letter-spacing: .12em; white-space: nowrap; margin-left: .45em; }
.slip-foot { position: absolute; left: calc(427 * var(--k) - 160 * var(--k)); width: calc(320 * var(--k)); top: calc(1234 * var(--k)); height: calc(100 * var(--k)); display: flex; align-items: center; justify-content: center; gap: max(5px, calc(14 * var(--k))); }
.slip-foot .btn { min-height: 0; height: min(100%, 40px); min-width: 0; padding: 0 max(9px, calc(26 * var(--k))); font-size: clamp(13px, calc(40 * var(--k)), 17px); white-space: nowrap; }
#fo-save { background: linear-gradient(180deg, #fffaf3, #ffe6df); border-color: #f4a7a0; color: #b8574e; }
@keyframes slipin { 0% { transform: translateY(40px) rotate(-5deg) scale(.8); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (orientation: landscape) and (max-height: 540px) {
  #slip { --k: min(calc(94vh / 1599), calc((100vw - 150px) / 854)); }
  #fo-cols { writing-mode: horizontal-tb; text-align: center; } #fo-cols .fl { white-space: normal; letter-spacing: .04em; overflow-wrap: anywhere; text-wrap: balance; margin: .15em 0; }
  #fo-cols.one .fl { white-space: nowrap; letter-spacing: 0; }
  .slip-foot { left: calc(100% + 22px); top: auto; bottom: calc(150 * var(--k)); width: auto; height: auto; flex-direction: column; align-items: stretch; gap: 8px; }
  .slip-foot .btn { height: 38px; padding: 0 18px; font-size: 15px; }
}
#slipimg { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(70,40,24,.55); animation: tin .3s; }
#si-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 20px); }
#si-img { display: block; max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; border-radius: 14px; -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; pointer-events: auto; }
#si-hint { font-family: var(--font-title); font-size: var(--fs-small); color: var(--ink-2); }
@media (orientation: landscape) and (max-height: 540px) { #si-card { flex-direction: row; width: auto; max-width: calc(100vw - 32px); } #si-hint { writing-mode: vertical-rl; } #si-img { max-height: calc(100vh - 40px); } }

/* ---------- reveal card ---------- */
#reveal { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; pointer-events: none; animation: tin .4s ease-out; transition: opacity .6s; padding: 0 var(--edge); }
#reveal.out { opacity: 0; }
.card { padding: 20px 24px 22px; text-align: center; width: min(320px, calc(100vw - 40px)); position: relative; animation: pop .5s cubic-bezier(.3,1.5,.5,1); }
#rv-cat { display: block; margin: 0 auto 6px; max-width: 150px; max-height: 190px; width: auto; height: auto; filter: drop-shadow(0 8px 8px rgba(96,62,40,.25)); }
#rv-tag { display: inline-block; max-width: 100%; font-family: var(--font-title); font-size: var(--fs-btn); letter-spacing: .16em; text-indent: .16em; color: #fff; background: linear-gradient(180deg, #f6cc6c, #e3a23c); padding: 2px 16px 3px; border-radius: 999px; margin-bottom: 8px; text-shadow: 0 1px 0 rgba(130,80,10,.5); border: 2px solid #fbe9b4; box-shadow: var(--shadow-s); }
#rv-tag:empty { display: none; }
#rv-a { font-family: var(--font-title); font-size: var(--fs-title); line-height: 1.35; margin-bottom: 6px; overflow-wrap: anywhere; text-wrap: balance; }
#rv-b { font-size: var(--fs-body); color: var(--ink-2); overflow-wrap: anywhere; text-wrap: balance; }
#rv-c { font-size: var(--fs-small); color: var(--ink-2); margin-top: 8px; overflow-wrap: anywhere; text-wrap: balance; }
#rv-c:empty { display: none; }
#reveal.rare .card, #reveal.hero .card { background: linear-gradient(170deg, #fffbe9, #ffe9d6); border-color: #f1cd7a; box-shadow: 0 0 0 3px #fff2c4, 0 0 44px rgba(255,205,110,.85), var(--shadow); }
#reveal.hero #rv-a { color: #b4552f; }

/* ---------- ambience overlays ---------- */
#dim { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(90,48,30,.12), rgba(70,34,22,.5)); opacity: 0; transition: opacity 1.4s; pointer-events: none; }
#dim.on { opacity: 1; }
#flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff6d6, transparent 70%); opacity: 0; pointer-events: none; }
#flash.go { animation: fl 2.2s ease-out; }
@keyframes fl { 0% { opacity: .9; } 100% { opacity: 0; } }
#fade { position: fixed; inset: 0; background: #f3e4d0; opacity: 0; pointer-events: none; transition: opacity .35s ease; z-index: 8; }
#fade.on { opacity: 1; pointer-events: auto; }

/* ---------- name tags (DOM ribbons) ---------- */
#tags { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ntag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 5px 0 12px; max-width: 220px; border-radius: 12px 6px 6px 12px; opacity: 0; transition: opacity .28s; will-change: transform, opacity;
  background: linear-gradient(180deg, #fffaf0, #fdecc9); border: 2px solid #f0c9a0; box-shadow: 0 2px 5px rgba(90,55,30,.28); }
.ntag.on { opacity: 1; }
.ntag::before { content: ""; position: absolute; left: -6px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: inherit; border: inherit; border-radius: 3px; transform: rotate(45deg); border-top: 0; border-right: 0; }
.ntag .nt-t { font-family: var(--font-title); font-size: var(--fs-small); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.1; padding-bottom: 1px; }
.ntag .nt-bell { flex: none; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b8, #eab84e 62%, #c58f2e); box-shadow: 0 1px 2px rgba(100,60,20,.35); }
.ntag.me { background: linear-gradient(180deg, #fff7d6, #fbe09a); border-color: #eab84e; } .ntag.me .nt-t { color: #7a4a14; }
.ntag.npc { background: linear-gradient(180deg, #f2f9e8, #dcebcb); border-color: #b4d29c; } .ntag.npc .nt-t { color: #476a3a; }
.ntag.sign { background: linear-gradient(180deg, var(--wood-l), var(--wood)); border-color: #f3dca8; } .ntag.sign .nt-t { color: #fff3d4; }
.ntag.dot { width: 16px; height: 16px; padding: 0; justify-content: center; border-radius: 50%; } .ntag.dot::before, .ntag.dot .nt-t { display: none; } .ntag.dot .nt-bell { width: 8px; height: 8px; }

/* ---------- title / cover ---------- */
#title { position: fixed; inset: 0; background: #4a4a22; z-index: 10; overflow: hidden; }
#cv-fg { position: absolute; left: 0; right: 0; top: 0; bottom: 0; }
#key { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
#cv-low { display: none; }
#title-box { position: absolute; z-index: 1; left: 50%; top: calc(7vh + var(--safe-t)); transform: translateX(-50%); width: min(92vw, 560px); text-align: center; }
#title-box h1 { margin: 0; font-family: var(--font-title); font-size: clamp(56px, 19vw, 112px); line-height: 1.1; font-weight: 400; letter-spacing: .12em; margin-right: -.12em; color: #8a3a28; text-shadow: 0 3px 0 #fff3dc, 0 6px 22px rgba(255,236,200,.95); }
html.title-in-art #title-box { display: none; }
/* portrait: a tall cover (cover art on top, painted terrace + lotus pond below) fills the screen by width, pinned to the top — no blur, no mirror */
@media (orientation: portrait) {
  #key { object-fit: cover; object-position: 50% 0; }
  #title::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(180deg, transparent, rgba(45,40,24,.22)); pointer-events: none; }
}
#enter-wrap { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(3vh + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 20px; }
#mode-pick { display: flex; gap: 8px; padding: 4px; border-radius: 999px; background: rgba(255,246,227,.82); border: 2.5px solid var(--paper-edge); box-shadow: var(--shadow-s), var(--soft); max-width: 100%; }
.mpick { pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 8px; border-radius: 999px; border: 2px solid transparent; background: transparent; cursor: pointer; font-family: var(--font-title); font-size: var(--fs-btn); color: var(--ink-2); white-space: nowrap; transition: transform .16s cubic-bezier(.3,1.7,.5,1), background .2s, color .2s; min-width: 0; }
.mpick .ico { width: 24px; height: 24px; flex: none; } .mpick span { min-width: 0; }
.mpick:active { transform: scale(.92); }
.mpick.on { color: #fff; background: linear-gradient(180deg, #a9cc97, var(--matcha-d)); border-color: #dcebcf; text-shadow: 0 1px 0 rgba(50,90,50,.4); box-shadow: 0 2px 6px rgba(70,110,60,.4); }
.mpick.on .ico svg { filter: brightness(1.7) saturate(.6); }
.enter { position: relative; pointer-events: auto; cursor: pointer; width: clamp(170px, 46vw, 240px); height: clamp(56px, 7.4vh, 72px); border: 0; padding: 0; background: none; transition: transform .2s cubic-bezier(.3,1.7,.5,1); animation: breathe 3.2s ease-in-out infinite; margin-top: 12px; }
.enter::before { content: ""; position: absolute; inset: 0; border-radius: 40px 40px 22px 22px / 50% 50% 28% 28%; background: radial-gradient(circle at 18% 22%, rgba(255,255,255,.3) 0 8px, transparent 9px), linear-gradient(180deg, #fbc0b6, #f19488); border: 5px solid #f6dfae; box-shadow: 0 10px 22px rgba(110,50,30,.4), inset 0 3px 0 rgba(255,255,255,.4), inset 0 -5px 0 rgba(150,60,50,.2); }
.enter #enter-t { position: relative; z-index: 1; font-family: var(--font-title); font-size: clamp(28px, 3vw + 18px, 38px); color: #fff9ec; letter-spacing: .3em; text-indent: .3em; text-shadow: 0 3px 0 rgba(150,60,50,.6); white-space: nowrap; display: block; text-align: center; line-height: clamp(46px, 6.4vh, 62px); }
.enter .o-loop, .enter .o-tassel { display: none; }
.enter .o-loop { position: absolute; left: 50%; top: -17px; width: 30px; height: 22px; margin-left: -15px; border: 5px solid #ee8f86; border-radius: 50%; border-bottom-color: transparent; }
.enter .o-tassel { position: absolute; z-index: -1; left: 50%; bottom: -22px; width: 16px; height: 28px; margin-left: -8px; background: linear-gradient(180deg, #ee8f86, #f7b4a8); clip-path: polygon(0 0, 100% 0, 100% 72%, 85% 100%, 70% 74%, 50% 100%, 30% 74%, 15% 100%, 0 72%); }
.enter:active { transform: scale(.92); animation: none; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
#t-sub { margin: 0; max-width: 20em; text-align: center; font-size: var(--fs-body); color: #fff9ec; text-shadow: 0 1px 4px rgba(60,40,20,.9), 0 0 10px rgba(60,40,20,.7); text-wrap: balance; overflow-wrap: anywhere; }
/* portrait title: 进寺 on top is the hero (wider), the sound pick below it is a slim, quieter bar */
@media (orientation: portrait) {
  #enter-wrap { gap: 16px; }
  .enter { width: clamp(210px, 60vw, 270px); height: clamp(58px, 7.2vh, 68px); margin-top: 0; }
  #mode-pick { gap: 4px; padding: 3px; border-width: 2px; }
  .mpick { height: 32px; padding: 0 12px 0 6px; gap: 4px; font-size: 14px; }
  .mpick .ico { width: 20px; height: 20px; }
}
@media (orientation: portrait) and (max-height: 700px) { #t-sub { display: none; } #enter-wrap { gap: 10px; bottom: calc(1.6vh + var(--safe-b)); } .mpick { height: 30px; } .enter { margin-top: 0; } }
@media (orientation: landscape) { #title-box { left: 46%; top: calc(6vh + var(--safe-t)); width: min(44vw, 560px); } #title-box h1 { font-size: clamp(52px, 13vh, 118px); } #enter-wrap { left: auto; right: clamp(16px, 5vw, 80px); bottom: calc(5vh + var(--safe-b)); align-items: center; width: min(360px, 44vw); gap: 12px; padding: 0; } }
@media (orientation: landscape) and (max-height: 520px) { #t-sub { display: none; } .enter { height: 52px; margin-top: 8px; } }

/* ---------- sound menu (bell button) ---------- */
#sound-menu { position: absolute; z-index: 7; right: calc(var(--edge) + var(--safe-r)); top: calc(70px + var(--safe-t)); pointer-events: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; border-radius: 22px; animation: pop .3s cubic-bezier(.3,1.5,.5,1); transform-origin: 100% 0; }
#sound-menu::before { content: ""; position: absolute; right: 22px; top: -9px; width: 16px; height: 16px; background: #fff9ec; border-left: 3px solid var(--paper-edge); border-top: 3px solid var(--paper-edge); transform: rotate(45deg); border-radius: 6px 0 0 0; }
.smi { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px; border: 2px solid transparent; background: transparent; font-family: var(--font-title); font-size: var(--fs-btn); color: var(--ink); cursor: pointer; white-space: nowrap; transition: transform .16s cubic-bezier(.3,1.7,.5,1); }
.smi .ico { width: 24px; height: 24px; flex: none; } .smi:active { transform: scale(.94); }
.smi.on { background: linear-gradient(180deg, #e3f0d6, #cfe4be); border-color: #b4d29c; color: #3f6a3c; }

/* ---------- loading + queue ---------- */
#loading, #queue { position: fixed; inset: 0; background: radial-gradient(circle at 50% 30%, #fdf1d9, #f2d5ae); z-index: 9; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 20px; }
.ld-card { width: min(320px, 100%); padding: 20px 22px 22px; }
#ld-cat { display: block; height: 100px; margin: 0 auto 6px; animation: bob 1.1s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(96,62,40,.25)); }
@keyframes bob { 50% { transform: translateY(-7px); } }
#ld-title { font-family: var(--font-title); font-size: var(--fs-title); letter-spacing: .2em; text-indent: .2em; margin-bottom: 10px; }
.ld-beads { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; } .ld-beads .bead { position: relative; width: 18px; height: 18px; inset: auto; }
#loading-text { font-size: var(--fs-body); line-height: 1.7; color: var(--ink-2); text-wrap: balance; overflow-wrap: anywhere; }
.qbox { padding: 22px 26px 24px; max-width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; } .qbox .ico { width: 44px; height: 44px; }
#qtext { margin: 0; font-size: var(--fs-btn); line-height: 1.8; overflow-wrap: anywhere; text-wrap: balance; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ============ social (P0): emote ring, 回礼, flash line, quests, daze ============ */
#ring { position: absolute; z-index: 6; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
#ring .rb { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0;
  background: linear-gradient(180deg, #fffaf0, var(--paper)); border: 2.5px solid var(--paper-edge); box-shadow: var(--shadow-s), var(--soft); animation: ringpop .35s cubic-bezier(.3,1.7,.5,1) backwards; font-family: var(--font-title); font-size: 11px; line-height: 1.1; color: var(--ink); white-space: nowrap; }
#ring .rb .ico { width: 26px; height: 26px; } #ring .rb:active { transform: scale(.88); }
@keyframes ringpop { from { transform: scale(.2); opacity: 0; } }
#ring .rb.cool { filter: grayscale(.8) opacity(.6); }
#ack-btn { position: absolute; z-index: 5; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 8px; border-radius: 999px; cursor: pointer; font-family: var(--font-title); font-size: var(--fs-btn); color: #7a3f34;
  background: linear-gradient(180deg, #fff1ec, #fcd2c8); border: 2.5px solid #f3b4a8; box-shadow: var(--shadow-s); animation: ackpop .45s cubic-bezier(.3,1.7,.5,1); }
#ack-btn .ico { width: 24px; height: 24px; } @keyframes ackpop { from { opacity: 0; scale: .4; } }
  background: rgba(255,250,240,.88); border: 2px solid var(--paper-edge); box-shadow: var(--shadow-s); opacity: 0; transition: opacity .6s; pointer-events: none; }
@keyframes checkpop { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1.25); } 30% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
#qpanel { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(70,40,24,.42); animation: tin .3s; }
#qcard { width: min(340px, calc(100vw - 36px)); padding: 20px 22px 20px; text-align: left; }
#q-title { font-family: var(--font-title); font-size: var(--fs-title); text-align: center; letter-spacing: .2em; text-indent: .2em; color: var(--ink); }
#q-sub { text-align: center; font-size: var(--fs-small); color: var(--ink-2); margin: 2px 0 12px; }
#q-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#q-list li { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 9px; border-radius: 16px; background: rgba(255,255,255,.6); border: 2px solid #f1e0bd; font-size: var(--fs-body); overflow-wrap: anywhere; min-width: 0; }
#q-list li i { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #d6c2a0; background: #fffaf0; position: relative; }
#q-list li.done { color: var(--ink-2); text-decoration: line-through; text-decoration-color: #b4d29c; } #q-list li.done i { background: var(--matcha-d); border-color: #dcebcf; }
#q-list li.done i::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(40deg); }
#qcard .btn { display: flex; margin: 0 auto; min-width: 120px; }
/* daze: all UI fades away except the way back */
#hud.daze > *:not(#daze-back):not(#game) { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s; }
#hud.daze #daze-back { opacity: .85 !important; pointer-events: auto !important; }

#menu .r2 { margin-top: 8px; }


#hud.daze > *:not(#daze-back):not(#game) { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s; }
#hud.daze #daze-back { opacity: .85 !important; pointer-events: auto !important; }

/* ============ HUD (v6, immersive minimal) ============
   Default: the hall owns the screen. Always on: a small merit badge (top-left, 28px), a small bell (top-right, 32px) and one paw button
   (bottom-right, 44px) that fans out the menu. Everything else fades in only when relevant: place title (2 s on entering), a thin bead strip
   (when stroking / progress changes / tapping the merit badge, 3 s), one notice slot (quips, toasts, signs), court actions float up at their spot.
   One material for all of it: frosted rice paper rgba(255,250,240,.72) + blur(10px), 1px gold hairline, one soft shadow.
   UI.audit() (ui.js, ?debug=1) checks pairwise overlap (>= 8 px), viewport bounds and text overflow. */
:root {
  --glass-bg: rgba(255, 250, 240, .72); --glass-line: rgba(214, 170, 80, .62); --glass-shadow: 0 5px 14px rgba(104, 66, 38, .16), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.glass, .toast, .signc, .quipc, .bannerc, .flc, .stand-pill, #napbanner, #sound-menu, #menu, #prompt, #ring .rb, #ack-btn, #fab, .ntag.act {
  background: var(--glass-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--glass-line); border-radius: 16px; box-shadow: var(--glass-shadow);
}
#hud { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 8px;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l)); }
#hud > #tags { position: absolute; inset: 0; }

/* ---- the two corner badges ---- */
#pill-merit { grid-area: 1 / 1; align-self: start; display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 4px; border-radius: 14px; pointer-events: auto; cursor: pointer; transition: opacity .6s; max-width: 40vw; }
#pill-merit .paw-badge { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background-color: rgba(252, 214, 206, .85); flex: none; }
#pill-merit b { font-family: var(--font-title); font-weight: 400; font-size: 15px; color: var(--ink); white-space: nowrap; line-height: 1; }
#pill-merit .bless { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; margin-left: 2px; padding-left: 5px; border-left: 1px solid var(--glass-line); white-space: nowrap; }
#pill-merit .bless b { font-size: 11px; } #pill-merit .bless .feather { width: 9px; height: 9px; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, #ffe08a, #f3a86a); transform: rotate(-20deg); }
#btn-sound { grid-area: 1 / 3; align-self: start; justify-self: end; position: relative; width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 16px; pointer-events: auto; cursor: pointer; transition: opacity .6s, transform .16s cubic-bezier(.3, 1.7, .5, 1); }
#btn-sound .ico { width: 20px; height: 20px; } #btn-sound.off .ico { filter: grayscale(1) opacity(.55); }
#btn-sound.off::after { content: ""; position: absolute; left: 8px; right: 8px; top: 15px; height: 2.5px; border-radius: 2px; background: #c9604f; transform: rotate(-38deg); box-shadow: 0 0 0 1px #fff6e3; }
#btn-sound:active { transform: scale(.88); }
#hud.idle #pill-merit, #hud.idle #btn-sound { opacity: .6; }

/* ---- top centre: transient things stack here (never on top of each other) ---- */
#topc { grid-area: 1 / 2; justify-self: center; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; max-width: 100%; pointer-events: none; }
#titlebox { display: flex; align-items: center; gap: 8px; padding: 0 4px; opacity: 0; transform: translateY(-4px); transition: opacity .6s, transform .6s; height: 0; overflow: visible; min-width: 0; }
#titlebox.show { opacity: 1; transform: none; height: 26px; }
#titlebox::before, #titlebox::after { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, #d6aa50); flex: none; } #titlebox::after { transform: scaleX(-1); }
#titlebox #place { font-family: var(--font-title); font-size: 18px; color: #fff8ea; letter-spacing: .22em; text-indent: .22em; white-space: nowrap; text-shadow: 0 1px 3px rgba(60, 35, 15, .85), 0 0 10px rgba(60, 35, 15, .55); }
#titlebox #monkhud { position: static; font-size: 10.5px; color: #fff8ea; text-shadow: 0 1px 3px rgba(60, 35, 15, .85); white-space: nowrap; background: none; border: 0; box-shadow: none; padding: 0; }
#beadbar { display: none; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 8px; border-radius: 14px; width: min(100%, 300px); opacity: 0; transition: opacity .6s; pointer-events: none; }
#beadbar.show { display: flex; opacity: 1; }
#bb-label { display: none; }
#beads-row { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 2px; }
#beads-row::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: repeating-linear-gradient(90deg, #cf7a62 0 4px, #e9a38e 4px 8px); border-radius: 2px; opacity: .85; }
.bc { position: relative; flex: 1 1 0; min-width: 0; max-width: 18px; aspect-ratio: 1; }
.bead { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff, #f5ece0 55%, #ddd0c0); box-shadow: inset 0 -2px 3px rgba(120, 90, 60, .2), 0 1px 2px rgba(100, 60, 30, .3); }
.bead::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff6c8, #f4c85a 55%, #cf9524); box-shadow: inset 0 -2px 3px rgba(130, 80, 10, .3); opacity: var(--part, 0); transition: opacity .5s; }
.bead.on::after { opacity: 1; }
.bead.flash { animation: beadpop .7s cubic-bezier(.3, 1.8, .5, 1); }
.bead.flash::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; background: radial-gradient(circle, #fff8d0 0, rgba(255, 240, 170, 0) 70%); animation: glint .7s ease-out forwards; pointer-events: none; }
@keyframes beadpop { 0% { transform: scale(.6); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes glint { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.7); } }
#deity-face { position: relative; flex: none; width: 28px; height: 24px; display: grid; place-items: center; }
#deity-face .df-art { position: absolute; inset: 1px; border-radius: 50% 50% 46% 46%; background:
  radial-gradient(ellipse 3px 1.8px at 33% 58%, transparent 60%, #7a4a22 62% 90%, transparent 92%), radial-gradient(ellipse 3px 1.8px at 67% 58%, transparent 60%, #7a4a22 62% 90%, transparent 92%),
  radial-gradient(circle at 50% 72%, #f3a09a 0 1.3px, transparent 1.8px), radial-gradient(circle at 40% 30%, #ffe9a4, #f6c360 70%, #e2a444); box-shadow: 0 0 0 1.5px #fff4d8; }
#deity-face .zz { position: absolute; right: -3px; top: -7px; font-family: var(--font-title); font-size: 10px; color: #8c7bc4; text-shadow: 0 1px 0 #fff; animation: zzf 2.6s ease-in-out infinite; }
@keyframes zzf { 0%, 100% { transform: translateY(0) rotate(8deg); opacity: .9; } 50% { transform: translateY(-3px) rotate(-6deg); opacity: .55; } }
#deity-face.awake .zz { display: none; } #deity-face.awake { animation: beadpop .8s; }
#napbanner { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 8px; max-width: 100%; font-family: var(--font-title); font-size: var(--fs-body); color: #5d4f8f; border-radius: 16px; }
#napbanner[hidden] { display: none; } #napbanner .ico { width: 22px; height: 22px; flex: none; } #nap-t { min-width: 0; overflow-wrap: anywhere; text-wrap: balance; text-align: center; }

/* ---- middle (free play area) ---- */
#mid { grid-area: 2 / 1 / 3 / -1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; position: relative; pointer-events: none; }
#mid-c { grid-area: 1 / 1 / 3 / 2; pointer-events: none; }
#prompt { grid-area: 2 / 1 / 3 / 2; position: relative; inset: auto; margin: 0 auto; align-self: end; width: min(330px, 100%); pointer-events: auto; padding: 16px 18px 14px; text-align: center; animation: pop .42s cubic-bezier(.3, 1.5, .5, 1); }
#prompt .paw-tag { position: absolute; width: 28px; height: 28px; left: 50%; top: -15px; margin-left: -14px; padding: 5px; border-radius: 50%; background: #fff6e3; border: 1px solid var(--glass-line); }
#hud.busy #bottom #fabbox { visibility: hidden; }

/* ---- notice slot items (one at a time) ---- */
.toast { position: relative; padding: 8px 16px 9px; font-size: var(--fs-body); text-align: center; overflow-wrap: anywhere; text-wrap: balance; animation: tin .38s cubic-bezier(.3, 1.6, .5, 1); transition: opacity .35s, transform .35s; }
.signc { position: relative; padding: 7px 18px 8px; text-align: center; animation: tin .4s cubic-bezier(.3, 1.6, .5, 1); transition: opacity .35s, transform .35s; }
.signc .st { font-family: var(--font-title); font-size: var(--fs-btn); letter-spacing: .24em; text-indent: .24em; color: #b9852a; }
.signc .sb { font-size: var(--fs-body); margin-top: 1px; overflow-wrap: anywhere; text-wrap: balance; }
.quipc { display: flex; align-items: center; gap: 8px; padding: 7px 14px 8px 8px; animation: tin .5s cubic-bezier(.3, 1.5, .5, 1); transition: opacity .35s, transform .35s; }
.quipc .ico { width: 30px; height: 30px; flex: none; } .quipc span { font-size: var(--fs-body); line-height: 1.45; text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
.bannerc { padding: 8px 20px 9px; text-align: center; font-family: var(--font-title); font-size: var(--fs-title); color: #8a5a14; letter-spacing: .06em; border-color: #e0b04e; animation: bannerin .6s cubic-bezier(.3, 1.5, .5, 1); transition: opacity .35s, transform .35s; text-wrap: balance; overflow-wrap: anywhere; }
.flc { padding: 4px 14px 5px; font-size: var(--fs-small); text-align: center; text-wrap: balance; overflow-wrap: anywhere; animation: tin .4s; transition: opacity .35s, transform .35s; }
#slot .out { opacity: 0; transform: translateY(6px); }
@keyframes tin { from { transform: translateY(8px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bannerin { from { transform: translateY(-10px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- bottom row: contextual sit bar (left/centre) + the paw button (right) ---- */
#bottom { grid-area: 3 / 1 / 4 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-width: 0; pointer-events: none; }
#sitbar { display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
#sitbar:not(:has(button:not([hidden]))) { display: none; }
.stand-pill { pointer-events: auto; height: 38px; padding: 0 16px; border-radius: 19px; font-family: var(--font-title); font-size: var(--fs-btn); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); transition: transform .16s cubic-bezier(.3, 1.7, .5, 1); }
.stand-pill .ico { width: 22px; height: 22px; } .stand-pill.chant { border-color: #e0b04e; background: rgba(252, 226, 170, .8); color: #6a4414; } .stand-pill:active { transform: scale(.92); }
#daze-back { position: absolute; z-index: 9; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); }
#fabbox { margin-left: auto; position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; flex: none; max-height: 100%; }
#fab { pointer-events: auto; width: 44px; height: 44px; border-radius: 22px; padding: 0; display: grid; place-items: center; cursor: pointer; transition: transform .2s cubic-bezier(.3, 1.7, .5, 1), opacity .6s; }
#fab .ico { width: 26px; height: 26px; } #fab:active { transform: scale(.88); } #fab.open { background: rgba(252, 226, 200, .9); }
#hud.idle #fab { opacity: .6; }
#fabmenu { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; border-radius: 18px; pointer-events: none; animation: fabin .3s cubic-bezier(.3, 1.5, .5, 1); transform-origin: 100% 100%; max-height: calc(100vh - 160px); flex-wrap: wrap; align-content: flex-end; }
#fabmenu[hidden] { display: none; }
@keyframes fabin { from { transform: scale(.7) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.fi { pointer-events: auto; position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 8px; height: 38px; min-width: 112px; padding: 0 12px 0 8px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; font-family: var(--font-title); color: var(--ink); transition: transform .16s cubic-bezier(.3, 1.7, .5, 1), background .2s; }
.fi:hover { background: rgba(255, 255, 255, .45); } .fi:active { transform: scale(.94); }
.fi .ico { width: 26px; height: 26px; flex: none; }
.fi .dl { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.fi .dl b, .fi .dl .fl { font-family: var(--font-title); font-weight: 400; font-size: 13px; white-space: nowrap; }
.fi .dl small { font-size: 10px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fi.cool { filter: saturate(.55) opacity(.8); } #btn-dnd.on { background: rgba(196, 184, 238, .55); } #btn-dnd.on .dl small { color: #6d5cb0; }
#hud.z-hall .fi[data-z="court"], #hud.z-court .fi[data-z="hall"] { display: none; }
.fi .o-check { position: absolute; right: 6px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--matcha-d); border: 1.5px solid #fff6e3; opacity: 0; transform: scale(.3); pointer-events: none; z-index: 2; }
.fi .o-check::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.fi .o-check.pop { animation: checkpop 2.4s ease-out forwards; }
.fbtn.quest.alldone small, .alldone small { color: var(--matcha-d); }
/* court hotspots: a small button floats up at the spot when you are close */
.ntag.act { pointer-events: auto; cursor: pointer; height: 30px; padding: 0 12px 0 10px; border-radius: 15px; background: var(--glass-bg); border: 1px solid var(--glass-line); animation: ackpop .35s cubic-bezier(.3, 1.7, .5, 1); }
.ntag.act::before { display: none; } .ntag.act .nt-t { color: var(--ink); font-size: 12.5px; } .ntag.act .nt-bell { width: 12px; height: 12px; }

/* ---- popups share the material ---- */
#menu { padding: 12px 14px 14px; } #menu::after { background: #fdf6e6; border-color: var(--glass-line); border-width: 1px; }
#sound-menu { top: calc(10px + var(--safe-t) + 8px + 44px + 14px); right: calc(22px + var(--safe-r)); padding: 8px; }
#ring .rb { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; }
#hud.ringing #tags { opacity: 0; transition: opacity .2s; }
#ack-btn { height: 36px; padding: 0 14px 0 8px; }

/* ---- art that still applies: bead / deity head / icons / reveal card frame ---- */
.a-bead_on .bead::after { background: var(--img-bead_on) center / contain no-repeat; box-shadow: none; }
.a-bead_off .bead { background: var(--img-bead_off) center / contain no-repeat; box-shadow: none; }
.a-deity_face #deity-face .df-art { background: var(--img-deity_face) center / contain no-repeat; box-shadow: none; inset: 0; border-radius: 0; filter: drop-shadow(0 2px 3px rgba(100, 60, 30, .3)); }
.a-card_frame #rv-card { background: var(--img-card_frame) center / 100% 100% no-repeat; border: 0; box-shadow: none; --rw: min(300px, calc(100vw - 48px), calc((100vh - 24px) * 519 / 768)); width: var(--rw); box-sizing: border-box; aspect-ratio: 519 / 768; padding: calc(var(--rw) * .19) calc(var(--rw) * .13) calc(var(--rw) * .1); --rvs: 1; /* padding in % would resolve against the full-width #reveal, not the card */ display: flex; flex-direction: column; align-items: center; justify-content: center; filter: drop-shadow(0 8px 14px rgba(80, 45, 20, .3)); overflow: hidden; backdrop-filter: none; -webkit-backdrop-filter: none; }
.a-card_frame #rv-cat { max-height: 34%; max-width: 62%; flex: 0 1 auto; min-height: 0; object-fit: contain; }
.a-card_frame #rv-a { font-size: max(12px, calc(clamp(17px, .6vw + 15px, 21px) * var(--rvs))); line-height: 1.3; max-width: 100%; }
.a-card_frame #rv-b { font-size: max(12px, calc(var(--fs-body) * var(--rvs))); line-height: 1.3; max-width: 100%; }
.a-card_frame #rv-c { font-size: max(11px, calc(var(--fs-small) * var(--rvs))); line-height: 1.3; max-width: 100%; }
.a-card_frame #rv-tag { font-size: max(12px, calc(var(--fs-btn) * var(--rvs))); }
.a-card_frame #reveal.rare #rv-card, .a-card_frame #reveal.hero #rv-card { background: var(--img-card_frame) center / 100% 100% no-repeat; box-shadow: none; filter: drop-shadow(0 0 22px rgba(255, 205, 110, .9)) drop-shadow(0 8px 14px rgba(80, 45, 20, .3)); }
.a-icon_incense .ico[data-ico="incense"], .a-icon_bell .ico[data-ico="bell"], .a-icon_koi .ico[data-ico="koi"], .a-icon_fortune .ico[data-ico="fortune"], .a-icon_beads .ico[data-ico="beads"],
.a-icon_paw .ico[data-ico="paw"], .a-icon_blink .ico[data-ico="blink"], .a-icon_quiet .ico[data-ico="quiet"], .a-icon_gate .ico[data-ico="gate"], .a-icon_hall .ico[data-ico="hall"] { background-size: contain; filter: drop-shadow(0 1px 1px rgba(80, 50, 20, .25)); }
.a-icon_incense .ico[data-ico="incense"] { background-image: var(--img-icon_incense); } .a-icon_bell .ico[data-ico="bell"] { background-image: var(--img-icon_bell); }
.a-icon_koi .ico[data-ico="koi"] { background-image: var(--img-icon_koi); } .a-icon_fortune .ico[data-ico="fortune"] { background-image: var(--img-icon_fortune); }
.a-icon_beads .ico[data-ico="beads"] { background-image: var(--img-icon_beads); } .a-icon_paw .ico[data-ico="paw"] { background-image: var(--img-icon_paw); }
.a-icon_blink .ico[data-ico="blink"] { background-image: var(--img-icon_blink); } .a-icon_quiet .ico[data-ico="quiet"] { background-image: var(--img-icon_quiet); }
.a-icon_gate .ico[data-ico="gate"] { background-image: var(--img-icon_gate); } .a-icon_hall .ico[data-ico="hall"] { background-image: var(--img-icon_hall); }
.a-icon_incense .ico[data-ico="incense"] svg, .a-icon_bell .ico[data-ico="bell"] svg, .a-icon_koi .ico[data-ico="koi"] svg, .a-icon_fortune .ico[data-ico="fortune"] svg, .a-icon_beads .ico[data-ico="beads"] svg,
.a-icon_paw .ico[data-ico="paw"] svg, .a-icon_blink .ico[data-ico="blink"] svg, .a-icon_quiet .ico[data-ico="quiet"] svg, .a-icon_gate .ico[data-ico="gate"] svg, .a-icon_hall .ico[data-ico="hall"] svg { display: none; }


/* ---- narrow / short screens ---- */
@media (max-width: 340px) { #pill-merit b { font-size: 14px; } }
@media (orientation: landscape) and (max-height: 540px) { #fabmenu { max-height: calc(100vh - 110px); } .fi { height: 34px; } }

/* ---- paw button: breathing, first-run guide, reminders, badge ---- */
#fab { position: relative; animation: fabbreath 3s ease-in-out infinite; }
#fab.open, #fab:active { animation: none; }
@keyframes fabbreath { 0%, 100% { transform: scale(1); box-shadow: var(--glass-shadow), 0 0 0 0 rgba(255, 214, 120, 0); } 50% { transform: scale(1.06); box-shadow: var(--glass-shadow), 0 0 16px 3px rgba(255, 214, 120, .65); } }
#fab.hop { animation: fabhop .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fabhop { 0% { transform: translateY(0); } 30% { transform: translateY(-9px) scale(1.08); } 55% { transform: translateY(0); } 72% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
#fab-cnt { position: absolute; right: 3px; top: 3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: #ee8f86; color: #fff; font-family: var(--font-title); font-weight: 400; font-size: 9.5px; line-height: 14px; text-align: center; pointer-events: none; }
#fab-cnt[hidden] { display: none; }
#fab .o-check { position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--matcha-d); border: 1.5px solid #fff6e3; opacity: 0; transform: scale(.3); pointer-events: none; }
#fab .o-check::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
#fab .o-check.pop { animation: checkpop 2.4s ease-out forwards; }
#fabhint { align-self: flex-end; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; margin-bottom: 4px; max-width: calc(100% - 64px); border-radius: 18px; font-size: var(--fs-body); opacity: 0; transform: translateX(8px) scale(.94); transition: opacity .5s, transform .5s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; flex: 0 1 auto; min-width: 0; }
#fabhint[hidden] { display: none; } #fabhint.show { opacity: 1; transform: none; }
#fabhint span { min-width: 0; overflow-wrap: anywhere; text-wrap: balance; } #fabhint .ico { width: 20px; height: 20px; flex: none; animation: pawpoke 1.1s ease-in-out infinite; }
@keyframes pawpoke { 0%, 100% { transform: translateX(0) rotate(-14deg); } 50% { transform: translateX(4px) rotate(-14deg); } }
.fi .qdot { position: absolute; right: 8px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ee8f86; box-shadow: 0 0 0 1.5px rgba(255, 250, 240, .9); pointer-events: none; }
#fabrow { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; max-width: calc(100vw - 24px); pointer-events: none; }
#fabhint { margin-bottom: 0; align-self: center; }
#fabhint { max-width: none; } #fabhint span { white-space: nowrap; }
@media (max-width: 330px) { #fabhint span { white-space: normal; } }
#fabmenu { position: absolute; right: 0; bottom: calc(100% + 12px); max-height: calc(100vh - 130px - var(--safe-t) - var(--safe-b)); }
#fabmenu { flex-wrap: nowrap; overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 540px) { #fabmenu { gap: 8px; padding: 6px; max-height: calc(100vh - 100px); } .fi { height: 29px; min-width: 100px; } .fi .dl small { display: none; } .fi .ico { width: 22px; height: 22px; } .fi .o-check, .fi .qdot { top: 4px; } }

/* ---- mountain fog (connection stutter): idle video over the game, HUD keeps only the bell ---- */
#fog { position: fixed; inset: 0; z-index: 1; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; background: #d9cdb8; overflow: hidden; }
#fog.on { opacity: 1; pointer-events: auto; }
#fog[hidden] { display: none; }
#fog .fog-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s linear; }
#fog .fog-v.live { opacity: 1; }
#fog .fog-still { position: absolute; inset: -4%; background: var(--still, none) 50% 40% / cover no-repeat; opacity: 1; animation: kenburns 22s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-1.2%, -.8%); } }
#fog-note { position: absolute; left: 50%; bottom: calc(18% + var(--safe-b)); transform: translateX(-50%); padding: 8px 20px 9px; font-size: var(--fs-body); max-width: calc(100% - 48px); text-align: center; text-wrap: balance; }
#hud.fogged > *:not(#btn-sound) { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s; }
#hud.fogged > #btn-sound { position: relative; z-index: 3; }
#queue-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
#queue { overflow: hidden; }
#hud { z-index: 2; }
#fog .fog-v { transition: opacity 1.5s linear; } #fog .fog-v.top { z-index: 2; }
#fog-note { z-index: 3; }
.ntag.chant { height: 18px; padding: 0 8px; border-radius: 9px; background: rgba(255, 250, 240, .86); border: 1px solid rgba(240, 170, 160, .8); } .ntag.chant::before, .ntag.chant .nt-bell { display: none; } .ntag.chant .nt-t { font-size: 11px; color: #c0605a; line-height: 16px; padding: 0; }

/* ---- 云顶小花园 ---- */
#vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.1s ease; background: radial-gradient(ellipse at 50% 52%, rgba(255, 190, 210, 0) 52%, rgba(255, 176, 202, .32) 82%, rgba(255, 160, 192, .5) 100%); }
#vig.on { opacity: 1; }
#gaze-bar { position: absolute; z-index: 9; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 12px; pointer-events: none; }
#gaze-bar[hidden] { display: none; } #gaze-bar .stand-pill { pointer-events: auto; }
#hud.gazing > *:not(#gaze-bar):not(#game):not(#vig) { opacity: 0 !important; pointer-events: none !important; transition: opacity .8s; }
#hud.z-cloud .fi[data-z="hall"] { display: none; }
.ntag.long { height: auto; max-width: min(250px, calc(100vw - 40px)); padding: 6px 12px 7px; flex-direction: column; align-items: center; gap: 5px; border-radius: 12px; }
.ntag.long::before, .ntag.long .nt-bell { display: none; }
.ntag.long .nt-t { white-space: normal; overflow: visible; text-align: center; text-wrap: balance; overflow-wrap: anywhere; line-height: 1.3; }
.nt-prog { display: flex; gap: 3px; justify-content: center; } .nt-prog i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 243, 212, .35); box-shadow: inset 0 0 0 1px rgba(255, 243, 212, .7); } .nt-prog i.on { background: #ffe08a; box-shadow: 0 0 4px #ffd36a; }
.ntag .nt-cloud { flex: none; width: 16px; height: 11px; margin-left: -1px; background: radial-gradient(circle at 28% 62%, #fff 0 36%, transparent 38%), radial-gradient(circle at 52% 42%, #fff 0 42%, transparent 44%), radial-gradient(circle at 76% 64%, #fff 0 34%, transparent 36%); filter: drop-shadow(0 0 1.5px #86a9e0) drop-shadow(0 0 1px #86a9e0); }

/* ---- 公共香炉: wish picker + wish card ---- */
#incpick, #incwish { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; pointer-events: auto; background: rgba(70,40,24,.42); animation: tin .3s; }
#incpick[hidden], #incwish[hidden] { display: none; }
#inc-card { width: min(340px, calc(100vw - 36px)); max-height: calc(100vh - 24px); overflow: auto; padding: 18px 18px 18px; }
#inc-t, #iw-t { font-family: var(--font-title); font-size: var(--fs-title); letter-spacing: .16em; text-indent: .16em; color: var(--ink); text-align: center; overflow-wrap: anywhere; }
#inc-s { font-size: var(--fs-small); color: var(--ink-2); margin: 2px 0 12px; text-align: center; }
#inc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.slip { pointer-events: auto; min-height: 54px; padding: 6px 8px; border-radius: 12px; border: 2px solid #ecd49a; border-left: 6px solid #f2a99a; background: linear-gradient(180deg, #fffdf4, #fbf0d4); font: inherit; font-size: var(--fs-small); color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; min-width: 0; cursor: pointer; }
.slip:active { transform: scale(.95); }
#inc-no { display: flex; margin: 0 auto; min-width: 120px; }
@media (max-height: 460px) { #inc-card { width: min(640px, calc(100vw - 36px)); } #inc-list { grid-template-columns: 1fr 1fr 1fr 1fr; } .slip { min-height: 44px; } }
#iw-card { width: min(320px, calc(100vw - 40px)); padding: 20px 20px 18px; }
#iw-w { margin: 12px 0 10px; padding: 14px 12px; border-radius: 14px; background: linear-gradient(180deg, #fffdf4, #fbf0d4); border: 2px solid #ecd49a; font-size: var(--fs-body); color: var(--ink); text-align: center; overflow-wrap: anywhere; }
#iw-h { display: flex; justify-content: center; gap: 4px; margin: 0 0 12px; min-height: 16px; }
#iw-h[hidden] { display: none; }
#iw-h i { width: 14px; height: 13px; background: radial-gradient(circle at 30% 30%, #ff9db0, #f06f8c); clip-path: path('M7 13 C-4 5 2 -2 7 3 C12 -2 18 5 7 13Z'); }
#iw-like[hidden] { display: none; } #iw-like:disabled { opacity: .55; }

/* dev only (?debug=1): keep the debug readout out of the HUD grid (it used to claim column 1 and squeeze the notice slot to a vertical sliver) */
#debug { position: absolute; left: 8px; bottom: 6px; z-index: 9; font: 10px/1.3 ui-monospace, monospace; color: #fff; text-shadow: 0 1px 2px #000; white-space: pre; pointer-events: none; }

/* modal cards (incense pick / wish card / quests / fortune / pet ask) own the screen: the world name plates must not show through them */
#hud.busy #tags { visibility: hidden; }

/* ---- way-finding: small edge pill while the door is off screen (only until the first door is used) ---- */
#navpill { position: absolute; z-index: 6; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translate(-50%, 10px); display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px 0 12px; border-radius: 17px; font-family: var(--font-title); font-size: 14px; color: var(--ink); opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s cubic-bezier(.3, 1.5, .5, 1); border: 0; }
#navpill.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
#navpill .np-a { width: 9px; height: 9px; border: solid #b9852a; border-width: 0 3px 3px 0; border-radius: 1px; transform: rotate(45deg) translate(-2px, -2px); animation: npbob 1s ease-in-out infinite; flex: none; }
#navpill.up .np-a { transform: rotate(-135deg) translate(-2px, -2px); animation-name: npbobu; }
#navpill span { white-space: nowrap; }
@keyframes npbob { 0%, 100% { transform: rotate(45deg) translate(-2px, -2px); } 50% { transform: rotate(45deg) translate(1px, 1px); } }
@keyframes npbobu { 0%, 100% { transform: rotate(-135deg) translate(-2px, -2px); } 50% { transform: rotate(-135deg) translate(1px, 1px); } }
/* short landscape: the menu may now hold two extra "去哪儿" rows, so it scrolls before it reaches the sound button */
@media (max-height: 540px) { #fabmenu { max-height: calc(100vh - 152px - var(--safe-t) - var(--safe-b)); } }

/* short landscape: the framed card is only ~230px wide, so drop the portrait and keep the text readable */
@media (max-height: 520px) { .a-card_frame #rv-cat { display: none; } }

/* deity wake: full-screen video, HUD fades out (bell button + notice slot stay) */
#wakecover { position: fixed; inset: 0; z-index: 0; background: #2a1d14; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
#wakecover.on { opacity: 1; } #wakecover:not(.on) { transition-duration: .8s; }
#wakecover[hidden] { display: none; }
#wakecover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
#hud.waking > *:not(#btn-sound):not(#topc) { opacity: 0 !important; pointer-events: none !important; transition: opacity .6s; }

/* wide screens (desktop landscape / tablets): bigger corner controls; phones keep the compact sizes */
@media (min-width: 1024px), (min-width: 700px) and (min-height: 700px) {
  #fab { width: 62px; height: 62px; border-radius: 31px; } #fab .ico { width: 36px; height: 36px; }
  #fab-cnt { right: 5px; top: 5px; min-width: 18px; height: 18px; border-radius: 9px; font-size: 12px; line-height: 18px; }
  #fab .o-check { width: 20px; height: 20px; left: 3px; top: 3px; }
  #btn-sound { width: 46px; height: 46px; border-radius: 23px; } #btn-sound .ico { width: 28px; height: 28px; }
  #btn-sound.off::after { left: 11px; right: 11px; top: 21.5px; }
  #pill-merit { height: 36px; padding: 0 14px 0 5px; border-radius: 18px; gap: 7px; } #pill-merit .paw-badge { width: 28px; height: 28px; padding: 5px; }
  #pill-merit b { font-size: 19px; } #pill-merit .bless { font-size: 12px; } #pill-merit .bless b { font-size: 14px; } #pill-merit .bless .feather { width: 12px; height: 12px; }
  #sound-menu { top: calc(10px + var(--safe-t) + 46px + 12px); }
  #fabrow { gap: 14px; } #fabhint { padding: 8px 10px 8px 16px; font-size: 15px; } #fabhint .ico { width: 24px; height: 24px; }
  #fabmenu { bottom: calc(100% + 14px); }
}

/* garden buttons (dance / tai chi): the plush icon sits inside a normal stand pill */
.gpill .gi { width: 22px; height: 26px; object-fit: contain; flex: none; } .gpill span { min-width: 0; white-space: nowrap; }

/* short landscape: the paw menu now holds up to three "去哪儿" rows, so it lays out in two columns instead of scrolling */
@media (orientation: landscape) and (max-height: 540px) { #fabmenu { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: stretch; } #fabmenu[hidden] { display: none; } }

/* Cloud sea, flowering wood and soft linen. */
@font-face{font-family:"Dojo Serif";src:url("/assets/fonts/dojo-title-serif.ttf?v=brand-1") format("truetype");font-style:normal;font-weight:500;font-display:swap}
:root{--ink:#655866;--ink-2:#948391;--paper:#fffaf9;--paper-2:#f7edf1;--paper-edge:#ead4dc;--matcha:#9fb8b1;--matcha-d:#759d93;--peach:#e8b3c1;--peach-d:#cc8fa5;--fs-body:16px;--fs-small:14px;--font-body:"Yuanti SC","PingFang SC","Microsoft YaHei",sans-serif}
html,body{background:#e8f3fa;font-size:16px}
#title{background:#e3f1fb}
#key{object-position:50% 50%}
#title::after{height:52%;background:linear-gradient(transparent,rgba(71,64,70,.17))}
#title-box{top:max(8vh,45px);left:50%;width:min(94vw,720px);text-align:center;pointer-events:none;padding:18px 12px 24px;isolation:isolate}
#title-box::before{content:"";position:absolute;inset:-22px -18px;z-index:-1;background:radial-gradient(ellipse at center,rgba(255,253,250,.88) 0%,rgba(255,253,250,.68) 42%,rgba(255,253,250,.24) 65%,transparent 78%);filter:blur(10px);pointer-events:none}
#title-box h1{font-family:"Dojo Serif","Songti SC","STSong",serif;color:#2f4b60;font-size:clamp(54px,7vw,94px);font-weight:500;line-height:1.35;letter-spacing:.2em;text-shadow:0 1px 0 rgba(255,255,255,.7);margin:10px -.2em 0 0}
.cover-kicker{font-family:"PingFang SC","Microsoft YaHei",sans-serif;font-size:14px;letter-spacing:.32em;color:#385267;margin:0;text-shadow:0 1px 6px #fffd;font-weight:500}
.cover-caption{font-family:"PingFang SC","Microsoft YaHei",sans-serif;font-size:16px;font-weight:500;color:#385267;letter-spacing:.12em;text-shadow:0 1px 6px #fffd;margin:18px 0 0}
#enter-wrap{left:0;right:0;bottom:7vh;width:auto;gap:16px;align-items:center;padding:0 20px}
.enter{background:linear-gradient(#ac5a77,#91455f)!important;color:#fffdf9!important;border:2px solid #fff4f4!important;text-shadow:none!important;box-shadow:0 7px 24px #7b405b45,inset 0 1px #ffffff40!important;border-radius:999px!important;font-size:23px;letter-spacing:.2em;min-height:60px;min-width:235px}
.enter .o-loop,.enter .o-tassel{display:none!important}
.enter::before{display:none}
.enter #enter-t{font-family:"Dojo Serif","Songti SC","STSong",serif;font-weight:500;font-size:24px;line-height:1.4;letter-spacing:.18em;text-indent:.18em;color:#fffdf9;text-shadow:none}
#mode-pick{background:#fffaf5ed;border:1px solid #fffaf5;box-shadow:0 4px 20px #7b68752b;padding:5px}
.mpick{font-family:"PingFang SC","Microsoft YaHei",sans-serif;font-weight:500;font-size:14px;min-height:36px;color:#665262}.mpick.on{background:#4d7568!important;color:#fffef9;border-color:#d3e1d8;text-shadow:none;box-shadow:0 2px 7px #305e4b33}
.glass{background:rgba(255,252,253,.88)!important;border-color:rgba(255,255,255,.92)!important;box-shadow:0 4px 20px rgba(99,76,99,.13),inset 0 1px #fff!important;color:#705e6b!important}
#pill-merit{gap:5px;padding-right:14px;min-width:100px}#l-merit{display:inline!important;font-size:14px;opacity:.8}#merit{font-size:19px}
#quick-bell{position:absolute;left:calc(18px + var(--safe-l));bottom:calc(22px + var(--safe-b));z-index:4;pointer-events:auto;display:flex;align-items:center;gap:6px;border:1.5px solid #fff;border-radius:999px;padding:11px 15px;min-height:48px;cursor:pointer;font-size:16px;font-family:var(--font-body);transition:transform .2s}
#quick-bell svg{width:25px;height:25px;color:#a98558}#quick-bell:active{transform:scale(.94)}
#sitbar{padding-left:125px}#titlebox #place{color:#5f6e7f;text-shadow:0 1px 5px #fff,0 1px 10px #fffd}#titlebox #monkhud{font-size:14px;color:#61758b;text-shadow:0 1px 5px #fff}
#beadbar{border-radius:24px}.feather{filter:hue-rotate(15deg)}
.fi{font-size:16px}.fi .dl small{font-size:14px}.toast,.signc,.quipc,.bannerc{font-size:16px!important}.ntag .nt-t{font-size:14px}
#fabmenu{border-radius:24px}#incpick .card{border-color:#f0d9e0}.slip{font-size:16px!important}#inc-s{font-size:16px}
#beadbar #bb-label{font-size:14px}#btn-chant .ico{display:none}
.fbtn[data-act="incense"] .ico{background:none!important}.fbtn[data-act="incense"] .ico>*{display:none}.fbtn[data-act="incense"] .ico::after{content:'♡';font-size:28px;line-height:32px;color:#bd8fa6}
#btn-beads .ico>*{display:none}#btn-beads .ico::after{content:'◌';font-size:30px;line-height:32px;color:#829fae}
@media(orientation:portrait){#title-box{top:10vh}#title-box h1{font-size:clamp(46px,11.5vw,66px)}.cover-caption{font-size:16px;margin-top:14px}.cover-kicker{font-size:14px}#key{object-position:50% 50%}#enter-wrap{bottom:7vh}#sitbar{padding-left:110px}#quick-bell{left:12px;bottom:18px;padding:10px 12px;font-size:14px}}
@media(max-height:500px) and (orientation:landscape){#title-box{top:5vh;left:50%;width:70vw}#title-box h1{font-size:56px}.cover-kicker{font-size:13px}.cover-caption{margin-top:6px;font-size:14px}#enter-wrap{bottom:4vh;gap:7px}.enter{min-height:48px;font-size:20px}#mode-pick{padding:3px}.mpick{min-height:30px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Two balanced lines for the longer new name. */
#title-box h1{white-space:pre-line;font-size:clamp(42px,6vw,76px);line-height:1.3;letter-spacing:.08em;margin-right:-.08em}
@media(orientation:portrait){#title-box h1{font-size:clamp(38px,10.5vw,56px)}}
@media(max-height:500px) and (orientation:landscape){#title-box h1{font-size:40px;line-height:1.15;margin-top:6px;margin-bottom:4px}}
/* Share sits below sound, away from movement and the paw menu. */
#copy-share{position:fixed;z-index:120;right:12px;top:calc(55px + env(safe-area-inset-top,0px));height:34px;display:flex;align-items:center;gap:5px;padding:0 11px;border-radius:18px;font-size:13px;color:#5b3f30;cursor:pointer;border:1px solid rgba(214,170,80,.62);background:rgba(255,250,240,.85);box-shadow:0 4px 12px #68422622}#copy-share svg{width:17px;height:17px}#share-feedback{position:fixed;z-index:16000;left:50%;top:calc(105px + env(safe-area-inset-top,0px));transform:translateX(-50%);width:max-content;max-width:calc(100vw - 36px);padding:12px 16px;border-radius:16px;background:#365e55;color:#fffaf1;font-size:14px;line-height:1.6;text-align:center;box-shadow:0 5px 20px #243e4333}
#donation-button{position:fixed;z-index:120;left:12px;right:auto;top:calc(96px + env(safe-area-inset-top,0px));height:34px;padding:0 13px;border-radius:18px;border:1px solid #c7ac89;background:rgba(255,246,232,.9);box-shadow:0 4px 12px #68422622;font-size:13px;color:#8a6247;cursor:pointer}#donation-button:disabled{opacity:.6}#donation-overlay{position:fixed;inset:0;z-index:18000;display:flex;align-items:center;justify-content:center;background:rgba(36,53,49,.46);padding:20px}#donation-dialog{position:relative;max-width:380px;width:100%;max-height:90vh;overflow:auto;background:#fffaf1;border:2px solid #fff;border-radius:25px;padding:34px 28px 28px;text-align:center;box-shadow:0 20px 70px #233e4340;color:#4e6254}#donation-close{position:absolute;right:8px;top:5px;width:36px;height:36px;padding:0;border:0;background:none;color:#8e9c8a;font-size:28px;cursor:pointer}#donation-heading{font-family:var(--font-body);font-size:23px;line-height:1.45;color:#805c62;margin:4px 0 16px}#donation-description{font-size:15px;line-height:1.9;white-space:pre-wrap;margin:0 0 20px}#donation-image{display:block;width:100%;height:260px;object-fit:contain;background:#fff;border-radius:12px;padding:10px;margin:0 auto 18px}#donation-dialog small{display:block;font-size:12px;color:#9b9d8b;line-height:1.8}#donation-image-error{font-size:14px;color:#a86863;padding:28px 0}@media(max-height:540px){#donation-dialog{padding:22px;max-width:470px}#donation-description{margin-bottom:10px;font-size:13px}#donation-image{height:180px;margin-bottom:8px}#donation-heading{font-size:20px;margin-bottom:8px}}

@font-face{font-family:'Cat Arabic';src:url('/assets/fonts/i18n/Arabic.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Cat Bengali';src:url('/assets/fonts/i18n/Bengali.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Cat Devanagari';src:url('/assets/fonts/i18n/Devanagari.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Cat Tamil';src:url('/assets/fonts/i18n/Tamil.ttf') format('truetype');font-display:swap}
@font-face{font-family:'Cat Thai';src:url('/assets/fonts/i18n/Thai.ttf') format('truetype');font-display:swap}
.locale-international body,.locale-international button,.locale-international select,.locale-international #title-box h1,.locale-international .cover-kicker,.locale-international .cover-caption,.locale-international #enter-t,.locale-international .mpick{font-family:var(--locale-font)!important}
.locale-international #title-box h1{font-size:clamp(34px,5.8vw,76px);line-height:1.35;font-weight:600;letter-spacing:0;margin-inline:0;overflow-wrap:normal;text-wrap:balance}
.locale-international #title-box{max-width:min(92vw,940px);width:92vw}
.locale-international .cover-kicker,.locale-international .cover-caption,.locale-international #enter-t,.locale-international #place,.locale-international .signc .st,.locale-international #inc-t{letter-spacing:normal;text-indent:0}
.locale-international .cover-kicker{font-size:clamp(12px,2.6vw,16px);line-height:1.6}
.locale-international .cover-caption{line-height:1.6;font-size:clamp(13px,3vw,18px)}
.locale-international #enter-t{font-size:clamp(16px,3.6vw,23px);white-space:normal;text-align:center}
.locale-international .enter{min-width:220px;max-width:90vw;width:auto;padding-inline:25px}
.locale-international #place{font-size:16px}
.locale-international .nt-t{font-size:12px;letter-spacing:0;unicode-bidi:plaintext}
.locale-international .nt{max-width:240px}
.locale-international .fi .dl b,.locale-international .fi .dl .fl{white-space:normal;line-height:1.3}
.locale-international .fi{height:auto;min-height:40px;max-width:255px;padding-block:5px}
.locale-international .btn{white-space:normal;line-height:1.45;height:auto;min-height:40px;padding-block:8px}
.locale-international .stand-pill{height:auto;min-height:40px;line-height:1.3;white-space:normal;max-width:200px;text-align:center;padding-block:7px}
.locale-international #sitbar{flex-wrap:wrap;padding-inline:10px;gap:5px;max-width:calc(100vw - 120px);margin-inline:auto;padding-bottom:58px}
.locale-horizontal #fo-cols{writing-mode:horizontal-tb;text-align:center;line-height:1.7;width:100%;max-height:100%;font-family:var(--locale-font)}
.locale-horizontal #fo-cols .fl,.locale-horizontal #fo-cols.one .fl{white-space:normal;overflow-wrap:normal;word-break:normal;text-wrap:balance;letter-spacing:0;margin:0}
.locale-horizontal #si-hint{writing-mode:horizontal-tb}
.locale-international #rv-a,.locale-international #rv-b,.locale-international #rv-c{line-height:1.6;overflow-wrap:normal;text-wrap:balance}
.locale-international #q-sub,.locale-international #inc-s{line-height:1.6;text-wrap:balance}
#language-control{position:fixed;inset-inline-start:12px;top:calc(12px + env(safe-area-inset-top,0px));z-index:140;display:flex;align-items:center;gap:4px;max-width:170px;min-height:34px;padding:0 8px;border:1px solid #ffffffc9;border-radius:18px;color:#3d625b;background:#fffaf0dc;box-shadow:0 3px 12px #335c6020;pointer-events:auto}
#language-select{font-family:var(--locale-font,system-ui);max-width:135px;font-size:12px;background:transparent;color:inherit;border:0;min-height:34px;cursor:pointer;outline-offset:2px}
#language-select option{background:white;color:#294c46}
html[dir=rtl] #copy-share{right:auto;left:12px}
html[dir=rtl] #btn-sound{right:auto;left:12px}
html[dir=rtl] .row,html[dir=rtl] #mode-pick{direction:rtl}
html[dir=rtl] #donation-button{left:auto;right:12px}
html[dir=rtl] .nt,html[dir=rtl] #tags{direction:rtl}
html[dir=rtl] #fo-cols,html[dir=rtl] .signc,html[dir=rtl] .toast{direction:rtl;unicode-bidi:plaintext}
#locale-error{position:fixed;inset:20%;z-index:20000;background:#fffaf1;color:#385267;border-radius:25px;padding:30px;display:grid;place-content:center;text-align:center;box-shadow:0 10px 60px #26423a44;font:18px/1.6 system-ui}
#locale-error button{padding:12px;border:1px solid #8caea2;border-radius:20px;color:#385267;background:#edf8ee;cursor:pointer}
@media(max-width:480px){.locale-international #title-box{top:14vh}.locale-international #title-box h1{font-size:clamp(29px,8.4vw,44px)}.locale-international .cover-kicker{font-size:12px}.locale-international #sitbar{padding-bottom:64px}.locale-international .stand-pill{max-width:145px;font-size:12px}.locale-international #quick-bell{max-width:165px;font-size:12px}.locale-international #topc{max-width:calc(100vw - 100px)}#language-control{max-width:155px}#language-select{max-width:120px}}
@media(max-height:540px){.locale-international #title-box{top:4vh}.locale-international #title-box h1{font-size:32px}.locale-international .cover-caption{margin-top:8px}.locale-international #sitbar{padding-bottom:38px}}
.locale-international #titlebox #place{letter-spacing:0;text-indent:0;max-width:100%;font-size:clamp(12px,3.5vw,17px)}
.in-garden #language-control{top:auto;bottom:calc(78px + env(safe-area-inset-bottom,0px));width:36px;height:36px;min-height:36px;padding:0;justify-content:center;border-radius:50%}
.in-garden #language-select{position:absolute;inset:0;width:100%;height:100%;max-width:none;opacity:0;font-size:14px}
.in-garden #language-control span{display:flex;align-items:center;justify-content:center}
#language-select option{font-size:14px}
.in-garden #copy-share{top:auto;bottom:calc(78px + env(safe-area-inset-bottom,0px))}
.in-garden:has(#fabmenu:not([hidden])) #copy-share{visibility:hidden}
.in-garden #sound-menu{max-width:calc(100vw - 30px)}
/* Arabic-script fonts need more ascent/descent room than the original compact CJK badges. */
html[dir=rtl] #pill-merit{height:auto;min-height:38px;padding-block:4px}
html[dir=rtl] #pill-merit b,html[dir=rtl] #pill-merit .lbl{line-height:1.9}
html[dir=rtl] #titlebox{min-height:38px;line-height:1.9}
html[dir=rtl] .ntag{height:auto;min-height:28px;padding-block:1px}
html[dir=rtl] .ntag .nt-t{line-height:1.9;padding-block:2px;overflow:visible}
