:root {
  color-scheme: light;
  --paper: #f8f2e3;
  --cream: #fffcf4;
  --ink: #41372d;
  --muted: #6e6251;
  --edge: #dccbb1;
  --green: #435e42;
  --border: #bd9d79;
  --shadow: #77491b28;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 54% 12%, #fffdf3, transparent 58%), var(--paper); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #546f46; outline-offset: 3px; }
[hidden] { display: none !important; }
.world-header, .world-main, .world-footer { width: min(calc(100% - clamp(1.4rem, 7vw, 5rem)), 1180px); margin-inline: auto; }
.world-header { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--edge); }
.world-header nav, .world-brand { display: flex; align-items: center; gap: clamp(.6rem, 2.4vw, 1.45rem); }
.world-brand { gap: .57rem; font-size: 1.18rem; font-weight: 840; letter-spacing: .16em; white-space: nowrap; }
.brand-mark { display: inline-block; width: 1.5rem; height: 1.5rem; position: relative; background: #b36f52; clip-path: polygon(41% 0%,58% 0%,58% 12%,72% 12%,72% 24%,86% 24%,86% 36%,100% 36%,100% 58%,87% 58%,87% 100%,13% 100%,13% 58%,0% 58%,0% 36%,14% 36%,14% 24%,28% 24%,28% 12%,41% 12%); }
.brand-mark::after { content: ""; position: absolute; inset: 62% 39% 0; background:#f7dfb7; }
.quiet-link { color: var(--green); padding: .54rem .1rem; font-size: .89rem; font-weight: 720; }
.quiet-link:hover, .world-map-link:hover, .world-footer a:hover { text-decoration: underline; text-underline-offset: .18em; }
.world-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.7rem; padding: .48rem .83rem; border: 1px solid #947751; border-radius: .48rem; background: #f6dda8; color: #3d3223; font-weight: 760; font-size: .88rem; white-space: nowrap; }
.world-button:hover:not(:disabled) { background: #ffeac2; }
.world-button--subtle { border-color: #d3bfa4; background: #fff8eb; color: #4d5d45; }
.world-button--subtle:hover:not(:disabled) { background: #f8eedc; }
.world-wave { display: inline-flex; align-items: center; height: 1rem; gap: .13rem; }
.world-wave i { width: .15rem; height: .38rem; background: #738761; }
.world-wave i:nth-child(2) { height: .73rem; }
.world-wave i:nth-child(3) { height: .52rem; }
#world-sound[aria-pressed="false"] .world-wave i { height: .14rem; background: #8c7d6a; }
.world-intro { display: flex; justify-content: space-between; align-items: end; gap: .8rem; margin: 1.30rem 0 1.16rem; }
.world-intro h1 { margin: .08rem 0 .49rem; font-weight: 950; font-size: clamp(2.65rem, 6.4vw, 4.85rem); line-height: 1.05; letter-spacing: .075em; color: #435542; text-shadow: 0 2px #fff9e6, 2px 4px #e4d4b4; }
.world-intro p { margin: 0; color: var(--muted); font-size: clamp(.88rem,1.6vw,1.04rem); letter-spacing: .02em; }
.world-map-link { white-space: nowrap; font-size: .87rem; color: var(--green); font-weight: 700; padding: .3rem 0; }
.world-map-link span { font-size: 1.15em; }
.world-map { overflow: hidden; border-radius: .79rem; outline: 1px solid #b6986b; background: #e7c49a; box-shadow: 0 4px 0 #c8b290, 0 15px 35px #6d442619; }
.street-viewport { position: relative; overflow: hidden; height: clamp(335px, 45vw, 552px); background: #f4dcb4; isolation: isolate; touch-action: pan-y; cursor: crosshair; }
.street-viewport:focus-visible { outline-offset: -4px; }
#street-image { position: absolute; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; image-rendering: pixelated; pointer-events: none; user-select: none; }
#street-canvas, #street-markers { position: absolute; inset: 0; }
#street-canvas { pointer-events: auto; }
#street-markers { pointer-events: none; }
.street-marker { position: absolute; z-index: 2; pointer-events: auto; display: grid; place-items: center; min-height: 2rem; white-space: nowrap; padding: .27rem .56rem; border: 1px solid #6c543b; border-radius: .38rem; background: #fff7e8; box-shadow: 0 2px 0 #6c543b, 0 4px 8px #40280d44; color: #483625; font-size: clamp(.72rem,1.2vw,.88rem); font-weight: 820; }
.street-marker:hover, .street-marker[data-near="true"] { background: #fff0b3; }
.street-marker[data-kind="stall"] { background: #eaf0ce; border-color: #63734a; box-shadow: 0 2px 0 #63734a, 0 4px 8px #40280d44; }
.street-marker[data-kind="stall"]:hover, .street-marker[data-kind="stall"][data-near="true"] { background: #f0f7d9; }
.street-bar { display: flex; align-items: center; justify-content: space-between; min-height: 3.35rem; padding: .4rem .75rem; gap: .6rem; background: #fbf1d9; border-top: 1px solid #b79871; }
.street-help { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .81rem; line-height: 1.4; }
.street-dot { flex: none; width: .48rem; height: .48rem; background: #79936b; border: 1px solid #5d7750; border-radius: 50%; }
.touch-help { display: none; }
.world-button--enter { min-height: 2.35rem; background: #e1e7c5; border-color: #88936b; color: #3d4b30; }
.world-button--enter:disabled { color: #786f58; background: transparent; border-color: #d9c8a8; }
.world-button--enter:hover:not(:disabled) { background: #eff2d8; }
.world-directory { margin-top: 1.75rem; }
.world-directory h2 { margin: 0 0 .67rem; font-size: 1.03rem; letter-spacing: .09em; color: var(--green); }
.world-directory h2:not(:first-child) { margin-top: 1.4rem; }
.directory-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .56rem; }
.directory-grid--stalls { grid-template-columns: repeat(3,minmax(0,1fr)); }
.directory-place { min-width: 0; display: flex; align-items: center; gap: .63rem; text-align: left; padding: .55rem .62rem; border: 1px solid var(--edge); border-radius: .47rem; background: #fef8ed; min-height: 3.54rem; }
.directory-place:hover { border-color: #9c835b; background: #fffdf7; }
.directory-place strong, .directory-place small { display: block; }
.directory-place strong { font-size: .88rem; }
.directory-place small { margin-top: .19rem; font-size: .73rem; color: var(--muted); }
.directory-icon { width: 2.23rem; height: 2.23rem; display: grid; place-items: center; flex: none; border-radius: .28rem; border: 1px solid #83644736; background: var(--icon-bg,#e9e3bf); color: #483a30; font-size: 1.25rem; font-family: Georgia, serif; }
.world-footer { display: flex; justify-content: center; gap: .65rem; border-top: 1px solid var(--edge); margin-top: 1.8rem; padding: 1.2rem 0 max(1.2rem,env(safe-area-inset-bottom)); font-size: .82rem; color: var(--muted); }
.shop-dialog { width: min(calc(100% - 1.9rem), 915px); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid #ab8a62; border-radius: .75rem; background: #fff9eb; color: var(--ink); box-shadow: 0 1.5rem 7rem #34261655; overflow: auto; overscroll-behavior: contain; }
.shop-dialog::backdrop { background: #372d216e; }
.shop-header { background: #fffaec; display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .85rem clamp(.85rem,3vw,1.35rem); border-bottom: 1px solid var(--edge); position: sticky; top: 0; z-index: 10; }
.shop-header h2 { font-size: clamp(1.2rem,3.3vw,1.66rem); margin: 0 0 .23rem; color: var(--green); letter-spacing: .04em; }
.shop-header p { margin: 0; font-size: .82rem; color: var(--muted); }
.shop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
#shop-body { padding: clamp(.8rem, 3.1vw, 1.4rem); }
.arcade-shop img, .music-hero img { width: 100%; display: block; border: 1px solid var(--edge); border-radius: .52rem; object-fit: cover; }
.arcade-shop img { aspect-ratio: 2.6 / 1; }
.arcade-shop-links { display:flex; flex-wrap:wrap; gap:.6rem; margin-top: .85rem; }
@media (hover:none), (pointer:coarse) { .desktop-help { display: none; } .touch-help { display: inline; } }
@media (max-width: 720px) {
  .world-header { min-height: 3.65rem; }
  .world-intro { margin: 1.04rem 0 .82rem; }
  .world-map-link { font-size: .73rem; }
  .street-viewport { height: clamp(345px, 57vh, 465px); }
  .street-bar { min-height: 3rem; padding: .31rem .42rem; }
  .world-directory { margin-top: 1.35rem; }
  .directory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .directory-grid--stalls { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .directory-grid--stalls .directory-place { align-items: start; flex-direction: column; gap: .32rem; }
}
@media (max-width: 440px) {
  .street-viewport { height: clamp(320px, 54svh, 420px); }
  .street-marker { min-height: 2.05rem; }
  .shop-dialog { width: calc(100% - .8rem); max-height: calc(100dvh - .8rem); }
  .shop-header { align-items: start; gap: .3rem; }
  .shop-header p { max-width: 20ch; font-size: .74rem; }
  .shop-actions { flex-wrap: nowrap; }
  .shop-actions .world-button { min-height: 2.45rem; font-size: .74rem; padding-inline: .48rem; }
}

body:has(.shop-dialog[open]) { overflow: hidden; }
.music-hall { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 1rem; align-items: start; }
.music-hero img { aspect-ratio: 1.78; }
.record-player { display: grid; grid-template-columns: 2.45rem minmax(0,1fr) auto; gap: .48rem .62rem; align-items: center; margin-top: .6rem; padding: .58rem; border: 1px solid var(--edge); border-radius: .47rem; background: #f4e9dd; }
.record-disc { aspect-ratio: 1; width: 2.43rem; border-radius: 50%; border: 2px solid #584252; background: repeating-radial-gradient(circle, #484049 0 2px, #322936 3px 5px); position: relative; }
.record-disc::after { content:""; position:absolute; width: 32%; aspect-ratio: 1; left: 34%; top: 34%; background:#eea86e; border-radius: 50%; border-right: 3px solid #cf7767; }
[data-playing="true"] .record-disc { animation: record-turn 3s linear infinite; }
@keyframes record-turn { to { transform: rotate(1turn); } }
.record-copy { min-width: 0; }
.record-now { display:block; font-size: .91rem; }
.record-status { margin: .12rem 0 0; font-size: .74rem; color: #69584e; }
.record-meter { grid-column: 1/-1; display:flex; gap:.35rem; align-items:center; justify-content:space-between; color:#69584e; font-size:.71rem; font-variant-numeric: tabular-nums; }
.record-meter input { width: 100%; min-width: 0; accent-color: #79637c; }
.record-shelf h3 { margin: 0 0 .55rem; color: var(--green); font-size: 1rem; }
.album-list { display: grid; gap: .5rem; }
.album { display:flex; align-items:center; gap:.66rem; width:100%; min-width:0; padding:.45rem; border:1px solid #ccb596; border-radius:.45rem; background:#fcf3e4; text-align:left; }
.album[aria-pressed="true"] { background:#ece2ee; border-color:#9779a0; }
.album img { width:3.1rem; height:3.1rem; object-fit:cover; border-radius:.27rem; }
.album strong,.album small { display:block; }
.album small { margin-top:.18rem; color:#69584e; font-size:.76rem; }
.track-list { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.6rem; }
.song-button { padding:.38rem .6rem; background:#fffaf0; border:1px solid #c3ac8e; border-radius:.37rem; font-size:.78rem; }
.song-button[aria-pressed="true"] { background:#f8e6b6; border-color:#998454; }
@media(max-width:620px) {
  .music-hall { grid-template-columns: minmax(0,1fr); gap:.82rem; }
  .music-hero img { aspect-ratio:2.3; }
  .album-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .album { flex-direction:column; align-items:flex-start; gap:.29rem; padding:.36rem; }
  .album img { width:100%; height:3rem; }
  .album strong { font-size:.79rem; }
  .album small { font-size:.70rem; }
}
@media(prefers-reduced-motion:reduce) { [data-playing="true"] .record-disc { animation:none; } }

.street-loading { position:absolute; z-index:2; inset:0; display:grid; place-items:center; margin:0; background:#f1e8d3; font-size:.9rem; color:var(--muted); }
.street-viewport[data-dimension="3d"] { height:clamp(410px,59svh,620px); background:#dfe8d8; }
.street-viewport[data-dimension="3d"] canvas { display:block; width:100%; height:100%; }
.street-viewport[data-dimension="3d"] .street-marker { transform:translate(-50%,-50%); background:#fffcf1ee; border-color:#9c8d68; box-shadow:0 2px 6px #6245233b; }
.street-viewport[data-dimension="3d"] .street-marker[data-near="true"] { border-color:#517454; background:#f3f9e3; }
.street-viewport[data-dimension="3d"]::after { content:""; z-index:3; position:absolute; inset:0; background:#f9e9ce; opacity:0; pointer-events:none; transition:opacity .25s ease; }
.street-viewport[data-dimension="3d"][data-door="opening"]::after { opacity:.11; }
.street-viewport[data-scene="cafe"] { background:#cfba90; }
.street-actions { display:flex; flex-wrap:wrap; justify-content:end; align-items:center; gap:.35rem; }
.cafe-panel { display:flex; gap:.65rem 1.15rem; padding:.85rem 1rem; align-items:center; justify-content:space-between; background:#fbf5e5; border-top:1px solid var(--edge); }
.cafe-state strong { color:var(--green); font-size:1.04rem; }
.cafe-state p { color:var(--muted); font-size:.82rem; margin:.22rem 0 0; }
.cafe-options, .cafe-order-menu { display:flex; flex-wrap:wrap; align-items:center; gap:.37rem; }
.cafe-options:empty { display:none; }
.cafe-order-menu .world-button { min-height:2.42rem; padding-inline:.56rem; font-size:.78rem; }
.cafe-order-menu [aria-pressed="true"] { outline:1px solid #668260; color:#344b36; background:#e7eed5; }
#move-help .inside-help, #move-help[data-inside="true"] .desktop-help, #move-help[data-inside="true"] .touch-help { display:none; }
#move-help[data-inside="true"] .inside-help { display:inline; }
.street-viewport[data-dimension="3d"][data-door="threshold"]::after { opacity:.83; }
@media (min-width:721px) { .world-intro h1 { font-size:clamp(3.2rem,5.6vw,4.1rem); } }
@media (max-width:720px) {
  .street-viewport[data-dimension="3d"] { height:clamp(370px,60svh,570px); }
  .street-viewport[data-scene="cafe"][data-dimension="3d"] { height:clamp(300px,49svh,520px); }
  .cafe-panel { align-items:start; flex-direction:column; padding:.69rem; }
  .cafe-options .world-button { min-height:2.5rem; }
}
@media (prefers-reduced-motion:reduce) { .street-viewport[data-dimension="3d"]::after { transition:none; } }

.venue-panel { padding:.75rem 1rem; background:#fbf5e5; border-top:1px solid var(--edge); }
.venue-intro { display:flex; justify-content:space-between; align-items:center; gap:.65rem; }
.venue-intro strong { color:var(--green); font-size:1.05rem; }
.venue-activity { margin-top:.55rem; }
.venue-activity .room-picture, .venue-activity .music-hero > img, .venue-activity .arcade-shop > img { display:none; }
.venue-activity .room-panel { margin:0; }
.world-main:has(#street[data-dimension="3d"]:not([data-scene="street"])) .world-directory,
.world-main:has(#street[data-dimension="3d"]:not([data-scene="street"])) .world-map-link { display:none; }
@media (max-width:720px) { .street-viewport[data-dimension="3d"]:not([data-scene="street"]) { height:clamp(300px,49svh,520px); } .venue-panel { padding:.7rem; } }
.street-actions:has(#leave-cafe:not([hidden])) #enter-near:disabled { display:none; }
