:root {
  --ink: #0e0b10;
  --warm: #f2a14a;
  --warm-hi: #ffd08a;
  --cold: #26303e;
  --cold-hi: #8fb4d8;
  --paper: #e9dbb8;
  --paper-dk: #c9b48a;
  --red: #c2392a;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", "Songti SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07080b; overflow: hidden; }
body { font-family: var(--sans); color: #efe6d4; user-select: none; -webkit-user-select: none; }
button { font-family: inherit; color: inherit; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

#stage {
  position: absolute; left: 50%; top: 50%; width: 390px; height: 844px;
  overflow: hidden; background: #141a24; transform-origin: 50% 50%;
}
body.busy #stage { cursor: progress; }
body.busy #world, body.busy #dock, body.busy #dock *, body.busy #hud *, body.busy #queue *, body.busy #book { pointer-events: none !important; }

/* ---------- the camp ---------- */
#world { position: absolute; inset: 0; overflow: hidden; }
#map { position: absolute; left: 0; top: 0; width: 390px; height: 699px; transform-origin: 0 0; }
#ground { position: absolute; inset: 0; background: url(../img/camp.jpg) 0 0 / 100% 100% no-repeat; }
#ground::before { /* the dark beyond the top edge when the map sits lower than the screen top */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 200px; background: linear-gradient(#0d1119, #1b2230);
}
#lamp { position: absolute; inset: 0; pointer-events: none; z-index: 900; mix-blend-mode: screen;
  background: radial-gradient(ellipse 150px 110px at 196px 300px, rgba(255,170,80,.16), transparent 70%),
              radial-gradient(ellipse 70px 50px at 262px 505px, rgba(255,150,60,.25), transparent 70%);
  animation: flicker 6s infinite; }
@keyframes flicker { 0%,100% { opacity: 1 } 47% { opacity: 1 } 48% { opacity: .75 } 49% { opacity: 1 } 76% { opacity: .9 } 77% { opacity: 1 } }
#vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 120% 70% at 50% 50%, transparent 55%, rgba(5,8,16,.7)); }
#things { position: absolute; inset: 0; }

/* a building or a plot: anchored at the middle of its bottom edge */
.bld { position: absolute; width: 0; height: 0; }
.bld .hit { position: absolute; bottom: 0; border-radius: 40% 40% 12px 12px; }
.bld .spr, .bld .ghost { position: absolute; bottom: 0; display: block; pointer-events: none; transform-origin: 50% 100%;
  filter: drop-shadow(0 5px 3px rgba(0,0,0,.45)); }
.bld .ghost { opacity: .8; filter: sepia(.7) saturate(.6) brightness(1.15) drop-shadow(0 0 4px rgba(255,200,120,.6)); }
.bld .shadow { position: absolute; bottom: -8px; height: 22px; border-radius: 50%; background: radial-gradient(rgba(0,0,0,.45), transparent 70%); pointer-events: none; }
.bld .aura { position: absolute; bottom: -24px; height: 60px; border-radius: 50%; pointer-events: none; display: none;
  background: radial-gradient(rgba(255,190,100,.38), transparent 70%); mix-blend-mode: screen; animation: breathe 3s infinite; }
@keyframes breathe { 50% { opacity: .6 } }
.bld.empty .spr { filter: brightness(.92) drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.bld .flag { position: absolute; width: 22px; height: 34px; pointer-events: none; display: none; z-index: 1; }
.bld .flag::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 34px; background: #3b2a1c; border: 1px solid var(--ink); border-radius: 1px; }
.bld .flag::after { content: ""; position: absolute; left: 3px; top: 2px; width: 18px; height: 12px; background: linear-gradient(#ffb25c, #e0782b);
  border: 2px solid var(--ink); border-left: none; clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%); animation: wave 2.4s ease-in-out infinite; transform-origin: 0 50%; }
@keyframes wave { 50% { transform: scaleX(.8) skewY(4deg) } }

.bld .tag { position: absolute; left: 0; transform: translateX(-50%) rotate(-2deg); display: flex; align-items: stretch; pointer-events: none; white-space: nowrap;
  font-size: 11px; font-weight: 700; line-height: 1; border: 2px solid var(--ink); border-radius: 3px; box-shadow: 0 2px 0 var(--ink); overflow: hidden; }
.bld .tag b { background: var(--paper); color: #2a2018; padding: 3px 5px; font-weight: 700; }
.bld .tag i { font-style: normal; background: #2a3442; color: var(--warm-hi); padding: 3px 5px; border-left: 2px solid var(--ink); font-weight: 800; }
.bld.empty .tag b { background: #8d8471; color: #231c15; }
.bld.empty .tag i { display: none; }
.bld .tag .up { display: none; width: 18px; background: var(--warm); border-left: 2px solid var(--ink); position: relative; text-decoration: none; }
.bld .tag .up::before { content: ""; position: absolute; left: 4px; top: 3px; border: 5px solid transparent; border-bottom: 6px solid var(--ink); border-top: none; }
.bld .tag .up::after { content: ""; position: absolute; left: 7px; top: 9px; width: 4px; height: 5px; background: var(--ink); }
.bld.can .tag .up { display: block; }
body.guided .bld .tag .up { display: none; }
@keyframes blink { 50% { background: var(--warm-hi); } }
@keyframes bob { 50% { transform: translateY(-4px) } }

/* calling out the first step: a ring on the ground and a note */
.bld .ring { position: absolute; bottom: -16px; height: 40px; background: radial-gradient(rgba(255,190,100,.35), transparent 70%); border-radius: 50%; display: none; pointer-events: none;
  border: 3px solid rgba(255,200,120,.95); box-shadow: 0 0 16px rgba(242,161,74,.9), inset 0 0 12px rgba(242,161,74,.6); animation: ring 1.3s ease-out infinite; }
.bld.beckon .ring { display: block; }
@keyframes ring { 0% { transform: scale(.75); opacity: 1 } 100% { transform: scale(1.25); opacity: 0 } }
.bld .note { position: absolute; left: 0; display: none; transform: translateX(-50%); pointer-events: none; z-index: 2; white-space: nowrap;
  background: var(--paper); color: #2a2018; border: 3px solid var(--ink); border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 700; line-height: 1.35;
  box-shadow: 0 4px 0 var(--ink); animation: notebob 1.6s ease-in-out infinite; text-align: center; }
@keyframes notebob { 0%, 100% { transform: translateX(-50%) } 50% { transform: translateX(-50%) translateY(-5px) } }
.bld .note small { display: block; font-size: 10px; font-weight: 600; color: #6b5338; }
.bld .note::after { content: ""; position: absolute; left: 50%; bottom: -11px; margin-left: -8px; border: 8px solid transparent; border-top: 9px solid var(--ink); border-bottom: none; }
.bld.beckon.noted .note { display: block; }

/* construction */
.bld .scaf { position: absolute; bottom: -2px; display: none; pointer-events: none; overflow: visible; }
.bld.build .scaf { display: block; }
.bld .scaf .p { stroke: #1a120c; stroke-width: 4.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bld .scaf .p2 { stroke: #a8743f; stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.bld .scaf .tarp { fill: rgba(200,150,90,.42); stroke: #1a120c; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bld .dust { position: absolute; bottom: 0; width: 0; height: 0; display: none; pointer-events: none; }
.bld.build .dust { display: block; }
.bld .dust i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: rgba(190,170,140,.55); animation: puff 1.6s ease-out infinite; }
.bld .dust i:nth-child(2) { animation-delay: .55s; } .bld .dust i:nth-child(3) { animation-delay: 1.1s; }
@keyframes puff { 0% { transform: translate(0,0) scale(.4); opacity: 0 } 20% { opacity: .9 } 100% { transform: translate(var(--dx, 12px), -26px) scale(1.6); opacity: 0 } }
.bld .spark { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #ffe0a0; box-shadow: 0 0 8px 3px rgba(255,170,70,.9); display: none; animation: spark .9s steps(1) infinite; }
.bld.build .spark { display: block; }
@keyframes spark { 0% { opacity: 1 } 15% { opacity: 0 } 45% { opacity: 1 } 55% { opacity: 0 } }
.bld .prog { position: absolute; left: 0; transform: translateX(-50%); display: none; pointer-events: none; width: 92px;
  background: rgba(14,11,16,.88); border: 2px solid var(--ink); border-radius: 5px; padding: 3px 5px 4px; text-align: center; box-shadow: 0 2px 0 var(--ink); z-index: 3; }
.bld.build .prog, .bld.study .prog { display: block; }
.bld .prog span { display: block; font-size: 10px; font-weight: 700; color: var(--warm-hi); line-height: 1.2; white-space: nowrap; }
.bld .prog u { display: block; height: 6px; margin-top: 2px; border-radius: 3px; background: #3a4350; overflow: hidden; }
.bld .prog u::before { content: ""; display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, #f2a14a, #ffd08a); transition: width .6s; }

/* people walking about */
.tok { position: absolute; width: 0; height: 0; transition-property: left, top; transition-timing-function: linear; }
.tok .body { position: absolute; left: -9px; bottom: 0; width: 18px; height: 15px; border-radius: 8px 8px 4px 4px; border: 2px solid var(--ink); background: #4a4036; }
.tok .face { position: absolute; left: -14px; bottom: 11px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink);
  background-size: 160%; background-position: 50% 32%; background-color: #1b1512; box-shadow: 0 0 0 1px rgba(255,190,120,.5); }
.tok .sh { position: absolute; left: -12px; bottom: -4px; width: 24px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.45); }
@keyframes step { 50% { transform: translateY(-2px) } }
.tok .hero { position: absolute; left: -22px; bottom: -3px; width: 44px; height: 44px; background: url(../img/hero.png) center / contain no-repeat; filter: drop-shadow(0 2px 1px rgba(0,0,0,.6)); }
.tok .q { position: absolute; left: 6px; bottom: 34px; width: 16px; height: 16px; border-radius: 50%; display: none; background: var(--ink); color: var(--warm-hi);
  font: 700 11px/16px var(--sans); text-align: center; border: 1.5px solid var(--warm); }
.tok.want .q { display: block; }
.tok .say { position: absolute; bottom: 46px; left: 0; transform: translateX(-50%); width: max-content; max-width: 170px; display: none;
  background: var(--paper); color: #2a2018; border: 2px solid var(--ink); border-radius: 6px; padding: 4px 7px; font-size: 12px; font-weight: 700; line-height: 1.35; box-shadow: 0 3px 0 var(--ink); z-index: 2; }
.tok .say small { display: block; font-size: 10px; color: #7a5c3a; font-weight: 600; }
.tok .say::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border: 6px solid transparent; border-top: 7px solid var(--ink); border-bottom: none; }
.tok.talk .say { display: block; animation: pop .2s; }
.tok.shade .face { background: #12151b !important; filter: none; box-shadow: none; }
.tok.shade .body { background: #12151b; }
.tok.shade .q { display: block; }
@keyframes pop { from { transform: translateX(-50%) scale(.5); opacity: 0 } }

/* ---------- head-up ---------- */
#hud { position: absolute; left: 0; right: 0; top: 0; z-index: 20; padding: 8px 10px 0; pointer-events: none;
  background: linear-gradient(rgba(10,13,20,.92), rgba(10,13,20,.75) 70%, transparent); height: 96px; }
#hud .row { display: flex; align-items: center; gap: 5px; height: 34px; }
#hud .row.res { margin-top: 6px; height: 32px; gap: 5px; }
#hud button, #hud .res-c { pointer-events: auto; }
#hud .sp { flex: 1; }
.plate { flex: none; height: 30px; padding: 0 9px; display: flex; align-items: center; font-size: 14px; font-weight: 800; letter-spacing: 1px;
  background: #2a3442; color: var(--paper); border: 2px solid var(--ink); border-radius: 7px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.plate.hot { background: var(--warm); color: var(--ink); }
.chip { flex: none; height: 30px; padding: 0 7px 0 5px; display: flex; align-items: center; gap: 3px; background: rgba(14,11,16,.85); border: 2px solid var(--ink); border-radius: 15px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.chip b { font-size: 15px; font-weight: 800; color: #fff4e0; }
.chip small { font-size: 11px; color: #9aa6b4; font-weight: 700; }
.round { flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(14,11,16,.85); border: 2px solid var(--ink); font-size: 14px; font-weight: 800; color: var(--paper); box-shadow: 0 3px 0 var(--ink); }
.round.off { color: #6b7684; text-decoration: line-through; }
.res-c { flex: none; height: 30px; display: flex; align-items: center; gap: 3px; padding: 0 8px 0 2px; background: rgba(14,11,16,.85); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.res-c img { width: 24px; height: 24px; object-fit: contain; margin-top: -2px; }
.res-c b { font-size: 15px; font-weight: 800; color: #fff4e0; min-width: 14px; }
.res-c small { font-size: 10px; color: #9aa6b4; font-weight: 700; }
#n-eat.short { color: #ff8f6e; }
.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--warm-hi) } }

i[class^="ico-"] { display: inline-block; flex: none; position: relative; }
.ico-people { width: 18px; height: 16px; }
.ico-people::before { content: ""; position: absolute; left: 5px; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); }
.ico-people::after { content: ""; position: absolute; left: 1px; top: 8px; width: 16px; height: 8px; border-radius: 8px 8px 2px 2px; background: var(--paper); }

/* ---------- construction strip and dock ---------- */
#queue { position: absolute; left: 10px; right: 10px; z-index: 19; height: 34px; display: flex; align-items: center; gap: 6px; }
#queue .hrs { flex: none; height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 8px; background: rgba(14,11,16,.9); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); font-size: 11px; font-weight: 700; color: #9aa6b4; white-space: nowrap; }
#queue .hrs b { color: #fff4e0; font-size: 14px; }
#queue .pips { display: flex; gap: 2px; }
#queue .pips i { width: 5px; height: 12px; border-radius: 1px; background: #3a4350; }
#queue .pips i.on { background: var(--warm); box-shadow: 0 0 4px rgba(242,161,74,.8); }
#queue .qs { flex: 1; min-width: 0; display: flex; gap: 5px; overflow: hidden; }
#queue .q { flex: 0 1 auto; min-width: 0; height: 30px; display: flex; align-items: center; gap: 4px; padding: 0 7px; background: rgba(42,52,66,.92); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; }
#queue .q em { font-style: normal; color: var(--warm-hi); }
#queue .q small { color: #9aa6b4; font-size: 10px; }
#queue .idle { font-size: 11px; color: #9aa6b4; font-weight: 600; padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }

#dock { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: 92px; padding: 12px 10px 0; display: flex; gap: 7px;
  background: linear-gradient(#232c39, #161c25 60%); border-top: 3px solid var(--ink); box-shadow: 0 -2px 0 rgba(255,190,120,.18) inset, 0 -10px 24px rgba(0,0,0,.6); }
#dock::before, #dock::after { content: ""; position: absolute; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9aa6b4, #3a4350); box-shadow: 0 1px 0 #000; }
#dock::before { left: 4px; } #dock::after { right: 4px; }
#dock .sq { flex: none; width: 56px; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--paper); color: #241a12; border: 3px solid var(--ink); border-radius: 7px; font-size: 13px; font-weight: 800; box-shadow: 0 4px 0 #6c5638, 0 6px 10px rgba(0,0,0,.5); }
#dock .sq.cold { background: linear-gradient(#b9cde0, #8fa9c2); box-shadow: 0 4px 0 #4b5f74, 0 6px 10px rgba(0,0,0,.5); }
#dock .sq:active, #b-go:active { transform: translateY(3px); box-shadow: 0 1px 0 #6c5638; }
#dock .sq .ico { width: 24px; height: 24px; color: #241a12; }
#b-go { flex: 1; height: 62px; border: 3px solid var(--ink); border-radius: 7px; background: linear-gradient(#ffc777, #f09a3c); color: #241a12;
  box-shadow: 0 4px 0 #7a4f1f, 0 6px 12px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
#b-go b { font: 800 24px var(--kai); letter-spacing: 6px; margin-right: -6px; }
#b-go small { font-size: 10px; font-weight: 700; color: #5c3a14; margin-top: 2px; }
#b-go.pulse { animation: gopulse 1.4s ease-in-out infinite; }
@keyframes gopulse { 50% { box-shadow: 0 4px 0 #7a4f1f, 0 0 0 4px rgba(255,208,138,.55), 0 0 26px 6px rgba(242,161,74,.75); } }
.ico-flask { width: 20px; height: 20px; }
.ico-flask::before { content: ""; position: absolute; left: 6px; top: 0; width: 8px; height: 7px; border: 2px solid #241a12; border-bottom: none; }
.ico-flask::after { content: ""; position: absolute; left: 1px; top: 6px; width: 18px; height: 13px; border: 2px solid #241a12; border-radius: 3px 3px 7px 7px; clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%); background: linear-gradient(transparent 45%, #2e5b86 45%); }
.ico-rifle { width: 24px; height: 20px; }
.ico-rifle::before { content: ""; position: absolute; left: 0; top: 7px; width: 24px; height: 5px; background: #241a12; border-radius: 1px; }
.ico-rifle::after { content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 9px; background: #241a12; border-radius: 0 0 2px 2px; transform: skewX(14deg); }
.ico-people.big { width: 22px; height: 20px; }
.ico-moon { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset -6px -2px 0 0 #241a12; transform: rotate(-20deg); }

/* ---------- menu ---------- */
#menu { position: absolute; right: 10px; top: 48px; z-index: 50; background: #161c25; border: 2px solid var(--ink); border-radius: 7px; padding: 6px; box-shadow: 0 4px 0 var(--ink); }
#menu button { display: block; background: none; border: none; color: #9aa6b4; font-size: 13px; padding: 6px 10px; }
#menu button.sure { color: #ff8f6e; font-weight: 800; }

/* ---------- bottom sheet ---------- */
#sheet-bg { position: absolute; inset: 0; z-index: 29; background: rgba(5,7,12,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
body[data-scene="sheet"] #sheet-bg { opacity: 1; pointer-events: auto; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; max-height: 80%;
  background: linear-gradient(#232c39, #161c25 50%); border-top: 3px solid var(--ink); border-radius: 14px 14px 0 0;
  box-shadow: 0 -2px 0 rgba(255,190,120,.2) inset, 0 -14px 30px rgba(0,0,0,.7); transform: translateY(105%); visibility: hidden; transition: transform .26s cubic-bezier(.2,.8,.2,1), visibility 0s .26s; }
#sheet.on { transform: translateY(0); visibility: visible; transition: transform .26s cubic-bezier(.2,.8,.2,1); }
#sheet .sh-head { flex: none; position: relative; padding: 14px 16px 8px; display: flex; gap: 12px; align-items: center; }
#sheet .x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: #2a3442; color: var(--paper); font-size: 16px; font-weight: 800; box-shadow: 0 3px 0 var(--ink); }
#sheet .thumb { flex: none; width: 84px; height: 72px; display: grid; place-items: end center; }
#sheet .thumb img { max-width: 84px; max-height: 72px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.6)); }
#sheet .ttl { flex: 1; min-width: 0; padding-right: 34px; }
#sheet h2 { margin: 0; font: 700 24px var(--kai); color: var(--warm-hi); letter-spacing: 2px; display: flex; align-items: baseline; gap: 8px; }
#sheet h2 small { font: 700 13px var(--sans); color: #9aa6b4; letter-spacing: 0; }
#sheet .what { font-size: 12px; color: #b9c3cf; line-height: 1.45; margin-top: 3px; }
#sheet .sh-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 10px; -webkit-overflow-scrolling: touch; }
#sheet .sh-foot { flex: none; padding: 10px 16px 16px; border-top: 2px solid rgba(0,0,0,.5); background: rgba(10,13,20,.5); }
.lines { display: flex; flex-direction: column; gap: 6px; }
.ln { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.45; }
.ln > b { flex: none; width: 48px; font-size: 11px; color: #2a2018; background: var(--paper-dk); border: 2px solid var(--ink); border-radius: 3px; text-align: center; padding: 1px 0; transform: rotate(-1.5deg); }
.ln > b.hot { background: var(--warm); }
.ln span { color: #efe6d4; }
.ln span.dim { color: #8d97a4; }
.cost { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cost .c { display: flex; align-items: center; gap: 3px; height: 30px; padding: 0 9px 0 3px; border: 2px solid var(--ink); border-radius: 7px; background: #2a3442; font-size: 14px; font-weight: 800; white-space: nowrap; }
.cost .c img { width: 24px; height: 24px; object-fit: contain; }
.cost .c small { font-size: 11px; color: #9aa6b4; font-weight: 700; }
.cost .c.short { background: #5a2620; }
.cost .c .hg { width: 18px; height: 20px; display: flex; gap: 2px; align-items: center; justify-content: center; }
.cost .c .hg i { width: 4px; height: 12px; border-radius: 1px; background: var(--warm); }
.when { margin-top: 8px; font-size: 12px; color: #b9c3cf; }
.when em { font-style: normal; color: var(--warm-hi); font-weight: 700; }
.who { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.who .p { display: flex; gap: 9px; align-items: center; background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px 8px; }
.fc { flex: none; width: 40px; height: 40px; border-radius: 7px; border: 2px solid var(--ink); background-size: 150%; background-position: 50% 36%; background-color: #1b1512; }
.fc.none { background: #12151b; display: grid; place-items: center; color: #6b7684; font-weight: 800; }
.fc.me { background: #2a2018 url(../img/hero.png) 50% 40% / 120% no-repeat; }
.who .p .t { font-size: 12px; line-height: 1.45; color: #b9c3cf; min-width: 0; }
.who .p .t b { color: #efe6d4; font-size: 13px; }
.who .p .t q { font-family: var(--kai); font-size: 14px; color: var(--warm-hi); quotes: "「" "」"; }
.sub { margin: 14px 0 6px; font-size: 12px; font-weight: 800; color: #2a2018; background: var(--warm); display: inline-block; padding: 2px 8px; border: 2px solid var(--ink); transform: rotate(-1.5deg); }
.go { width: 100%; height: 54px; border: 3px solid var(--ink); border-radius: 7px; background: linear-gradient(#ffc777, #f09a3c); color: #241a12; font-size: 18px; font-weight: 800;
  box-shadow: 0 4px 0 #7a4f1f, 0 6px 12px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.go small { font-size: 11px; font-weight: 700; color: #5c3a14; }
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 #7a4f1f; }
.go.cold { background: linear-gradient(#cfe0f0, #8fa9c2); box-shadow: 0 4px 0 #4b5f74, 0 6px 12px rgba(0,0,0,.5); }
.go.cold small { color: #2b3c50; }
.go:disabled { background: #3a4350; color: #8d97a4; box-shadow: 0 4px 0 #1b2129; }
.go:disabled small { color: #ff8f6e; }
.busyline { text-align: center; font-size: 14px; font-weight: 700; color: var(--warm-hi); padding: 8px 0; }
.busyline u { display: block; height: 8px; margin: 8px 30px 0; border-radius: 4px; background: #3a4350; overflow: hidden; border: 2px solid var(--ink); }
.busyline u::before { content: ""; display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #f2a14a, #ffd08a); }

/* tech tree */
.tree { display: grid; grid-template-columns: 28px repeat(3, 1fr); gap: 8px 7px; margin-top: 4px; }
.tree .ch { text-align: center; font: 700 16px var(--kai); color: var(--warm-hi); letter-spacing: 2px; }
.tree .rh { writing-mode: vertical-rl; font-size: 10px; color: #8d97a4; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.tree .rh.off { color: #5a6370; }
.node { position: relative; min-height: 74px; border: 2px solid var(--ink); border-radius: 8px; padding: 6px 6px 5px; text-align: left; background: #2a3442; box-shadow: 0 3px 0 var(--ink); }
.node b { display: block; font-size: 13px; font-weight: 800; color: #efe6d4; }
.node span { display: block; font-size: 10px; line-height: 1.35; color: #9aa6b4; margin-top: 2px; }
.node em { position: absolute; right: 4px; top: 4px; font-style: normal; font-size: 10px; font-weight: 800; }
.node.done { background: linear-gradient(#e7b562, #c78434); }
.node.done b, .node.done span { color: #241a12; }
.node.done em { color: #241a12; }
.node.open { border-color: var(--warm); box-shadow: 0 3px 0 var(--ink), 0 0 12px rgba(242,161,74,.5); }
.node.open em { color: var(--warm-hi); }
.node.lock { opacity: .5; }
.node.busy { background: repeating-linear-gradient(-45deg, #3a3020 0 8px, #2a3442 8px 16px); }
.node.busy em { color: var(--warm-hi); }
.node.sel { outline: 3px solid var(--warm-hi); outline-offset: 1px; }
.node:not(:last-child)::after { content: none; }
.node.link::before { content: ""; position: absolute; left: 50%; top: -10px; width: 3px; height: 8px; margin-left: -1px; background: #4a5462; }
.node.link.lit::before { background: var(--warm); }

/* gear */
.hero-box { display: flex; gap: 10px; align-items: center; }
.hero-box .hb { flex: none; width: 76px; height: 76px; background: #1b1512 url(../img/hero.png) center / 86% no-repeat; border: 3px solid var(--ink); border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(255,190,120,.3); }
.gearrow { display: flex; gap: 10px; align-items: center; padding: 9px 8px; margin-top: 8px; background: rgba(0,0,0,.25); border-radius: 8px; }
.gearrow .gi { flex: 1; min-width: 0; }
.gearrow .gi b { font: 700 17px var(--kai); color: var(--warm-hi); }
.gearrow .gi .txt { font-size: 11px; color: #b9c3cf; margin-top: 2px; line-height: 1.4; }
.pipsx { display: flex; gap: 3px; margin-top: 4px; }
.pipsx i { width: 18px; height: 8px; border-radius: 2px; border: 1.5px solid var(--ink); background: #3a4350; }
.pipsx i.on { background: var(--warm); }
.pipsx i.cap { background: repeating-linear-gradient(-45deg, #222831 0 3px, #39414d 3px 6px); }
.gbtn { flex: none; width: 92px; height: 48px; border: 3px solid var(--ink); border-radius: 7px; background: linear-gradient(#ffc777, #f09a3c); color: #241a12; font-size: 14px; font-weight: 800;
  box-shadow: 0 3px 0 #7a4f1f; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.gbtn small { font-size: 10px; font-weight: 700; color: #5c3a14; display: flex; align-items: center; gap: 2px; }
.gbtn small img { width: 14px; height: 14px; }
.gbtn:disabled { background: #3a4350; color: #8d97a4; box-shadow: 0 3px 0 #1b2129; }
.gbtn:disabled small { color: #ff8f6e; }
.gbtn.flash { animation: gflash .5s; }
@keyframes gflash { 30% { box-shadow: 0 0 0 4px var(--warm-hi), 0 0 24px 6px rgba(242,161,74,.9) } }

/* ---------- the morning ---------- */
#report { position: absolute; inset: 0; z-index: 45; display: none; background: rgba(5,7,12,.78); }
body[data-scene="report"] #report { display: block; }
.paper { position: absolute; left: 16px; right: 16px; background: var(--paper); color: #2b2117; border: 3px solid var(--ink); padding: 14px 14px 12px; transform: rotate(-.6deg);
  box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 5px 0 var(--ink); background-image: radial-gradient(circle at 20% 30%, rgba(120,80,40,.1), transparent 40%), radial-gradient(circle at 80% 85%, rgba(120,80,40,.14), transparent 35%); }
.paper h3 { margin: 0; font: 700 24px var(--kai); text-align: center; letter-spacing: 3px; }
.paper .sub2 { text-align: center; font-size: 12px; color: #7a5c3a; margin-top: 2px; }
.rp { display: flex; gap: 8px; align-items: center; font-size: 13px; line-height: 1.4; padding: 6px 0; border-bottom: 1px dashed #a98d63; }
.rp:last-of-type { border-bottom: none; }
.rp > b { flex: none; width: 56px; color: #7a5c3a; font-size: 12px; font-weight: 800; }
.rp .v { flex: 1; min-width: 0; }
.rp .v em { font-style: normal; font-weight: 800; color: #2b2117; }
.rp .v .neg { color: var(--red); font-weight: 800; }
.rp .v .pos { color: #8a4a12; font-weight: 800; }
.rp .ico { width: 20px; height: 20px; vertical-align: -5px; object-fit: contain; }
.loot { display: flex; gap: 10px; justify-content: center; margin: 10px 0 4px; }
.loot div { display: flex; flex-direction: column; align-items: center; width: 64px; }
.loot img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.loot b { font: 800 20px var(--sans); }
.loot small { font-size: 11px; color: #7a5c3a; }
.paper .go { margin-top: 12px; }
.paper .rp.warn .v { color: var(--red); font-weight: 700; }

/* ---------- banners, toasts, night ---------- */
#toast { position: absolute; left: 50%; z-index: 44; pointer-events: none; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ribbon { padding: 6px 18px; font: 700 20px var(--kai); letter-spacing: 3px; color: #241a12; white-space: nowrap; background: linear-gradient(#ffd08a, #f2a14a); border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 0 30px rgba(242,161,74,.6); clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); padding-left: 22px; padding-right: 22px; }
.ribbon.cold { background: linear-gradient(#cfe0f0, #8fa9c2); box-shadow: 0 4px 0 var(--ink); }
.ribbon.red { background: linear-gradient(#ffb09a, #e0634a); }
.ribbon { text-align: center; max-width: 350px; }
.ribbon small { display: block; font: 700 12px var(--sans); letter-spacing: 0; margin-top: 2px; white-space: normal; }
.fly { position: absolute; z-index: 46; width: 26px; height: 26px; pointer-events: none; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.puff { position: absolute; width: 20px; height: 20px; margin: -10px; border-radius: 50%; background: rgba(214,196,168,.85); pointer-events: none; }
.shock { position: absolute; border-radius: 50%; border: 4px solid rgba(255,214,150,.95); pointer-events: none; box-shadow: 0 0 20px rgba(242,161,74,.9); }
.banner { position: absolute; left: 0; right: 0; z-index: 44; text-align: center; pointer-events: none; }
.banner b { display: block; font: 800 42px var(--kai); letter-spacing: 8px; color: var(--warm-hi); text-shadow: 0 4px 0 var(--ink), 0 0 24px rgba(242,161,74,.6); }
.banner small { display: block; margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--paper); text-shadow: 0 2px 0 var(--ink); }
#fade { position: absolute; inset: 0; z-index: 60; background: #05060a; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fade.on { opacity: 1; pointer-events: auto; }
#fade div { font: 700 30px var(--kai); color: var(--warm-hi); letter-spacing: 4px; text-align: center; }
#fade div small { display: block; font: 600 14px var(--sans); color: #8d97a4; letter-spacing: 1px; margin-top: 8px; }

/* ---------- safe area probe ---------- */
#safe { position: fixed; left: 0; top: 0; width: 0; visibility: hidden; pointer-events: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* ---------- light and dark ---------- */
#ground2 { position: absolute; inset: 0; background: url(../img/camp2.jpg) 0 0 / 100% 100% no-repeat; opacity: 0; transition: opacity 1.6s ease-in-out; }
#ground2.on { opacity: 1; }
#dark { position: absolute; inset: 0; pointer-events: none; background: rgba(4,8,22,.66); transition: opacity 1.6s; }
body.lit #dark { opacity: 0; }
#lamp { background: none; animation: none; }
#lamp i { position: absolute; border-radius: 50%; pointer-events: none; }
#lamp .fire { width: 170px; height: 110px; margin: -55px 0 0 -85px; background: radial-gradient(rgba(255,150,60,.34), transparent 70%); animation: flicker 6s infinite; }
#lamp .pool { width: 170px; height: 86px; margin: -43px 0 0 -85px; background: radial-gradient(rgba(255,232,170,.3), transparent 70%); display: none; }
#lamp .pool.gen { width: 90px; height: 50px; margin: -25px 0 0 -45px; }
#lamp .head { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: radial-gradient(rgba(255,246,210,.95), rgba(255,220,140,.5) 40%, transparent 70%); display: none; }
body.lit #lamp .pool, body.lit #lamp .head { display: block; }
.lampost { position: absolute; pointer-events: none; display: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
body.lit .lampost { display: block; }
.gen { position: absolute; width: 36px; height: 38px; display: none; pointer-events: none; }
body.lit .gen { display: block; }
.gen img { width: 36px; display: block; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); animation: hum .18s steps(2) infinite; }
.gen i { position: absolute; left: 4px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: rgba(170,165,160,.6); animation: exhaust 1.4s ease-out infinite; }
@keyframes hum { 50% { transform: translateX(.6px) } }
@keyframes exhaust { 0% { transform: translate(0,0) scale(.5); opacity: .8 } 100% { transform: translate(-8px,-22px) scale(2); opacity: 0 } }
.bld .spr, .bld img.d, .wd, .tok .face, .tok .body, .tok .hero { transition: filter 1.6s; }
body:not(.lit) .bld .spr, body:not(.lit) .bld img.d, body:not(.lit) .wd { filter: brightness(.62) saturate(.8) drop-shadow(0 5px 3px rgba(0,0,0,.45)); }
body:not(.lit) .tok .face, body:not(.lit) .tok .body, body:not(.lit) .tok .hero { filter: brightness(.72); }
body.lit .bld:not(.empty) .spr { filter: brightness(1.06) drop-shadow(0 5px 3px rgba(0,0,0,.45)); }
#things.moving .bld { transition-property: left, top; transition-duration: 1.2s; transition-timing-function: ease-in-out; }

/* ---------- what each level adds to a building ---------- */
.bld .d { position: absolute; display: none; pointer-events: none; }
.bld img.d { filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.bld.g2 .crate, .bld.g6 .pallet, .bld.g9 .bags { display: block; }
.bld .bags { z-index: 1; }
.bld .lights { height: 9px; border-bottom: 1.5px solid #1a120c; border-radius: 0 0 50% 50% / 0 0 100% 100%; justify-content: space-between; align-items: flex-end; padding: 0 2px; }
.bld.g3 .lights { display: flex; }
.bld .lights i { width: 5px; height: 6px; margin-bottom: -4px; border-radius: 50% 50% 45% 45%; background: #8a7a50; border: 1px solid #1a120c; }
.bld .lights i:nth-child(1), .bld .lights i:nth-child(6) { transform: translateY(-6px); }
.bld .lights i:nth-child(2), .bld .lights i:nth-child(5) { transform: translateY(-2px); }
body.lit .bld .lights i { background: #ffe08a; box-shadow: 0 0 6px 2px rgba(255,200,90,.8); animation: twinkle 2.4s ease-in-out infinite; }
body.lit .bld .lights i:nth-child(even) { animation-delay: 1.2s; }
@keyframes twinkle { 50% { opacity: .65 } }
.bld.g5 .flag { display: block; }
.bld.g8 .flag.f2, .bld.g8 .aura { display: block; }
.bld .flag.f2::after { background: linear-gradient(#cfe0f0, #8fa9c2); }
.bld.g10 .flag::after { background: linear-gradient(#fff0b0, #f2b440); }
.bld .smoke { width: 0; height: 0; }
.bld.g7 .smoke { display: block; }
.bld .smoke i { position: absolute; left: -6px; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: rgba(190,180,170,.55); animation: smoke 2.6s ease-out infinite; }
.bld .smoke i:nth-child(2) { animation-delay: .87s; } .bld .smoke i:nth-child(3) { animation-delay: 1.74s; }
@keyframes smoke { 0% { transform: translate(0,0) scale(.4); opacity: 0 } 15% { opacity: .8 } 100% { transform: translate(-10px,-34px) scale(2); opacity: 0 } }
.bld .star { width: 9px; height: 9px; margin: -4px; background: #fff3b8; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: star 1.8s ease-in-out infinite; }
.bld .star.s2 { animation-delay: .9s; }
.bld.g10 .star { display: block; }
@keyframes star { 0%, 100% { transform: scale(.4); opacity: .3 } 50% { transform: scale(1.3) rotate(45deg); opacity: 1 } }
/* a building that waits for the person who knows the trade */
.bld .tag .wk { display: none; width: 16px; border-left: 2px solid var(--ink); background: #3a4350 radial-gradient(circle at 50% 36%, #c9d2dc 3px, transparent 3.5px); position: relative; text-decoration: none; }
.bld .tag .wk::after { content: ""; position: absolute; left: 3px; bottom: 2px; width: 8px; height: 5px; border-radius: 5px 5px 0 0; background: #c9d2dc; }
.bld.waitk .tag .wk { display: block; }

/* the gate and the fence */
.bld.wall .hit { border-radius: 8px; }
.bld.wall .tag { transform: translateX(-50%) rotate(1.5deg); }
.bld.wall .pips { position: absolute; left: -36px; top: 27px; width: 72px; display: flex; gap: 1px; pointer-events: none; }
.bld.wall .pips i { flex: 1; height: 5px; background: rgba(20,24,30,.8); border: 1px solid var(--ink); }
.bld.wall .pips i.on { background: var(--warm); }
.wd { position: absolute; pointer-events: none; display: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }

/* people */
.tok .q { background: var(--warm); color: var(--ink); border-color: var(--ink); animation: bob 1s ease-in-out infinite; }
.tok .dots { position: absolute; left: -24px; bottom: 32px; display: none; padding: 0 4px; border-radius: 8px; background: #3a4350; color: #c9d2dc; font: 700 11px/14px var(--sans); border: 1.5px solid var(--ink); font-style: normal; }
.tok.sour .dots { display: block; }
.tok.outside .face { filter: brightness(.55) saturate(.6); }
.tok.outside .body { background: #26221e; }
.tok.knock .face { filter: none; }
.tok.knock .q { display: block; }
#sheet.kn { background: linear-gradient(#2a2f3a, #171b23 70%); }
.knock { text-align: center; padding: 4px 4px 2px; }
.knock .kf { width: 128px; height: 128px; margin: 0 auto 8px; border: 3px solid var(--ink); border-radius: 12px; background: #1a1410 center/cover; box-shadow: 0 5px 0 rgba(0,0,0,.45); }
.knock .kn b { display: block; font: 700 22px var(--kai); color: #efe6d4; }
.knock .kn span { font-size: 12px; color: #9aa6b4; }
.knock q { display: block; margin: 10px 0; font: 18px/1.5 var(--kai); color: var(--warm-hi); quotes: "「" "」"; }
.knote { text-align: left; margin: 0 2px 10px; padding: 8px 10px 9px 16px; position: relative; color: #2b2117; border: 2px solid var(--ink); border-radius: 3px 3px 7px 3px; background: var(--paper); transform: rotate(-.6deg); }
.knote::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: rgba(194,57,42,.45); }
.knote b { font: 800 11px var(--sans); color: #8a2a1e; }
.knote p { margin: 2px 0 0; font: 15px/1.5 var(--kai); }
.knote.none { background: #cfc6b0; }
.knote.none b { color: #5a4a38; }
.knote.none p { color: #5a4a38; }
.kfact { text-align: left; font-size: 12px; line-height: 1.5; color: #b9c3cf; margin: 0 4px 6px; }
.kfact.warn { color: #ff8f6e; font-weight: 800; }
.knock .btns { display: flex; gap: 10px; margin-top: 10px; }
.knock .btns .go { flex: 1; }
.knock .btns .go:disabled { filter: grayscale(.8) brightness(.7); }
.who .p .warnk { display: block; margin-top: 4px; padding: 5px 7px; font-size: 11.5px; line-height: 1.45; color: #2b2117; background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; }
.who .p .warnk b { color: #8a2a1e; margin-left: 2px; }
.who .p .warnk.hot { background: #ffd9c9; }
.who .p .warnk.none { background: none; border: none; padding: 0; color: #8f9aa8; }
.who .p .evict { display: block; margin-top: 6px; height: 30px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 6px; background: #3a4350; color: #dfe6ee; font-size: 12px; font-weight: 800; box-shadow: 0 2px 0 var(--ink); }
.who .p .evict.sure { background: #a5422e; color: #fff4e0; }
.heal { position: absolute; font: 800 16px var(--sans); color: #8fe07a; text-shadow: 0 2px 0 var(--ink); pointer-events: none; white-space: nowrap; }

/* ---------- head-up additions ---------- */
#hud .row { gap: 4px; }
#lv { font-size: 13px; padding: 0 7px; }
.chip.wx { pointer-events: none !important; padding: 0 8px; font-size: 12px; font-weight: 800; color: #e7eef6; }
.chip.wx.fog { color: #c9d2dc; } .chip.wx.rain { color: #8fb4d8; } .chip.wx.herd { color: #ff8f6e; }
.hp { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 4px; padding: 0 7px; background: rgba(14,11,16,.85); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.hp .hpbar { flex: 1; min-width: 20px; height: 12px; border: 2px solid var(--ink); border-radius: 3px; background: #3a1c1a; overflow: hidden; }
.hp .hpbar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff8a6a, #c2392a); transition: width .5s; }
.hp b { font-size: 14px; font-weight: 800; color: #fff4e0; }
.hp small { font-size: 10px; color: #9aa6b4; font-weight: 700; }
.hp.low .hpbar i { animation: lowhp 1s ease-in-out infinite; }
@keyframes lowhp { 50% { filter: brightness(1.6) } }
#queue { bottom: 98px; }
#queue .bar { width: 48px; height: 12px; background: #3a4350; border-radius: 2px; overflow: hidden; }
#queue .bar i { display: block; height: 12px; background: var(--warm); }
#b-go.night { background: linear-gradient(#ff9f80, #d2493a); box-shadow: 0 4px 0 #6a1c12, 0 6px 12px rgba(0,0,0,.5); }
#b-go.night small { color: #3a0d08; }

/* ---------- the notebook, always in sight ---------- */
#book { position: absolute; left: 8px; top: 94px; z-index: 18; width: 178px; padding: 0; border: none; background: none; text-align: left; transform: rotate(-1.2deg); }
#book .bk-in { position: relative; padding: 4px 7px 6px 15px; color: #2b2117; border: 2px solid var(--ink); border-radius: 3px 3px 7px 3px;
  background: radial-gradient(circle at 85% 80%, rgba(120,80,40,.18), transparent 30%), repeating-linear-gradient(transparent 0 15px, rgba(70,100,150,.2) 15px 16px), var(--paper);
  box-shadow: 0 3px 0 var(--ink), 0 6px 14px rgba(0,0,0,.55); }
#book .bk-in::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: rgba(194,57,42,.45); }
#book .bk-in::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; background: linear-gradient(135deg, #c9b48a 50%, #141a24 50%); border-top: 1px solid rgba(0,0,0,.3); border-left: 1px solid rgba(0,0,0,.3); }
#book .h { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font: 700 13px var(--kai); color: #5a4430; white-space: nowrap; }
#book .h em { font-style: normal; font: 700 11px var(--sans); color: #8a2a1e; }
#book .h em b { font-size: 14px; }
#book .h em b.now { font-size: 12px; color: #c2392a; }
#book.urgent .h em { animation: blink2 1.2s ease-in-out infinite; }
@keyframes blink2 { 50% { opacity: .45 } }
#book .e { margin-top: 2px; font: 13px/1.25 var(--kai); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#book .e .d { font: 800 10px var(--sans); color: #fff4e0; background: #7a5c3a; border-radius: 3px; padding: 0 3px; margin-right: 3px; vertical-align: 1px; }
#book .e.today .d { background: #c2392a; }
#book .e .k { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; font: 700 10.5px/1.3 var(--sans); color: #6b5338; overflow: hidden; }
#book .f { margin-top: 3px; text-align: right; font: 800 10px var(--sans); color: #8a2a1e; }
#book .e .k.ok { color: #2e5b86; }

/* ---------- scenes ---------- */
#scene { position: absolute; inset: 0; z-index: 55; display: none; background: #07080b; }
body[data-scene="story"] #scene { display: block; }
#scene.noart { background: rgba(5,7,12,.74); }
#scene .art { position: absolute; left: 16px; right: 16px; top: 58px; aspect-ratio: 1 / 1; border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; background: #0d1119;
  box-shadow: 0 0 0 2px rgba(255,190,120,.15), 0 10px 30px rgba(0,0,0,.7); }
#scene.noart .art { display: none; }
#scene .pic { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .7s; animation: drift 16s ease-in-out infinite alternate; }
#scene .pic.on { opacity: 1; }
@keyframes drift { from { transform: scale(1.03) } to { transform: scale(1.1) translate(-1.5%, -1%) } }
#scene .box { position: absolute; left: 12px; right: 12px; bottom: 26px; min-height: 140px; padding: 12px 16px 28px; background: rgba(14,11,16,.94); border: 3px solid var(--ink); border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(255,190,120,.12), 0 10px 30px rgba(0,0,0,.7); }
#scene .who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#scene .who:empty { display: none; }
#scene .who .fc { width: 46px; height: 46px; display: block; }
#scene .who .fc.none { background: #12151b radial-gradient(circle at 50% 40%, #3a4350 9px, transparent 10px); }
#scene .who b { font: 700 20px var(--kai); color: var(--warm-hi); letter-spacing: 1px; }
#scene .txt { font-size: 17px; line-height: 1.6; color: #efe6d4; min-height: 54px; }
#scene:not(.noart) .box { top: 432px; bottom: auto; }
#scene .box.me .txt { font: 19px/1.6 var(--kai); color: #f3ead8; }
#scene .box.note { color: #2b2117; background: repeating-linear-gradient(transparent 0 29px, rgba(70,100,150,.22) 29px 30px), var(--paper); }
#scene .box.note .txt { font: 19px/1.55 var(--kai); color: #2b2117; }
#scene .box.note .who b { font: 700 12px var(--sans); color: #7a5c3a; letter-spacing: 2px; }
#scene .box.sys { background: #232c39; }
#scene .box.sys .txt { font-size: 15px; font-weight: 700; color: var(--warm-hi); text-align: center; padding-top: 14px; }
#scene .next { position: absolute; right: 14px; bottom: 7px; font-size: 11px; color: #8d97a4; animation: blink2 1.4s ease-in-out infinite; }
#scene .box.note .next { color: #7a5c3a; }
#scene .skip { position: absolute; right: 14px; top: 14px; height: 30px; padding: 0 14px; border-radius: 15px; border: 2px solid var(--ink); background: rgba(14,11,16,.85); color: #9aa6b4; font-size: 13px; font-weight: 700; z-index: 2; }

/* ---------- reports ---------- */
.paper .btns { display: flex; gap: 10px; margin-top: 12px; }
.paper .btns .go { flex: 1; margin-top: 0; font-size: 16px; }
.paper.gate { background: #1e2531; color: #efe6d4; box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 5px 0 var(--ink), inset 0 0 0 2px rgba(194,57,42,.35); }
.paper.gate h3 { color: #ff8f6e; }
.paper.gate .sub2 { color: #c9b48a; }
.paper.gate .rp { border-bottom-color: #4a5462; }
.paper.gate .rp > b { color: #9aa6b4; }
.paper.gate .rp .v em { color: #fff4e0; }
.paper.gate .rp.warn .v { color: #ff8f6e; }

/* ---------- sheets ---------- */
#sheet .sh-foot.two { display: flex; gap: 10px; }
#sheet .sh-foot.two .go { flex: 1; font-size: 16px; }
#sheet .back { flex: none; margin: -6px 16px 12px; background: none; border: none; color: var(--cold-hi); font-size: 13px; font-weight: 700; text-decoration: underline; }
#sheet .ttl .pipsx { margin: 4px 0 2px; }
#sheet .ttl .pipsx i { width: 15px; height: 7px; }
.lvl { color: #9aa6b4; font-size: 12px; }
.ln.warn span { color: #ff8f6e; }
.ln > b.red { background: #c2392a; color: #fff4e0; }
.hpbig { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.hpbig span { flex: 1; height: 14px; border: 2px solid var(--ink); border-radius: 4px; background: #3a1c1a; overflow: hidden; }
.hpbig i { display: block; height: 100%; background: linear-gradient(#ff8a6a, #c2392a); }
.hpbig b { font-size: 18px; font-weight: 800; color: #fff4e0; }
.hpbig small { font-size: 12px; color: #9aa6b4; }
.hpbig.low i { animation: lowhp 1s ease-in-out infinite; }
.who .p.wait { border: 2px dashed #4a5462; }
.who .p.later { opacity: .75; }
.who .p.focus { outline: 2px solid var(--warm); }
.who .p.mem { align-items: flex-start; }
.who .p .mood { color: #a9d98a; }
.who .p.m-ok .mood { color: var(--warm-hi); }
.who .p.m-bad .mood { color: #ff8f6e; }
.fc.dim { filter: grayscale(.8) brightness(.55); }
.hope { font: 700 13px var(--kai); color: var(--warm-hi); }
.ask { margin-top: 6px; padding: 7px; background: rgba(242,161,74,.1); border: 2px dashed var(--warm); border-radius: 7px; }
.ask q { display: block; font: 14px/1.45 var(--kai); color: #f3ead8; quotes: "「" "」"; }
.ask .rw { font-size: 11px; color: var(--warm-hi); margin: 3px 0 6px; }
.ask .gbtn { width: 100%; height: 42px; }
.ask.done { border-style: solid; border-color: #4a5462; background: none; color: #9aa6b4; font-size: 11px; }

/* trip planning */
.what.wxl b { color: var(--warm-hi); }
.what.wxl.herd b { color: #ff8f6e; }
.dists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 4px; }
.dist { position: relative; height: 90px; padding: 0; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: #2a3442; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 3px 0 var(--ink); }
.dist .dimg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .6; }
.dist b, .dist small, .dist .sup { position: relative; }
.dist b { font: 700 16px var(--kai); color: #fff4e0; text-shadow: 0 2px 0 var(--ink); padding: 0 6px; }
.dist small { font-size: 10px; font-weight: 700; color: #dfe8f1; padding: 0 6px 5px; text-shadow: 0 1px 2px #000; }
.dist .sup { display: block; height: 5px; margin: -2px 6px 6px; background: rgba(0,0,0,.55); border-radius: 3px; overflow: hidden; }
.dist .sup i { display: block; height: 100%; background: var(--warm); }
.dist.sel { border-color: var(--warm-hi); box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--warm); }
.dist.shut { filter: grayscale(.9) brightness(.55); }
.mk { position: absolute; top: 4px; right: 4px; font-style: normal; font-size: 10px; font-weight: 800; background: var(--paper); color: #8a2a1e; border: 1.5px solid var(--ink); border-radius: 3px; padding: 0 3px; transform: rotate(4deg); }
.mis .mk { position: static; display: inline-block; margin-right: 2px; }
.dinfo p { margin: 8px 0 0; font-size: 12px; color: #b9c3cf; line-height: 1.45; }
.dinfo .kinds em { font-style: normal; color: #ff8f6e; margin-left: 6px; font-weight: 700; }
.miss { display: flex; flex-direction: column; gap: 6px; }
.mis { text-align: left; border: 2px solid var(--ink); border-radius: 8px; background: #2a3442; padding: 7px 9px; box-shadow: 0 3px 0 var(--ink); }
.mis b { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 800; color: #efe6d4; }
.mis .left { margin-left: auto; font-size: 11px; color: #ff8f6e; }
.mis span { display: block; font-size: 11px; color: #9aa6b4; line-height: 1.4; margin-top: 2px; }
.mis.sel { border-color: var(--warm); background: #3a3020; }
.mis .gain { color: var(--warm-hi); }
.kit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.chipb { height: 32px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 16px; background: #2a3442; color: #efe6d4; font-size: 13px; font-weight: 800; box-shadow: 0 2px 0 var(--ink); }
.chipb.on { background: var(--warm); color: #241a12; }
.kn { width: 100%; font-size: 11px; color: #9aa6b4; line-height: 1.4; }
.hprow { display: flex; align-items: center; gap: 10px; }
.hprow .hpbig { flex: 1; margin: 0; }

/* the notebook sheet: a worn exercise book, not a list */
#sheet.nb { background: linear-gradient(#4a3424, #2c1e14 60%); }
#sheet.nb h2 { color: var(--paper); }
#sheet.nb .x { background: #3b2a1c; }
.page { position: relative; margin: 2px 0 6px; padding: 10px 10px 14px 18px; color: #2b2117; border: 2px solid var(--ink); border-radius: 2px 6px 6px 2px; transform: rotate(-.3deg);
  background: radial-gradient(circle at 80% 12%, rgba(120,80,40,.16), transparent 22%), radial-gradient(circle at 12% 70%, rgba(120,80,40,.12), transparent 30%),
    repeating-linear-gradient(transparent 0 23px, rgba(70,100,150,.2) 23px 24px), var(--paper);
  box-shadow: 4px 4px 0 #1a120c, 0 8px 20px rgba(0,0,0,.5); }
.page::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 1px; background: rgba(194,57,42,.45); }
.page .cd { text-align: right; font: 15px var(--kai); color: #8a2a1e; padding-bottom: 4px; border-bottom: 1px solid rgba(138,42,30,.35); }
.page .cd b { font-size: 22px; }
.page .cd b.now { font-size: 18px; color: #c2392a; }
.page .sec { margin: 12px 0 2px; font: 800 12px var(--sans); color: #fff4e0; background: #7a5c3a; display: inline-block; padding: 1px 8px; border-radius: 3px; }
.page .sec + .ent, .page .sec + .was { border-top: none; }
.ent, .was { position: relative; padding: 9px 0 10px 4px; border-bottom: 1px dashed rgba(90,68,48,.35); }
.eh { display: flex; align-items: baseline; gap: 6px; }
.eh .dn { flex: none; font: 800 10px var(--sans); color: #fff4e0; background: #7a5c3a; border-radius: 3px; padding: 1px 4px; }
.eh b { flex: 1; min-width: 0; font: 700 17px var(--kai); color: #2b2117; }
.eh em { flex: none; font: 800 11px var(--sans); font-style: normal; color: #7a5c3a; }
.eh em.hot { color: #c2392a; }
.ent p { margin: 3px 0 0; font: 14px/1.5 var(--kai); color: #5a4a38; }
.ent .task { margin-top: 6px; display: flex; gap: 5px; align-items: flex-start; font: 800 13px/1.4 var(--sans); color: #2b2117; }
.ent .task i { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid #5a4430; border-radius: 2px; }
.gl { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; font: 12px/1.45 var(--sans); color: #3a2a1c; }
.gl b { flex: none; min-width: 34px; text-align: center; font-size: 10px; font-weight: 800; line-height: 16px; border-radius: 3px; color: #fff4e0; background: #7a5c3a; padding: 0 3px; }
.gl.g b { background: #2e5b86; }
.gl.l b { background: #a5422e; }
.gl.l span { color: #6b4a3a; }
.ent.can { background: rgba(242,161,74,.13); margin: 0 -6px; padding-left: 10px; padding-right: 6px; border-radius: 4px; }
.ent .wait { margin-top: 6px; font: 700 11px var(--sans); color: #8a7458; }
.ent .goto { margin-top: 8px; height: 34px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 6px; background: var(--warm); color: #241a12; font-size: 13px; font-weight: 800; box-shadow: 0 2px 0 var(--ink); }
.was { padding: 6px 0 7px 4px; }
.was .eh b { font-size: 14px; color: #6b5338; }
.was .stamp { font: 800 12px var(--kai); color: rgba(165,42,30,.9); border: 1.5px solid rgba(165,42,30,.9); border-radius: 4px; padding: 0 4px; transform: rotate(-3deg); }
.was.done .stamp { color: rgba(46,91,134,.9); border-color: rgba(46,91,134,.9); }
.was.past .stamp { color: #7a5c3a; border-color: #7a5c3a; }
.was .gl { font-size: 11px; }
.page .chg { margin-top: 6px; font: 15px var(--kai); color: #2e5b86; }
.page .chg b { font-size: 22px; }
.fate { margin-top: 4px; font: 12px/1.5 var(--sans); }
.fate > div { display: flex; gap: 6px; align-items: flex-start; }
.fate b { flex: none; min-width: 40px; text-align: center; font-size: 10px; font-weight: 800; line-height: 16px; margin-top: 1px; border-radius: 3px; color: #fff4e0; background: #8a7458; }
.fate .n b { background: #2e5b86; }
.fate .w s, .fate .w span { color: #8a7458; }
.fate .w s { text-decoration-color: rgba(165,42,30,.8); text-decoration-thickness: 1.5px; }
.fate .n span { color: #2b2117; font-weight: 700; }
.rp.fated .v .w { color: #8a7458; font-size: 12px; }
.rp.fated .v .w s { text-decoration-color: rgba(165,42,30,.8); }
.rp.fated > b { color: #2e5b86; }
#book .f i { float: left; font-style: normal; color: #2e5b86; }
.who .p .was { display: block; font-size: 11px; color: #8f9aa8; }
.who .p .was s { text-decoration-color: #ff8f6e; }
.logl { margin-top: 4px; font: 12px/1.6 var(--sans); color: #5a4a38; }
.logl b { display: inline-block; min-width: 52px; font-weight: 800; color: #7a5c3a; }
.page .more { margin-top: 10px; font: 13px var(--kai); color: #7a5c3a; text-align: center; }

/* ---------- the guide: one line, one pointer ---------- */
#guide { position: absolute; z-index: 21; max-width: 250px; padding: 6px 11px; pointer-events: none; background: var(--paper); color: #2a2018; border: 3px solid var(--ink); border-radius: 7px;
  box-shadow: 0 4px 0 var(--ink), 0 6px 14px rgba(0,0,0,.5); font-size: 13px; font-weight: 800; line-height: 1.4; animation: guidebob 1.6s ease-in-out infinite; }
#guide::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -12px; margin-left: -8px; border: 8px solid transparent; border-top: 10px solid var(--ink); border-bottom: none; }
#guide.below::after { bottom: auto; top: -12px; border-top: none; border-bottom: 10px solid var(--ink); }
@keyframes guidebob { 50% { transform: translateY(-4px) } }
#guide.below { animation-name: guidebob2; }
@keyframes guidebob2 { 50% { transform: translateY(4px) } }
#dock .sq.pulse { animation: sqpulse 1.4s ease-in-out infinite; }
@keyframes sqpulse { 50% { box-shadow: 0 4px 0 #4b5f74, 0 0 0 4px rgba(255,208,138,.6), 0 0 22px 6px rgba(242,161,74,.7); } }
#book.pulse .bk-in { animation: bookpulse 1.4s ease-in-out infinite; }
@keyframes bookpulse { 50% { box-shadow: 0 3px 0 var(--ink), 0 0 0 3px rgba(255,208,138,.8), 0 0 22px 6px rgba(242,161,74,.7); } }
body.guided #book.urgent .h em { animation: none; }
body.guided .tok .q { animation: none; }

/* a building that just became available */
.unlock { position: absolute; left: 50%; top: 186px; z-index: 44; width: 300px; padding: 10px 14px 12px; text-align: center; pointer-events: none; transform: translateX(-50%);
  background: var(--paper); color: #2b2117; border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 5px 0 var(--ink), 0 10px 30px rgba(0,0,0,.6); }
.unlock small { display: block; font-size: 11px; font-weight: 800; color: #8a2a1e; letter-spacing: 3px; }
.unlock b { display: block; font: 700 26px var(--kai); letter-spacing: 4px; margin-top: 2px; }
.unlock span { display: block; font-size: 13px; line-height: 1.5; color: #5a4430; margin-top: 4px; }

/* people stand where they belong and only breathe */
.tok .face, .tok .hero { animation: idle 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes idle { 50% { transform: translateY(-1.5px) } }
.tok.pop .face, .tok.pop .hero { animation: none; }

/* districts that are not open yet stay quiet */
.dist.shut { filter: none; background: rgba(0,0,0,.25); border-style: dashed; border-color: #4a5462; box-shadow: none; }
.dist.shut b { color: #6b7684; text-shadow: none; font-size: 14px; }
.dist.shut small { color: #6b7684; text-shadow: none; }

/* buildings do not make their own stacking layer: sprites sort by depth with everything else, labels float above all */
.bld > * { z-index: var(--z, 0); }
.bld .bags { z-index: calc(var(--z, 0) + 1); }
.bld .hit { z-index: calc(var(--z, 0) + 2); }
.bld .tag, .bld .prog, .bld .pips { z-index: calc(var(--z, 0) + 3000); }
.bld .flag { transform: scale(.82); transform-origin: 0 100%; }

/* ---------- how deep: five layers in a row ---------- */
:root { --ok: #8fd07a; --hard: #f2a14a; --grim: #ff6b55; }
.dist .dp { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff4e0; background: rgba(14,11,16,.85); border: 1.5px solid var(--ink); border-radius: 3px; padding: 0 3px; }
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: relative; }
.rung { position: relative; min-width: 0; height: 76px; padding: 5px 3px 4px; border: 2px solid var(--ink); border-radius: 7px; background: #2a3442; box-shadow: 0 3px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; text-align: center; overflow: hidden; }
.rung b { font-size: 10px; font-weight: 800; color: #9aa6b4; line-height: 1.2; }
.rung i { font: 700 13px/1.25 var(--kai); font-style: normal; color: #efe6d4; white-space: nowrap; }
.rung .dz { margin-top: 2px; font-size: 11px; font-weight: 800; padding: 0 4px; border-radius: 3px; border: 1.5px solid var(--ink); color: #1a120c; line-height: 15px; }
.rung.ok .dz { background: var(--ok); } .rung.hard .dz { background: var(--hard); } .rung.grim .dz { background: var(--grim); }
.rung small { font-size: 9.5px; font-weight: 700; color: #b9c3cf; white-space: nowrap; margin-top: 1px; }
.rung.sel { border-color: var(--warm-hi); background: #3a3020; box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--warm); }
.rung.grim.sel { border-color: var(--grim); box-shadow: 0 3px 0 var(--ink), 0 0 0 2px var(--grim); background: #3a2220; }
.rung.done::after { content: "✓"; position: absolute; left: 4px; top: 2px; font-size: 10px; font-weight: 800; color: var(--ok); }
.rung.lock { background: rgba(0,0,0,.28); border-style: dashed; border-color: #4a5462; box-shadow: none; }
.rung.lock b, .rung.lock i { color: #5f6a78; }
.rung .lk { margin-top: 4px; font-size: 9.5px; font-weight: 700; color: #7d8794; line-height: 1.25; }
.rung .lk::before { content: ""; display: block; width: 10px; height: 8px; margin: 0 auto 2px; border: 1.5px solid #7d8794; border-radius: 2px; box-shadow: 0 -4px 0 -1.5px #12151b, 0 -5px 0 -1.5px #7d8794; }
.ladder.story .rung:not(.sel):not(.lock) { opacity: .45; }
.sk { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: #e8d9c0; }
.rung .bs { position: absolute; right: 2px; top: 2px; line-height: 0; }
.rung .bs .sk { color: #d9c9ae; }
.rung .bs.prize .sk { color: var(--warm-hi); filter: drop-shadow(0 0 3px rgba(242,161,74,.9)); }
.lyr { margin-top: 8px; padding: 7px 9px; border-radius: 8px; background: rgba(0,0,0,.25); font-size: 12px; line-height: 1.5; color: #b9c3cf; }
.lyr p { margin: 0; }
.lyr p + p { margin-top: 3px; }
.lyr b { color: #efe6d4; font-size: 13px; margin-right: 6px; }
.lyr .dz { font-size: 11px; font-weight: 800; padding: 0 5px; border-radius: 3px; border: 1.5px solid var(--ink); color: #1a120c; }
.lyr .dz.ok { background: var(--ok); } .lyr .dz.hard { background: var(--hard); } .lyr .dz.grim { background: var(--grim); }
.lyr em { font-style: normal; color: #ff8f6e; font-weight: 800; }
.lyr .nw { color: #7d8794; font-size: 10px; }
.lyr .bossl { color: var(--warm-hi); font-weight: 700; }
.lyr .bossl .sk { margin-right: 4px; color: var(--warm-hi); }
.lyr .bossl.dim { color: #9aa6b4; font-weight: 600; }
.lyr .bossl.dim .sk { color: #9aa6b4; }
.lyr .rule { color: #7d8794; font-size: 11px; }
/* leaving for a layer that is too much: unmistakable, not a lock */
.grimline { margin: -2px 0 8px; padding: 4px 8px; border-radius: 6px; background: rgba(194,57,42,.22); border: 2px solid var(--grim); color: #ffb3a4; font-size: 12px; font-weight: 800; text-align: center; }
.go.grim { background: repeating-linear-gradient(-45deg, #e0634a 0 12px, #c2392a 12px 24px); color: #fff4e0; box-shadow: 0 4px 0 #6a1c12, 0 6px 12px rgba(0,0,0,.5); }
.go.grim small { color: #ffe3d8; }
/* the payoff lines on the way back */
.paper .rp.hi { margin: 4px -6px; padding: 7px 6px; border: 2px solid #b5541c; border-radius: 6px; background: rgba(242,161,74,.22); }
.paper .rp.hi > b { color: #8a2a1e; }
.paper .rp.hi .v em { color: #8a2a1e; }

/* ---------- the book ---------- */
.bookbtn { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; padding: 8px 12px; margin-bottom: 4px; text-align: left;
  background: var(--paper); color: #2a2018; border: 3px solid var(--ink); border-radius: 8px; box-shadow: 0 4px 0 #6c5638; }
.bookbtn b { font: 700 18px var(--kai); letter-spacing: 2px; }
.bookbtn span { font-size: 15px; font-weight: 800; color: #8a2a1e; }
.bookbtn small { grid-column: 1 / -1; font-size: 11px; color: #6b5338; font-weight: 700; }
.kn-sub { font-size: 11px; color: #9aa6b4; margin: -2px 0 6px; }
.kn-list { display: flex; flex-direction: column; gap: 6px; }
.kn-e { padding: 7px 9px; border-radius: 8px; background: rgba(0,0,0,.25); border: 2px solid transparent; }
.kn-e .h { display: flex; align-items: baseline; gap: 6px; }
.kn-e b { font: 700 16px var(--kai); color: var(--warm-hi); }
.kn-e em { font-style: normal; font-size: 10px; font-weight: 800; color: #241a12; background: var(--cold-hi); border: 1.5px solid var(--ink); border-radius: 3px; padding: 0 4px; }
.kn-e p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: #efe6d4; }
.kn-e p.mo { font-size: 11px; color: #9aa6b4; }
.kn-e.lock { border: 2px dashed #3a4350; background: none; }
.kn-e.lock b { color: #5f6a78; }
.kn-e .how { margin-left: auto; font-size: 11px; font-weight: 800; color: #9aa6b4; white-space: nowrap; }
.kn-e .how::before { content: "要："; color: #6b7684; font-weight: 700; }
.unlock.learn { border-color: var(--ink); background: linear-gradient(#cfe0f0, #b5cbe0); }
.unlock.learn small { color: #2e5b86; }
.unlock i { display: block; margin-top: 4px; font-style: normal; font-size: 11px; font-weight: 800; color: #2e5b86; }
/* a layer that teaches something when reached */
.rung .nk { margin-top: 2px; font-size: 9px; font-weight: 800; color: #1a120c; background: var(--cold-hi); border-radius: 3px; padding: 0 3px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rung.teach .lk::before { display: none; }
.lyr .teachl { color: var(--cold-hi); font-weight: 700; }
#sheet.book .back { margin: 6px 16px 14px; }

/* who comes along, ground you hold, the stand-in advertisement */
.chipb.pal { display: inline-flex; align-items: center; gap: 6px; height: auto; min-height: 40px; padding: 4px 10px 4px 4px; text-align: left; flex-wrap: wrap; max-width: 100%; }
.chipb.pal .pf { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #1a1410 center/cover; }
.chipb.pal small { flex-basis: 100%; margin-left: 36px; margin-top: -4px; font-size: 10.5px; font-weight: 700; opacity: .8; }
.chipb.pal:disabled { opacity: .5; }
.chipb.adb { height: auto; padding: 3px 10px; margin-left: 4px; vertical-align: middle; border-color: #7a5c3a; }
.chipb.adb small { display: block; font-size: 10px; font-weight: 700; opacity: .75; }
.chipb.adb:disabled { opacity: .5; }
.postb { border: 2px dashed #56627a; border-radius: 8px; padding: 8px 10px; margin: 0 0 4px; }
.postb p { margin: 0 0 6px; font-size: 12px; line-height: 1.5; color: #b9c3cf; }
.postb p b { color: var(--warm-hi); }
.postb .hot { color: #ff8f6e; font-weight: 800; }
.postb.held { border-style: solid; border-color: var(--warm); background: rgba(242,161,74,.08); }
.postb.dim p { margin: 0; color: #7f8a98; }
.mk.hot { background: #c2392a !important; color: #fff4e0 !important; }
.mk.flag { background: var(--warm) !important; color: #241a12 !important; }
#adcard { position: absolute; inset: 0; z-index: 9000; background: rgba(6,8,12,.82); display: flex; align-items: center; justify-content: center; }
#adcard .adin { width: 260px; padding: 18px 16px; text-align: center; border: 3px solid var(--ink); border-radius: 10px; background: #232a35; color: #efe6d4; box-shadow: 0 8px 0 rgba(0,0,0,.5); }
#adcard small { display: block; font-size: 11px; color: #9aa6b4; }
#adcard b { display: block; margin-top: 10px; font-size: 20px; }
#adcard span { display: block; font-size: 13px; color: #b9c3cf; }
#adcard i { display: block; margin: 12px auto 8px; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--ink); background: var(--warm); color: #241a12; font: 900 26px/50px var(--sans); font-style: normal; }
#adcard em { font-style: normal; font-size: 11px; color: #9aa6b4; }
