/* 纸雕成都 / the paper UI: cream cards, cut edges, a vermilion seal, Kai lettering */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui.capture .hud, #ui.capture #toasts { display: none; }
#ui button, #ui .panel, #ui .toast { pointer-events: auto; }
#ui button { font: inherit; color: inherit; cursor: pointer; border: 0; }
kbd { display: inline-block; min-width: 1.4em; padding: 1px 6px; margin: 0 2px; text-align: center; font: 600 .82em/1.5 ui-monospace, Consolas, monospace; background: #fffaf0; border-radius: 4px; box-shadow: 0 1.5px 0 #c9bb98, 0 0 0 1px #d9cdaf; }
.hud { position: absolute; display: flex; gap: 10px; align-items: flex-start; }
.hud.tl { left: 16px; top: 14px; flex-direction: column; }
.hud.tr { right: 16px; top: 14px; flex-direction: column; align-items: flex-end; }
.hud.bc { left: 50%; bottom: 18px; transform: translateX(-50%); flex-direction: column; align-items: center; }
.chip, .tally, .compass, .prompt { background: #f6efdd; border-radius: 5px; box-shadow: 0 1px 0 #fffaf0 inset, 0 1.5px 0 #cbbf9f, 0 5px 12px rgba(90, 50, 20, .18); }
.chip.place { padding: 7px 16px 8px; transform: rotate(-1.2deg); }
.chip.place b { display: block; font-size: 23px; letter-spacing: .12em; }
.chip.place span { font-size: 14px; color: #8a7460; letter-spacing: .1em; }
.chip.clock { padding: 4px 12px; font-size: 15px; color: #6a5646; transform: rotate(.8deg); letter-spacing: .06em; }
.tally { display: flex; gap: 14px; padding: 6px 14px; font-size: 15px; color: #7d6a58; transform: rotate(.7deg); }
.tally b { color: #c2452e; font-size: 18px; }
.tools { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.tools button { padding: 6px 12px; font-size: 16px; letter-spacing: .1em; background: #f6efdd; border-radius: 5px; box-shadow: 0 1px 0 #fffaf0 inset, 0 2px 0 #cbbf9f, 0 5px 10px rgba(90, 50, 20, .16); transition: transform .12s ease, box-shadow .12s ease; }
.tools button:nth-child(odd) { transform: rotate(-1deg); }
.tools button:nth-child(even) { transform: rotate(1deg); }
.tools button:hover { transform: translateY(-2px) rotate(0); box-shadow: 0 1px 0 #fffaf0 inset, 0 3px 0 #cbbf9f, 0 9px 14px rgba(90, 50, 20, .2); }
.tools button:active { transform: translateY(1px); box-shadow: 0 1px 0 #cbbf9f; }
.tools button.off { color: #b0a08c; text-decoration: line-through; }
.compass { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; font-size: 16px; color: #6a5646; letter-spacing: .06em; }
.compass i { position: relative; display: inline-block; width: 26px; height: 26px; background: #c2452e; border-radius: 50%; box-shadow: 0 1.5px 0 #8f2f1e; transition: transform .35s ease; }
.compass i s { position: absolute; left: 7px; top: 4px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 13px solid #f6efdd; }
.prompt { padding: 6px 16px; font-size: 17px; opacity: 0; transform: translateY(8px); transition: all .3s ease; }
.prompt.on { opacity: 1; transform: none; }
#toasts { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(560px, 92vw); }
.toast { position: relative; max-width: 100%; padding: 12px 20px 13px; font-size: 16px; line-height: 1.6; color: #5b4a3c; background: #f8f1df; border-radius: 5px; box-shadow: 0 1px 0 #fffaf0 inset, 0 2px 0 #cbbf9f, 0 12px 26px rgba(90, 50, 20, .24); opacity: 0; transform: translateY(-14px) rotateX(70deg); transform-origin: 50% 0; transition: transform .55s cubic-bezier(.3, 1.5, .5, 1), opacity .3s ease; }
.toast.in { opacity: 1; transform: rotate(-.6deg); }
.toast b { display: block; font-size: 19px; color: #3d2c22; letter-spacing: .08em; }
.toast.small { padding: 7px 16px 8px; font-size: 14px; color: #8a7460; }
.toast.small b { display: inline; font-size: 16px; margin-right: 10px; }
.toast.big { padding: 16px 24px 18px 96px; min-height: 64px; }
.toast.big b { font-size: 23px; margin-bottom: 2px; }
.seal { position: absolute; left: 20px; top: 16px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 23px; line-height: 1.05; letter-spacing: .02em; color: #f8f1df; background: #c2452e; border-radius: 8px; box-shadow: 0 2px 0 #8f2f1e; transform: rotate(-7deg); animation: stamp .5s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
@keyframes stamp { from { transform: rotate(-7deg) scale(2.2); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: 1; } }
.panel { position: absolute; left: 50%; top: 50%; width: min(880px, 94vw); max-height: 88vh; display: flex; flex-direction: column; padding: 22px 26px 22px; box-sizing: border-box; background: #f8f1df; border-radius: 7px; box-shadow: 0 1px 0 #fffaf0 inset, 0 3px 0 #cbbf9f, 0 24px 60px rgba(60, 30, 10, .38); transform: translate(-50%, -50%) rotate(-.4deg); transition: opacity .25s ease, transform .4s cubic-bezier(.3, 1.4, .5, 1); }
.panel.narrow { width: min(560px, 94vw); }
.panel.hide { opacity: 0; pointer-events: none !important; transform: translate(-50%, -46%) rotate(-2deg) scale(.96); }
.panel h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: .16em; font-weight: 600; }
.panel .x { position: absolute; right: 12px; top: 8px; width: 36px; height: 36px; font-size: 26px; background: none; color: #8a7460; }
.dim { color: #8a7460; font-size: 15px; line-height: 1.7; margin: 4px 0 10px; }
.tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.tabs button { padding: 5px 14px; font-size: 16px; background: #ece2c8; border-radius: 4px; }
.tabs button.on { background: #c2452e; color: #f8f1df; box-shadow: 0 2px 0 #8f2f1e; }
.scroll { overflow: auto; flex: 1; padding-right: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.stamp, .snack { position: relative; padding: 12px 14px 12px 78px; min-height: 62px; background: #f1e8d0; border-radius: 5px; box-shadow: 0 1.5px 0 #d6c9a8; }
.snack { padding-left: 14px; min-height: 0; }
.stamp i { position: absolute; left: 12px; top: 12px; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 20px; color: #b9ab8c; border: 2px dashed #cdbf9f; border-radius: 8px; box-sizing: border-box; }
.stamp.got i { color: #f8f1df; background: #c2452e; border: 0; box-shadow: 0 2px 0 #8f2f1e; transform: rotate(-6deg); }
.stamp b, .snack b { font-size: 18px; letter-spacing: .06em; }
.stamp p, .snack p { margin: 3px 0 0; font-size: 14px; line-height: 1.6; color: #7d6a58; }
.stamp:not(.got) b, .snack:not(.got) b { color: #a8997e; }
.streets { display: flex; flex-wrap: wrap; gap: 7px; }
.streets span { padding: 3px 10px; font-size: 15px; background: #ece2c8; border-radius: 3px; }
.mapwrap { overflow: auto; flex: 1; border-radius: 4px; box-shadow: 0 0 0 1px #d6c9a8; background: #e4dbc6; }
.mapwrap canvas { display: block; width: 100%; min-width: 760px; height: auto; }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.st { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 16px; background: #f1e8d0; border-radius: 5px; box-shadow: 0 2px 0 #d6c9a8; text-align: left; }
.st u { text-decoration: none; min-width: 20px; height: 20px; padding: 0 3px; text-align: center; font: 600 12px/20px ui-sans-serif, system-ui, sans-serif; color: #fff; border-radius: 10px; }
.st.lock { color: #b9ab8c; cursor: default; box-shadow: none; background: #f1ead8; }
.st.here { outline: 2px solid #c2452e; cursor: default; }
.st:not(.lock):not(.here):hover { transform: translateY(-2px); }
.intro { text-align: center; }
.intro h2 { margin: 12px 0 6px; font-size: 38px; letter-spacing: .22em; text-indent: .22em; }
.intro p { font-size: 17px; line-height: 1.8; margin: 8px 0; }
.intro ul { list-style: none; padding: 0; margin: 12px auto; display: inline-block; text-align: left; font-size: 16px; line-height: 2.1; color: #5b4a3c; }
.go { margin-top: 12px; padding: 10px 38px; font-size: 21px; letter-spacing: .3em; text-indent: .3em; color: #f8f1df !important; background: #c2452e; border-radius: 6px; box-shadow: 0 3px 0 #8f2f1e, 0 10px 18px rgba(140, 50, 30, .3); }
.go:hover { transform: translateY(-2px); }
@media (max-width: 720px) {
  .chip.place b { font-size: 18px; }
  .tally { gap: 8px; font-size: 13px; padding: 5px 9px; }
  .tools button { padding: 5px 9px; font-size: 14px; }
  .compass { font-size: 14px; }
  .panel { padding: 16px 16px; }
  .panel h2 { font-size: 22px; }
  #toasts { top: 120px; }
}

.mini { position: absolute; right: 16px; bottom: 16px; width: 200px; height: 200px; padding: 7px; background: #f6efdd; border-radius: 8px; box-shadow: 0 1px 0 #fffaf0 inset, 0 2px 0 #cbbf9f, 0 10px 22px rgba(90, 50, 20, .26); transform: rotate(1.4deg); pointer-events: auto; cursor: pointer; }
.mini canvas { display: block; width: 200px; height: 200px; border-radius: 4px; }
.mini b { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); font-size: 13px; color: #8f2f1e; background: rgba(246, 239, 221, .85); padding: 0 5px; border-radius: 3px; }
#ui.capture .mini { display: none; }
@media (max-width: 720px) { .mini { width: 120px; height: 120px; padding: 5px; right: 8px; bottom: 64px; } .mini canvas { width: 120px; height: 120px; } }

.prompt span { cursor: pointer; pointer-events: auto; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; padding: 10px 8px 16px; }
.polaroid { position: relative; display: block; padding: 9px 9px 12px; background: #fffaf0; border-radius: 3px; box-shadow: 0 1px 0 #fff inset, 0 2px 0 #d6c9a8, 0 10px 18px rgba(90, 50, 20, .22); transform: rotate(var(--r, 0deg)); color: inherit; text-decoration: none; transition: transform .2s ease; }
.polaroid:hover { transform: rotate(0deg) translateY(-4px) scale(1.03); z-index: 2; }
.polaroid img { display: block; width: 100%; border-radius: 2px; }
.polaroid b { display: block; margin-top: 8px; font-size: 18px; letter-spacing: .08em; }
.polaroid span { font-size: 13px; color: #8a7460; }
.polaroid i { position: absolute; right: 12px; bottom: 10px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 15px; color: #fffaf0; background: #c2452e; border-radius: 6px; box-shadow: 0 2px 0 #8f2f1e; transform: rotate(-8deg); }
.toast.snapped { padding-left: 24px; padding-bottom: 20px; }
.toast.snapped .seal { left: auto; right: 18px; top: 14px; }
.toast .snap { display: block; width: 100%; max-width: 500px; margin: 0 0 10px; border: 7px solid #fffaf0; border-bottom-width: 7px; box-sizing: border-box; border-radius: 2px; box-shadow: 0 3px 10px rgba(90, 50, 20, .3); transform: rotate(-1deg); }
.flash { position: fixed; inset: 0; background: #fffaf0; pointer-events: none; animation: flash .45s ease-out both; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
#ui.capture .flash { display: none; }

/* names that surface over the roofs as you pass */
#names { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
#names .nm { position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; font: 600 14px/1.2 'STKaiti', 'KaiTi', 'Kaiti SC', 'Noto Serif SC', serif; letter-spacing: 0.12em; color: #4a3a30;
  padding: 3px 10px 4px; border-radius: 3px; background: rgba(250, 244, 230, 0.86); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 3px 8px rgba(60, 30, 40, 0.18); will-change: transform, opacity; }
#names .nm::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 1px; height: 5px; background: rgba(90, 60, 50, 0.5); }
#names .nm.comp { font-weight: 400; font-size: 12.5px; color: #6a5a50; background: rgba(250, 244, 230, 0.6); box-shadow: none; }

/* the quarter's name when you walk into it */
#quarter { position: fixed; left: 50%; top: 17%; transform: translate(-50%, -8px); opacity: 0; transition: opacity 0.9s ease, transform 0.9s ease; pointer-events: none; z-index: 4; text-align: center; color: #3d2c22; text-shadow: 0 1px 0 rgba(255, 250, 236, 0.9), 0 0 14px rgba(255, 246, 226, 0.95); }
#quarter.on { opacity: 1; transform: translate(-50%, 0); }
#quarter b { display: block; font: 700 30px/1.3 'STKaiti', 'KaiTi', 'Kaiti SC', 'Noto Serif SC', serif; letter-spacing: 0.32em; padding-left: 0.32em; }
#quarter i { display: block; margin-top: 6px; font: 400 15px/1.4 'STKaiti', 'KaiTi', 'Kaiti SC', 'Noto Serif SC', serif; letter-spacing: 0.16em; color: #6a4a3c; }
#quarter b::before, #quarter b::after { content: '·'; margin: 0 0.4em; color: #c2452e; }
#ui.capture ~ #quarter, body:has(#ui.capture) #quarter { display: none; }

/* the metro: line badges, the direction chooser, the ride bar */
.mb { display: inline-flex; align-items: center; justify-content: center; min-width: 1.55em; height: 1.55em; padding: 0 0.2em; border-radius: 1em; color: #fff; font: 700 13px/1 "Microsoft YaHei", "PingFang SC", sans-serif; font-style: normal; box-shadow: 0 0 0 2px #fff; margin: 0 0.25em; vertical-align: middle; }
#metro-ui { position: fixed; left: 50%; transform: translateX(-50%); z-index: 6; display: none; color: #2e2622; font-family: 'STKaiti', 'KaiTi', 'Kaiti SC', serif; }
#metro-ui.on { display: block; }
#metro-ui.choose { top: 50%; transform: translate(-50%, -50%); background: rgba(251, 247, 238, 0.97); border-radius: 10px; padding: 18px 20px 12px; box-shadow: 0 10px 40px rgba(40, 20, 30, 0.3); min-width: 380px; }
#metro-ui h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: 0.1em; }
#metro-ui button { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; width: 100%; margin: 0 0 8px; padding: 10px 12px; border: 1px solid #e0d6c4; border-radius: 8px; background: #fffdf8; cursor: pointer; text-align: left; font: inherit; }
#metro-ui button:hover { background: #fff6e6; border-color: #c9a87a; }
#metro-ui button .mb { grid-row: span 2; font-size: 18px; }
#metro-ui button b { font-size: 19px; } #metro-ui button span { font-size: 14px; color: #6a5a50; } #metro-ui button kbd { grid-row: 1 / span 2; grid-column: 3; }
#metro-ui em { font-style: normal; color: #c2452e; font-weight: 700; }
#metro-ui p { margin: 6px 0 0; font-size: 13px; color: #8a7a6e; text-align: center; }
#metro-ui.bar { bottom: 92px; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: rgba(30, 30, 36, 0.86); color: #f6f1e4; border-radius: 30px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); white-space: nowrap; font-size: 16px; }
#metro-ui.bar .mb { font-size: 16px; } #metro-ui.bar b { font-size: 18px; letter-spacing: 0.06em; } #metro-ui.bar strong { color: #ffd27a; font-size: 19px; } #metro-ui.bar small { color: #c9c0b4; font-size: 13px; } #metro-ui.bar em { color: #ffd27a; }
/* riding on foot: the window frame and a strap hanging from the rail */
#train-window { position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity 0.6s; }
#train-window.on { opacity: 1; }
#train-window::before { content: ''; position: absolute; inset: 0; border: solid #50565c; border-width: 9vh 6vw 16vh; border-radius: 3vw; box-shadow: inset 0 0 0 10px #c9cfd4, inset 0 0 40px rgba(0, 0, 0, 0.35); }
#train-window i { position: absolute; left: 0; right: 0; top: 4.5vh; height: 10px; background: linear-gradient(#e8ecef, #9aa2a8); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3); }
#train-window b { position: absolute; top: 4.5vh; left: 30vw; width: 2px; height: 11vh; background: #9aa0a6; box-shadow: 18vw 0 0 #9aa0a6, 36vw 0 0 #9aa0a6; }
#train-window b::after { content: ''; position: absolute; left: -16px; top: 11vh; width: 30px; height: 30px; border: 5px solid #f2f2ee; border-radius: 50%; }
