/* 纸雕成都 / the account corner, its forms and the character picker, the map's exploration panel, other players' name
   tags and speech, the chat. Same paper as the rest of the UI (ui.css, hud.css). */

/* the corner: online count, who you are, 登录 / 注册 */
#acct { display: flex; align-items: center; gap: 7px; pointer-events: auto; }
#acct:empty { display: none; }
#acct .on { font-size: 13px; color: #4f8a5a; letter-spacing: .06em; padding: 3px 9px; background: #f6efdd; border-radius: 12px; box-shadow: 0 1.5px 0 #cbbf9f; white-space: nowrap; }
#acct .on.off { color: #a8997e; }
#ui #acct button { padding: 5px 12px; font-size: 15px; 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; }
#ui #acct button:hover { transform: translateY(-1px); }
#ui #acct button.reg { color: #f8f1df; background: #c2452e; box-shadow: 0 2px 0 #8f2f1e, 0 5px 10px rgba(140, 50, 30, .25); }
#ui #acct button.who { display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; letter-spacing: .04em; }
#acct button.who img { width: 28px; height: 34px; object-fit: contain; background: #ece2c8; border-radius: 4px; }
#acct button.who b { font-weight: 600; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#acct button.who i { font-style: normal; font-size: 12px; color: #a8997e; }

/* its forms, the reminder, the picker */
.panel.acct { width: min(460px, 94vw); }
.panel.acct.side { left: 24px; width: min(480px, 46vw); max-height: 92vh; transform: translate(0, -50%) rotate(-.3deg); }
.panel.acct.side.hide { transform: translate(-30px, -50%) rotate(-2deg); }
form.auth { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; min-height: 0; }
form.auth label { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: #6a5646; letter-spacing: .06em; }
form.auth input { font: inherit; font-size: 17px; padding: 8px 10px; color: #3d2c22; background: #fffaf0; border: 0; border-radius: 4px; box-shadow: 0 0 0 1px #d6c9a8 inset, 0 1.5px 0 #e9dfc6; outline: none; }
form.auth input:focus { box-shadow: 0 0 0 2px #c2452e inset; }
form.auth .err { min-height: 1.2em; margin: 0; color: #c2452e; font-size: 14px; }
form.auth .go { align-self: center; margin-top: 2px; }
form.auth .go:disabled { opacity: .6; }
.panel .swap a { color: #c2452e; text-decoration: underline; cursor: pointer; }
.panel .row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
#ui .panel .later { margin-top: 12px; padding: 10px 22px; font-size: 17px; letter-spacing: .14em; background: #ece2c8; border-radius: 6px; box-shadow: 0 2px 0 #d6c9a8; }
.panel .small { font-size: 13px; text-align: center; }
ul.perks { list-style: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 8px; }
ul.perks li { position: relative; padding: 8px 12px 8px 42px; background: #f1e8d0; border-radius: 5px; font-size: 15px; line-height: 1.6; color: #6a5646; }
ul.perks li::before { content: '✓'; position: absolute; left: 12px; top: 9px; width: 20px; height: 20px; font: 700 13px/20px sans-serif; text-align: center; color: #f8f1df; background: #c2452e; border-radius: 50%; }
ul.perks b { display: block; color: #3d2c22; font-size: 16px; letter-spacing: .06em; }
.chars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; padding: 3px; }
#ui .ch { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto 1fr; gap: 0 8px; align-items: start; padding: 6px 8px; text-align: left; background: #f1e8d0; border-radius: 6px; box-shadow: 0 1.5px 0 #d6c9a8; transition: transform .12s ease; }
.ch img { grid-row: span 2; width: 54px; height: 64px; object-fit: contain; }
.ch b { font-size: 16px; letter-spacing: .06em; margin-top: 6px; }
.ch i { font-style: normal; font-size: 13px; line-height: 1.45; color: #8a7460; }
#ui .ch.on { background: #fff6e2; box-shadow: 0 0 0 2px #c2452e, 0 2px 0 #8f2f1e; }
#ui .ch:hover { transform: translateY(-1px); }

/* the map: how much of each district the mist has lifted from */
.explore { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 2px 0 6px; }
.explore .all { display: flex; align-items: center; gap: 10px; padding-right: 8px; }
.explore .all b { font-size: 34px; color: #c2452e; letter-spacing: .02em; }
.explore .all span { font-size: 13px; line-height: 1.4; color: #8a7460; }
.explore .d { display: grid; grid-template-columns: auto 90px auto; align-items: center; gap: 6px; font-size: 14px; color: #6a5646; }
.explore .d i { height: 8px; background: #e6dcc2; border-radius: 4px; overflow: hidden; }
.explore .d u { display: block; height: 100%; background: #c2452e; border-radius: 4px; }
.explore .d b { font-size: 14px; color: #3d2c22; min-width: 3.4em; }
.tally span[data-a] { cursor: pointer; pointer-events: auto; }

/* other players: a name over the head, a speech bubble above it */
#players { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
#players .pl { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: 0; transition: opacity .25s; will-change: transform; }
#players .pl > b { padding: 1px 9px 2px; font: 600 13px/1.5 'STKaiti', 'KaiTi', 'Kaiti SC', serif; letter-spacing: .06em; color: #fffaf0; background: rgba(47, 95, 120, .88); border-radius: 10px; white-space: nowrap; box-shadow: 0 1.5px 0 rgba(20, 50, 70, .5); }
#players .pl > b.guest { background: rgba(120, 110, 96, .85); }
#players .bub { display: none; max-width: 240px; padding: 6px 12px 7px; font-size: 15px; line-height: 1.5; color: #3d2c22; background: #fffaf0; border-radius: 10px; box-shadow: 0 2px 0 #d6c9a8, 0 6px 14px rgba(60, 30, 10, .2); word-break: break-word; text-align: center; position: relative; }
#players .bub::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fffaf0; }
#players .bub.on { display: block; animation: bubpop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bubpop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* the chat: a log that fades, a line that opens on Enter */
#chat { position: fixed; left: 16px; bottom: 18px; width: min(380px, 60vw); z-index: 11; pointer-events: none; font-size: 14px; }
#chat .log { max-height: 30vh; overflow: hidden; display: flex; flex-direction: column; gap: 3px; opacity: 0; transition: opacity .6s; }
#chat.live .log, #chat.open .log { opacity: 1; }
#chat.open .log { overflow: auto; pointer-events: auto; }
#chat .ln { align-self: flex-start; max-width: 100%; padding: 3px 10px; color: #3d2c22; background: rgba(248, 241, 223, .92); border-radius: 5px; box-shadow: 0 1px 0 #d6c9a8; line-height: 1.5; word-break: break-word; }
#chat .ln b { margin-right: 6px; color: #2f5f78; }
#chat .ln.mine b { color: #c2452e; }
#chat .ln.sys { color: #8a7460; font-style: italic; background: rgba(248, 241, 223, .75); }
#chat form { display: none; margin-top: 6px; gap: 6px; pointer-events: auto; }
#chat.open form { display: flex; }
#chat input { flex: 1; font: inherit; font-size: 15px; padding: 7px 10px; color: #3d2c22; background: #fffaf0; border: 0; border-radius: 5px; outline: none; box-shadow: 0 0 0 2px #c2452e inset; }
#chat form button { padding: 0 14px; font: inherit; font-size: 15px; color: #f8f1df; background: #c2452e; border: 0; border-radius: 5px; cursor: pointer; }
#chat .hint { margin-top: 5px; font-size: 12px; color: #8a7460; opacity: .85; text-shadow: 0 1px 0 rgba(255, 250, 236, .8); }
#chat.open .hint { display: none; }
body:has(#ui.capture) #chat, body:has(#ui.capture) #players { display: none; }
@media (max-width: 720px) { #chat { bottom: 70px; } #ui #acct button { padding: 4px 8px; font-size: 13px; } .panel.acct.side { left: 50%; width: 94vw; transform: translate(-50%, -50%); } }

/* the 天府通 card */
.tally span.owe b { color: #8f2f1e; text-decoration: underline wavy #c2452e; }
.toast.coin { padding: 4px 14px; font-size: 14px; color: #3f7a4a; }
.toast.coin b { color: #2f7a3a; }
.card-face { position: relative; display: flex; align-items: baseline; gap: 14px; margin: 4px 0 14px; padding: 16px 22px; color: #fffaf0; background: linear-gradient(120deg, #2f7f86, #3f9a8a 60%, #8ac0a0); border-radius: 12px; box-shadow: 0 3px 0 #1f5f66, 0 10px 20px rgba(30, 80, 80, .25); }
.card-face.owe { background: linear-gradient(120deg, #8f2f1e, #c2452e); box-shadow: 0 3px 0 #6a1e12; }
.card-face span { font-size: 15px; letter-spacing: .2em; opacity: .85; }
.card-face b { font-size: 40px; letter-spacing: .02em; }
.card-face i { margin-left: auto; font-style: normal; font-size: 14px; opacity: .9; }
.wallet { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; overflow: auto; }
.wallet h3 { margin: 4px 0 6px; font-size: 18px; letter-spacing: .12em; }
ul.earn, ul.tx { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
ul.earn li { display: flex; align-items: baseline; gap: 8px; padding: 5px 10px; background: #f1e8d0; border-radius: 4px; font-size: 15px; }
ul.earn li b { margin-left: auto; color: #2f7a3a; }
ul.earn li i { font-style: normal; font-size: 12px; color: #8a7460; }
ul.tx li { display: grid; grid-template-columns: 82px 1fr auto; gap: 8px; padding: 4px 8px; font-size: 14px; border-bottom: 1px dashed #e0d4b8; }
ul.tx li span { color: #a8997e; }
ul.tx li i { font-style: normal; color: #5b4a3c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.tx li b { color: #2f7a3a; } ul.tx li b.neg { color: #c2452e; }
@media (max-width: 720px) { .wallet { grid-template-columns: 1fr; } }

/* the boss key: a spreadsheet over everything */
#boss { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; background: #fff; color: #222; font: 13px/1.4 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif; cursor: default; user-select: none; }
#boss.on { display: flex; }
body.bossed #chat, body.bossed #players, body.bossed #names, body.bossed #quarter, body.bossed #metro-ui { display: none !important; }
.xl-top { display: flex; align-items: center; gap: 18px; height: 32px; padding: 0 12px; color: #fff; background: #1d6f42; }
.xl-top b { font-weight: 400; opacity: .9; } .xl-top span { flex: 1; text-align: center; } .xl-top i { font-style: normal; letter-spacing: .6em; }
.xl-menu { display: flex; gap: 2px; padding: 0 8px; background: #f3f3f3; border-bottom: 1px solid #ddd; }
.xl-menu span { padding: 6px 12px; } .xl-menu span.on { color: #1d6f42; border-bottom: 2px solid #1d6f42; }
.xl-ribbon { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 12px; background: #f8f8f8; border-bottom: 1px solid #ddd; color: #444; }
.xl-ribbon span { padding: 4px 8px; border-radius: 3px; } .xl-ribbon span:hover { background: #e6e6e6; } .xl-ribbon i { width: 1px; height: 40px; background: #ddd; }
.xl-fx { display: flex; align-items: center; gap: 12px; height: 26px; padding: 0 8px; border-bottom: 1px solid #ddd; }
.xl-fx span:first-child { width: 80px; padding-right: 8px; border-right: 1px solid #ddd; } .xl-fx i { color: #888; font-style: italic; }
.xl-grid { flex: 1; overflow: hidden; }
.xl-grid table { border-collapse: collapse; table-layout: fixed; }
.xl-grid th { min-width: 34px; height: 20px; padding: 0 4px; font-weight: 400; color: #555; background: #f0f0f0; border: 1px solid #d4d4d4; }
.xl-grid tr:first-child th { min-width: 96px; }
.xl-grid td { width: 96px; height: 20px; padding: 0 5px; overflow: hidden; white-space: nowrap; border: 1px solid #e2e2e2; }
.xl-grid td.n { text-align: right; } .xl-grid td.h { font-weight: 700; background: #e7f1ea; } .xl-grid td.sel { outline: 2px solid #1d6f42; outline-offset: -2px; }
.xl-tabs { display: flex; gap: 2px; height: 28px; padding: 0 30px; background: #f3f3f3; border-top: 1px solid #ddd; }
.xl-tabs span { padding: 4px 16px; color: #444; } .xl-tabs span.on { color: #1d6f42; background: #fff; border-bottom: 2px solid #1d6f42; font-weight: 700; }
.xl-status { display: flex; justify-content: space-between; height: 24px; padding: 0 12px; line-height: 24px; color: #fff; background: #1d6f42; font-size: 12px; }
/* the end of the working day */
.chip.offwork { cursor: pointer; pointer-events: auto; font-size: 14px; color: #6a5646; }
.chip.offwork.soon { color: #c2452e; }
.chip.offwork input { font: inherit; font-size: 14px; border: 0; background: #fffaf0; border-radius: 3px; }
#ui .tools .boss-btn { color: #1d6f42; }
/* the share card */
.panel.share { width: min(520px, 94vw); }
.panel.share img.sharecard { display: block; width: 100%; max-height: 62vh; object-fit: contain; margin: 4px 0 10px; border-radius: 6px; box-shadow: 0 2px 0 #d6c9a8, 0 8px 18px rgba(60, 30, 10, .2); }
.panel.share a.go { text-decoration: none; display: inline-block; }

/* the strip under the city */
:root { --adh: 0px; }
#ui { bottom: var(--adh) !important; }
#chat { bottom: calc(18px + var(--adh)); }
#adbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px; box-sizing: border-box; background: #efe6cf; border-top: 1px solid #d6c9a8; box-shadow: 0 -2px 8px rgba(90, 50, 20, .08) inset; font-size: 15px; color: #5b4a3c; }
#adbar .tag { padding: 1px 6px; font-size: 12px; color: #a8997e; border: 1px solid #cdbf9f; border-radius: 3px; }
#adbar .msg { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; letter-spacing: .04em; }
#adbar.in .msg { animation: adin .5s ease; }
@keyframes adin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#adbar button { font: inherit; cursor: pointer; border: 0; }
#adbar .cta { padding: 4px 14px; font-size: 14px; color: #f8f1df; background: #c2452e; border-radius: 4px; box-shadow: 0 2px 0 #8f2f1e; }
#adbar .close { width: 28px; height: 28px; font-size: 20px; color: #a8997e; background: none; }
#ad-slot:empty { display: none; }
body.bossed #adbar { display: none; }

/* sponsoring */
.panel.sponsor { width: min(520px, 94vw); }
.panel.sponsor .thanks { margin: 6px 0; padding: 8px 12px; color: #8f2f1e; background: #fbe9e0; border-radius: 5px; }
.panel.sponsor .code { margin: 8px 0; padding: 8px 12px; font-size: 15px; background: #f1e8d0; border-radius: 5px; }
.panel.sponsor .code b { font: 700 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: #c2452e; margin: 0 6px; user-select: all; -webkit-user-select: all; }
.panel.sponsor .code span { display: block; margin-top: 4px; font-size: 13px; color: #8a7460; }
.panel.sponsor .code a { color: #c2452e; text-decoration: underline; cursor: pointer; }
.panel.sponsor a.go { text-decoration: none; display: inline-block; }
