/* Xiaoyu's Kingdom, the playable town. Red lacquer, gold trim, night ink and paper, like the videos. */
:root {
    --night: #140c0b;
    --lacquer: #1f1210;
    --lacquer-2: #2a1813;
    --panel: rgba(28, 16, 14, .93);
    --line: rgba(255, 211, 106, .22);
    --line-soft: rgba(255, 243, 214, .1);
    --ink: #f6ecdc;
    --ink-soft: #c2ad96;
    --seal: #e2583d;
    --seal-deep: #a8261a;
    --gold: #dcb35e;
    --gold-hi: #ffd36a;
    --wood: #3a2016;
    --paper: #f3e6cc;
    --display: "Young Serif", Georgia, serif;
    --brush: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
    --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: max(10px, env(safe-area-inset-top));
    --trim: 0 0 0 1px var(--line), inset 0 0 0 3px var(--lacquer), inset 0 0 0 4px rgba(255, 211, 106, .12);
    --lift: 0 14px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); font: 15px/1.5 var(--body); overflow: hidden; -webkit-tap-highlight-color: transparent }
button { font: inherit; color: inherit; cursor: pointer }
button:disabled { cursor: default }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px }
[hidden] { display: none !important }
.ico { width: 1.25em; height: 1.25em; display: block; flex: none }
.ico.mini { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: var(--seal) }
[data-icon] { display: inline-grid; place-items: center }

#app { position: fixed; inset: 0 }
#stage { position: absolute; inset: 0; touch-action: none }
.stage-canvas { display: block; width: 100%; height: 100%; touch-action: none }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 25 }

/* panels share one lacquer look */
.sheet, .card, .dialog, .hud, .bubble-x { background: var(--panel); box-shadow: var(--trim), var(--lift) }

/* ---------- top bar ---------- */
header.top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: var(--safe-t) 16px 18px; pointer-events: none; background: linear-gradient(180deg, rgba(14, 6, 6, .72), rgba(14, 6, 6, 0)) }
header.top > * { pointer-events: auto }
.brand { display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6) }
.seal { width: 40px; height: 40px; display: grid; place-items: center; background: var(--seal-deep); color: #fff1d6; font: 28px/1 var(--brush);
    border-radius: 7px; box-shadow: inset 0 0 0 2px rgba(255, 220, 180, .35), 0 3px 10px rgba(0, 0, 0, .4); transform: rotate(-4deg); text-shadow: none }
.brand-text { display: grid; line-height: 1.15 }
.brand .en { font-family: var(--display); font-size: 19px }
.brand .pop { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums }
.brand .pop b { color: var(--gold-hi); font-weight: 600 }
.top-actions { display: flex; gap: 8px; align-items: center }
.seg { display: inline-flex; background: var(--panel); box-shadow: 0 0 0 1px var(--line); border-radius: 999px; padding: 3px }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink-soft); min-height: 34px; transition: background .2s, color .2s }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1813 }
.seg.wide { display: flex; width: 100% }
.seg.wide button { flex: 1 }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; background: var(--panel); border: 0; box-shadow: 0 0 0 1px var(--line) }

/* ---------- HUD ---------- */
.hud { position: absolute; top: calc(var(--safe-t) + 54px); left: 16px; display: flex; align-items: center; gap: 4px; border-radius: 14px; padding: 6px 10px 6px 6px; max-width: calc(100% - 32px) }
.hud-me { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px; text-align: left; border-radius: 10px }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 22px/1 var(--brush); color: #fff1d6;
    background: radial-gradient(circle at 35% 30%, #e9603f, var(--seal-deep)); box-shadow: inset 0 0 0 2px rgba(255, 211, 106, .7), 0 2px 8px rgba(0, 0, 0, .4) }
.hud.guest .avatar { background: radial-gradient(circle at 35% 30%, #5a4036, #2a1813); color: var(--gold-hi); font: 700 18px var(--body); animation: nudge 2.4s ease-in-out infinite }
@keyframes nudge { 0%, 70%, 100% { transform: none } 80% { transform: rotate(-8deg) } 90% { transform: rotate(8deg) } }
.hud-id { display: grid; gap: 1px; min-width: 112px }
.hud-who { font: 600 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px }
.hud-rank { font-size: 12px; color: var(--gold-hi); display: flex; gap: 6px; align-items: baseline }
.hud-honour { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 11px }
.hud-track { height: 5px; background: rgba(255, 255, 255, .09); border-radius: 3px; overflow: hidden; margin-top: 3px }
.hud-bar { display: block; height: 100%; background: linear-gradient(90deg, var(--seal), var(--gold-hi)); width: 3%; transition: width .8s cubic-bezier(.2, .9, .3, 1.2); border-radius: 3px }
.hud.guest .hud-who { color: var(--gold-hi) }
.hud.guest .hud-rank { color: var(--ink-soft) }
.hud-stat { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); margin-left: 4px }
.hud-stat b { font-weight: 700; min-width: 1ch }
.hud-stat .ico { width: 20px; height: 20px }
.hud-stat.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes bump { 40% { transform: scale(1.25) } }

/* ---------- Xiaoyu and her bubble ---------- */
.xiaoyu { position: absolute; right: 16px; bottom: calc(112px + var(--safe-b)); width: 66px; height: 66px; padding: 0; border-radius: 50%;
    border: 0; background: var(--night); box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .5); transition: transform .15s; z-index: 6 }
.xiaoyu:active { transform: scale(.92) rotate(-4deg) }
.xiaoyu img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50% }
.xiaoyu-name { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); background: var(--seal-deep); color: #fff1d6; font: 700 10px var(--body);
    letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(255, 211, 106, .5) }
.xiaoyu.talking { animation: talk .5s ease-in-out infinite alternate }
@keyframes talk { to { transform: scale(1.05) } }
.bubble { position: absolute; right: 94px; bottom: calc(122px + var(--safe-b)); max-width: min(300px, calc(100% - 120px)); z-index: 6;
    background: var(--paper); color: #2a1813; border-radius: 16px 16px 4px 16px; padding: 10px 14px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(168, 38, 26, .18); font-size: 15px; line-height: 1.4 }
.bubble .who { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--seal-deep); font-weight: 700; margin-bottom: 1px }
.bubble.pop { animation: pop .3s cubic-bezier(.3, 1.5, .5, 1) }
@keyframes pop { from { transform: translateY(10px) scale(.9); opacity: 0 } }

/* ---------- labels over houses ---------- */
.label { position: absolute; left: 0; top: 0; pointer-events: none; font: 600 13px var(--mono); color: #f4cf72; background: linear-gradient(180deg, #4a2a1a, var(--wood));
    border: 1px solid #a8261a; outline: 1px solid rgba(255, 211, 106, .35); border-radius: 3px; padding: 3px 9px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); will-change: transform; z-index: 3 }
.label::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: #a8261a }
.label.mine { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1813; border-color: #fff3d6 }
.label.mine::after { border-top-color: var(--gold) }

/* ---------- sheet: tabs and panes ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 5;
    border-radius: 18px 18px 0 0; padding: 0 16px calc(12px + var(--safe-b)); max-height: 64vh; display: flex; flex-direction: column; transition: max-height .3s cubic-bezier(.2, .8, .2, 1) }
.sheet.collapsed { max-height: calc(96px + var(--safe-b)) }
.sheet.collapsed .pane { display: none }
.grip { border: 0; background: none; display: grid; place-items: center; height: 28px; margin: 0 auto; width: 90px; flex: none }
.grip span { width: 42px; height: 4px; border-radius: 2px; background: rgba(255, 211, 106, .35) }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; flex: none }
.tabs button { position: relative; flex: 1; border: 0; background: none; padding: 6px 4px 7px; border-radius: 10px; font-weight: 600; font-size: 12px; color: var(--ink-soft);
    min-height: 54px; display: grid; justify-items: center; gap: 2px; transition: background .2s, color .2s; --tab-cut: #1f1210 }
.tabs button .ico { width: 22px; height: 22px }
.tabs button[aria-selected="true"] { color: var(--gold-hi); background: linear-gradient(180deg, rgba(255, 211, 106, .14), rgba(255, 211, 106, .04)); box-shadow: inset 0 0 0 1px var(--line) }
.dot-badge { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--seal); box-shadow: 0 0 0 2px var(--lacquer); animation: pulse 1.6s infinite }
@keyframes pulse { 50% { transform: scale(1.3) } }
.pane { overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 6px; display: grid; gap: 10px; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255, 211, 106, .3) transparent }
.pane h2 { margin: 8px 0 0; font: 400 19px var(--display); display: flex; align-items: center; gap: 9px }
.pane h2 .small-note { margin-left: auto }
.pane h3 { margin: 6px 0 0; font: 700 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold) }
.h-seal { width: 26px; height: 26px; display: inline-grid; place-items: center; flex: none; background: var(--seal-deep); color: #fff1d6; border-radius: 5px; font: 18px/1 var(--brush); transform: rotate(-4deg); box-shadow: inset 0 0 0 1.5px rgba(255, 220, 180, .35) }
.small-note { font: 500 12px var(--body); color: var(--ink-soft) }
.lbl { font-weight: 600; font-size: 13px; color: var(--ink-soft); margin: 4px 0 0 }
.note { margin: 0; color: var(--ink-soft); font-size: 13px }
.note.demo, .demo-flag { color: #e9b98a; font-size: 12px }
.demo-flag { margin: 0; border: 1px dashed rgba(233, 185, 138, .45); padding: 6px 9px; border-radius: 6px }
.gain-txt { color: var(--gold-hi); font-weight: 600 }
.search-wrap { position: relative }
.search-wrap [data-icon] { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gold); pointer-events: none }
input[type=search], input[type=text] { width: 100%; font: 600 16px var(--mono); padding: 12px 14px; border-radius: 10px; border: 0; background: rgba(0, 0, 0, .35); color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 6px rgba(0, 0, 0, .35) }
.search-wrap input { padding-left: 42px }
input::placeholder { color: rgba(194, 173, 150, .6) }
.row { display: flex; gap: 8px; flex-wrap: wrap }
.results, .deeds, .shop, .log, .ladder, .days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.results button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: rgba(255, 243, 214, .045); box-shadow: inset 0 0 0 1px var(--line-soft); border-radius: 10px; padding: 7px 10px; min-height: 52px }
.results button:hover, .deeds button:hover { background: rgba(255, 211, 106, .08) }
.results img { width: 40px; height: 40px; flex: none }
.r-text { display: grid; min-width: 0 }
.r-name { font: 600 14px var(--mono); color: #fff3d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.r-name mark { background: none; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px }
.r-addr { display: block; font-size: 12px; color: var(--ink-soft) }
.districts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px }
.district { border: 0; background: rgba(255, 243, 214, .04); box-shadow: inset 0 0 0 1px var(--line-soft); border-radius: 10px; padding: 4px 4px 7px; display: grid; justify-items: center; gap: 0; font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; transition: transform .15s, background .2s }
.district:hover { background: rgba(255, 211, 106, .08); transform: translateY(-2px) }
.district img { width: 58px; height: 58px }
.district small { font-size: 11px; color: var(--ink-soft); font-weight: 500; font-variant-numeric: tabular-nums }
.rebels { border-top: 1px solid var(--line-soft); padding-top: 10px }

.btn { position: relative; border: 0; background: linear-gradient(180deg, rgba(255, 243, 214, .1), rgba(255, 243, 214, .04)); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 10px 15px; font-weight: 700; min-height: 44px; transition: transform .1s, filter .2s }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98) }
.btn.small { padding: 7px 12px; font-size: 13px; min-height: 38px; font-weight: 600 }
.btn.primary { background: linear-gradient(180deg, #f06a46 0%, #c63a24 48%, var(--seal-deep) 100%); color: #fff6e4; text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
    box-shadow: inset 0 0 0 1px rgba(255, 211, 106, .75), inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 #6a160e, 0 8px 18px rgba(168, 38, 26, .35); margin-bottom: 4px }
.btn.primary:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 1px rgba(255, 211, 106, .75), 0 1px 0 #6a160e }
.btn.primary:disabled { background: rgba(255, 243, 214, .07); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line-soft); text-shadow: none }
.btn.primary.ready { animation: ready 1.8s ease-in-out infinite }
@keyframes ready { 50% { filter: brightness(1.15) } }
.btn.wide { width: 100% }
.btn.big { padding: 15px 30px; font-size: 18px }
.btn.ghost { background: none; box-shadow: none; color: var(--ink-soft); justify-self: start; text-decoration: underline; text-underline-offset: 3px }
.btn .ico { display: inline-block; vertical-align: -4px; margin-right: 6px }

/* daily */
.days { grid-template-columns: repeat(7, 1fr); gap: 5px }
.days li { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 1px 7px; border-radius: 10px; background: rgba(255, 243, 214, .035); box-shadow: inset 0 0 0 1px var(--line-soft); font-variant-numeric: tabular-nums }
.days .ico { width: 24px; height: 24px }
.days .d { font-size: 11px; color: var(--ink-soft); font-weight: 600 }
.days b { font: 400 15px var(--display) }
.days li.got { background: rgba(220, 179, 94, .14); box-shadow: inset 0 0 0 1px rgba(220, 179, 94, .45) }
.days li.got::after { content: "✓"; position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--gold-hi); font-weight: 700 }
.days li.now { box-shadow: inset 0 0 0 2px var(--gold-hi); animation: glow 1.6s ease-in-out infinite }
.days li.big { background: linear-gradient(180deg, rgba(226, 88, 61, .25), rgba(226, 88, 61, .08)) }
.days li.big b { color: var(--gold-hi) }
@keyframes glow { 50% { background: rgba(255, 211, 106, .16) } }
.goal { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line-soft) }
.goal-line { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-soft) }
.goal-line b { font: 400 26px var(--display); color: var(--gold-hi) }
.goal-prize { margin: 0; font-size: 13px }
.goal-prize b { color: var(--seal); font-weight: 700 }
.track { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4) }
.track .bar { height: 100%; background: linear-gradient(90deg, var(--seal-deep), var(--seal), var(--gold-hi)); width: 0; transition: width .9s; border-radius: 6px;
    background-size: 200% 100%; animation: sheen 3s linear infinite }
@keyframes sheen { to { background-position: -200% 0 } }

/* deeds */
.deeds button { width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; border: 0; background: rgba(255, 243, 214, .045); box-shadow: inset 0 0 0 1px var(--line-soft); border-radius: 12px; padding: 9px 11px; min-height: 58px }
.deed-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-soft) }
.deed-ic .ico { width: 28px; height: 28px }
.deeds b { font-weight: 700 }
.deeds .state { margin-left: auto; font-size: 12px; font-weight: 700; color: #2a1813; background: var(--gold-hi); border-radius: 999px; padding: 3px 11px; flex: none }
.deeds li.done button { opacity: .55 }
.deeds li.done .state { color: #cfe8d2; background: rgba(156, 199, 160, .2) }
.empty { color: var(--ink-soft); font-size: 13px }
.log li { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center }
.log li .ico { width: 18px; height: 18px }

/* rank, home and shop */
.home-hero { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: radial-gradient(circle at 20% 50%, rgba(255, 211, 106, .14), transparent 60%), rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 1px var(--line-soft) }
.home-hero img { width: 104px; height: 104px; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)) }
.home-hero > div { display: grid; gap: 6px; min-width: 0 }
.ladder li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-soft); opacity: .5 }
.ladder li.got { opacity: .85 }
.ladder li.now { opacity: 1; box-shadow: inset 0 0 0 2px var(--gold-hi); background: rgba(255, 211, 106, .1) }
.ladder .zh { width: 34px; height: 34px; display: grid; place-items: center; background: var(--seal-deep); color: #fff1d6; border-radius: 6px; font: 19px/1 var(--brush) }
.ladder li:not(.got):not(.now) .zh { background: rgba(255, 255, 255, .08); color: var(--ink-soft) }
.ladder .at { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums }
.shop li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-soft) }
.shop .sw { width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid; place-items: center; background: rgba(0, 0, 0, .3) }
.shop .sw .ico { width: 24px; height: 24px }
.shop li > span:nth-child(2) { flex: 1; min-width: 0 }
.shop .btn { display: inline-flex; align-items: center; gap: 4px }
.shop .btn .ico { width: 16px; height: 16px; margin: 0 }

/* ---------- house card ---------- */
.card { position: absolute; left: 16px; right: 92px; bottom: calc(110px + var(--safe-b)); border-radius: 16px; padding: 0; overflow: hidden; max-width: 420px; animation: pop .26s cubic-bezier(.3, 1.4, .5, 1); z-index: 6 }
.card #card-body { display: grid; gap: 8px; padding: 0 14px 14px }
.card-photo { position: relative; height: 112px; margin: 0 -14px; overflow: hidden }
.card-photo img.street { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; filter: saturate(1.05) }
.card-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 10, 10, 0) 40%, rgba(28, 16, 14, .96)) }
.card-photo img.house { position: absolute; right: 8px; bottom: -6px; width: 92px; height: 92px; z-index: 1; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)) }
.card-photo .district-tag { position: absolute; left: 12px; top: 10px; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(20, 10, 10, .72); padding: 3px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line) }
.card .plaque { margin-top: -26px; position: relative; z-index: 2 }
.close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; background: rgba(20, 10, 10, .7); font-size: 22px; line-height: 1; color: var(--ink); border-radius: 50%; z-index: 3; box-shadow: inset 0 0 0 1px var(--line) }
.plaque { justify-self: start; max-width: calc(100% - 100px); background: linear-gradient(180deg, #4e2c1b, var(--wood)); color: #f4cf72; font: 600 18px var(--mono); padding: 6px 13px; border-radius: 3px; overflow-wrap: anywhere;
    box-shadow: 0 0 0 2px #a8261a, 0 0 0 3px rgba(255, 211, 106, .35), 0 6px 14px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08) }
.plaque.gilded { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 4px rgba(255, 211, 106, .3), 0 0 18px rgba(255, 211, 106, .35) }
.plaque.big { font-size: 22px; justify-self: center; max-width: 100% }
.addr { margin: 0; font-size: 14px }
.addr .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin: 0 3px 1px 6px }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--ink-soft); align-items: center }
.tag { font-weight: 700; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 1px 9px }
.tag.gold { color: #2a1813; background: var(--gold-hi); box-shadow: none }
.done-note { margin: 0; color: #9cc7a0; font-size: 13px; display: flex; gap: 6px; align-items: center }
.work { position: relative; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line) }
.work-bar { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transition: width 1.25s linear }
.work.go .work-bar { width: 100% }
.work-text { position: relative; display: grid; place-items: center; height: 100%; font-size: 13px; font-weight: 700; color: #2a1813 }

/* ---------- coach mark, toasts, fps ---------- */
.coach { position: absolute; z-index: 7; display: flex; gap: 10px; align-items: center; background: var(--paper); color: #2a1813; font-weight: 700; padding: 8px 8px 8px 14px; border-radius: 12px; box-shadow: var(--lift); animation: pop .3s, float 1.6s ease-in-out .3s infinite alternate }
.coach .btn { background: var(--seal-deep); color: #fff; box-shadow: none; min-height: 32px }
.coach::after { content: ""; position: absolute; left: 30px; top: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--paper) }
@keyframes float { to { transform: translateY(-5px) } }
.toasts { position: absolute; top: calc(var(--safe-t) + 118px); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(92vw, 420px); z-index: 8 }
.toast { background: var(--panel); box-shadow: var(--trim), 0 8px 18px rgba(0, 0, 0, .4); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; animation: pop .3s cubic-bezier(.3, 1.5, .5, 1); transition: opacity .4s, transform .4s; text-align: center; display: flex; align-items: center; gap: 6px }
.toast .ico { width: 18px; height: 18px }
.toast.gain { color: var(--gold-hi) }
.toast.out { opacity: 0; transform: translateY(-8px) }
.fps { position: absolute; right: 16px; top: calc(var(--safe-t) + 56px); font: 600 11px var(--mono); color: rgba(255, 243, 214, .4); pointer-events: none }
.stats { position: absolute; right: 16px; top: calc(var(--safe-t) + 74px); margin: 0; font: 11px var(--mono); background: rgba(0, 0, 0, .6); padding: 6px; border-radius: 6px; max-width: 46vw; white-space: pre-wrap; pointer-events: none; z-index: 9 }
.float-txt { position: absolute; z-index: 9; pointer-events: none; font: 800 18px var(--body); color: var(--gold-hi); text-shadow: 0 2px 0 #6a160e, 0 4px 12px rgba(0, 0, 0, .6); animation: rise 1.4s ease-out forwards; white-space: nowrap }
@keyframes rise { from { transform: translate(-50%, 0) scale(.6); opacity: 0 } 15% { transform: translate(-50%, -10px) scale(1.15); opacity: 1 } to { transform: translate(-50%, -70px) scale(1); opacity: 0 } }

/* ---------- modals ---------- */
.modal { position: absolute; inset: 0; background: rgba(10, 5, 5, .7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .2s }
@keyframes fade { from { opacity: 0 } }
.dialog { position: relative; width: min(440px, 100%); max-height: calc(100% - 20px); overflow-y: auto; border-radius: 18px; padding: 22px; display: grid; gap: 10px; animation: pop .3s cubic-bezier(.3, 1.4, .5, 1) }
.dialog h2 { margin: 0; font: 400 26px var(--display) }
.dialog.center { text-align: center; justify-items: center }
.kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700 }
.how p { margin: 0 0 6px }
.code { font: 600 30px var(--mono); color: var(--gold-hi); letter-spacing: .08em; background: rgba(0, 0, 0, .35); border: 1px dashed rgba(255, 211, 106, .5); border-radius: 10px; padding: 8px 12px; text-align: center }
.fake-btn { display: inline-block; padding: 10px 16px; border-radius: 10px; background: #fff; color: #111; font-weight: 700 }
.fake-btn.tt { background: #111; color: #fff; box-shadow: -2px 0 0 #25f4ee, 2px 0 0 #fe2c55 }
.err { margin: 0; color: #ff9b85; font-size: 13px; min-height: 1em }
.welcome-img { width: 190px; height: 190px; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .5)); animation: drop .6s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes drop { from { transform: translateY(-40px) scale(.7); opacity: 0 } }
.rankup { overflow: hidden }
.rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 211, 106, .1) 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; pointer-events: none }
@keyframes spin { to { transform: rotate(1turn) } }
.rankup > *:not(.rays) { position: relative }
.stamp { width: 120px; height: 120px; display: grid; place-items: center; background: var(--seal-deep); color: #fff1d6; font: 64px/1 var(--brush); border-radius: 14px;
    box-shadow: inset 0 0 0 4px rgba(255, 220, 180, .4), inset 0 0 0 7px var(--seal-deep), inset 0 0 0 8px rgba(255, 220, 180, .3), 0 10px 30px rgba(168, 38, 26, .5); transform: rotate(-6deg); animation: stamp .55s cubic-bezier(.2, 1.4, .4, 1) }
@keyframes stamp { from { transform: rotate(-20deg) scale(2.6); opacity: 0 } 60% { transform: rotate(-4deg) scale(.92); opacity: 1 } }

/* ---------- splash ---------- */
.splash { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; text-align: center; overflow: hidden; background: var(--night) }
.splash-bg { position: absolute; inset: -4%; background: url("img/aerial.jpg") center 32% / cover no-repeat; animation: drift 24s ease-in-out infinite alternate; filter: saturate(1.1) }
.splash-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 60% at 50% 45%, rgba(20, 8, 8, .5), rgba(20, 8, 8, .92)), linear-gradient(180deg, rgba(20, 8, 8, .2), rgba(20, 8, 8, .85)) }
@keyframes drift { to { transform: scale(1.08) translateY(-2%) } }
.splash-inner { position: relative; display: grid; gap: 10px; justify-items: center; max-width: 440px }
.splash-pfp { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .6); animation: drop .8s cubic-bezier(.3, 1.6, .5, 1) }
.splash .zh { margin: 4px 0 0; font: 58px/1 var(--brush); color: var(--seal); text-shadow: 0 3px 0 #3a0e0a, 0 8px 30px rgba(226, 88, 61, .45) }
.splash h1 { margin: 0; font: 400 clamp(32px, 8vw, 48px)/1.05 var(--display); text-shadow: 0 4px 20px rgba(0, 0, 0, .6) }
.lede { margin: 0 0 8px; color: var(--ink); opacity: .85; max-width: 34ch }
.lede b { color: var(--gold-hi) }
.sound-note { opacity: .7 }

#app.night .seal { background: #7a1c14 }

/* ---------- wide screens: the sheet becomes a side panel ---------- */
@media (min-width: 761px) {
    .sheet { left: 16px; right: auto; bottom: 16px; top: calc(var(--safe-t) + 124px + var(--hud-extra, 0px)); width: 360px; max-height: none; border-radius: 16px; padding-bottom: 12px }
    .sheet.collapsed { max-height: none }
    .sheet.collapsed .pane:not([hidden]) { display: grid }
    .grip { display: none }
    .tabs { margin-top: 12px }
    .card { left: auto; right: 104px; bottom: 24px; width: 380px }
    .xiaoyu { bottom: 24px; right: 22px }
    .bubble { bottom: 36px; right: 104px }
    #app:has(.card:not([hidden])) .bubble { bottom: 330px }
}
@media (max-width: 760px) {
    .brand .en { font-size: 16px }
    .seal { width: 34px; height: 34px; font-size: 24px }
    .hud-who { max-width: 110px }
    .hud-id { min-width: 92px }
    #app:has(.card:not([hidden])) .bubble { display: none }
    .bubble { right: 16px; bottom: calc(188px + var(--safe-b)); max-width: calc(100% - 96px) }
    #app:has(.sheet:not(.collapsed)) :is(.xiaoyu, .bubble, .card) { display: none }
    .card { right: 16px; bottom: calc(108px + var(--safe-b)) }
    #app:has(.card:not([hidden])) .xiaoyu { bottom: calc(108px + var(--safe-b) + var(--card-h, 260px)) }
}
@media (max-width: 380px) {
    .seg button { padding: 6px 10px }
    .hud-stat { padding: 3px 6px }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }

/* ---------- wish board, jobs, pets, tip jar ---------- */
.link { border: 0; background: none; padding: 0; color: var(--gold-hi); font-weight: 700; text-decoration: underline; text-underline-offset: 3px }
.goal.mini { gap: 6px; padding: 10px 12px }
.goal.mini .goal-line b { font-size: 18px }
.builds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.builds li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-soft); background: rgba(255, 243, 214, .03) }
.builds li.granted { background: rgba(168, 38, 26, .12) }
.b-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; font-size: 20px; border-radius: 8px; background: rgba(0, 0, 0, .3) }
.b-text { flex: 1; min-width: 0; display: grid; gap: 5px }
.b-text b { font-size: 14px; line-height: 1.25 }
.b-track { height: 5px; border-radius: 9px; background: rgba(255, 243, 214, .08); overflow: hidden }
.b-track span { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--seal-deep), var(--gold-hi)) }
.builds li.granted .b-track span { background: var(--seal) }
.seal-stamp { flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--seal); font: 20px/1 var(--brush);
    box-shadow: inset 0 0 0 2px var(--seal); transform: rotate(-8deg); background: rgba(226, 88, 61, .08) }
.vote { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 6px 11px; min-height: 36px; font-weight: 700; font-size: 13px;
    background: rgba(255, 243, 214, .06); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink) }
.vote .ico { width: 16px; height: 16px; color: var(--seal) }
.vote:not(:disabled):hover { background: rgba(226, 88, 61, .18) }
.vote.on { background: var(--seal-deep); color: #fff1d6 }
.vote.on .ico { color: #fff1d6 }
.vote:disabled:not(.on) { opacity: .55 }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 5px 11px; min-height: 34px; font-size: 13px; font-weight: 600;
    background: rgba(255, 243, 214, .05); box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--ink) }
.chip b { color: var(--gold-hi) }
button.chip:not(:disabled):hover { background: rgba(255, 211, 106, .1) }
.chip.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1813 }
.chip.on b { color: var(--seal-deep) }
.chip:disabled { opacity: .5 }
.chip.pet { padding-left: 5px }
.mini-seal { font: 12px/1 var(--body); font-weight: 700; color: var(--seal); padding: 2px 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--seal) }
.chip.on .mini-seal { color: var(--seal-deep); box-shadow: inset 0 0 0 1px var(--seal-deep) }
.pet-img { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; color: var(--gold); object-fit: contain }
.pet-img .ico { width: 18px; height: 18px }
.shop .pet-img { width: 34px; height: 34px; border-radius: 8px; background: rgba(0, 0, 0, .3) }
#job-people { margin-top: 8px }
.wish { margin: 2px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft) }
.wish .ico { width: 18px; height: 18px; color: var(--gold) }
.wish b { color: var(--ink) }
.wish .seal-stamp { width: 24px; height: 24px; font-size: 16px }
.wish .pending { font-size: 11px; color: var(--ink-soft); opacity: .8; margin-left: auto }
.deeds li.jobdeed button { box-shadow: inset 0 0 0 1px var(--line) }
.tipjar { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft) }
.tip, .tip-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; text-decoration: none; color: var(--ink) }
.tip .ico, .tip-link .ico { width: 20px; height: 20px; margin: 0 }
.tip-link { font-size: 13px; color: var(--ink-soft) }
.tip-link:hover { color: var(--gold-hi) }
[data-tip][aria-disabled="true"] { cursor: default; opacity: .7 }
[data-tip] small { font-weight: 400; color: var(--ink-soft) }
.foot { margin: 10px 0 0; text-align: center; display: flex; justify-content: center }

/* ---------- Xiaoyu's chibi poses ---------- */
.bubble { display: flex; align-items: flex-end; gap: 8px }
.bubble .pose { width: 68px; height: auto; flex: none; margin: -44px -2px -8px -10px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)) }
.bubble .b-words { min-width: 0 }
.bubble.pop .pose { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes hop { 0% { transform: translateY(14px) scale(.8) } 100% { transform: none } }
.pose-big { position: relative; display: block; width: 116px; height: auto; margin: 0 auto -6px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); animation: hop .5s .1s cubic-bezier(.3, 1.6, .5, 1) both }
.welcome .pose-side { position: absolute; right: 2px; top: 84px; width: 100px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); animation: hop .5s .15s cubic-bezier(.3, 1.6, .5, 1) both }
.tipjar { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px }
.tipjar .pose-tip { grid-row: span 2; width: 56px; height: auto }
.wish-head { display: flex; align-items: flex-end; justify-content: space-between }
.wish-head img { width: 52px; height: auto; margin: -14px 0 -6px }

/* =====================================================================================================
   RPG layer: level ring, quest tracker, juicy buttons, quests, bag, wardrobe, friends, trade, wall game
   ===================================================================================================== */

/* juicy buttons: a solid bottom edge, a shine sweep, a squash on press */
.btn.juicy { overflow: hidden; box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 rgba(0, 0, 0, .45); margin-bottom: 3px }
.btn.juicy:active:not(:disabled) { transform: translateY(3px) scale(.97); box-shadow: inset 0 0 0 1px var(--line), 0 0 0 rgba(0, 0, 0, .45) }
.btn.juicy.primary { box-shadow: inset 0 0 0 1px rgba(255, 211, 106, .75), inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 #6a160e, 0 8px 18px rgba(168, 38, 26, .35) }
.btn.juicy.primary:active:not(:disabled) { transform: translateY(4px) scale(.98); box-shadow: inset 0 0 0 1px rgba(255, 211, 106, .75), 0 0 0 #6a160e }
.btn.juicy::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg); pointer-events: none }
.btn.juicy.ready::after, .btn.juicy:hover:not(:disabled)::after { animation: shine 2.2s ease-in-out infinite }
@keyframes shine { 0% { left: -60% } 45%, 100% { left: 130% } }
.btn.juicy:disabled { opacity: .55; box-shadow: inset 0 0 0 1px var(--line-soft) }
.btn.juicy.primary:disabled { opacity: 1 }

/* HUD: the level ring replaces the old avatar */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0 }
.lvl-ring { --p: 0; position: relative; width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--gold-hi) calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); transition: --p .6s }
.lvl-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e9603f, var(--seal-deep)); box-shadow: inset 0 0 0 1.5px rgba(255, 211, 106, .6) }
.lvl-n { position: relative; font: 800 19px/1 var(--body); color: #fff6e4; text-shadow: 0 2px 0 #6a160e }
.rank-badge { position: absolute; right: -6px; bottom: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--lacquer-2); color: var(--gold-hi);
    font: 14px/1 var(--brush); box-shadow: 0 0 0 1.5px var(--gold), 0 2px 6px rgba(0, 0, 0, .5); transform: rotate(-6deg) }
.hud.guest .lvl-ring { animation: nudge 2.4s ease-in-out infinite }
.hud.guest .lvl-ring::before { background: radial-gradient(circle at 35% 30%, #5a4036, #2a1813) }
.hud.guest .lvl-n { color: var(--gold-hi); text-shadow: none }
.hud.guest .rank-badge { display: none }
.lvl-ring.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1) }

/* the quest tracker under the HUD */
.tracker { position: absolute; top: calc(var(--safe-t) + 118px + var(--hud-extra, 0px)); left: 16px; max-width: min(380px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; border: 0; text-align: left;
    padding: 6px 6px 6px 8px; border-radius: 12px; background: linear-gradient(90deg, rgba(42, 24, 19, .94), rgba(28, 16, 14, .9)); box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0, 0, 0, .4); z-index: 4; animation: pop .3s cubic-bezier(.3, 1.4, .5, 1) }
.tr-text { display: grid; min-width: 0; line-height: 1.25 }
.tr-text b { font: 400 14px var(--display); color: var(--gold-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tr-text span { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tracker .go { flex: none; min-height: 34px; padding: 5px 13px; margin-bottom: 3px }
.q-seal { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--seal-deep); color: #fff1d6; font: 22px/1 var(--brush);
    box-shadow: inset 0 0 0 1.5px rgba(255, 220, 180, .4), 0 2px 6px rgba(0, 0, 0, .35); transform: rotate(-5deg) }
.q-seal.small { width: 30px; height: 30px; font-size: 19px }

/* walking chip */
.walk-chip { position: absolute; top: calc(var(--safe-t) + 172px + var(--hud-extra, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; z-index: 4; white-space: nowrap;
    padding: 5px 5px 5px 12px; border-radius: 999px; background: var(--paper); color: #2a1813; font-weight: 700; font-size: 13px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); animation: pop .25s }
.walk-feet { display: inline-block; animation: step .5s steps(2) infinite }
@keyframes step { 50% { transform: translateY(-2px) rotate(-6deg) } }
.walk-stop { border: 0; border-radius: 999px; background: var(--seal-deep); color: #fff1d6; font-weight: 700; font-size: 12px; padding: 5px 11px; min-height: 30px }

/* floating buttons: walk home, find me */
.fabs { position: absolute; left: 16px; bottom: calc(112px + var(--safe-b)); display: grid; gap: 8px; z-index: 4 }
.fab { width: 52px; height: 52px; border-radius: 16px; border: 0; display: grid; place-items: center; align-content: center; gap: 0; padding: 0; line-height: 1;
    background: linear-gradient(180deg, #3a2018, #24130f); box-shadow: inset 0 0 0 1.5px var(--gold), 0 4px 0 #0c0606, 0 8px 16px rgba(0, 0, 0, .45); transition: transform .1s }
.fab span { font-size: 22px }
.fab small { font-size: 10px; font-weight: 700; color: var(--gold-hi); margin-top: 2px }
.fab:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--gold), 0 1px 0 #0c0606 }
#app:has(.card:not([hidden])) .fabs { display: none }

/* six tabs */
.tabs { gap: 2px }
.tabs button { font-size: 11px; padding: 6px 2px 7px; min-height: 52px }
.tab-ic { font-size: 20px; line-height: 1.1; filter: grayscale(.5) brightness(.9); transition: transform .2s, filter .2s }
.tabs button[aria-selected="true"] .tab-ic { filter: none; transform: translateY(-1px) scale(1.12) }
.dot-badge.gift { right: calc(50% - 24px); top: 3px; background: var(--gold-hi) }

/* quests */
.quests, .story-done, .bag-grid, .stats-list, .rewards, .steps, .lu-got, .weird-list { list-style: none; margin: 0; padding: 0 }
.quests { display: grid; gap: 8px }
.quest { padding: 10px 12px; border-radius: 14px; display: grid; gap: 7px; background: linear-gradient(180deg, rgba(255, 243, 214, .07), rgba(255, 243, 214, .025)); box-shadow: inset 0 0 0 1px var(--line-soft) }
.quest.story { background: linear-gradient(180deg, rgba(226, 88, 61, .18), rgba(168, 38, 26, .06)); box-shadow: inset 0 0 0 1px rgba(226, 88, 61, .45) }
.quest.trial { background: linear-gradient(180deg, rgba(255, 211, 106, .16), rgba(255, 211, 106, .04)); box-shadow: inset 0 0 0 1px rgba(255, 211, 106, .5) }
.q-head { display: flex; gap: 10px; align-items: center }
.q-head > span:last-child { display: grid; line-height: 1.25 }
.q-head b { font: 400 16px var(--display) }
.q-head .kicker { font-size: 10px }
.q-text { margin: 0; font-size: 13px; color: var(--ink-soft) }
.steps { display: grid; gap: 4px }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 30px }
.steps li b { color: var(--gold-hi); font-variant-numeric: tabular-nums }
.steps .tick { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; color: var(--ink-soft); box-shadow: inset 0 0 0 1.5px rgba(255, 243, 214, .25) }
.steps li.done { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(255, 211, 106, .5) }
.steps li.done .tick { background: var(--gold-hi); color: #2a1813; box-shadow: none; font-weight: 800 }
.steps .go { margin-left: auto; flex: none; min-height: 36px; min-width: 52px; padding: 4px 14px; font-size: 13px; white-space: nowrap }
.rewards { display: flex; flex-wrap: wrap; gap: 5px }
.rw { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line) }
.rw .ico { width: 15px; height: 15px }
.rw b { color: var(--gold-hi) }
.rw.xp { background: linear-gradient(180deg, #4a8a3a, #2a5a22); box-shadow: inset 0 0 0 1px rgba(200, 255, 170, .4); color: #effbe6 }
.rw.xp b { color: #fff }
.rw.xp s { opacity: .6; font-weight: 600; margin-right: 2px }
.rewards.big { justify-content: center; gap: 8px }
.rewards.big .rw { font-size: 15px; padding: 5px 13px 5px 10px; animation: drop .5s cubic-bezier(.3, 1.6, .5, 1) both }
.rewards.big .rw:nth-child(2) { animation-delay: .1s }
.rewards.big .rw:nth-child(3) { animation-delay: .2s }
.rewards.big .rw:nth-child(4) { animation-delay: .3s }
.story-done { display: grid; gap: 5px }
.story-done li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-soft) }
.story-done li > span:nth-child(2) { flex: 1; display: grid; line-height: 1.25 }
.story-done .tick { color: var(--gold-hi); font-weight: 800 }
.xp-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #3a7a2e; color: #fff; font-weight: 800 }
.toast.quest { color: #effbe6; background: linear-gradient(180deg, rgba(58, 122, 46, .95), rgba(34, 80, 26, .95)) }

/* bag */
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px }
.bag-grid li { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-soft), inset 0 2px 6px rgba(0, 0, 0, .4) }
.bag-grid li.full { background: radial-gradient(circle at 50% 40%, rgba(255, 211, 106, .16), rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px var(--line) }
.bag-grid li span { font-size: 26px; line-height: 1 }
.bag-grid li b { position: absolute; right: 4px; bottom: 2px; font-size: 11px; color: var(--gold-hi) }
.skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px }
.skin { position: relative; border: 0; border-radius: 12px; padding: 4px 2px 6px; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center;
    background: rgba(255, 243, 214, .05); box-shadow: inset 0 0 0 1px var(--line-soft); transition: transform .15s }
.skin img, .npc-head img, .trade-head img, .merchants img, .results img[src^="img/folk/"] { background: var(--paper); border-radius: 12px; object-fit: cover }
.skin img { width: 58px; height: 58px }
.skin.on { box-shadow: inset 0 0 0 2px var(--gold-hi), 0 0 14px rgba(255, 211, 106, .3); background: rgba(255, 211, 106, .12) }
.skin:not(:disabled):hover { transform: translateY(-2px) }
.skin:disabled img { filter: grayscale(1) brightness(.5) }
.skin .lock { font-size: 11px; line-height: 1.2; font-weight: 500; color: var(--ink-soft) }
.dye-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .3) }
.merchants img { width: 44px; height: 44px; flex: none }
.merchants .m-act { margin-left: auto }
.merchants li > span:nth-child(2) { flex: 1; min-width: 0 }
.tier-card { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: radial-gradient(circle at 15% 50%, rgba(255, 211, 106, .16), transparent 60%), rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line) }
.tier-zh { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--seal-deep); color: #fff1d6; font: 30px/1 var(--brush); transform: rotate(-4deg); box-shadow: inset 0 0 0 2px rgba(255, 220, 180, .35) }
.tier-card b { font: 400 18px var(--display) }
.stats-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.stats-list li { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12px; color: var(--ink-soft); background: rgba(255, 243, 214, .04) }
.stats-list b { color: var(--ink); font-variant-numeric: tabular-nums }

/* map: places */
.places { display: grid; gap: 6px }
.place { display: flex; gap: 10px; align-items: center; border: 0; text-align: left; border-radius: 12px; padding: 8px 10px; background: linear-gradient(90deg, rgba(106, 58, 138, .28), rgba(255, 243, 214, .03)); box-shadow: inset 0 0 0 1px var(--line-soft) }
.place:nth-child(2) { background: linear-gradient(90deg, rgba(141, 133, 128, .28), rgba(255, 243, 214, .03)) }
.place span:last-child { display: grid; line-height: 1.25 }
.place small { color: var(--ink-soft); font-size: 12px }
.pl-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 10px; background: rgba(0, 0, 0, .3) }

/* card: townsfolk, places, social */
.npc-head { display: flex; gap: 12px; align-items: center; padding-top: 14px }
.npc-head img { width: 84px; height: 84px; flex: none; box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0, 0, 0, .45); animation: hop .4s cubic-bezier(.3, 1.6, .5, 1) }
.npc-head > div { display: grid; gap: 4px; min-width: 0 }
.card .npc-head .plaque { margin: 0; max-width: 100% }
.say { margin: 0; font: italic 14px/1.4 var(--display); color: var(--paper); padding: 8px 12px; border-radius: 12px; background: rgba(255, 243, 214, .06); box-shadow: inset 3px 0 0 var(--seal) }
.row.act { gap: 6px }
.social { display: grid; gap: 7px; padding-top: 8px; border-top: 1px solid var(--line-soft) }
.bond { display: flex; align-items: center; gap: 8px; font-size: 13px }
.bond .hearts { color: var(--seal); letter-spacing: 1px }
.bond .r-addr { margin-left: auto }
.emotes { display: flex; gap: 6px }
.emote { flex: 1; border: 0; border-radius: 10px; font-size: 22px; min-height: 42px; background: rgba(255, 243, 214, .06); box-shadow: inset 0 0 0 1px var(--line-soft); transition: transform .1s }
.emote:active { transform: scale(.9) }
.emote.popped { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1) }
.gifts .chip { font-size: 12px }
.card-photo.weird { height: 104px; display: grid; place-items: center; background: radial-gradient(circle at 50% 120%, #6a3a8a, #2a1430 70%) }
.weird-sign { position: absolute; left: 12px; top: 10px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: #2a8a5a; color: #ffe9a8; font: 26px/1 var(--brush); transform: rotate(-8deg); z-index: 1 }
.weird-pets { position: relative; z-index: 1; display: flex; gap: 2px }
.weird-pets img { width: 50px; height: 50px; animation: wobble 2s ease-in-out infinite alternate }
.weird-pets img:nth-child(2n) { animation-delay: -.7s }
.weird-pets img:nth-child(3n) { animation-delay: -1.3s }
@keyframes wobble { from { transform: translateY(0) rotate(-6deg) } to { transform: translateY(-6px) rotate(6deg) } }
.weird-list { display: grid; gap: 6px; max-height: 180px; overflow-y: auto }
.card-photo.wallpic { height: 100px; background: linear-gradient(180deg, #1a1a3a 0%, #3a2a4a 55%, #8d8580 55%, #6a625d 100%) }
.card .card-photo.wallpic::after, .card .card-photo.weird::after { display: none }
.wall-crenels { position: absolute; left: 0; right: 0; top: calc(55% - 12px); height: 12px; background: repeating-linear-gradient(90deg, #8d8580 0 18px, transparent 18px 30px) }
.wall-ladder { position: absolute; bottom: 0; left: 28%; width: 16px; height: 62%; background: repeating-linear-gradient(180deg, transparent 0 8px, #7b4a24 8px 11px), linear-gradient(90deg, #7b4a24 0 3px, transparent 3px 13px, #7b4a24 13px); transform: rotate(8deg); transform-origin: bottom }
.wall-ladder.b { left: 66%; transform: rotate(-6deg) }

/* level up banner */
.levelup { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 22; width: min(320px, 86vw); text-align: center; padding: 18px 16px 16px; border-radius: 20px; overflow: hidden; cursor: pointer;
    background: radial-gradient(circle at 50% 30%, #6a1a10, #2a1210 70%); box-shadow: 0 0 0 2px var(--gold-hi), 0 0 0 5px rgba(0, 0, 0, .4), 0 20px 50px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 211, 106, .35) }
.levelup.show { animation: lvlin .6s cubic-bezier(.2, 1.5, .4, 1) }
@keyframes lvlin { from { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0 } }
.lu-rays { position: absolute; inset: -60%; background: repeating-conic-gradient(rgba(255, 211, 106, .14) 0 9deg, transparent 9deg 18deg); animation: spin 10s linear infinite }
.levelup > *:not(.lu-rays) { position: relative }
.lu-n { font: 800 76px/1 var(--body); color: var(--gold-hi); text-shadow: 0 4px 0 #6a160e, 0 0 30px rgba(255, 211, 106, .6) }
.lu-got { display: grid; gap: 4px; margin-top: 6px; font-size: 13px }

/* quest done */
.quest-done { overflow: hidden }
.quest-done > *:not(.rays) { position: relative }

/* trade */
.trade-head { display: flex; gap: 12px; align-items: center; padding-right: 30px }
.trade-head img { width: 84px; height: 84px; flex: none; box-shadow: 0 0 0 2px var(--gold) }
.trade-head > div { display: grid; gap: 4px; min-width: 0 }
.trade-head h2 { font-size: 20px }
.trade-head .say { font-size: 13px }
.trade-wallet { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft) }
.trade-wallet .ico { width: 18px; height: 18px }
.trade-wallet b { color: var(--gold-hi) }
.dialog h3 { margin: 4px 0 0; font: 700 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold) }
.trade-list .it { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 9px; background: rgba(0, 0, 0, .3) }
.trade-list li > span:nth-child(2) { flex: 1; min-width: 0 }
.trade-list li.want { box-shadow: inset 0 0 0 1.5px var(--gold-hi); background: rgba(255, 211, 106, .07) }
.trade-list .btn { white-space: nowrap; margin-bottom: 3px }
.trade-list .btn .ico { width: 15px; height: 15px; margin: 0 3px 0 0 }

/* wall defence */
.defend { gap: 8px }
.def-hud { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .3) }
.def-hud b { color: var(--gold-hi); font-variant-numeric: tabular-nums }
.def-board { position: relative; height: 290px; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, #0e0e26 0%, #2a1e3a 60%, #3a2a24 100%); box-shadow: inset 0 0 0 1px var(--line) }
.def-board.shake { animation: shake .35s }
@keyframes shake { 20% { transform: translateX(-6px) } 40% { transform: translateX(5px) } 60% { transform: translateX(-3px) } 80% { transform: translateX(2px) } }
.def-wall { position: absolute; left: 0; right: 0; top: 0; height: 64px; z-index: 1; background: #8d8580; box-shadow: 0 6px 0 rgba(0, 0, 0, .3), inset 0 -10px 0 #6a625d }
.def-wall::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 0 }
.def-wall::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: repeating-linear-gradient(90deg, transparent 0 22px, #0e0e26 22px 34px) }
.def-slots { position: absolute; inset: 52px 6px 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px }
.slot { position: relative; border: 0; background: none; padding: 0; overflow: visible; touch-action: manipulation }
.slot .ladder { position: absolute; left: 50%; bottom: 0; width: 30px; height: 0; transform: translateX(-50%); transform-origin: bottom; display: block; margin: 0; padding: 0;
    background: repeating-linear-gradient(0deg, transparent 0 12px, #b07a44 12px 16px), linear-gradient(90deg, #b07a44 0 5px, transparent 5px 25px, #b07a44 25px); border-radius: 3px }
.slot .climber { position: absolute; left: 50%; bottom: 0; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #2a1e1a; box-shadow: inset 0 -6px 0 #4a3a30, 0 0 0 2px #120a08; opacity: 0 }
.slot.up .ladder { height: 100%; transition: height .25s cubic-bezier(.3, 1.4, .5, 1) }
.slot.up .climber { opacity: 1; animation: climb var(--life, 1.6s) linear forwards }
@keyframes climb { from { bottom: 0 } to { bottom: calc(100% - 22px) } }
.slot.up::after { content: "TAP"; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font: 800 10px var(--body); color: var(--gold-hi); letter-spacing: .08em; animation: ready 1s infinite }
.slot.pushed .ladder { height: 100%; animation: fall .45s ease-in forwards }
@keyframes fall { to { transform: translateX(-50%) rotate(75deg); opacity: 0 } }
.slot.breach .ladder { height: 100%; filter: sepia(1) hue-rotate(-30deg) saturate(3); animation: fade .6s reverse forwards }
.def-start, .def-over { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 18px; text-align: center; background: rgba(14, 8, 8, .78) }
.def-start p { margin: 0; font-size: 14px }
.def-over h3 { margin: 0; font: 400 26px var(--display); color: var(--gold-hi); letter-spacing: 0; text-transform: none }

/* the toasts sit below the tracker now */
.toasts { top: calc(var(--safe-t) + 214px + var(--hud-extra, 0px)) }
@media (min-width: 761px) {
    .tracker { top: calc(var(--safe-t) + 54px); left: 392px; max-width: 360px }
    .walk-chip { top: calc(var(--safe-t) + 112px) }
    .fabs { left: auto; right: 22px; bottom: 112px }
    .toasts { top: calc(var(--safe-t) + 112px) }
}
@media (max-width: 760px) {
    #app:has(.sheet:not(.collapsed)) :is(.fabs, .tracker, .walk-chip, .battle-pad) { display: none }
}

/* ==========================================================================
   Reward layer: title chip, combo meter, big stamps, achievement banner, chest and wheel buttons, the Rewards tab,
   chest opening, the daily wheel, the Royal Pass track, skills, ranking, wall-game extras
   ========================================================================== */
.hud-title { display: inline-block; margin: 1px 0; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #2a1813;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold)); justify-self: start; width: max-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

.combo { position: absolute; top: calc(var(--safe-t) + 222px + var(--hud-extra, 0px)); right: 16px; z-index: 6; display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px;
    padding: 6px 12px 9px; border-radius: 14px; background: linear-gradient(180deg, #3a1a10, #1f1210); box-shadow: inset 0 0 0 1.5px var(--gold), 0 8px 20px rgba(0, 0, 0, .5); overflow: hidden; pointer-events: none }
.combo-x { font: 400 24px/1 var(--display); color: var(--gold-hi); text-shadow: 0 2px 0 #6a160e }
.combo-l { font: 800 10px var(--body); letter-spacing: .14em; color: var(--ink-soft) }
.combo-l b { display: block; font-size: 18px; letter-spacing: 0; color: #fff3d6 }
.combo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--seal), var(--gold-hi)); transform-origin: left }
.combo.bump { animation: cbump .35s cubic-bezier(.3, 1.8, .5, 1) }
.combo.hot { box-shadow: inset 0 0 0 1.5px #ff7a4a, 0 0 22px rgba(255, 122, 74, .55), 0 8px 20px rgba(0, 0, 0, .5) }
.combo.hot .combo-x { color: #ffb08a }
@keyframes cbump { 40% { transform: scale(1.22) rotate(-3deg) } }
.combo-tag { font-size: 11px; color: #5fd0a8; font-weight: 800 }

.stamp-pop { position: absolute; left: 50%; top: 40%; z-index: 30; transform: translate(-50%, -50%); text-align: center; pointer-events: none; display: grid; gap: 2px }
.stamp-pop b { font: 400 clamp(38px, 11vw, 64px)/1 var(--display); color: var(--sc, var(--gold-hi)); text-shadow: 0 3px 0 #4a0e08, 0 0 28px var(--sc, var(--gold-hi)), 0 10px 30px rgba(0, 0, 0, .7); white-space: nowrap; letter-spacing: .02em }
.stamp-pop small { font: 800 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #fff3d6; text-shadow: 0 2px 6px rgba(0, 0, 0, .8) }
.stamp-pop.go { animation: stampgo 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards }
@keyframes stampgo { 0% { transform: translate(-50%, -50%) scale(2.4) rotate(-8deg); opacity: 0 } 18% { transform: translate(-50%, -50%) scale(.92) rotate(-3deg); opacity: 1 } 26% { transform: translate(-50%, -50%) scale(1.04) rotate(-3deg) } 78% { opacity: 1 } 100% { transform: translate(-50%, -62%) scale(1) rotate(-3deg); opacity: 0 } }

.ach-pop { position: absolute; top: calc(var(--safe-t) + 8px); left: 50%; z-index: 28; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px;
    border-radius: 16px; background: linear-gradient(180deg, #4a1c12, #241210); box-shadow: inset 0 0 0 1.5px var(--gold-hi), 0 0 26px rgba(255, 211, 106, .35), 0 12px 28px rgba(0, 0, 0, .55); min-width: min(320px, 90vw); pointer-events: none }
.ach-pop.go { animation: achin 2.7s cubic-bezier(.2, 1.3, .4, 1) forwards }
@keyframes achin { 0% { transform: translate(-50%, -140%) } 12% { transform: translate(-50%, 0) } 85% { transform: translate(-50%, 0); opacity: 1 } 100% { transform: translate(-50%, -140%); opacity: 0 } }
.ach-pop > span:last-child { display: grid; line-height: 1.25 }
.ach-pop small { font: 800 10px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold) }
.ach-pop b { font: 400 18px var(--display); color: #fff3d6 }
.ach-pop em { font-style: normal; font-size: 12px; color: var(--ink-soft) }
.ach-medal { font-size: 34px; animation: medal 1s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes medal { from { transform: scale(.2) rotate(-200deg) } }

/* the chest and wheel buttons */
.fab { position: relative }
.fab-n { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--seal); color: #fff; font: 800 12px/22px var(--body); font-style: normal;
    box-shadow: 0 0 0 2px var(--lacquer); text-align: center }
.fab.ready { animation: fabwiggle 2.6s ease-in-out infinite }
.fab-chest.ready { box-shadow: 0 0 0 2px var(--rc, var(--gold)), 0 0 18px var(--rc, var(--gold)), 0 4px 0 #0c0606 }
.fab-wheel.ready { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 18px rgba(255, 211, 106, .7), 0 4px 0 #0c0606 }
.fab-wheel.ready span { animation: spin 3s linear infinite }
.fab.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes fabwiggle { 0%, 82%, 100% { transform: none } 86% { transform: rotate(-9deg) scale(1.08) } 90% { transform: rotate(8deg) scale(1.08) } 94% { transform: rotate(-4deg) } }
.fly-chest { position: absolute; z-index: 32; font-size: 34px; margin: -20px 0 0 -20px; pointer-events: none; transition: transform .75s cubic-bezier(.5, -0.3, .7, 1), opacity .75s; filter: drop-shadow(0 0 10px var(--rc, #fff)) }
.fly-chest.r-common { --rc: #e8dcc6 } .fly-chest.r-rare { --rc: #5fd0a8 } .fly-chest.r-epic { --rc: #c27cff } .fly-chest.r-legendary { --rc: #ffd36a }
.tabs button.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1) }

/* Rewards tab */
.chest-stash { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px }
.chest-stash button { width: 100%; border: 0; border-radius: 14px; padding: 10px 4px 8px; display: grid; justify-items: center; gap: 2px; background: rgba(0, 0, 0, .28);
    box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--ink-soft) }
.chest-stash .cs-box { font-size: 30px; filter: grayscale(1) opacity(.45) }
.chest-stash b { font: 400 20px/1 var(--display); color: var(--ink-soft) }
.chest-stash small { font-size: 11px; font-weight: 700 }
.chest-stash li.has button { box-shadow: inset 0 0 0 2px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 45%, transparent); background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 22%, transparent), rgba(0, 0, 0, .3)); color: var(--rc); animation: ready 1.6s ease-in-out infinite }
.chest-stash li.has .cs-box { filter: drop-shadow(0 0 8px var(--rc)); animation: fabwiggle 2.2s ease-in-out infinite }
.chest-stash li.has b { color: #fff3d6 }
.chip.ready { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1813; animation: ready 1.6s infinite }

.pass-head { display: flex; gap: 12px; align-items: center }
.pass-tier { width: 64px; height: 64px; flex: none; border-radius: 16px; display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 35% 30%, #e9603f, var(--seal-deep));
    box-shadow: inset 0 0 0 2px var(--gold-hi), 0 6px 14px rgba(0, 0, 0, .4); line-height: 1 }
.pass-tier small { font: 800 10px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #ffe0b0 }
.pass-tier b { font: 400 28px var(--display); color: #fff3d6 }
.pass-meta { flex: 1; display: grid; gap: 5px; min-width: 0 }
.pass-track { list-style: none; margin: 0; padding: 4px 2px 10px; display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin }
.pass-track li { flex: none; scroll-snap-align: start }
.pass-track button { position: relative; width: 58px; height: 74px; border: 0; border-radius: 12px; display: grid; align-content: space-between; justify-items: center; padding: 5px 2px 7px;
    background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--ink-soft); opacity: .6 }
.pass-track li.big button { box-shadow: inset 0 0 0 1px var(--gold); background: linear-gradient(180deg, rgba(255, 211, 106, .12), rgba(0, 0, 0, .3)) }
.pass-track li.open button { opacity: 1; box-shadow: inset 0 0 0 2px var(--gold-hi), 0 0 14px rgba(255, 211, 106, .45); animation: ready 1.4s infinite }
.pass-track li.got button { opacity: .85; box-shadow: inset 0 0 0 1px rgba(95, 208, 168, .5) }
.pass-track small { font: 800 11px var(--body); color: var(--gold) }
.pass-track .pr { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1px 3px; font-size: 18px; line-height: 1.1 }
.pass-track .pr small { font-size: 11px; color: var(--ink) }
.pr-chest { filter: drop-shadow(0 0 5px var(--rc)) }
.pass-track .ck { position: absolute; top: -5px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: #2f8a6a; color: #fff; font: 800 11px/18px var(--body); font-style: normal }
.pass-track .ck.go { background: var(--seal); animation: pulse 1.2s infinite }

.ach-list, .codex, .skills, .ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.ach-list li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line-soft) }
.ach-list li.m3 { box-shadow: inset 0 0 0 1.5px var(--gold-hi); background: linear-gradient(180deg, rgba(255, 211, 106, .1), rgba(0, 0, 0, .2)) }
.a-ic { font-size: 22px; text-align: center }
.a-text { display: grid; gap: 3px; min-width: 0 }
.a-text b { font-size: 14px }
.a-text small { font-size: 11px; color: var(--ink-soft) }
.a-track { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden }
.a-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--seal), var(--gold-hi)); border-radius: 3px; transition: width .8s }
.a-medals { display: flex; gap: 1px; font-size: 15px }
.a-medals i { font-style: normal; filter: grayscale(1) opacity(.3) }
.a-medals i.on { filter: none }
.codex li { display: grid; grid-template-columns: 90px 1fr 46px; gap: 10px; align-items: center; font-size: 13px }
.codex b { text-align: right; font-variant-numeric: tabular-nums; color: var(--gold-hi) }

.skills li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line-soft) }
.skills .zh { width: 34px; height: 34px; display: grid; place-items: center; background: var(--seal-deep); color: #fff1d6; border-radius: 8px; font: 19px/1 var(--brush) }
.skills .pips { display: inline-flex; gap: 3px; vertical-align: 1px }
.skills .pips i { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: rgba(255, 255, 255, .1) }
.skills .pips i.on { background: var(--gold-hi); box-shadow: 0 0 6px rgba(255, 211, 106, .7) }
.small-note.hot b { color: var(--gold-hi); animation: pulse 1.4s infinite; display: inline-block }

.ranking li button { padding: 6px 10px }
.ranking .rk { width: 36px; text-align: center; font: 700 14px var(--body); color: var(--gold); flex: none }
.ranking li.me button { box-shadow: inset 0 0 0 2px var(--gold-hi); background: rgba(255, 211, 106, .1) }
.ranking li.gap { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 0 }
.title-chip { font-size: 12px }
.days li .day-bonus { position: absolute; bottom: 1px; right: 3px; font-size: 10px; font-style: normal }
.dye-dot.big { width: 34px; height: 34px }

/* opening a chest */
.chest-modal { background: radial-gradient(circle at 50% 42%, rgba(60, 20, 14, .85), rgba(6, 3, 3, .94)) }
.chest-stage { position: relative; width: min(440px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center }
.chest-rays { position: absolute; left: 50%; top: 150px; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none; opacity: .25;
    background: repeating-conic-gradient(from 0deg, var(--rc, #e8dcc6) 0 9deg, transparent 9deg 18deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
    animation: spin 14s linear infinite; transition: opacity .4s }
.chest-modal[data-state="open"] .chest-rays { opacity: .55 }
.chest-modal[data-rar="common"] { --rc: #e8dcc6 } .chest-modal[data-rar="rare"] { --rc: #5fd0a8 } .chest-modal[data-rar="epic"] { --rc: #c27cff } .chest-modal[data-rar="legendary"] { --rc: #ffd36a }
.chest-rar { margin: 0; font: 400 30px var(--display); text-shadow: 0 0 22px currentColor, 0 3px 0 rgba(0, 0, 0, .6); transition: color .3s }
.chest-hint { margin: 0; font: 800 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #fff3d6; animation: pulse 1s infinite; min-height: 20px }
.chest-box { position: relative; width: 180px; height: 150px; border: 0; background: none; padding: 0; margin-top: 30px; cursor: pointer; touch-action: manipulation }
.cb-glow { position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(circle, var(--rc), transparent 65%); opacity: .45; animation: ready 1.2s infinite }
.cb-body { position: absolute; left: 10px; right: 10px; bottom: 0; height: 84px; border-radius: 8px 8px 14px 14px;
    background: linear-gradient(90deg, transparent 18%, var(--rc) 18% 26%, transparent 26% 74%, var(--rc) 74% 82%, transparent 82%), linear-gradient(180deg, #8a5228, #5a3014);
    box-shadow: inset 0 0 0 3px #3a1c0a, inset 0 -8px 0 rgba(0, 0, 0, .25), 0 12px 24px rgba(0, 0, 0, .6) }
.cb-lid { position: absolute; left: 4px; right: 4px; bottom: 76px; height: 62px; border-radius: 60px 60px 10px 10px; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
    background: linear-gradient(90deg, transparent 18%, #3a1c0a 18% 20%, transparent 20% 80%, #3a1c0a 80% 82%, transparent 82%), linear-gradient(180deg, color-mix(in srgb, var(--rc) 85%, #fff), var(--rc) 60%, color-mix(in srgb, var(--rc) 60%, #3a1c0a));
    box-shadow: inset 0 0 0 3px #3a1c0a, inset 0 6px 0 rgba(255, 255, 255, .35) }
.cb-lock { position: absolute; left: 50%; bottom: 58px; width: 30px; height: 34px; margin-left: -15px; border-radius: 6px; background: linear-gradient(180deg, #ffe08a, #b88a2a); box-shadow: inset 0 0 0 2px #5a3a0a }
.cb-lock::after { content: ""; position: absolute; left: 50%; top: 11px; width: 6px; height: 12px; margin-left: -3px; border-radius: 3px; background: #3a1c0a }
.chest-box.shake1 { animation: cshake .4s }
.chest-box.shake2 { animation: cshake .45s; filter: brightness(1.15) }
.chest-box.shake3 { animation: cshake2 .5s; filter: brightness(1.3) }
@keyframes cshake { 20% { transform: rotate(-6deg) scale(1.04) } 40% { transform: rotate(6deg) scale(1.06) } 60% { transform: rotate(-4deg) } 80% { transform: rotate(3deg) } }
@keyframes cshake2 { 15% { transform: rotate(-10deg) scale(1.1) translateY(-6px) } 35% { transform: rotate(10deg) scale(1.12) } 55% { transform: rotate(-7deg) scale(1.1) } 75% { transform: rotate(5deg) } }
.chest-modal[data-state="open"] .cb-lid { transform: translateY(-34px) rotate(-24deg) translateX(-30px) }
.chest-modal[data-state="open"] .cb-lock { opacity: 0; transition: opacity .2s }
.chest-modal[data-state="open"] .chest-box { animation: copen .5s cubic-bezier(.3, 1.6, .5, 1) }
@keyframes copen { 30% { transform: scale(1.15, .85) } 60% { transform: scale(.95, 1.08) } }
.chest-loot { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 10px }
.loot { width: 92px; padding: 10px 6px 8px; border-radius: 14px; display: grid; justify-items: center; gap: 2px; background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .35));
    box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 40%, transparent); animation: lootin .55s cubic-bezier(.2, 1.6, .4, 1) both }
.loot .l-ic { font-size: 30px; line-height: 1.1 }
.loot b { font: 400 17px/1.15 var(--display); color: #fff3d6; text-align: center }
.loot small { font-size: 11px; color: var(--ink-soft); line-height: 1.2 }
.loot.new { width: 128px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rc) 35%, transparent), rgba(0, 0, 0, .4)); box-shadow: inset 0 0 0 2px var(--rc), 0 0 28px var(--rc) }
.loot.new small { color: var(--rc); font-weight: 800; letter-spacing: .1em }
@keyframes lootin { from { transform: translateY(40px) scale(.3) rotate(-12deg); opacity: 0 } }
.row.center { justify-content: center }

/* the daily wheel */
.wheel-dlg { overflow: hidden }
.wheel-wrap { position: relative; width: min(300px, 76vw); aspect-ratio: 1; margin: 8px auto 0 }
.wheel-disc { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 6px var(--gold), 0 0 0 9px #3a1c0a, 0 0 30px rgba(255, 211, 106, .35), inset 0 0 30px rgba(0, 0, 0, .5); will-change: transform }
.wh-slice { position: absolute; left: 50%; top: 0; width: 70px; height: 50%; margin-left: -35px; transform-origin: 50% 100%; display: grid; justify-items: center; align-content: start; padding-top: 12px; gap: 1px; pointer-events: none }
.wh-slice i { font-style: normal; font-size: 24px; line-height: 1 }
.wh-slice small { font-size: 9px; font-weight: 800; color: #fff3d6; text-transform: uppercase; letter-spacing: .04em; text-align: center; line-height: 1.1; max-width: 62px }
.wh-slice.jp small { color: #3a1c0a }
.wheel-pin { position: absolute; left: 50%; top: -12px; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 26px solid var(--gold-hi); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6)); z-index: 2; transform-origin: 50% 0 }
.wheel-pin.flick { animation: flick .12s }
@keyframes flick { 50% { transform: rotate(-18deg) } }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%; border: 0; z-index: 2; font: 800 16px var(--body); letter-spacing: .08em; color: #fff6e4;
    background: radial-gradient(circle at 35% 30%, #f06a46, var(--seal-deep)); box-shadow: inset 0 0 0 3px var(--gold-hi), 0 5px 0 #6a160e, 0 10px 20px rgba(0, 0, 0, .5) }
.wheel-hub.ready { animation: ready 1.2s infinite }
.wheel-hub:disabled { filter: grayscale(.7) brightness(.7) }
.wheel-hub:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 0 0 3px var(--gold-hi), 0 2px 0 #6a160e }
.wh-result { margin: 4px 0 0; font: 400 22px var(--display); min-height: 30px; color: var(--gold-hi) }

/* wall game extras */
.def-hud { flex-wrap: wrap }
.def-pot { border: 0; border-radius: 999px; padding: 3px 10px; font: 700 15px var(--body); background: rgba(255, 255, 255, .08); color: var(--ink); display: inline-flex; gap: 4px; align-items: center; margin-left: auto }
.def-pot:disabled { opacity: .45 }
.def-pot.ready { background: linear-gradient(180deg, #ff9a5a, #c63a24); box-shadow: 0 0 14px rgba(255, 122, 74, .8); animation: ready 1s infinite }
.slot.gold .ladder { filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.25) drop-shadow(0 0 6px #ffd36a) }
.def-board.boom { animation: boom .45s }
@keyframes boom { 0% { filter: brightness(2.2) saturate(1.5) } 100% { filter: none } }
.rw.chest { box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 10px color-mix(in srgb, var(--rc) 50%, transparent) }

@media (max-width: 760px) {
    #app:has(.sheet:not(.collapsed)) .combo { display: none }
    .tabs button { font-size: 10px }
    .tabs .tab-ic { font-size: 18px }
}
@media (max-width: 380px) {
    .loot { width: 80px }
    .chest-stash .cs-box { font-size: 24px }
}

/* ---------- first visit: newcomers move in, a clearer landing ---------- */
.btn.ghost.splash-new { justify-self: center; min-width: min(300px, 100%); min-height: 48px; padding: 10px 18px; border-radius: 12px; background: rgba(255, 243, 214, .06); box-shadow: inset 0 0 0 1.5px rgba(255, 211, 106, .55); color: var(--gold-hi); font-weight: 700; font-size: 16px; text-decoration: none }
.splash-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 6px 0 0 }
.splash-perks span { font-size: 12px }
.splash-perks span, .welcome-gifts span { padding: 4px 9px; border-radius: 999px; background: rgba(255, 243, 214, .08); box-shadow: inset 0 0 0 1px var(--line-soft); font-size: 12.5px; font-weight: 600; color: var(--ink) }
.welcome-gifts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 2px 0 }
.nu-note { border: 1px dashed rgba(255, 211, 106, .4); border-radius: 10px; padding: 8px 10px; text-align: left }
.nu-note b, #search-note b { color: var(--gold-hi) }
#search-note .move-in { margin-top: 8px }
#claim.fresh .how, #claim.fresh .demo-flag { display: none }
.link#skill-reset { padding: 8px 0; margin: -8px 0 }
/* small phones (iPhone SE and smaller): keep the header on one line */
@media (max-width: 360px) {
    .brand { gap: 7px }
    .brand .en { font-size: 14px; white-space: nowrap }
    .brand .pop { font-size: 11px; white-space: nowrap }
    .hud-rank, .hud-honour { white-space: nowrap }
    .hud-id { min-width: 84px }
    .seg button { padding: 6px 8px }
}
/* bigger thumbs: close buttons, platform switch, fire pot; the wall game uses the whole phone */
.close { width: 40px; height: 40px }
.seg.wide button { min-height: 40px }
.def-pot { min-height: 36px; padding: 4px 12px }
@media (max-width: 420px) {
    .dialog.defend { padding: 16px 12px }
    .def-board { height: min(360px, 52vh) }
    .def-slots { inset: 52px 4px 0; gap: 3px }
}
/* long usernames never push a dialog wider than the phone */
.dialog > * { min-width: 0 }
.dialog h2, .trade-head h2, .plaque, .addr, .say { overflow-wrap: anywhere }
.share-btn { margin-top: 8px; gap: 8px }
.share-btn small { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); color: #ffe7a8 }
/* phones held sideways: the round buttons go in a row so they never reach the sound button */
@media (min-width: 761px) and (max-height: 520px) {
    .fabs { grid-auto-flow: column; bottom: 24px; right: 100px }
}

/* ---------- more dopamine: treasury, Lantern Rush, games corner, Tanghulu Catch, codes, welcome back ---------- */
.fab-n.coin { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a1813 }
.fab-home.ready { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(255, 211, 106, .45), 0 4px 0 #0c0606 }
.fab-home.jar-full { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 22px rgba(255, 211, 106, .85), 0 4px 0 #0c0606 }
.fab-play.ready { box-shadow: 0 0 0 2px var(--seal), 0 0 18px rgba(226, 88, 61, .7), 0 4px 0 #0c0606 }
.fab-play.ready span { animation: bob 1.2s ease-in-out infinite }
@keyframes bob { 30% { transform: translateY(-4px) } 60% { transform: none } }

/* the next level is close: the ring breathes */
.lvl-ring.close { animation: closeglow 1.3s ease-in-out infinite }
@keyframes closeglow { 50% { filter: drop-shadow(0 0 7px rgba(255, 211, 106, .95)) brightness(1.15) } }

/* Lantern Rush */
.rush-pill { position: absolute; left: 50%; bottom: calc(126px + var(--safe-b)); transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; white-space: nowrap;
    font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); background: linear-gradient(180deg, #3a1a10, #1f1210); box-shadow: inset 0 0 0 1.5px var(--line), 0 6px 16px rgba(0, 0, 0, .5); pointer-events: none }
.rush-pill b { color: var(--gold-hi) }
.rush-pill .rush-ic { font-size: 17px; line-height: 1 }
.rush-pill.on { background: linear-gradient(180deg, #b5321f, #6a160e); box-shadow: inset 0 0 0 1.5px var(--gold-hi), 0 0 22px rgba(255, 122, 74, .6), 0 6px 16px rgba(0, 0, 0, .5); animation: rushpulse 1.4s ease-in-out infinite }
.rush-pill.on b { color: #fff3d6 }
.rush-pill.on .rush-ic { animation: bob 1s ease-in-out infinite }
@keyframes rushpulse { 50% { box-shadow: inset 0 0 0 1.5px var(--gold-hi), 0 0 34px rgba(255, 170, 74, .85), 0 6px 16px rgba(0, 0, 0, .5) } }
.hud.rush .hud-bar { background: linear-gradient(90deg, #ff7a4a, var(--gold-hi), #fff3d6, var(--gold-hi)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite }
@keyframes shimmer { to { background-position: -200% 0 } }
.rush-tag { color: #ffb08a }
@media (max-width: 760px) {
    #app:has(.sheet:not(.collapsed)) .rush-pill, #app:has(.card:not([hidden])) .rush-pill { display: none }
}
@media (min-width: 761px) {
    .rush-pill { left: auto; right: 22px; bottom: auto; top: calc(var(--safe-t) + 54px); transform: none }
}

/* the treasury on your house card */
.jar { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 211, 106, .12), rgba(255, 243, 214, .03)); box-shadow: inset 0 0 0 1px var(--line) }
.jar-ic { font-size: 28px; line-height: 1; flex: none }
.jar-t { display: grid; gap: 3px; flex: 1; min-width: 0; line-height: 1.2 }
.jar-t b { font-size: 14px; font-variant-numeric: tabular-nums }
.jar-t small { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums }
.jar .track { height: 7px }
.jar .btn { flex: none; min-height: 38px }
.jar.full { box-shadow: inset 0 0 0 1.5px var(--gold-hi), 0 0 16px rgba(255, 211, 106, .35) }
.jar.full .jar-ic { animation: bob 1s ease-in-out infinite }
.jar-note { margin: 4px 0 0; font-size: 12px }

/* games corner */
.game-card { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; padding: 12px; border-radius: 14px; color: var(--ink);
    background: linear-gradient(90deg, rgba(226, 88, 61, .3), rgba(255, 243, 214, .04)); box-shadow: inset 0 0 0 1.5px var(--line), 0 4px 0 #0c0606; transition: transform .1s }
.game-card.wall { background: linear-gradient(90deg, rgba(106, 58, 138, .35), rgba(255, 243, 214, .04)) }
.game-card:active { transform: translateY(2px) }
.gc-ic { font-size: 34px; line-height: 1; flex: none }
.gc-t { display: grid; flex: 1; min-width: 0; line-height: 1.25 }
.gc-t b { font-size: 16px }
.gc-t small { font-size: 12px; color: var(--ink-soft) }
.gc-go { flex: none; padding: 7px 14px; border-radius: 10px; font-weight: 800; color: #2a1813; background: linear-gradient(180deg, var(--gold-hi), var(--gold)) }

/* Tanghulu Catch */
.cat-board { height: min(400px, 56vh); touch-action: none; background: linear-gradient(180deg, #1a0e1e 0%, #3a1420 55%, #4a2416 100%) }
.cat-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block }
.cat-board.fever { animation: fever .5s ease-in-out infinite alternate }
@keyframes fever { to { box-shadow: inset 0 0 0 3px var(--gold-hi), inset 0 0 40px rgba(255, 211, 106, .45) } }
.cat-fever { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .07); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4) }
.cat-fever i { position: absolute; inset: 0 auto 0 0; width: calc(var(--f) * 100%); background: linear-gradient(90deg, var(--seal), var(--gold-hi)); transition: width .15s }
.cat-fever span { position: relative; display: block; text-align: center; font: 800 11px/16px var(--body); letter-spacing: .2em; color: #fff3d6; text-shadow: 0 1px 0 #000 }
.cat-board.shake { animation: shake .35s }

/* secret codes */
.code-form { display: flex; gap: 8px }
.code-form input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 0; font: 700 16px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--line) }
.code-form .btn { flex: none; min-height: 44px }
.code-form.shake { animation: shake .35s }
#code-msg.ok { color: #5fd0a8; font-weight: 700 }

/* welcome back */
.back-dlg .pose-side { position: absolute; right: 4px; top: 8px; width: 78px; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); animation: hop .6s .2s cubic-bezier(.3, 1.6, .5, 1) both }
.back-dlg h2 { padding-right: 70px; text-align: left }
.back-dlg .kicker, .back-dlg > .note { text-align: left }
.back-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left }
.back-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 243, 214, .05); box-shadow: inset 0 0 0 1px var(--line-soft); animation: pop .35s cubic-bezier(.3, 1.4, .5, 1) both }
.back-list li:nth-child(2) { animation-delay: .08s } .back-list li:nth-child(3) { animation-delay: .16s } .back-list li:nth-child(4) { animation-delay: .24s } .back-list li:nth-child(5) { animation-delay: .32s }
.back-list li > span:first-child { font-size: 22px; flex: none }
.back-list b { color: var(--gold-hi) }
/* short phones: five round buttons must stay clear of the quest bar */
@media (max-width: 760px) and (max-height: 700px) {
    .fabs { gap: 6px }
    .fab { width: 46px; height: 46px; border-radius: 14px }
    .fab span { font-size: 19px }
    .fab small { margin-top: 0 }
}
/* a tall house card scrolls instead of running off the top of a small phone */
@media (max-width: 760px) {
    .card { max-height: calc(100% - 108px - var(--safe-b) - var(--safe-t) - 52px); overflow-y: auto; overscroll-behavior: contain }
}
.share-btn { flex-wrap: wrap; row-gap: 2px }
.share-btn small { white-space: nowrap }
/* a tall house card on a short phone: Xiaoyu steps aside instead of sitting on the header */
@media (max-width: 760px) {
    #app:has(.card:not([hidden])) .xiaoyu { bottom: min(calc(108px + var(--safe-b) + var(--card-h, 260px)), calc(100% - var(--safe-t) - 140px)) }
}
@media (max-width: 760px) and (max-height: 700px) {
    #app:has(.card:not([hidden])) .xiaoyu { display: none }
}
@media (max-width: 360px) {
    .share-btn small { display: table; margin: 3px auto 0 }
}
