:root {
  --ink: #2b211c;
  --muted: #6f5b4d;
  --paper: #f4e2bd;
  --paper-light: #fff2d7;
  --wood: #583226;
  --red: #a7432e;
  --red-dark: #70291f;
  --gold: #ddac4d;
  --jade: #3f704d;
  --shadow: rgba(37, 20, 13, .36);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { touch-action: manipulation; }
body {
  margin: 0;
  color: var(--ink);
  background: #201916 radial-gradient(circle at 50% 10%, #5d4637 0, #241b17 58%);
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
button, input { font: inherit; }
button { cursor: pointer; }
.game-shell { --shop-scene: url("assets/shop-level-1.webp"); position: relative; width: 100%; max-width: 430px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 42px #120b08; }
.bgm-toggle-btn { position: relative; z-index: 2; flex: 0 0 38px; width: 38px; min-width: 38px; height: 38px; min-height: 38px; display: grid; place-items: center; grid-gap: 0; gap: 0; padding: 3px 2px 2px; color: #ffe7ae; background: rgba(62,31,22,.9); border: 1px solid #c69755; border-radius: 50%; box-shadow: 0 2px 0 #24130e, 0 3px 10px rgba(30,14,8,.28); font-family: inherit; }
.bgm-toggle-btn span { font-size: 1rem; line-height: .9; }
.bgm-toggle-btn small { font-size: .43rem; font-weight: 800; line-height: 1; }
.bgm-toggle-btn.is-muted { color: #9b806b; background: rgba(45,36,31,.88); border-color: #715c4a; }
.global-back-btn { position: absolute; z-index: 30; top: 18px; left: 8px; width: 35px; height: 35px; padding: 0 0 3px; display: grid; place-items: center; color: #fff0c9; background: rgba(52,29,23,.92); border: 1px solid #b98a55; border-radius: 50%; box-shadow: 0 2px 0 #1b100c, 0 4px 10px rgba(0,0,0,.28); font-size: 1.55rem; line-height: 1; }
.global-back-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #1b100c; }
.global-back-btn:disabled { opacity: .3; cursor: default; }
.titlebar {
  height: 74px; min-height: 74px; flex-shrink: 0; padding: 10px 12px; color: #fff1d1;
  display: flex; align-items: center; justify-content: space-between; grid-gap: 7px; gap: 7px;
  background: linear-gradient(90deg, rgba(47,27,20,.98), rgba(86,49,35,.95));
  border-bottom: 4px solid #c7974e; box-shadow: 0 4px 18px #160d09;
}
.titlebar > div:first-child { padding-left: 36px; }
.titlebar h1 { margin: 2px 0 0; font-size: 1.16rem; letter-spacing: .04em; white-space: nowrap; }
.titlebar > div:not(.top-stats) { min-width: 0; }
.world-status-strip { position: absolute; z-index: 15; left: 8px; right: 8px; top: 82px; display: grid; grid-template-columns: 1.35fr .64fr 1fr; grid-gap: 5px; gap: 5px; pointer-events: none; }
.world-status-strip > div { min-width: 0; min-height: 38px; padding: 4px 7px; display: grid; align-content: center; color: #3c281d; background: rgba(247,225,180,.94); border: 1px solid #795039; border-radius: 7px; box-shadow: 0 2px 0 rgba(48,27,19,.35); }
.world-status-strip small { color: #82654d; font-size: .56rem; line-height: 1; }
.world-status-strip strong { overflow: hidden; margin-top: 3px; font-size: .7rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.world-status-strip .special-node { color: #fff0cf; background: rgba(66,80,57,.94); border-color: #b48c51; }
.world-status-strip .special-node small { color: #d5c29a; }
.time-box-entry, .feature-entry { position: absolute; z-index: 16; top: 174px; width: 48px; height: 62px; padding: 4px 3px; display: grid; place-items: center; color: #ffe9b5; background: linear-gradient(rgba(126,72,47,.96), rgba(69,35,27,.97)); border: 2px solid #d0a15f; border-radius: 9px; box-shadow: 0 3px 0 #24130f, 0 5px 12px rgba(31,17,12,.32); }
.time-box-entry { left: 9px; }
.decorate-entry { left: 64px; background: linear-gradient(rgba(72,91,67,.96), rgba(42,57,42,.97)); border-color: #c7aa68; }
.recipe-study-entry { left: 119px; background: linear-gradient(rgba(133,77,40,.96), rgba(77,42,27,.97)); border-color: #d6ad68; }
.save-load-entry { position: absolute; z-index: 17; top: 126px; right: 8px; width: 44px; display: grid; grid-gap: 4px; gap: 4px; }
.save-load-entry button { width: 44px; min-height: 43px; padding: 3px 2px; display: grid; place-items: center; color: #ffe9b5; background: linear-gradient(rgba(108,64,43,.97), rgba(59,31,24,.98)); border: 1px solid #d0a15f; border-radius: 7px; box-shadow: 0 2px 0 #24130f; }
.save-load-entry button span { font-family: "STKaiti", "KaiTi", serif; font-size: .9rem; font-weight: 900; line-height: 1; }
.save-load-entry button small { color: #efd293; font-size: .48rem; font-weight: 800; line-height: 1; }
.save-load-entry button:active { transform: translateY(1px); box-shadow: 0 1px 0 #24130f; }
.save-load-entry .reset-progress-btn { color: #ffe0c0; background: linear-gradient(rgba(126,55,41,.97), rgba(72,31,27,.98)); border-color: #c77b57; }
.save-slot-panel { position: absolute; z-index: 30; top: 0; right: 50px; width: 174px; padding: 7px; color: #4a2d20; background: rgba(250,231,190,.98); border: 2px solid #9b653f; border-radius: 9px; box-shadow: 0 7px 18px rgba(32,17,12,.4); }
.save-slot-panel[hidden] { display: none; }
.save-slot-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.save-slot-panel header strong { font-size: .63rem; }
.save-slot-panel header button { width: 23px; min-height: 23px; color: #4a2d20; background: #dfbd80; border: 0; border-radius: 50%; font-size: .8rem; box-shadow: none; }
.save-slot-panel > div { display: grid; grid-gap: 4px; gap: 4px; }
.save-slot-panel .save-slot-option { width: 100%; min-height: 39px; padding: 4px 7px; display: grid; grid-template-columns: auto 1fr; grid-gap: 7px; gap: 7px; align-items: center; color: #4a2d20; background: #f6ddb0; border: 1px solid #b88855; border-radius: 6px; box-shadow: none; text-align: left; }
.save-slot-option b { font-size: .62rem; }
.save-load-entry .save-slot-option span { display: grid; place-items: initial; font-family: inherit; font-size: .51rem; font-weight: 400; line-height: 1.25; }
.save-slot-option small { color: #83644d; font-size: .45rem; }
.save-slot-option:disabled { opacity: .5; }
.save-load-entry em { position: absolute; top: 95px; right: 0; width: max-content; max-width: 118px; padding: 3px 6px; color: #fff0cf; background: rgba(62,32,24,.9); border-radius: 5px; font-size: .48rem; font-style: normal; opacity: 0; pointer-events: none; transition: opacity .2s; }
.save-load-entry em.show { opacity: 1; }
.game-shell:not(.screen-hubScreen) .save-load-entry { display: none; }
.cover-screen { position: absolute; z-index: 100; top: 0; right: 0; bottom: 0; left: 0; min-height: 100%; overflow: hidden; background: #29170f url("assets/game-cover-v5.webp") center / cover no-repeat; }
.cover-screen.active { display: block; }
.cover-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(to bottom, rgba(35,18,12,.18) 0%, rgba(35,18,12,.03) 35%, rgba(35,18,12,.08) 62%, rgba(31,15,10,.78) 100%); }
.cover-title { position: absolute; top: 9%; left: 8%; right: 8%; color: #fff0c3; text-align: center; text-shadow: 0 3px 0 #4f2418, 0 5px 16px rgba(33,15,9,.72); }
.cover-title small { display: inline-block; padding: 4px 12px; color: #5a2b1d; background: rgba(250,221,157,.9); border: 1px solid #8b5030; border-radius: 999px; font-size: .58rem; font-weight: 900; letter-spacing: .12em; text-shadow: none; }
.cover-title h2 { margin: 12px 0 8px; font-family: "STKaiti", "KaiTi", serif; font-size: 2.35rem; line-height: 1.05; letter-spacing: .06em; }
.cover-title p { margin: 0; font-size: .68rem; font-weight: 700; line-height: 1.65; }
.cover-enter-btn { position: absolute; left: 14%; right: 14%; bottom: 8%; min-height: 55px; color: #fff1cf; background: linear-gradient(#b84d31, #8f3526); border: 2px solid #efc477; border-radius: 11px; box-shadow: inset 0 0 0 2px #7b281e, 0 5px 0 #3c1b15, 0 10px 24px rgba(27,12,8,.45); font-family: "STKaiti", "KaiTi", serif; font-size: 1.15rem; font-weight: 900; letter-spacing: .16em; }
.cover-enter-btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px #7b281e, 0 2px 0 #3c1b15; }
.cover-seal { position: absolute; right: 7%; bottom: 17%; width: 38px; height: 38px; display: grid; place-items: center; color: #ffe5af; background: rgba(143,46,31,.9); border: 2px solid #f0bf72; font-family: "STKaiti", "KaiTi", serif; font-size: .55rem; font-weight: 900; line-height: 1; writing-mode: vertical-rl; }
.game-shell.screen-coverScreen > .global-back-btn,
.game-shell.screen-coverScreen > .titlebar,
.game-shell.screen-coverScreen > .world-status-strip,
.game-shell.screen-coverScreen > .time-box-entry,
.game-shell.screen-coverScreen > .feature-entry,
.game-shell.screen-coverScreen > .save-load-entry { display: none; }
.time-box-entry span, .feature-entry span { font-family: "STKaiti", "KaiTi", serif; font-size: 1.18rem; font-weight: 900; line-height: 1; }
.time-box-entry small, .feature-entry small { color: #efd293; font-size: .62rem; font-weight: 800; line-height: 1; }
.time-box-entry:hover, .feature-entry:hover { filter: brightness(1.08); transform: translateY(-1px); }
.time-box-entry:active, .feature-entry:active { transform: translateY(1px); box-shadow: 0 1px 0 #24130f; }
.game-shell:not(.screen-businessScreen) .time-box-entry, .game-shell:not(.screen-businessScreen) .feature-entry { top: 126px; }
.seal, .eyebrow { margin: 0; color: #b95138; font-weight: 800; letter-spacing: .18em; font-size: .84rem; }
.titlebar .seal { color: #ddb96e; }
.top-stats { display: flex; grid-gap: 10px; gap: 10px; align-items: center; white-space: nowrap; }
.top-stats > span, .hud > div { background: rgba(47,27,20,.9); border: 1px solid #957253; border-radius: 10px; padding: 9px 13px; box-shadow: 0 2px 0 #1c110c; }
.coin b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #5a3b16; background: var(--gold); margin-right: 5px; }
.capital-display small { margin-right: 5px; color: #d9b875; font-size: .68rem; }
.screen { display: none; flex: 1; }
.screen.active { display: block; animation: reveal .4s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }
.start-screen {
  min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); height: calc(100dvh - 74px); place-items: end center; padding: 0 6px 7px;
  background: linear-gradient(180deg, rgba(30,18,13,.02), rgba(30,18,13,.2)), var(--shop-scene) center/cover;
}
.start-screen.active { display: grid; }
.hub-screen {
  min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); height: calc(100dvh - 74px); place-items: end center; padding: 0 10px 18px;
  background: linear-gradient(180deg, rgba(30,18,13,.04), rgba(30,18,13,.42)), var(--shop-scene) center/cover;
}
.hub-screen.active { display: grid; }
.hub-card { width: 100%; max-width: 400px; padding: 18px; }
.hub-heading { text-align: center; }
.hub-heading h2 { margin: 5px 0 4px; font-size: 1.65rem; }
.hub-heading > p:last-child { margin: 0 0 13px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.hub-actions { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; gap: 8px; }
.hub-choice { min-width: 0; min-height: 74px; padding: 9px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; text-align: left; color: #533625; background: rgba(247,232,196,.88); border: 1px solid #a87a4e; border-radius: 9px; box-shadow: 0 2px 0 rgba(79,43,28,.28); }
.hub-choice > span { grid-row: 1 / 3; font-size: 1.35rem; }
.hub-choice strong { align-self: end; font-size: .85rem; }
.hub-choice small { align-self: start; color: #866650; font-size: .58rem; line-height: 1.25; }
.hub-choice.primary-choice { grid-column: 1 / -1; color: #fff4d5; background: linear-gradient(#aa5238, #7e3224); border-color: #572319; }
.hub-choice.primary-choice small { color: #f0d1a1; }
.hub-choice.future-choice { background: rgba(221,216,188,.9); }
.hub-choice:active { transform: translateY(1px); box-shadow: none; }
.map-screen { position: relative; min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); height: calc(100dvh - 74px); overflow: hidden; background: #2b1b15; }
.map-screen.active { display: block; }
.game-shell.screen-mapScreen .time-box-entry, .game-shell.screen-mapScreen .feature-entry { display: none; }
.map-viewport { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; }
.map-viewport.dragging { cursor: grabbing; }
.map-track { width: 300%; height: 100%; display: flex; transform: translate3d(-33.333333%,0,0); will-change: transform; }
.map-panel { position: relative; flex: 0 0 33.333333%; height: 100%; overflow: hidden; background-position: center; background-size: cover; }
.map-panel::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: linear-gradient(180deg, rgba(29,17,12,.1), transparent 28%, transparent 68%, rgba(25,15,11,.48)); }
.map-panel-market { background-image: url("assets/map-east-market.webp"); }
.map-panel-shop { background-image: var(--shop-scene); }
.map-panel-gambling { background-image: url("assets/map-changle-gambling-house.webp"); }
.map-landmark { position: absolute; z-index: 2; left: 50%; bottom: 22%; width: 72%; max-width: 270px; padding: 11px 15px; display: grid; grid-gap: 2px; gap: 2px; transform: translateX(-50%); color: #fff1c9; text-align: center; background: linear-gradient(rgba(79,42,30,.94), rgba(48,27,23,.96)); border: 2px solid #d0a15f; border-radius: 11px; box-shadow: 0 5px 0 #24130f, 0 10px 22px rgba(25,12,8,.4); }
.map-landmark strong { font-family: "STKaiti", "KaiTi", serif; font-size: 1.18rem; letter-spacing: .12em; }
.map-landmark small { color: #dec18e; font-size: .65rem; }
.map-landmark span { margin-top: 5px; padding-top: 5px; color: #fff4d4; border-top: 1px solid rgba(218,174,103,.42); font-size: .7rem; font-weight: 900; }
.map-landmark.current-place { opacity: .88; }
.map-landmark.current-place span { color: #bcd19c; }
.map-topbar { position: absolute; z-index: 5; top: 58px; left: 13px; right: 13px; display: flex; align-items: center; grid-gap: 9px; gap: 9px; pointer-events: none; }
.map-topbar button { display: none; }
.map-topbar div { min-width: 0; padding: 7px 12px; display: grid; color: #fff2ce; background: rgba(61,35,27,.9); border: 1px solid #a9794d; border-radius: 9px; box-shadow: 0 2px 7px rgba(0,0,0,.28); }
.map-topbar small { color: #d8b67b; font-size: .58rem; }
.map-topbar strong { font-size: .84rem; }
.map-footer { position: absolute; z-index: 5; left: 50%; bottom: 12px; width: calc(100% - 24px); max-width: 390px; padding: 8px 12px; transform: translateX(-50%); color: #fff0ce; text-align: center; background: rgba(54,31,24,.9); border: 1px solid #a77b4e; border-radius: 11px; box-shadow: 0 5px 16px rgba(0,0,0,.34); pointer-events: none; }
.map-footer p { margin: 0 0 5px; font-size: .67rem; }
.map-footer > small { color: #d3b88a; font-size: .55rem; }
.map-dots { display: flex; justify-content: center; grid-gap: 7px; gap: 7px; pointer-events: auto; }
.map-dots button { width: 8px; height: 8px; padding: 0; background: #a48462; border: 0; border-radius: 50%; transition: width .2s, background .2s; }
.map-dots button.active { width: 23px; background: #efc66f; border-radius: 6px; }
.gambling-summary { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 5px; gap: 5px; margin-bottom: 9px; }
.gambling-summary span { min-width: 0; padding: 6px 3px; display: grid; grid-gap: 2px; gap: 2px; color: #7b604c; text-align: center; background: #edddba; border: 1px solid #c2a06f; border-radius: 6px; font-size: .57rem; }
.gambling-summary b { overflow: hidden; color: #35251d; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.gambling-tabs { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 5px; gap: 5px; }
.gambling-tabs button, .gambling-choices button { min-height: 34px; padding: 5px; color: #633c29; background: #ead4a9; border: 1px solid #aa7b4d; border-radius: 7px; font-size: .68rem; font-weight: 800; }
.gambling-tabs button.active, .gambling-choices button.active { color: #fff1cc; background: #7e3528; border-color: #4d211a; box-shadow: inset 0 0 0 1px #ba6849; }
.gambling-tabs button:disabled, .gambling-bet-editor button:disabled, .gambling-bet-additions button:disabled { opacity: .45; cursor: not-allowed; }
.gambling-rule { min-height: 42px; margin: 7px 0; padding: 7px 9px; color: #684c3a; background: rgba(246,230,194,.72); border-left: 3px solid #9d5637; font-size: .64rem; line-height: 1.45; }
.gambling-choices { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 6px; gap: 6px; }

.gambling-choice-prompt { margin: 6px 0; padding: 7px; color: #765744; text-align: center; background: #ead9b8; border-radius: 6px; font-size: .63rem; }
.gambling-bet-editor { margin: 8px 0 5px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-gap: 6px; gap: 6px; align-items: center; }
.gambling-bet-editor label { color: #775a44; font-size: .62rem; font-weight: 900; }
.gambling-bet-editor > div { min-width: 0; height: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: #fff3d8; border: 1px solid #9e7149; border-radius: 7px; overflow: hidden; }
.gambling-bet-editor input { min-width: 0; width: 100%; height: 100%; padding: 4px 6px; color: #3e291f; background: transparent; border: 0; outline: 0; font-weight: 900; }
.gambling-bet-editor strong { padding: 0 7px; color: #7c402a; font-size: .62rem; white-space: nowrap; }
.gambling-bet-editor > button { min-height: 36px; padding: 4px 7px; color: #68452f; background: #ead4a9; border: 1px solid #aa7b4d; border-radius: 7px; font-size: .58rem; font-weight: 800; }
.gambling-bet-additions { margin-bottom: 8px; display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 4px; gap: 4px; }
.gambling-bet-additions button { min-width: 0; min-height: 32px; padding: 4px 2px; color: #fff1cc; background: #73402e; border: 1px solid #4d291f; border-radius: 6px; font-size: .57rem; font-weight: 900; }
.paigow-hand { margin: 7px 0; display: grid; justify-items: center; grid-gap: 5px; gap: 5px; }
.paigow-hand small { color: #775a44; font-size: .62rem; font-weight: 900; }
.paigow-hand div { display: flex; grid-gap: 9px; gap: 9px; }
.paigow-hand b, .paigow-hand i { width: 45px; height: 58px; display: grid; place-items: center; color: #f8dfae; background: linear-gradient(#6f3024, #3f211c); border: 2px solid #b98651; border-radius: 7px; box-shadow: 0 3px 0 #2d1713; font-size: 1.35rem; font-style: normal; }
.paigow-hand i { color: #b28c65; background: #d9c39b; border-color: #9b754e; }
.gambling-result { min-height: 68px; padding: 10px; display: grid; place-items: center; align-content: center; grid-gap: 4px; gap: 4px; color: #79634f; text-align: center; background: #e8d5ad; border: 1px dashed #a9855c; border-radius: 8px; font-size: .68rem; }
.gambling-result strong { font-size: 1rem; }
.gambling-result small { font-size: .65rem; line-height: 1.35; }
.gambling-result.win { color: #356440; background: #dce7c9; border-color: #73905c; }
.gambling-result.lose { color: #963a2b; background: #eed1b4; border-color: #bb6d50; }
.gambling-result.draw { color: #655747; background: #e4ddc8; }
.gambling-play { width: 100%; min-height: 43px; margin: 8px 0 10px; padding: 8px 12px; font-size: .86rem; }
.game-dialog.gambling-scene-sheet { width: 94vw; max-width: 580px; max-height: 94vh; max-height: 94dvh; overflow: auto; background: #261712; border-color: #b48049; }
.game-dialog.gambling-scene-sheet form { padding: 10px 12px 14px; }
.gambling-scene-sheet form { position: relative; }
.gambling-scene-sheet > form > .eyebrow, .gambling-scene-sheet > form > h2 { color: #f3d28e; }
.gambling-scene-sheet > form > h2 { margin-bottom: 8px; }
.gambling-scene-sheet .dialog-close { color: #2e1b14; background: #d6ad6c; }
.gambling-rules-btn { position: absolute; z-index: 8; top: 43px; left: 120px; min-height: 31px; padding: 3px 10px; color: #f6d48c; background: #623322; border: 1px solid #d29a53; border-radius: 7px; box-shadow: 0 2px 0 #24110c; font-size: .62rem; font-weight: 900; }
.gambling-rules-btn[aria-expanded="true"] { color: #47251a; background: #efcc82; }
.gambling-rules-panel { position: absolute; z-index: 20; top: 88px; left: 12px; right: 12px; padding: 9px; color: #4b3022; background: rgba(255,239,204,.98); border: 2px solid #a96b3e; border-radius: 9px; box-shadow: 0 10px 26px rgba(26,9,5,.55); }
.gambling-rules-panel[hidden], .gambling-rules-btn[hidden] { display: none; }
.rules-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; color: #7e3426; }
.rules-panel-head strong { font-size: .72rem; }
.rules-panel-head button { width: 25px; height: 25px; padding: 0; color: #4c291e; background: #dfbd80; border: 0; border-radius: 50%; font-size: 1rem; }
.gambling-rules-panel article { padding: 6px 7px; display: grid; grid-template-columns: 63px 1fr; grid-gap: 6px; gap: 6px; align-items: start; border-top: 1px solid #d4b47e; }
.gambling-rules-panel article b { color: #913c2b; font-size: .62rem; }
.gambling-rules-panel article p { margin: 0; font-size: .54rem; line-height: 1.45; }
.casino-scene { position: relative; height: 320px; height: clamp(255px, 46dvh, 390px); margin: 7px 0; overflow: hidden; isolation: isolate; background: #4c271c url("assets/gambling-house-interior.webp") center 54%/cover no-repeat; border: 2px solid #95643d; border-radius: 10px; box-shadow: inset 0 0 28px rgba(26,10,5,.52); }
.casino-scene::after { content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(27,11,7,.08), transparent 48%, rgba(25,10,6,.5)); pointer-events: none; }
.casino-npc { position: absolute; z-index: 2; width: 78px; display: grid; justify-items: center; color: #fff0c7; filter: drop-shadow(0 3px 3px rgba(20,8,4,.6)); }
.casino-npc > span { width: 50px; height: 50px; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, #eed2a2, #8b4a30 72%); border: 2px solid #e0ae61; border-radius: 50%; font-size: 1.75rem; }
.casino-npc b { margin-top: 2px; padding: 1px 5px; background: rgba(51,25,17,.82); border-radius: 5px; font-size: .61rem; }
.casino-npc small { margin-top: 2px; padding: 1px 4px; color: #e8ca91; text-align: center; background: rgba(51,25,17,.76); border-radius: 5px; font-size: .48rem; }
.npc-left { left: 6%; top: 34%; }
.npc-dealer { left: 50%; top: 8%; transform: translateX(-50%); }
.npc-right { right: 6%; top: 34%; }
.casino-speech { position: absolute; z-index: 3; top: 3%; left: 3%; max-width: 48%; padding: 5px 7px; color: #4e2d20; background: rgba(255,239,199,.94); border: 1px solid #a57543; border-radius: 8px 8px 8px 2px; font-size: .55rem; line-height: 1.35; box-shadow: 0 2px 6px rgba(33,13,7,.28); }
.casino-bet-zones { position: absolute; z-index: 3; left: 18%; right: 18%; bottom: 12%; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 28%; gap: 28%; }
.casino-bet-zones button { min-height: 56px; display: grid; place-content: center; color: #ffe9ad; background: rgba(70,30,22,.82); border: 2px solid #d09a51; border-radius: 50%; box-shadow: 0 4px 0 rgba(32,13,8,.72); }
.casino-bet-zones button strong { font: 900 1.25rem "STKaiti", "KaiTi", serif; }
.casino-bet-zones button small { color: #e5c588; font-size: .48rem; }
.casino-bet-zones button.active { color: #401e15; background: #f0c96e; border-color: #fff0b0; transform: translateY(-2px); }
.casino-bet-zones button.active small { color: #704126; }
.casino-cup { position: absolute; z-index: 4; left: 50%; bottom: 17%; width: 54px; height: 48px; display: grid; place-items: center; transform: translateX(-50%); color: #e6bb72; background: linear-gradient(90deg,#4a281d,#875035 50%,#422218); border: 2px solid #d2a15c; border-radius: 7px 7px 20px 20px; box-shadow: 0 5px 7px rgba(25,9,5,.5); font-weight: 900; }
.casino-scene.shaking .casino-cup { animation: casino-shake .18s infinite alternate ease-in-out; }
@keyframes casino-shake { from { transform: translateX(-56%) rotate(-5deg); } to { transform: translateX(-44%) rotate(5deg); } }
.casino-challenge { position: absolute; z-index: 5; left: 6%; right: 6%; bottom: 5%; padding: 8px; color: #4b2b1d; text-align: center; background: rgba(255,235,190,.96); border: 2px solid #b9783f; border-radius: 9px; box-shadow: 0 5px 14px rgba(28,10,5,.48); }
.casino-challenge > small { color: #806044; font-size: .52rem; }
.casino-challenge > strong { margin-left: 6px; color: #a43d28; font-size: .78rem; }
.casino-challenge > p { margin: 4px 0 6px; font-size: .58rem; }
.casino-challenge > div { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 5px; gap: 5px; }
.casino-challenge button { min-width: 0; min-height: 36px; padding: 4px 2px; display: grid; place-content: center; color: #fff0c8; background: #713b2a; border: 1px solid #4a241b; border-radius: 6px; font-size: .61rem; font-weight: 900; }
.casino-challenge button:nth-child(3) { background: #a8442d; }
.casino-challenge button small { color: #e7c58d; font-size: .45rem; font-weight: 500; }
.casino-challenge button:disabled { opacity: .42; cursor: not-allowed; }
.parity-levels { position: absolute; z-index: 4; left: 15%; right: 15%; top: 40%; display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 5px; gap: 5px; }
.parity-levels span { padding: 5px 2px; color: #d8bd91; text-align: center; background: rgba(55,28,20,.84); border: 1px solid #95633c; border-radius: 6px; font-size: .5rem; }
.parity-levels span.active { color: #432519; background: #efcc7d; border-color: #fff0b3; }
.parity-levels b { font-size: .58rem; }
.parity-progress { position: absolute; z-index: 5; left: 10%; right: 10%; bottom: 8%; padding: 9px; display: grid; grid-gap: 4px; gap: 4px; color: #47281c; text-align: center; background: rgba(255,236,190,.96); border: 2px solid #bc8045; border-radius: 9px; }
.parity-progress > small { color: #79563e; font-size: .54rem; }
.parity-progress > strong { color: #9f3b27; font-size: .83rem; }
.parity-progress > div { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 6px; gap: 6px; }
.parity-progress button { min-height: 34px; color: #fff0c7; background: #70402e; border: 1px solid #48251c; border-radius: 6px; font-size: .62rem; font-weight: 900; }
.parity-progress button:last-child { background: #a3432d; }
.paigow-table { position: absolute; z-index: 5; left: 4%; right: 4%; top: 37%; bottom: 4%; display: grid; grid-template-rows: auto auto 1fr; grid-gap: 5px; gap: 5px; }
.dealer-preview { display: flex; justify-content: center; align-items: center; grid-gap: 4px; gap: 4px; color: #f3d28d; font-size: .52rem; }
.dealer-preview b, .dealer-preview i { width: 24px; height: 29px; display: grid; place-items: center; color: #4c281c; background: #ecd39c; border: 1px solid #70412c; border-radius: 4px; font-style: normal; font-size: .7rem; }
.dealer-preview i { color: #d8b778; background: #683625; }
.paigow-pool { min-height: 38px; display: flex; justify-content: center; grid-gap: 5px; gap: 5px; }
.paigow-pool > i { width: 28px; height: 36px; display: grid; place-items: center; color: #d9bb82; background: #623423; border: 1px solid #d19a54; border-radius: 4px; font-style: normal; }
.paigow-tile { width: 31px; height: 39px; padding: 1px; display: grid; place-content: center; color: #402219; background: linear-gradient(#f5dfa8,#d5ad68); border: 1px solid #6d3a27; border-radius: 5px; box-shadow: 0 2px 0 #3d1d14; cursor: grab; }
.paigow-tile b { font-size: .84rem; }
.paigow-tile small { font-size: .4rem; }
.paigow-groups { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 7px; gap: 7px; }
.paigow-groups > div { min-height: 54px; padding: 4px; display: flex; align-items: end; justify-content: center; grid-gap: 4px; gap: 4px; position: relative; color: #eed39c; background: rgba(62,31,22,.76); border: 1px dashed #d0a05c; border-radius: 7px; }
.paigow-groups span { position: absolute; top: 2px; left: 5px; font-size: .46rem; }
.paigow-groups em { align-self: center; color: #bc9a6a; font-size: .48rem; font-style: normal; }
.paigow-decisions { margin: 7px 0 9px; display: grid; grid-template-columns: 1fr 1.3fr; grid-gap: 7px; gap: 7px; }
.paigow-decisions button { min-height: 41px; display: grid; place-content: center; color: #65402c; background: #e4c89b; border: 1px solid #9b7048; border-radius: 7px; font-weight: 900; }
.paigow-decisions button small { font-size: .48rem; }
.paigow-decisions .primary-btn { color: #fff0ce; background: linear-gradient(#b65336,#8b321f); }
.casino-inline-choice { position: absolute; z-index: 3; left: 14%; right: 14%; bottom: 13%; }
.casino-card-prompt { position: absolute; z-index: 3; left: 20%; right: 20%; bottom: 12%; }
.gambling-scene-sheet .gambling-rule { min-height: 0; margin-block: 5px; }
.gambling-scene-sheet .gambling-result { min-height: 52px; }
.gambling-scene-sheet .gambling-bet-editor { margin-top: 6px; }
.gambling-scene-sheet .dialog-actions { margin-top: 7px; }
@media (max-height: 760px) {
  .casino-scene { height: 235px; }
  .casino-npc > span { width: 42px; height: 42px; font-size: 1.45rem; }
  .gambling-scene-sheet .gambling-rule { display: none; }
}
.warehouse-sheet { width: 94vw; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; }
.warehouse-summary { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 5px; gap: 5px; margin-bottom: 7px; }
.warehouse-summary span { min-width: 0; padding: 6px 3px; display: grid; grid-gap: 2px; gap: 2px; color: #795c45; text-align: center; background: #ead7ae; border: 1px solid #bf9763; border-radius: 7px; font-size: .56rem; }
.warehouse-summary b { overflow: hidden; color: #39261c; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-rumor { margin: 6px 0 8px; padding: 7px 9px; color: #6d4a32; background: rgba(246,228,188,.76); border-left: 3px solid #a44d32; font-size: .6rem; line-height: 1.42; }
.warehouse-goods { display: flex; grid-gap: 6px; gap: 6px; padding: 2px 1px 7px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-y; cursor: grab; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.warehouse-goods::-webkit-scrollbar { display: none; }
.warehouse-goods.dragging { cursor: grabbing; scroll-snap-type: none; }
.warehouse-goods.dragging button { pointer-events: none; }
.warehouse-goods button { position: relative; flex: 0 0 105px; min-height: 71px; padding: 6px 5px; display: grid; grid-template-columns: 23px 1fr; grid-template-rows: auto auto; align-items: center; text-align: left; scroll-snap-align: start; color: #593b28; background: #ead7ae; border: 1px solid #b58a57; border-radius: 8px; }
.warehouse-goods button.active { background: #f8e7bd; border: 2px solid #9b412b; box-shadow: inset 0 0 0 1px #d59657; }
.warehouse-goods button > span { grid-row: 1 / 3; font-size: 1.15rem; }
.warehouse-goods button strong { font-size: .65rem; }
.warehouse-goods button small { color: #80664f; font-size: .52rem; }
.warehouse-goods button i { position: absolute; top: 4px; right: 4px; font-size: .49rem; font-style: normal; font-weight: 900; }
.warehouse-goods .up, .warehouse-trend.up { color: #a43c2c; }
.warehouse-goods .down, .warehouse-trend.down { color: #39714a; }
.warehouse-goods .flat, .warehouse-trend.flat { color: #806f57; }
.warehouse-ticket { padding: 9px; background: #f5e3bb; border: 1px solid #c0945d; border-radius: 9px; }
.warehouse-ticket-head { display: flex; justify-content: space-between; grid-gap: 10px; gap: 10px; align-items: center; }
.warehouse-ticket-head div { display: grid; grid-gap: 2px; gap: 2px; }
.warehouse-ticket-head small { color: #8c6c51; font-size: .55rem; }
.warehouse-ticket-head strong { color: #3c281e; font-size: .72rem; }
.warehouse-trend { padding: 4px 7px; background: rgba(255,255,255,.43); border: 1px solid currentColor; border-radius: 999px; font-size: .59rem; white-space: nowrap; }
.warehouse-ticket > p { margin: 7px 0; color: #765940; font-size: .57rem; }
.warehouse-position { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px; gap: 5px; }
.warehouse-position span { padding: 5px 7px; background: #e8d1a4; border-radius: 5px; color: #72533b; font-size: .57rem; }
.warehouse-position b { float: right; color: #34231b; }
.warehouse-quantity { margin-top: 7px; display: grid; grid-template-columns: 34px 1fr 34px; grid-gap: 5px; gap: 5px; }
.warehouse-quantity button, .warehouse-quick button { color: #633e2a; background: #ead2a3; border: 1px solid #a9794c; border-radius: 6px; font-weight: 900; }
.warehouse-quantity label { height: 35px; padding-left: 8px; display: flex; align-items: center; justify-content: space-between; color: #775a42; background: #fff1d1; border: 1px solid #b18452; border-radius: 6px; font-size: .56rem; }
.warehouse-quantity input { width: 64px; height: 100%; padding: 3px 5px; text-align: center; background: transparent; border: 0; font-weight: 900; }
.warehouse-quick { margin-top: 5px; display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 4px; gap: 4px; }
.warehouse-quick button { min-height: 27px; padding: 3px; font-size: .54rem; }
.warehouse-quick button.active { color: #fff1ce; background: #78402e; }
.warehouse-total { margin: 7px 0 5px; display: flex; justify-content: space-between; color: #6c4a34; font-size: .62rem; }
.warehouse-total strong { color: #38241b; font-size: .72rem; }
.warehouse-trade-actions { display: grid; grid-template-columns: 1fr 1.2fr; grid-gap: 7px; gap: 7px; }
.warehouse-trade-actions button { min-height: 38px; color: #5d3c29; background: #e6cca0; border: 1px solid #9c7047; border-radius: 7px; font-weight: 900; }
.warehouse-trade-actions .primary-btn { color: #fff1d1; background: linear-gradient(#b95337,#8f341f); }
.warehouse-trade-actions button:disabled { opacity: .46; cursor: not-allowed; }
.paper-card {
  background-color: var(--paper);
  background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.65), transparent 36%), repeating-linear-gradient(0deg, transparent 0 27px, rgba(105,72,42,.035) 28px);
  border: 2px solid #5e3929; outline: 1px solid #d9b77b; outline-offset: -7px;
  border-radius: 13px; box-shadow: 0 14px 36px var(--shadow), inset 0 0 38px rgba(145,91,45,.17);
}
.start-card { width: 100%; max-width: 406px; padding: 30px; padding: clamp(24px, 8cqw, 36px); text-align: center; }
.start-card h2 { margin: 10px 0; font-size: 2.7rem; font-size: clamp(2.35rem, 13cqw, 3.45rem); letter-spacing: .1em; }
.start-card > p:not(.eyebrow) { color: var(--muted); font-size: 1rem; line-height: 1.7; }
.start-ledger { margin: 26px 0; padding: 16px 24px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; text-align: left; border-top: 1px solid #b9905a; border-bottom: 1px solid #b9905a; }
.start-ledger strong { text-align: right; }
.market-card { max-height: 54vh; max-height: 54dvh; padding: 13px 13px 12px; overflow: auto; text-align: left; border-radius: 16px 16px 9px 9px; }
.market-heading { display: flex; justify-content: space-between; align-items: start; grid-gap: 12px; gap: 12px; }
.market-heading .eyebrow { font-size: .72rem; letter-spacing: .1em; }
.market-card .market-heading h2 { margin: 3px 0 0; font-size: 1.55rem; letter-spacing: .08em; }
.market-date { flex: none; padding: 5px 8px; color: #fff0cd; background: #68402d; border-radius: 6px; font-size: .68rem; }
.market-facts { margin-top: 9px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 6px; gap: 6px; }
.market-facts div { min-width: 0; padding: 7px 9px; display: grid; grid-gap: 2px; gap: 2px; background: rgba(255,247,224,.62); border: 1px solid #c4a06d; border-radius: 7px; }
.market-facts span { color: var(--muted); font-size: .65rem; }
.market-facts strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.market-description { margin: 9px 1px; color: #5f4938; font-size: .75rem; line-height: 1.55; }
.market-demand { display: flex; grid-gap: 5px; gap: 5px; margin-bottom: 10px; padding: 2px 4px 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.market-demand.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.market-demand.dragging span { pointer-events: none; }
.market-demand::-webkit-scrollbar { display: none; }
.market-demand span { flex: 0 0 auto; min-width: 0; padding: 5px 7px; display: flex; align-items: center; justify-content: center; grid-gap: 3px; gap: 3px; border-radius: 7px; font-size: .68rem; white-space: nowrap; }
.market-demand b { padding: 1px 4px; border-radius: 8px; font-size: .58rem; }
.market-demand .demand-high { color: #733222; background: #f0c99c; border: 1px solid #c47d4b; }
.market-demand .demand-high b { color: #fff7e8; background: #a8452d; }
.market-demand .demand-flat { background: #e6d5ad; border: 1px solid #b69a6d; }
.market-demand .demand-low { color: #566056; background: #d4d6bd; border: 1px solid #9da184; }
.market-demand .demand-low b { color: #f2f1df; background: #6e7766; }
.market-card > .primary-btn { width: 100%; min-height: 43px; padding: 8px 14px; font-size: .92rem; }
.primary-btn {
  min-height: 52px; padding: 12px 32px; color: #fff5df; font-weight: 800; font-size: 1.12rem; letter-spacing: .12em;
  background: linear-gradient(#be5b3c, #913621); border: 2px solid #542016; border-radius: 9px;
  box-shadow: inset 0 0 0 2px #d47a56, 0 4px 0 #4c2017; transition: transform .15s, filter .15s;
}
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px #d47a56, 0 1px 0 #4c2017; }
.primary-btn:disabled { filter: grayscale(.7); cursor: not-allowed; opacity: .6; }
.stock-layout {
  min-height: calc(100vh - 74px); min-height: calc(100vh - 74px); height: calc(100dvh - 74px); padding: 0 6px 6px; display: grid; align-items: end;
  background: linear-gradient(180deg, rgba(43,25,15,.04), rgba(43,25,15,.28)), #b7a07c var(--shop-scene) center/cover;
}
.stock-card {
  height: 224px; height: min(25dvh, 224px); min-height: 0; overflow: hidden; padding: 7px 8px 6px;
  display: grid; grid-template-rows: auto 25px minmax(48px, 1fr) auto auto; grid-gap: 3px; gap: 3px;
  border-radius: 15px 15px 9px 9px;
}
.stock-toolbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; grid-gap: 6px; gap: 6px; overflow: hidden; }
.stock-toolbar > div:first-child { flex: none; white-space: nowrap; }
.stock-toolbar h2 { display: inline; margin: 0 0 0 5px; font-size: .95rem; }
.stock-toolbar .eyebrow { display: inline; font-size: .68rem; letter-spacing: .08em; }
.stock-funds { min-width: 0; margin-left: auto; display: flex; justify-content: flex-end; grid-gap: 5px; gap: 5px; overflow: hidden; color: var(--muted); font-size: .58rem; white-space: nowrap; }
.stock-funds span { min-width: 0; }
.stock-funds strong { color: var(--ink); font-size: .68rem; }
.stock-navigation { min-width: 0; display: flex; align-items: center; grid-gap: 6px; gap: 6px; overflow: hidden; }
.display-capacity { flex: 0 0 auto; min-width: 0; display: flex; grid-gap: 4px; gap: 4px; }
.display-capacity button { min-width: 0; height: 23px; padding: 2px 7px; display: flex; align-items: center; grid-gap: 4px; gap: 4px; color: inherit; border: 1px solid #b38a57; border-radius: 11px; font-size: .54rem; cursor: pointer; }
.display-capacity button.active { color: #fff3d7; background: #7e3b2b; border-color: #5b281e; box-shadow: inset 0 0 0 1px #b86a47; }
.display-capacity button.active b { color: inherit; }
.display-capacity b { color: #3f2b20; white-space: nowrap; }
.display-capacity small { display: none; }
.capacity-shelf { background: rgba(224,211,169,.72); }
.capacity-front { background: rgba(243,201,153,.72); }
.empty-display-filter { flex: 1 0 100%; display: grid; place-items: center; color: #80634d; background: rgba(244,226,188,.62); border: 1px dashed #ba9363; border-radius: 8px; font-size: .64rem; }
.category-filters { flex: 1 1 auto; min-width: 0; height: 23px; display: flex; grid-gap: 4px; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; touch-action: pan-x; overscroll-behavior-x: contain; }
.category-filters.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.category-filters.dragging button { pointer-events: none; }
.category-filters::-webkit-scrollbar { display: none; }
.category-filters button { flex: 0 0 auto; min-height: 22px; padding: 1px 9px; color: #6e513e; background: rgba(229,207,166,.66); border: 1px solid #b28b5f; border-radius: 11px; font-size: .62rem; font-weight: 800; }
.category-filters button.active { color: #fff5df; background: #8e3d29; border-color: #632619; }
.product-shelf {
  min-width: 0; min-height: 0; display: flex; grid-gap: 7px; gap: 7px; overflow-x: auto; overflow-y: hidden; padding: 1px 1px 3px;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; touch-action: pan-x;
  scrollbar-width: none; cursor: grab;
}
.product-shelf::-webkit-scrollbar { display: none; }
.product-shelf.dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
.stock-product-card {
  position: relative; flex: 0 0 158px; min-width: 158px; height: 100%; min-height: 0; overflow: hidden; padding: 4px 7px; display: grid; grid-template-columns: 34px 1fr;
  grid-gap: 6px; gap: 6px; align-items: center; scroll-snap-align: start;
  color: var(--ink); text-align: left; background: rgba(255,247,226,.72); border: 1px solid #b89463;
  border-radius: 9px; box-shadow: 0 2px 0 rgba(65,39,24,.2); transition: border-color .15s, background .15s, transform .15s;
}
.stock-product-card.selected { background: #fff1cf; border: 2px solid #9a3f29; box-shadow: 0 0 0 2px rgba(197,137,70,.4); }
.stock-product-card.displayed::after { content: "在售"; position: absolute; right: 3px; bottom: 2px; padding: 1px 4px; color: #fff2d2; background: #39704a; border-radius: 5px; font-size: .43rem; font-weight: 900; }
.stock-product-card.locked { color: #776b5f; background: rgba(214,204,184,.78); border-color: #9d9181; }
.stock-product-card.locked.selected { background: #e9ddc5; border-color: #765744; box-shadow: 0 0 0 2px rgba(118,87,68,.25); }
.stock-product-card.locked .shelf-product-icon { filter: grayscale(1); opacity: .78; }
.shelf-product-icon { font-size: 1.4rem; text-align: center; }
.shelf-product-copy { min-width: 0; display: grid; align-content: center; line-height: 1.08; }
.shelf-product-copy strong { font-size: .82rem; }
.shelf-product-copy small { overflow: hidden; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.placement-badge { position: absolute; top: 2px; right: 3px; padding: 1px 4px; border-radius: 5px; font-size: .42rem; font-style: normal; font-weight: 900; }
.placement-badge.shelf { color: #46633d; background: #dce2bc; }
.placement-badge.front { color: #9b3f27; background: #f2cfaa; }
.stock-product-card.locked .placement-badge { opacity: .92; box-shadow: 0 0 0 1px rgba(91,72,55,.18); }
.selected-stock-controls { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-columns: auto auto minmax(62px,auto) minmax(64px,auto); grid-gap: 5px; gap: 5px; align-items: center; }

.selected-stock-controls > strong { min-width: 30px; font-size: .78rem; }
.locked-product-note { min-width: 0; overflow: hidden; color: #765744; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.unlock-product-btn { justify-self: end; min-height: 28px; padding: 3px 12px; color: #fff5df; background: #8e3d29; border: 1px solid #5f251a; border-radius: 6px; font-size: .7rem; font-weight: 800; }
.unlock-product-btn:disabled { color: #75685e; background: #c7b9a4; border-color: #968778; }
.compact-control { min-width: 0; display: grid; grid-template-columns: auto auto; grid-gap: 3px; gap: 3px; align-items: center; }
.compact-control > span { color: var(--muted); font-size: .64rem; white-space: nowrap; }
.customer-intent { min-width: 72px; min-height: 28px; padding: 4px 6px; display: grid; place-content: center; text-align: center; border: 1px solid currentColor; border-radius: 6px; line-height: 1; white-space: nowrap; }
.customer-intent strong { font-size: .62rem; }
.toggle-display-btn { min-height: 27px; padding: 3px 7px; color: #fff3d5; background: #3f6845; border: 1px solid #294830; border-radius: 6px; font-size: .55rem; font-weight: 900; white-space: nowrap; }
.toggle-display-btn.remove { color: #6d4431; background: #e4caa0; border-color: #956c47; }
.toggle-display-btn:disabled { color: #786b60; background: #c9bdab; border-color: #9d9182; }
.customer-intent.intent-strong { color: #2f6a3e; background: #d8e8c9; }
.customer-intent.intent-good { color: #60834a; background: #e4edcf; }
.customer-intent.intent-hesitate { color: #8a702d; background: #eee1af; }
.customer-intent.intent-high { color: #b46127; background: #f2d0a2; }
.customer-intent.intent-low, .customer-intent.intent-none { color: #a43d2f; background: #efd0c3; }
.stepper { display: flex; align-items: center; grid-gap: 6px; gap: 6px; }
.stepper button { width: 32px; height: 32px; border-radius: 6px; border: 1px solid #97734e; background: #e9d1a6; color: #3c291e; font-weight: 900; font-size: 1.12rem; }
.stepper input { width: 54px; height: 32px; border: 1px solid #9f7d57; border-radius: 6px; background: #fff6df; text-align: center; font-weight: 800; }
.stepper small { font-size: .7rem; }
.selected-stock-controls .stepper { grid-gap: 3px; gap: 3px; }
.selected-stock-controls .stepper button { width: 23px; height: 25px; font-size: .88rem; }
.selected-stock-controls .stepper input { width: 34px; height: 25px; font-size: .72rem; }
.selected-stock-controls .stepper small { display: none; }
.purchase-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; grid-gap: 7px; gap: 7px; padding-top: 4px; border-top: 1px solid #b28b5f; }
.shelf-hint { color: var(--muted); font-size: .62rem; }
.purchase-footer .primary-btn { min-height: 32px; padding: 4px 13px; font-size: .76rem; letter-spacing: .06em; border-width: 1px; box-shadow: inset 0 0 0 1px #d47a56, 0 2px 0 #4c2017; }
.form-error { position: absolute; left: 12px; bottom: 232px; bottom: calc(min(25dvh, 224px) + 8px); margin: 0; color: #fff0d0; background: rgba(116,33,24,.92); border-radius: 5px; font-size: .72rem; font-weight: 700; }
.tips-card { display: none; align-self: start; padding: 28px; }
.tips-card h3 { text-align: center; font-size: 1.35rem; }
.tips-card p, .tips-card li { line-height: 1.8; color: #584638; }
.tips-card ul { padding-left: 1.3em; }
.brush-icon { width: 58px; height: 58px; margin: 0 auto; display: grid; place-items: center; border: 3px double var(--red); border-radius: 8px; color: var(--red); font-size: 1.8rem; font-weight: 900; transform: rotate(-3deg); }
.business-screen { height: calc(100vh - 74px); height: calc(100dvh - 74px); min-height: 0; flex: none; background: #1f1712; }
.scene { position: relative; height: 100%; min-height: 0; max-height: 860px; overflow: hidden; isolation: isolate; background: #a88a60 var(--shop-scene) center/cover no-repeat; }
.scene-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: linear-gradient(180deg, rgba(30,18,12,.1), transparent 28%, rgba(40,22,12,.1) 70%, rgba(28,15,10,.45)); transition: background .5s; }
.scene[data-period="中午"] .scene-shade { background: linear-gradient(180deg, rgba(255,217,119,.04), transparent, rgba(72,38,14,.17)); }
.scene[data-period="晚上"] .scene-shade { background: linear-gradient(180deg, rgba(19,27,67,.52), rgba(41,34,65,.25), rgba(22,14,29,.65)); }
.hud { position: absolute; z-index: 10; top: 52px; left: 8px; right: 8px; display: flex; align-items: center; grid-gap: 6px; gap: 6px; color: #fff3d5; }
.business-money { margin-left: auto; display: grid; grid-gap: 1px; gap: 1px; min-width: 102px; }
.business-money span { display: flex; justify-content: space-between; grid-gap: 6px; gap: 6px; color: #e3cba2; font-size: .62rem; line-height: 1.15; white-space: nowrap; }
.business-money strong { color: #fff3d5; font-size: .76rem; }
.hud .period-badge, .hud .flow-status {
  min-width: 0; min-height: 39px; padding: 4px 8px; display: grid; align-content: center; grid-gap: 3px; gap: 3px;
  color: #3c281d; background: rgba(247,225,180,.94); border: 1px solid #795039; border-radius: 7px;
  box-shadow: 0 2px 0 rgba(48,27,19,.35);
}
.hud .period-badge { flex: 1.08; }
.hud .flow-status { flex: .94; }
.hud .period-badge small, .hud .flow-status > small { color: #82654d; font-size: .56rem; line-height: 1; }
.hud .period-badge strong { overflow: hidden; font-size: .7rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.hud .flow-status > span { display: flex; align-items: center; grid-gap: 5px; gap: 5px; min-width: 0; }
.hud .flow-status strong { overflow: hidden; font-size: .7rem; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.flow-dot { flex: none; display: block; width: 7px; height: 7px; border-radius: 50%; background: #9bc07d; box-shadow: 0 0 0 3px rgba(155,192,125,.17); }
.scene[data-flow="1"] .flow-dot { background: #d5bd62; box-shadow: 0 0 0 3px rgba(213,189,98,.18); }
.scene[data-flow="2"] .flow-dot { background: #e89a4c; box-shadow: 0 0 0 3px rgba(232,154,76,.2); }
.scene[data-flow="3"] .flow-dot { background: #cf6545; box-shadow: 0 0 0 3px rgba(207,101,69,.2); animation: flow-pulse .75s ease-in-out infinite alternate; }
@keyframes flow-pulse { to { transform: scale(1.35); } }
.landmark-label { position: absolute; z-index: 3; padding: 4px 9px; color: #fff0cc; background: rgba(71,37,25,.86); border: 1px solid #d7aa62; border-radius: 4px; font-size: .76rem; font-weight: 800; letter-spacing: .12em; box-shadow: 0 2px 0 rgba(34,18,12,.38); }
.academy-label { right: 2%; top: 25%; writing-mode: vertical-rl; padding: 8px 5px; }
.npc-layer { position: absolute; z-index: 4; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; pointer-events: none; }
.scene.period-closing .npc { opacity: 0; transform: translate(-50%, -100%) scale(.76); transition: opacity .75s ease, transform .75s ease; }
.scene.period-closing .flow-dot { background: #dcb24b; animation: flow-pulse .35s ease-in-out infinite alternate; }
.npc { position: absolute; left: var(--x); top: var(--y); z-index: var(--depth-layer); width: 72px; height: 116px; opacity: 1; text-align: center; transform: translate(-50%, -100%) scale(var(--scale, .82)); transform-origin: 50% 100%; transition-property: left, top, transform; transition-duration: var(--move-time, 1.3s); transition-timing-function: linear; will-change: left, top, transform; }
.npc-avatar { width: 68px; height: 102px; margin: 0 auto; background-image: url("assets/scholar-customers.webp"); background-repeat: no-repeat; background-size: 400% 100%; background-position: var(--sprite-x) center; filter: drop-shadow(0 4px 2px rgba(33,20,13,.3)); animation: bob .48s ease-in-out infinite alternate; }
.npc-avatar.extra { background-image: url("assets/scholar-customers-extra.webp"); }
.npc.paused .npc-avatar { animation-play-state: paused; }
.bubble { display: inline-block; min-width: 38px; margin-bottom: -3px; padding: 4px 7px; background: #fff7df; border: 1.5px solid #3a261c; border-radius: 16px; font-size: .72rem; font-weight: 900; white-space: nowrap; box-shadow: 2px 2px 0 rgba(40,24,16,.22); }
.bubble:empty { display: none; }
.bubble.sale { color: #28723f; }
.bubble.price { color: #a43d2f; background: #fff0df; border-color: #7f3027; animation: reaction-pop .22s ease-out; }
.bubble.soldout { color: #765744; background: #f2e7cf; border-color: #765744; animation: reaction-pop .22s ease-out; }
@keyframes reaction-pop { from { opacity: 0; transform: translateY(4px) scale(.72); } to { opacity: 1; transform: translateY(0) scale(1); } }
.money-pop {
  position: absolute; z-index: 4; left: 50%; top: -8px; transform: translateX(-50%);
  padding: 4px 8px; color: #fff0a8; background: rgba(83,47,20,.9); border: 1px solid #efc65c;
  border-radius: 14px; font-size: .78rem; font-weight: 900; white-space: nowrap;
  text-shadow: 0 1px 1px #5a3216; box-shadow: 0 2px 6px rgba(55,30,12,.35);
  pointer-events: none; animation: money-rise 1.25s ease-out forwards;
}
@keyframes money-rise {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.72); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  72% { opacity: 1; transform: translate(-50%, -26px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(.92); }
}
@keyframes bob { to { transform: translateY(-4px) rotate(1deg); } }
.foreground-occluder { display: none; }
.sale-toast { position: absolute; z-index: 12; left: 50%; top: 22%; transform: translate(-50%, -8px); padding: 10px 20px; border-radius: 8px; background: rgba(60,40,28,.9); color: #ffe6a7; font-weight: 900; opacity: 0; pointer-events: none; }
.sale-toast.show { animation: toast 1.5s ease; }
@keyframes toast { 15%, 75% { opacity: 1; transform: translate(-50%, 0); } }
.price-board { position: absolute; z-index: 8; left: 8px; right: 8px; bottom: 92px; display: flex; grid-gap: 4px; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.price-board::-webkit-scrollbar { display: none; }
.price-tag { min-width: 64px; padding: 6px 7px; text-align: center; color: #3c271d; background: rgba(233,204,153,.94); border: 2px solid #6d402b; border-radius: 5px 5px 9px 9px; box-shadow: 0 3px 0 rgba(59,31,20,.38); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.price-tag.selected { color: #2e2017; background: #ffe5a8; border-color: #a33e29; box-shadow: 0 0 0 2px rgba(255,220,137,.72), 0 3px 0 rgba(59,31,20,.38); transform: translateY(-2px); }
.price-tag.sold-out { color: #665548; background: rgba(225,211,184,.94); border-color: #8d7a67; }
.price-tag.sold-out > small { color: #9a382b; font-weight: 900; }
.price-tag strong { display: block; max-width: 82px; font-size: .68rem; line-height: 1.2; }
.price-tag small { display: block; margin-top: 3px; }
.restock-btn { width: 100%; margin-top: 5px; padding: 3px 5px; color: #fff5df; background: #9a452d; border: 1px solid #5b2b20; border-radius: 5px; font-size: .68rem; font-weight: 800; }
.restock-btn:active { transform: translateY(1px); }
.business-controls { position: absolute; z-index: 10; left: 8px; right: 8px; bottom: 8px; bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 8px)); display: flex; grid-gap: 4px; gap: 4px; }
.control-btn { flex: 1; width: auto; min-width: 0; min-height: 68px; padding: 6px; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: 1fr 1fr; align-items: center; color: #312017; background: linear-gradient(#f6e2b9, #d7b379); border: 2px solid #4b2d20; border-radius: 9px; box-shadow: 0 3px 0 #362018; }
.control-btn > span { grid-row: 1 / 3; font-size: 1.25rem; }
.control-btn strong, .control-btn small { text-align: left; }
.control-btn strong { font-size: .78rem; }
.control-btn small { font-size: .66rem; }
.control-btn small { color: #6e4e36; }
.control-btn:disabled { opacity: .68; cursor: wait; }
.shout-btn { color: #fff7e8; background: linear-gradient(#b65a31, #7b321f); }
.shout-btn small { color: #f3d19c; }
.close-period-btn { color: #fff3df; background: linear-gradient(#855038, #5f3024); }
.close-period-btn small { color: #e6c5a1; }
.inline-price-editor {
  flex: 1.18; min-width: 0; min-height: 68px; padding: 6px 5px; display: grid; align-content: center; grid-gap: 4px; gap: 4px;
  color: #312017; text-align: center; background: linear-gradient(#f9e8c3, #d8b57b);
  border: 2px solid #4b2d20; border-radius: 9px; box-shadow: 0 3px 0 #362018;
}
.inline-price-editor > small { overflow: hidden; color: #6e4e36; font-size: .68rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.inline-price-editor > div { display: grid; grid-template-columns: 27px minmax(34px, 1fr) 27px; align-items: center; grid-gap: 3px; gap: 3px; }
.inline-price-editor button { width: 27px; height: 29px; padding: 0; color: #3b261a; background: #ead0a0; border: 1px solid #8d6847; border-radius: 5px; font-size: 1.05rem; font-weight: 900; }
.inline-price-editor button:active { transform: translateY(1px); }
.inline-price-editor button:disabled { opacity: .45; cursor: not-allowed; }
.inline-price-editor strong { overflow: hidden; font-size: .8rem; white-space: nowrap; }
.settlement-screen { min-height: calc(100vh - 74px); min-height: calc(100dvh - 74px); padding: 22px 14px; background: linear-gradient(rgba(31,20,27,.55), rgba(18,15,27,.78)), url("assets/guozijian-street.webp") center/cover; }
.settlement-screen.active { display: grid; place-items: center; }
.settlement-card { width: 100%; max-width: 406px; padding: 30px; padding: clamp(24px, 8cqw, 38px); text-align: center; }
.settlement-card h2 { margin: 8px 0 22px; font-size: 1.8rem; font-size: clamp(1.65rem, 8cqw, 2.15rem); }
.settlement-hero { padding: 20px; display: grid; grid-gap: 5px; gap: 5px; background: rgba(255,246,220,.5); border-top: 1px solid #b68f58; border-bottom: 1px solid #b68f58; }
.settlement-hero strong { color: var(--jade); font-size: 2.1rem; }
.ledger-grid { margin: 22px 0; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 12px; gap: 12px; text-align: left; }
.ledger-grid strong { text-align: right; }
.remaining-stock { display: flex; justify-content: center; flex-wrap: wrap; grid-gap: 8px; gap: 8px; margin-bottom: 18px; }
.remaining-stock span { padding: 8px 12px; border: 1px solid #b69061; border-radius: 6px; background: rgba(255,246,220,.5); }
.settlement-note { color: var(--muted); line-height: 1.7; }
.game-dialog { width: calc(100% - 24px); max-width: 540px; color: var(--ink); background: var(--paper-light); border: 2px solid #5a3424; border-radius: 12px; box-shadow: 0 16px 50px #130b07; }
.game-dialog::backdrop { background: rgba(27,17,13,.68); backdrop-filter: blur(2px); }
.game-dialog form { padding: 14px 22px 24px; }
.game-dialog h2 { margin: 5px 0 18px; }
.dialog-close { float: right; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #e0c69a; font-size: 1.5rem; }
.dialog-price-row, .stat-row { padding: 12px 0; display: grid; grid-template-columns: 1fr auto; grid-gap: 12px; gap: 12px; align-items: center; border-bottom: 1px solid #d6ba8b; }
.dialog-price-row .stepper { grid-column: 2; }
.dialog-price-row small { color: var(--muted); }
.stat-row strong { text-align: right; }
.game-dialog.price-sheet, .game-dialog.restock-sheet {
  position: fixed; left: 0; right: 0; bottom: 84px; width: calc(100% - 16px); max-width: 414px; max-height: 42vh; max-height: 42dvh;
  margin: auto; overflow: auto; border-radius: 15px 15px 8px 8px;
  background: rgba(255, 239, 202, .97); box-shadow: 0 -6px 24px rgba(29,16,10,.34);
}
.game-dialog.price-sheet::backdrop, .game-dialog.restock-sheet::backdrop { display: none; }
.game-dialog.price-sheet form, .game-dialog.restock-sheet form { padding: 10px 14px 12px; }
.game-dialog.price-sheet h2, .game-dialog.restock-sheet h2 { margin: 2px 0 7px; font-size: 1.18rem; }
.game-dialog.price-sheet .eyebrow, .game-dialog.restock-sheet .eyebrow { font-size: .68rem; }
.game-dialog.price-sheet .dialog-price-row { padding: 7px 0; }
.game-dialog.price-sheet .stepper { justify-content: flex-end; }
.restock-summary { padding: 5px 0 8px; display: flex; align-items: center; grid-gap: 10px; gap: 10px; border-bottom: 1px solid #d6ba8b; }
.restock-summary > span { width: 40px; font-size: 1.8rem; text-align: center; }
.restock-summary div { display: grid; grid-gap: 2px; gap: 2px; }
.restock-summary small { color: var(--muted); }
.restock-editor { margin: 10px 0 7px; display: flex; align-items: center; justify-content: center; grid-gap: 6px; gap: 6px; }
.restock-editor button { width: 36px; height: 36px; color: var(--ink); background: #e4c99b; border: 1px solid #94704c; border-radius: 6px; font-size: 1.2rem; font-weight: 900; }
.restock-editor input { width: 82px; height: 36px; text-align: center; background: #fff7e3; border: 1px solid #94704c; border-radius: 6px; font-weight: 900; }
.restock-total { margin-bottom: 6px; display: flex; justify-content: space-between; }
.restock-fee { margin: 0 0 7px; padding: 6px 8px; display: flex; justify-content: space-between; grid-gap: 8px; gap: 8px; color: var(--muted); background: rgba(238,218,180,.58); border-radius: 6px; font-size: .66rem; }
.restock-fee b { color: var(--ink); }
.restock-total strong.insufficient, .restock-error { color: #a32f22; }
.restock-error { min-height: 16px; margin: 0 0 5px; font-size: .72rem; text-align: right; }
.game-dialog.restock-sheet .primary-btn { width: 100%; min-height: 40px; padding: 6px 12px; font-size: .86rem; }
.period-ledger { margin: 8px 0 18px; padding: 12px; display: grid; grid-template-columns: 1fr auto; grid-gap: 9px 14px; gap: 9px 14px; background: rgba(255,246,220,.55); border-top: 1px solid #c5a273; border-bottom: 1px solid #c5a273; }
.period-ledger strong { text-align: right; }
.period-waste-note { margin: -9px 0 12px; padding: 7px 9px; color: #8e3f2e; background: #efd3b4; border-radius: 6px; font-size: .62rem; line-height: 1.45; }
.profit-up { color: var(--jade); }
.profit-down { color: #a13b2b; }
.close-period-note { color: var(--muted); line-height: 1.65; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.2fr; grid-gap: 9px; gap: 9px; margin-top: 16px; }
.dialog-actions > button { min-height: 44px; border: 1px solid #8f6c49; border-radius: 8px; background: #ead3a9; color: var(--ink); font-weight: 800; }
.dialog-actions > .primary-btn { padding: 7px 12px; color: #fff5df; background: linear-gradient(#be5b3c, #913621); }
.decor-current { padding: 12px; display: flex; justify-content: space-between; grid-gap: 12px; gap: 12px; background: rgba(255,246,220,.58); border-top: 1px solid #c3a06f; border-bottom: 1px solid #c3a06f; }
.decor-current span { color: var(--muted); }
.decor-slots { margin: 12px 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 7px; gap: 7px; }
.decor-slots div { padding: 10px 5px; display: grid; grid-gap: 4px; gap: 4px; text-align: center; background: #e8d2aa; border: 1px solid #a98558; border-radius: 8px; }
.decor-slots b { font-size: .88rem; }
.decor-slots small { color: var(--muted); font-size: .66rem; }
.decor-note { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.decor-note b { color: #9a3f29; }
.decor-next { margin: 12px 0 8px; padding: 11px 12px; display: grid; grid-template-columns: 1fr auto; grid-gap: 3px 10px; gap: 3px 10px; background: linear-gradient(135deg, #f5e2b7, #e4c58e); border: 1px solid #a97a43; border-radius: 9px; }
.decor-next small { color: var(--muted); }
.decor-next strong { text-align: right; }
.decor-next span { grid-column: 1 / -1; color: #765039; font-size: .72rem; }
.decor-requirements { margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 6px; gap: 6px; }
.decor-requirements div { padding: 8px 9px; display: grid; grid-gap: 3px; gap: 3px; background: rgba(255,246,220,.62); border: 1px solid #c6a16d; border-radius: 7px; }
.decor-requirements span { color: var(--muted); font-size: .68rem; }
.decor-requirements strong { font-size: .78rem; }
.decor-requirements .met { border-color: #78916a; background: #e1e8cf; }
.decor-requirements .met strong { color: #47633f; }
.decor-requirements .unmet strong { color: #9b3d2b; }
.decor-upgrade { width: 100%; margin-top: 12px; min-height: 44px; }
.decor-upgrade:disabled { cursor: not-allowed; filter: grayscale(.45); opacity: .64; }
.decor-max { margin-top: 12px; padding: 18px; display: grid; grid-gap: 6px; gap: 6px; text-align: center; color: #5d472c; background: #efe0b8; border: 1px solid #ad8957; border-radius: 9px; }
.decor-max b { color: #8b541f; font-size: 1.05rem; }
.time-box-dialog { width: calc(100% - 16px); max-width: 414px; max-height: 88vh; max-height: 88dvh; padding: 0; overflow: visible; color: var(--ink); background: var(--paper-light); border: 2px solid #5a3424; border-radius: 14px; box-shadow: 0 18px 52px #130b07; }
.time-box-dialog::backdrop { background: rgba(24,14,11,.72); backdrop-filter: blur(2px); }
.time-box-dialog form { max-height: 88vh; max-height: 88dvh; padding: 13px; overflow: auto; }
.box-title-row { display: flex; align-items: start; justify-content: space-between; grid-gap: 10px; gap: 10px; }
.box-title-row h2 { margin: 2px 0 0; font-size: 1.45rem; }
.box-title-row > span { margin-right: 38px; padding: 5px 7px; color: #6d452c; background: #ead0a2; border-radius: 7px; font-size: .68rem; white-space: nowrap; }
.box-status { margin: 8px 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.pool-overview-btn { width: 100%; margin: 0 0 8px; padding: 7px 10px; color: #73462e; background: #ecd8ae; border: 1px solid #a77c50; border-radius: 7px; font-size: .7rem; font-weight: 900; }
.pool-overview-btn::after { content: " ▾"; }
.pool-overview-btn[aria-expanded="true"]::after { content: " ▴"; }
.pool-overview { max-height: 34vh; max-height: 34dvh; margin: 0 0 8px; padding: 7px; overflow: auto; display: grid; grid-gap: 7px; gap: 7px; background: rgba(119,76,43,.08); border: 1px solid #c5a477; border-radius: 8px; }
.pool-overview[hidden] { display: none; }
.pool-tier { display: grid; grid-template-columns: 40px 1fr; grid-gap: 6px; gap: 6px; align-items: start; }
.pool-tier > b { padding: 5px 3px; color: #fff8e9; background: #7d6b55; border-radius: 5px; text-align: center; font-size: .64rem; }
.pool-tier-items { min-width: 0; display: flex; flex-wrap: wrap; grid-gap: 4px; gap: 4px; }
.pool-item { padding: 4px 6px; color: #4d3426; background: #f5e8c9; border: 1px solid #cbb083; border-radius: 5px; font-size: .61rem; line-height: 1.25; }
.pool-item small { margin-left: 3px; color: #8a684d; font-size: .54rem; }
.pool-tier-r > b { background: #62814e; }
.pool-tier-sr > b { background: #466d96; }
.pool-tier-ssr > b { background: #774a91; }
.pool-tier-ur > b { background: #a96818; }
.box-results { min-height: 118px; max-height: 42vh; max-height: 42dvh; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px; gap: 5px; }
.box-results:empty::before { content: "宝匣尚未开启\A异世物资与食方正在其中沉睡"; grid-column: 1 / -1; align-self: center; text-align: center; white-space: pre; color: #8c715b; font-size: .78rem; line-height: 1.8; }
.box-reward { min-width: 0; padding: 6px 7px; display: grid; grid-template-columns: auto 1fr; grid-gap: 2px 6px; gap: 2px 6px; align-items: center; background: #ead9b5; border: 1px solid #baa078; border-radius: 7px; }
.box-reward > b { grid-row: 1 / 3; padding: 2px 4px; border-radius: 5px; color: #fff8e9; background: #7d6b55; font-size: .58rem; }
.box-reward strong { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.box-reward small { overflow: hidden; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.box-reward.rarity-r { background: #dfe9cd; border-color: #839d68; }
.box-reward.rarity-r > b { background: #62814e; }
.box-reward.rarity-sr { background: #d8e3ef; border-color: #6d8fb2; }
.box-reward.rarity-sr > b { background: #466d96; }
.box-reward.rarity-ssr { background: #e8dbf0; border-color: #9b6fb3; }
.box-reward.rarity-ssr > b { background: #774a91; }
.box-reward.rarity-ur { background: #f5dfaa; border-color: #c58d32; box-shadow: inset 0 0 14px rgba(255,214,94,.45); }
.box-reward.rarity-ur > b { background: #a96818; }
.pity-board { margin: 8px 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 4px; gap: 4px; }
.pity-board span { padding: 4px 2px; display: grid; grid-gap: 1px; gap: 1px; text-align: center; color: var(--muted); background: rgba(224,198,154,.5); border-radius: 5px; font-size: .58rem; }
.pity-board b { color: var(--ink); font-size: .64rem; }
.box-actions { display: grid; grid-template-columns: 1fr 1.35fr; grid-gap: 7px; gap: 7px; }
.box-actions button { min-height: 48px; padding: 6px; display: grid; place-items: center; color: var(--ink); background: #e9d1a6; border: 1px solid #8f6947; border-radius: 8px; }
.box-actions button strong { font-size: .78rem; }
.box-actions button small { color: #76543b; font-size: .62rem; }
.box-actions .primary-btn { color: #fff5df; background: linear-gradient(#be5b3c, #913621); }
.box-actions .primary-btn small { color: #f3d4a2; }
.box-actions button:disabled { filter: grayscale(.7); opacity: .55; cursor: not-allowed; }
.time-box-reveal {
  --reveal-color: #8eb7d8; position: fixed; z-index: 999; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;
  display: grid; place-items: center; align-content: center; color: #fff7df; text-align: center;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--reveal-color) 34%, transparent), rgba(14,10,18,.97) 58%);
}
.time-box-reveal[hidden] { display: none; }
.time-box-reveal.reveal-r { --reveal-color: #9bc77d; }
.time-box-reveal.reveal-sr { --reveal-color: #67a9e5; }
.time-box-reveal.reveal-ssr { --reveal-color: #b879df; }
.time-box-reveal.reveal-ur { --reveal-color: #ffd257; }
.time-box-reveal::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #fff8da; opacity: 0; pointer-events: none; }
.time-box-reveal.playing::after { animation: reveal-flash 1.25s ease both; }
.reveal-rays { position: absolute; width: 520px; aspect-ratio: 1; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(from 0deg, transparent 0 8deg, color-mix(in srgb, var(--reveal-color) 72%, white) 9deg 12deg, transparent 13deg 22deg); filter: blur(1px); }
.time-box-reveal.playing .reveal-rays { animation: reveal-rays 2.2s .38s cubic-bezier(.18,.72,.2,1) both; }
.reveal-box { position: relative; z-index: 2; width: 96px; height: 84px; display: grid; place-items: center; border: 3px solid color-mix(in srgb, var(--reveal-color) 70%, #fff); border-radius: 14px; color: #fff2bd; background: linear-gradient(145deg, #6b3e2a, #2d1714); box-shadow: 0 0 12px var(--reveal-color), inset 0 0 22px rgba(255,223,135,.25); }
.reveal-box::before { content: ""; position: absolute; left: -9px; right: -9px; top: 16px; height: 12px; background: #bc8c52; background: color-mix(in srgb, var(--reveal-color) 72%, #aa6c25); border-top: 2px solid #ffebae; border-bottom: 2px solid #ffebae; }
.reveal-box span { position: relative; z-index: 1; font: 900 2.2rem/1 "STKaiti", "KaiTi", serif; }
.time-box-reveal.playing .reveal-box { animation: reveal-box 1.25s cubic-bezier(.36,.07,.19,.97) both; }
.reveal-sparks { position: absolute; z-index: 1; left: 50%; top: 47%; width: 1px; height: 1px; }
.reveal-sparks i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--reveal-color) 70%, white); box-shadow: 0 0 10px 2px var(--reveal-color); opacity: 0; }
.time-box-reveal.playing .reveal-sparks i { animation: reveal-spark 1.15s calc(.75s + var(--delay)) cubic-bezier(.18,.68,.22,1) both; }
.time-box-reveal p, .time-box-reveal h2, .time-box-reveal > small { position: relative; z-index: 3; opacity: 0; transform: translateY(12px); }
.time-box-reveal p { margin: 24px 0 4px; color: var(--reveal-color); font-size: .8rem; font-weight: 900; letter-spacing: .18em; }
.time-box-reveal h2 { width: 390px; max-width: 88vw; margin: 4px 0; font-size: 1.55rem; text-shadow: 0 0 16px var(--reveal-color); }
.time-box-reveal > small { color: #ffe9a8; font-size: .78rem; font-weight: 900; letter-spacing: .14em; }
.skip-reveal-btn { position: relative; z-index: 4; min-width: 108px; margin-top: 26px; padding: 8px 18px; color: #fff0c9; background: rgba(64,39,31,.78); border: 1px solid rgba(255,228,167,.72); border-radius: 18px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; box-shadow: 0 3px 12px rgba(0,0,0,.28); backdrop-filter: blur(3px); }
.skip-reveal-btn:active { transform: translateY(1px); background: rgba(100,57,38,.9); }
.recipe-study-dialog { width: calc(100% - 16px); max-width: 414px; max-height: 90vh; max-height: 90dvh; padding: 0; color: var(--ink); background: var(--paper-light); border: 2px solid #5a3424; border-radius: 14px; box-shadow: 0 18px 52px #130b07; }
.recipe-study-dialog::backdrop { background: rgba(24,14,11,.72); backdrop-filter: blur(2px); }
.recipe-study-dialog form { max-height: 90vh; max-height: 90dvh; padding: 13px; overflow: auto; }
.study-title-row { display: flex; align-items: start; justify-content: space-between; grid-gap: 10px; gap: 10px; }
.study-title-row h2 { margin: 2px 0 0; font-size: 1.4rem; }
.study-title-row > span { margin-right: 36px; padding: 5px 8px; color: #70492e; background: #ead0a2; border-radius: 7px; font-size: .7rem; white-space: nowrap; }
.study-status { min-height: 18px; margin: 7px 0; color: #8d452f; font-size: .68rem; font-weight: 700; }
.study-content { display: grid; grid-gap: 8px; gap: 8px; }
.study-section { padding: 8px; background: rgba(234,213,174,.55); border: 1px solid #b89262; border-radius: 9px; }
.study-section h3 { margin: 0 0 6px; color: #6c3d29; font-size: .86rem; }
.study-section > p { margin: 0 0 7px; color: #80644d; font-size: .62rem; line-height: 1.4; }
.study-list { display: grid; grid-gap: 5px; gap: 5px; }
.study-item { min-width: 0; padding: 6px; display: grid; grid-template-columns: 1fr auto; align-items: center; grid-gap: 3px 7px; gap: 3px 7px; background: rgba(255,245,218,.8); border: 1px solid #c4a271; border-radius: 7px; }
.study-item strong { min-width: 0; font-size: .7rem; }
.study-item small { grid-column: 1; color: #816750; font-size: .58rem; line-height: 1.3; }
.study-item button, .study-buff-grid button { min-height: 30px; padding: 4px 8px; color: #fff5df; background: #9c452e; border: 1px solid #6b2c20; border-radius: 6px; font-size: .62rem; font-weight: 800; }
.study-item button { grid-column: 2; grid-row: 1 / 3; }
.study-item button:disabled, .study-buff-grid button:disabled { opacity: .48; filter: grayscale(.55); }
.study-buff-target { width: 100%; min-height: 32px; margin-bottom: 6px; padding: 4px 7px; color: #3d2b20; background: #fff4d7; border: 1px solid #a68158; border-radius: 6px; font-size: .68rem; }
.study-buff-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px; gap: 5px; }
.study-buff-grid button { display: grid; grid-gap: 2px; gap: 2px; text-align: left; background: #6e5436; }
.study-buff-grid button small { color: #ead7ad; font-size: .54rem; }
.study-active-buff { padding: 7px; color: #315b39; background: #e0ecd4; border: 1px solid #839b70; border-radius: 6px; font-size: .65rem; font-weight: 800; }
.time-box-reveal.playing p, .time-box-reveal.playing h2, .time-box-reveal.playing > small { animation: reveal-title .65s 1.2s ease both; }
.time-box-reveal.playing h2 { animation-delay: 1.3s; }
.time-box-reveal.playing > small { animation-delay: 1.42s; }
@keyframes reveal-box {
  0% { opacity: 0; transform: translateY(24px) scale(.72); }
  18% { opacity: 1; transform: translateY(0) scale(1); }
  35% { transform: rotate(-4deg) scale(1.02); }
  43% { transform: rotate(5deg) scale(1.05); }
  51% { transform: rotate(-6deg) scale(1.08); }
  60% { transform: rotate(4deg) scale(1.1); filter: brightness(1); }
  76% { transform: scale(1.28); filter: brightness(2.4); }
  100% { opacity: 0; transform: scale(1.9); filter: brightness(4); }
}
@keyframes reveal-rays { 0% { opacity: 0; transform: scale(.12) rotate(0); } 35% { opacity: .88; } 100% { opacity: .38; transform: scale(1.45) rotate(45deg); } }
@keyframes reveal-flash { 0%, 54% { opacity: 0; } 62% { opacity: .95; } 74% { opacity: 0; } 100% { opacity: 0; } }
@keyframes reveal-spark { 0% { opacity: 0; transform: rotate(var(--angle)) translateX(8px) scale(.3); } 18% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--angle)) translateX(var(--distance)) scale(1); } }
@keyframes reveal-title { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .titlebar .seal { display: none; }
  .titlebar h1 { font-size: 1.16rem; letter-spacing: .04em; }
  .top-stats > span { padding: 7px 9px; font-size: .82rem; }
  .hud { flex-wrap: wrap; }
  .hud > div { padding: 7px 9px; font-size: .84rem; }
}

@media (max-width: 390px) {
  .titlebar h1 { font-size: 1rem; }
  .top-stats { grid-gap: 5px; gap: 5px; }
  .top-stats > span { padding: 6px 7px; font-size: .74rem; }
  .stock-card { padding-left: 7px; padding-right: 7px; grid-gap: 2px; gap: 2px; }
  .stock-toolbar h2 { margin-left: 3px; font-size: .82rem; }
  .stock-toolbar .eyebrow { font-size: .59rem; letter-spacing: .04em; }
  .stock-funds { grid-gap: 3px; gap: 3px; font-size: .52rem; }
  .stock-funds strong { font-size: .6rem; }
  .display-capacity button { padding-left: 5px; padding-right: 5px; }
  .display-capacity small { display: none; }
  .category-filters { grid-gap: 3px; gap: 3px; }
  .category-filters button { padding-left: 8px; padding-right: 8px; font-size: .58rem; }
  .stock-product-card { flex-basis: 150px; min-width: 150px; }
  .selected-stock-controls { grid-gap: 3px; gap: 3px; }
  .customer-intent { min-width: 60px; padding-left: 3px; padding-right: 3px; }
  .toggle-display-btn { max-width: 58px; padding-left: 4px; padding-right: 4px; white-space: normal; line-height: 1.05; }
  .stepper { grid-gap: 4px; gap: 4px; }
  .stepper input { width: 48px; }
  .control-btn { min-height: 64px; }
  .control-btn { grid-template-columns: 19px 1fr; padding-left: 3px; padding-right: 3px; }
  .control-btn > span { font-size: 1.05rem; }
  .control-btn strong { font-size: .7rem; }
  .control-btn small { font-size: .58rem; }
  .inline-price-editor { flex: 1.1; padding-left: 3px; padding-right: 3px; }
}

@media (max-height: 720px) {
  .stock-product-card { grid-template-columns: 23px 1fr; grid-gap: 4px; gap: 4px; padding: 1px 5px; }
  .shelf-product-icon { font-size: 1rem; }
  .shelf-product-copy strong { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
  .shelf-product-copy small { display: none; }
  .selected-stock-controls > strong { font-size: .68rem; }
  .locked-product-note { font-size: .6rem; }
  .unlock-product-btn { min-height: 24px; padding: 2px 8px; font-size: .62rem; }
  .purchase-footer .primary-btn { min-height: 28px; padding-block: 2px; font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .screen.active { animation: none; }
  .npc-avatar { animation: none; }
  .time-box-reveal::after, .time-box-reveal .reveal-rays, .time-box-reveal .reveal-box, .time-box-reveal .reveal-sparks i { animation: none !important; }
  .time-box-reveal p, .time-box-reveal h2, .time-box-reveal > small { opacity: 1; transform: none; }
}
