/* Shell v4: views, tabs, map, sheet, notebook. Black and white, one blue accent, FamPay yellow-orange only in the 3D world. */
:root{ --tabs-h:64px; --fam:#FBAF03; }
.device{position:relative}
.view{position:absolute;inset:0;display:none;flex-direction:column;overflow:hidden;background:#fff}
body[data-view="story"] .view-story,body[data-view="boot"] .view-story{display:flex}
body[data-view="map"] .view-map{display:flex}
body[data-view="market"] .view-market{display:flex}
body[data-view="notebook"] .view-notebook{display:flex}
.view-story .stage{flex:1;position:relative;overflow:hidden}
.view-market,.view-notebook{overflow-y:auto;padding-bottom:calc(var(--tabs-h) + 16px)}

/* tabs */
.tabs{position:absolute;left:0;right:0;bottom:0;height:calc(var(--tabs-h) + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);display:flex;background:#fff;border-top:2.5px solid var(--ink);z-index:30}
body[data-view="story"] .tabs,body[data-view="boot"] .tabs{display:none}
.tabs a{flex:1;display:grid;place-items:center;font-family:var(--display);font-weight:700;font-size:21px;color:var(--ink-soft);text-decoration:none;min-height:44px}
.tabs a.on{color:var(--ink);text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:6px}

/* hud back */
.hud-back{width:36px;height:36px;border:2px solid var(--ink);border-radius:50%;background:#fff;font-size:22px;line-height:1;display:grid;place-items:center;margin-right:2px}

/* map */
.view-map{overflow-y:auto;padding-bottom:calc(var(--tabs-h) + 16px)}
.map-top{display:flex;justify-content:space-between;align-items:flex-start;padding:16px 20px 8px;position:sticky;top:0;z-index:5;background:linear-gradient(#fff 70%,rgba(255,255,255,0))}
.map-title{font-family:var(--display);font-weight:700;font-size:34px;line-height:1}
.icon-btn{width:44px;height:44px;border:2.5px solid var(--ink);border-radius:50%;background:#fff;font-size:20px;display:grid;place-items:center;flex:none}
.icon-btn.off{opacity:.45;text-decoration:line-through}
.world{position:relative;height:0;flex:none}
body.has-world .world{height:min(62dvh,560px);border-top:2.5px solid var(--ink);border-bottom:2.5px solid var(--ink);touch-action:none}
.map-list{padding:16px 20px 0;display:flex;flex-direction:column;gap:18px}
.next-card{border:2.5px solid var(--ink);border-radius:22px 18px 24px 14px / 18px 24px 16px 22px;padding:16px;display:flex;flex-direction:column;gap:8px;background:#fff;box-shadow:0 5px 0 var(--ink)}
.next-title{font-family:var(--display);font-weight:700;font-size:30px;line-height:1}
.next-card p{margin:0;font-size:15px;line-height:1.35}
.district{display:flex;flex-direction:column;gap:8px}
.district-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;border-bottom:2px solid var(--ink);padding-bottom:6px}
.district-head b{font-family:var(--display);font-size:24px;font-weight:700}
.district-head span{font-size:13px;color:var(--ink-soft);text-align:right}
.district.locked .district-head{border-bottom-style:dashed;color:var(--ink-soft)}
.ch-row{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:10px;text-align:left;border:2px solid var(--ink);border-radius:16px;background:#fff;padding:10px 12px;min-height:56px;width:100%}
.ch-row .ch-num{font-family:var(--display);font-size:22px;font-weight:700}
.ch-row .ch-text{display:flex;flex-direction:column;min-width:0}
.ch-row .ch-text b{font-size:16px;font-weight:700}
.ch-row .ch-text span{font-size:13px;color:var(--ink-soft);line-height:1.3}
.ch-row .ch-state{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.ch-row.done{background:var(--paper-2)}
.ch-row.done .ch-state{color:var(--accent)}
.ch-row.next{box-shadow:0 4px 0 var(--ink)}
.ch-row.next .ch-state{background:var(--ink);color:#fff;border-radius:999px;padding:4px 10px}
.ch-row.locked{border-style:dashed;color:var(--ink-soft);opacity:.75}

/* district sheet (opened from the 3D world) */
.sheet{position:absolute;left:0;right:0;bottom:var(--tabs-h);z-index:25;background:#fff;border-top:2.5px solid var(--ink);border-radius:26px 26px 0 0;padding:10px 18px 18px;display:flex;flex-direction:column;gap:8px;max-height:62%;overflow-y:auto;box-shadow:0 -6px 0 rgba(17,17,17,.08);animation:sheetUp .32s cubic-bezier(.2,.8,.2,1)}
@keyframes sheetUp{from{transform:translateY(100%)}}
.sheet-grip{width:44px;height:5px;border-radius:5px;background:var(--ink);opacity:.25;align-self:center}
.sheet-title{font-family:var(--display);font-weight:700;font-size:30px;line-height:1}
.sheet-x{position:absolute;right:14px;top:14px}

/* unlock card at chapter end */
.end-title{font-size:48px}
.unlock-card{border:2.5px solid var(--ink);border-radius:20px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;background:#fff;box-shadow:0 6px 0 var(--ink);animation:sceneIn .5s .2s both}
.unlock-row{display:flex;gap:10px;align-items:center;font-weight:600;font-size:16px}
.unlock-row .dot{width:12px;height:12px;border-radius:50%;background:var(--accent);flex:none}

/* notebook + market shells */
.nb-head{padding:18px 20px 8px}
.nb-title{font-size:40px}
.view-notebook .stickers{padding:0 20px}
.view-notebook .btn{margin:20px}
.market-locked{padding:40px 24px;display:flex;flex-direction:column;gap:10px}
.av-letter{font-family:var(--display);font-weight:700;font-size:22px}
