/* Island paper: the interface in the language of the toy sheets — warm parchment panels, earth-brown type, mint game
   buttons with a pressed-down 3D edge, pill shapes, dark-teal title ribbons like the sheets' "G-01" badges, and toy
   photos (icons.js) where other games put emoji. Loaded after style.css and overrides its freeway-sign look. */
:root {
  --ui-bg: #FFF9EE; --ui-paper: #FBF3E4; --ui-paper2: #F3E6CF; --ui-paper3: #EADAB9; --ui-line: #E6D3B3;
  --ui-text: #794F27; --ui-text2: #725D42; --ui-muted: #9F927D;
  --ui-teal: #19C8B9; --ui-teal-hi: #3DD4C6; --ui-teal-lo: #11A89B; --ui-teal-bg: #E6F9F6;
  --ui-ribbon: #1E6E64; --ui-ribbon2: #155850; --ui-yellow: #F5C31C; --ui-focus: #FFCC00; --ui-red: #E05A5A; --ui-green: #6FBA2C;
  --ui-coin: #F7CD67; --ui-btn3d: #BDAEA0; --ui-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ui-shadow: 0 8px 24px rgba(61, 52, 40, 0.14); --ui-shadow-sm: 0 2px 4px rgba(61, 52, 40, 0.06);
  --font: Nunito, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
html, body { font-family: var(--font); font-weight: 600; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }
.ic { width: 1.5em; height: 1.5em; }

/* ---------- HUD ---------- */
#loc { background: var(--ui-paper); color: var(--ui-text); border: 0; border-radius: 22px; padding: 8px 18px 7px 16px; box-shadow: var(--ui-shadow); }
#loc-name { font-weight: 900; font-size: 20px; color: var(--ui-text); }
#clock { color: var(--ui-muted); font-weight: 700; font-size: 13px; opacity: 1; }
#goal { background: var(--ui-paper) !important; color: var(--ui-text) !important; border: 0 !important; border-radius: 50px !important; box-shadow: var(--ui-shadow-sm) !important; font-weight: 800 !important; }
#money { background: var(--ui-coin); color: var(--ui-text); border: 0; border-radius: 50px; padding: 6px 16px 6px 8px; box-shadow: 0 4px 0 0 #D8A93F, var(--ui-shadow-sm); display: flex; align-items: center; gap: 4px; font-size: 19px; }
#money .ic { width: 30px; height: 30px; }
#money.neg { background: #F8A6B2; box-shadow: 0 4px 0 0 #D97B8A; }
#topright button { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--ui-paper); box-shadow: 0 4px 0 0 var(--ui-btn3d); padding: 0; display: grid; place-items: center; transition: transform .15s var(--ui-ease), box-shadow .15s var(--ui-ease); }
#topright button .ic { width: 38px; height: 38px; margin: 0; }
#topright button:hover { background: var(--ui-bg); transform: translateY(-1px); box-shadow: 0 5px 0 0 var(--ui-btn3d); }
#topright button:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--ui-btn3d); }
#activity { background: var(--ui-paper); color: var(--ui-text); border: 0; border-radius: 50px; padding: 8px 10px 8px 22px; box-shadow: var(--ui-shadow); }
.act-text strong { color: var(--ui-text); font-weight: 800; }
.act-text small { color: var(--ui-muted); opacity: 1; }
.act-text em { color: #B9861A; }
#activity button { background: var(--ui-teal); color: #fff; border-radius: 50px; padding: 7px 16px; box-shadow: 0 4px 0 0 var(--ui-teal-lo); font-weight: 800; }
#activity button:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--ui-teal-lo); }
.bar { background: var(--ui-paper2); height: 9px; border-radius: 50px; }
.bar s { background: var(--ui-teal); border-radius: 50px; }
.bar.low s { background: var(--ui-yellow); } .bar.crit s { background: var(--ui-red); } .bar.skill s { background: #889DF0; }
.toast { background: var(--ui-paper); color: var(--ui-text); border: 0; border-radius: 50px; padding: 9px 18px; box-shadow: var(--ui-shadow); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.toast.ok { background: #E9F7DD; color: #3D6B17; } .toast.err { background: #FDE6E3; color: #A33A33; }
#prompt { background: var(--ui-paper); color: var(--ui-text); border-radius: 50px; padding: 6px 18px 6px 6px; box-shadow: 0 5px 0 0 var(--ui-btn3d), var(--ui-shadow); font-weight: 800; }
#prompt kbd { background: var(--ui-teal); color: #fff; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; font-family: var(--font); }
#needs { background: var(--ui-paper); border-radius: 22px; padding: 10px 14px; box-shadow: var(--ui-shadow); width: 190px; gap: 5px; }
.need i { width: 26px; height: 26px; font-size: 16px; display: grid; place-items: center; }
.need i .ic { width: 26px; height: 26px; margin: 0; }
.need b { background: var(--ui-paper2); height: 10px; border-radius: 50px; }
.need s { background: var(--ui-teal); border-radius: 50px; }
.need.low s { background: var(--ui-yellow); } .need.crit s { background: var(--ui-red); }
#chat { background: rgba(251, 243, 228, 0.94); border-radius: 22px; box-shadow: var(--ui-shadow); color: var(--ui-text2); }
.chat-tabs button { color: var(--ui-muted); border-radius: 50px; padding: 4px 12px; }
.chat-tabs button.on { background: var(--ui-paper2); color: var(--ui-text); }
.msg b { color: var(--ui-ribbon); }
.msg i { background: #889DF0; color: #fff; border-radius: 50px; }
.msg.news span { color: #B9861A; }
#chat-input { background: var(--ui-bg); color: var(--ui-text); border-top: 2px solid var(--ui-line); font-weight: 600; }
#chat-input::placeholder { color: var(--ui-muted); }
#chat-toggle { background: var(--ui-paper) !important; border: 0 !important; border-radius: 50% !important; box-shadow: 0 4px 0 0 var(--ui-btn3d) !important; }
#joy { background: rgba(251, 243, 228, .5); border-color: rgba(255, 255, 255, .8); }
#joy i { background: var(--ui-paper); box-shadow: 0 3px 0 0 var(--ui-btn3d); }
#wp-arrow { color: var(--ui-teal); }

/* ---------- panels ---------- */
#modal { background: rgba(61, 45, 28, 0.28); }
.sign { background: var(--ui-paper); color: var(--ui-text2); border: 0; border-radius: 34px; box-shadow: var(--ui-shadow), 0 0 0 6px rgba(255, 249, 238, .55); padding-top: 8px; animation: ui-pop .25s var(--ui-ease); }
@keyframes ui-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.sign-head { padding: 0 22px 8px; align-items: center; }
.sign-head > div { min-width: 0; }
/* swallowtail ribbon title, tilted a touch like a paper banner */
.sign-head h2 { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin: -26px 0 0 -6px; padding: 9px 34px 10px 22px; font-size: 22px; font-weight: 900; color: #FFF6E3; background: var(--ui-ribbon);
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 12px 50%); transform: perspective(800px) rotateY(3deg); filter: drop-shadow(0 4px 0 var(--ui-ribbon2)); max-width: 100%; }
.sign-head h2 .ic { width: 32px; height: 32px; margin: -6px 0; }
.sign-head p { color: var(--ui-muted); font-weight: 700; opacity: 1; margin-top: 8px; }
.sign .exit-tab, .phone .exit-tab { position: absolute; top: -14px; right: -10px; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 0; background: var(--ui-paper); color: transparent; font-size: 0; box-shadow: 0 4px 0 0 var(--ui-btn3d), var(--ui-shadow-sm); display: grid; place-items: center; z-index: 2; }
.sign .exit-tab .ic, .phone .exit-tab .ic { width: 38px; height: 38px; margin: 0; }
.sign .exit-tab:hover, .phone .exit-tab:hover { background: var(--ui-bg); transform: translateY(-1px); }
.sign .exit-tab:active, .phone .exit-tab:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--ui-btn3d); }
.sign-body { padding: 4px 22px 22px; scrollbar-color: var(--ui-paper3) transparent; }
.sign h3, .app h3 { color: var(--ui-text); border: 0; font-weight: 900; font-size: 16px; display: flex; align-items: center; gap: 4px; margin: 18px 0 8px; padding: 0; }
.sign h3::after, .app h3::after { content: ""; flex: 1; height: 3px; border-radius: 3px; margin-left: 8px; background: repeating-linear-gradient(90deg, var(--ui-line) 0 8px, transparent 8px 14px); }
.lead, .note { color: var(--ui-text2); opacity: 1; font-weight: 600; }
.note { color: var(--ui-muted); }
.row { border: 0; background: var(--ui-bg); border-radius: 20px; padding: 10px 12px; margin: 6px 0; }
.row.mine { background: var(--ui-teal-bg); }
.row-main > span { color: var(--ui-text); font-weight: 800; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.row-main small { color: var(--ui-muted); opacity: 1; font-weight: 600; }
.price { color: var(--ui-text); background: var(--ui-coin); border-radius: 50px; padding: 2px 10px 2px 4px; display: inline-flex; align-items: center; gap: 2px; font-weight: 900; font-size: 14px; }
.price .ic { width: 22px; height: 22px; margin: 0; }
.price.free { background: #E1F3CF; color: #3D6B17; padding: 2px 10px; }
.sign button, .app button, .phone button:not(.exit-tab):not(.back) { background: var(--ui-teal); color: #fff; border: 0; border-radius: 50px; padding: 7px 16px; font-weight: 800; font-size: 14px; box-shadow: 0 4px 0 0 var(--ui-teal-lo); transition: transform .15s var(--ui-ease), box-shadow .15s var(--ui-ease), background .15s; }
.sign button:hover, .app button:hover { background: var(--ui-teal-hi); transform: translateY(-1px); box-shadow: 0 5px 0 0 var(--ui-teal-lo); }
.sign button:active, .app button:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--ui-teal-lo); }
.sign button:disabled, .app button:disabled { background: var(--ui-paper3); color: var(--ui-muted); box-shadow: none; transform: none; cursor: default; }
.sign button.ghost, .app button.ghost { background: var(--ui-bg); color: var(--ui-text); box-shadow: 0 0 0 2px var(--ui-line), var(--ui-shadow-sm); }
.sign button.ghost:hover, .app button.ghost:hover { background: #fff; box-shadow: 0 0 0 2px var(--ui-paper3), var(--ui-shadow-sm); }
.sign button.armed, .app button.armed { background: var(--ui-red); box-shadow: 0 4px 0 0 #C94444; color: #fff; }
.sign button.wide, .app button.wide { padding: 12px; margin: 12px 0 0; font-size: 15px; }
.sign button.chip, .app button.chip { background: var(--ui-bg); color: var(--ui-text2); box-shadow: 0 0 0 2px var(--ui-line); padding: 5px 13px; font-size: 13px; }
.sign button.chip.on, .app button.chip.on { background: var(--ui-teal); color: #fff; box-shadow: 0 3px 0 0 var(--ui-teal-lo); }
input[type=number], input[type=text], input[type=password], select, textarea { background: #FFFBE7; color: var(--ui-text); border: 2.5px solid var(--ui-line); border-radius: 50px; padding: 6px 12px; font-weight: 700; }
input:focus, select:focus, textarea:focus { border-color: var(--ui-focus); outline: none; }
.stats div { background: var(--ui-bg); border-radius: 18px; }
.stats small { color: var(--ui-muted); opacity: 1; }
.stats b { color: var(--ui-text); }
.up { color: #4E9A1E; } .down { color: #C94444; }
.kv { color: var(--ui-text2); }
.cloth { background: var(--ui-bg); border-radius: 20px; }
.cloth.on { box-shadow: inset 0 0 0 3px var(--ui-teal); }
.cloth span { color: var(--ui-text); }
.sign .type, .app .type { background: var(--ui-bg); color: var(--ui-text); box-shadow: 0 0 0 2px var(--ui-line); }
.type small { color: var(--ui-muted); opacity: 1; }
.sign .emotes button { background: var(--ui-bg); color: var(--ui-text2); box-shadow: 0 0 0 2px var(--ui-line); border-radius: 20px; }
.sign .emotes button .ic { width: 34px; height: 34px; }
.mine-card { background: var(--ui-teal-bg); border: 0; border-radius: 22px; color: var(--ui-text2); }
.job { border-color: var(--ui-line); }
.job small { color: var(--ui-muted); opacity: 1; }
.line { border-color: #fff; }
.sign.metro { --ui-ribbon: #3A3B42; --ui-ribbon2: #24252A; }

/* ---------- phone (island phone: cream body, colourful app tiles) ---------- */
.phone { background: var(--ui-paper); border: 0; border-radius: 40px; box-shadow: var(--ui-shadow), 0 0 0 8px #F7E9D2, 0 0 0 10px var(--ui-line); color: var(--ui-text2); }
.phone-top { color: var(--ui-text); }
.phone-top b { color: var(--ui-text); font-weight: 900; }
.back { color: var(--ui-text); }
.phone .apps button { color: var(--ui-text2); font-weight: 800; background: transparent; box-shadow: none; }
.phone .apps button:hover { transform: translateY(-2px); background: transparent; box-shadow: none; }
.apps i { width: 72px; height: 72px; border-radius: 24px; border: 0; background: var(--tile, #82D5BB); box-shadow: 0 5px 0 0 rgba(61, 52, 40, .18); }
.apps i .ic { width: 56px; height: 56px; margin: 0; }
.apps button:nth-child(8n+1) i { --tile: #F8A6B2; } .apps button:nth-child(8n+2) i { --tile: #889DF0; } .apps button:nth-child(8n+3) i { --tile: #F7CD67; }
.apps button:nth-child(8n+4) i { --tile: #82D5BB; } .apps button:nth-child(8n+5) i { --tile: #B77DEE; } .apps button:nth-child(8n+6) i { --tile: #E59266; }
.apps button:nth-child(8n+7) i { --tile: #8AC68A; } .apps button:nth-child(8n+8) i { --tile: #FC736D; }
.apps em { background: var(--ui-red); color: #fff; }
.app button.stock { background: var(--ui-bg); color: var(--ui-text); box-shadow: 0 0 0 2px var(--ui-line); }
.dm { background: var(--ui-bg); color: var(--ui-text2); }
.dm.mine { background: var(--ui-teal); color: #fff; }
.me-card canvas { background: var(--ui-paper2); }
.dot { background: var(--ui-paper3); } .dot.on { background: var(--ui-green); }

/* ---------- shop shelves (island store: toy photos on paper tiles) ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.tile { position: relative; background: var(--ui-bg); border-radius: 22px; padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; box-shadow: 0 0 0 2px var(--ui-line); transition: transform .2s var(--ui-ease); }
.tile:hover { transform: translateY(-2px); }
.tile.on { box-shadow: 0 0 0 3px var(--ui-teal); background: var(--ui-teal-bg); }
.tile .pic { width: 88px; height: 88px; border-radius: 18px; background: radial-gradient(circle at 50% 62%, #fff 0 40%, var(--ui-paper2) 72%); display: grid; place-items: center; }
.tile .pic .ic { width: 84px; height: 84px; margin: 0; }
.tile .pic .sw { width: 54px; height: 54px; border-radius: 50%; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), 0 3px 0 rgba(61, 52, 40, .15); }
.tile b { color: var(--ui-text); font-weight: 800; font-size: 13.5px; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; }
.tile small { color: var(--ui-muted); font-size: 12px; font-weight: 700; }
.tile .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.sign .tile .acts button { padding: 5px 12px; font-size: 13px; }
.tile .badge { position: absolute; top: 6px; right: 6px; background: var(--ui-teal); color: #fff; border-radius: 50px; font-size: 11px; padding: 2px 8px; font-weight: 900; }
.tile .badge.own { background: var(--ui-paper3); color: var(--ui-text2); }
.todo .row-main > span .ic { width: 34px; height: 34px; }
.eff .ic { width: 22px; height: 22px; margin: 0 -1px; }

@media (max-width: 520px) {
  .sign { border-radius: 28px; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .tile .pic { width: 74px; height: 74px; } .tile .pic .ic { width: 70px; height: 70px; }
  #needs { width: 160px; }
}
.sign button.coat { width: 30px; height: 30px; padding: 0; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(61, 52, 40, .22); }
.tile .coats { margin: 0; }

/* ---------- build mode (catalogue along the bottom, like a life-sim buy mode) ---------- */
body.building #chat, body.building #chat-toggle, body.building #needs, body.building #prompt, body.building #activity, body.building #joy, body.building #goal, body.building #wp-arrow { display: none !important; }
#build-top { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 30; }
.bt-title { display: flex; align-items: center; gap: 8px; background: var(--ui-ribbon); color: #FFF6E3; padding: 6px 30px 6px 12px; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%, 10px 50%); filter: drop-shadow(0 4px 0 var(--ui-ribbon2)); }
.bt-title .ic { width: 32px; height: 32px; margin: -4px 0; }
.bt-title b { font-weight: 900; font-size: 18px; } .bt-title span { font-weight: 700; opacity: .9; } .bt-title em { font-style: normal; background: rgba(255, 246, 227, .2); border-radius: 50px; padding: 1px 9px; font-weight: 900; font-size: 13px; }
.bt-done { background: var(--ui-teal); color: #fff; border: 0; border-radius: 50px; padding: 9px 22px; font-weight: 900; font-size: 15px; box-shadow: 0 5px 0 0 var(--ui-teal-lo); }
.bt-done:active { transform: translateY(3px); box-shadow: 0 2px 0 0 var(--ui-teal-lo); }
#build { position: fixed; left: 14px; right: 14px; bottom: 14px; height: 248px; z-index: 30; display: grid; grid-template-columns: 78px 1fr; background: var(--ui-paper); border-radius: 30px; box-shadow: var(--ui-shadow), 0 0 0 6px rgba(255, 249, 238, .6); overflow: hidden; color: var(--ui-text2); animation: ui-rise .3s var(--ui-ease); }
@keyframes ui-rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.bcats { background: var(--ui-paper2); display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; overflow-y: auto; scrollbar-width: none; }
.bcats button { position: relative; flex: none; width: 60px; height: 60px; border-radius: 20px; border: 0; background: transparent; display: grid; place-items: center; padding: 0; transition: background .15s var(--ui-ease), transform .15s var(--ui-ease); }
.bcats button .ic { width: 50px; height: 50px; margin: 0; }
.bcats button span { position: absolute; left: 66px; top: 50%; transform: translateY(-50%); background: var(--ui-text); color: #FFF6E3; border-radius: 50px; padding: 3px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2; }
.bcats button:hover span { opacity: 1; }
.bcats button:hover { background: var(--ui-bg); transform: translateY(-1px); }
.bcats button.on { background: var(--ui-bg); box-shadow: 0 0 0 3px var(--ui-teal); }
.bmain { display: flex; flex-direction: column; min-width: 0; padding: 10px 14px 12px; gap: 8px; }
.bhead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bhead h4 { margin: 0; font-size: 17px; font-weight: 900; color: var(--ui-text); white-space: nowrap; }
.bsearch { display: flex; align-items: center; gap: 2px; background: #FFFBE7; border: 2.5px solid var(--ui-line); border-radius: 50px; padding: 0 10px 0 4px; flex: none; }
.bsearch .ic { width: 26px; height: 26px; }
.bsearch input { border: 0 !important; background: transparent !important; width: 150px; padding: 6px 2px !important; }
.bseries { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; padding: 3px; }
.bseries button { flex: none; border: 0; border-radius: 50px; background: var(--ui-bg); color: var(--ui-text2); font-weight: 800; font-size: 12.5px; padding: 5px 12px; box-shadow: 0 0 0 2px var(--ui-line); }
.bseries button.on { background: var(--ui-teal); color: #fff; box-shadow: 0 3px 0 0 var(--ui-teal-lo); }
.bgrid { flex: 1; display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 1fr); grid-auto-columns: 92px; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scrollbar-color: var(--ui-paper3) transparent; }
.btile { position: relative; border: 0; border-radius: 20px; background: var(--ui-bg); box-shadow: 0 0 0 2px var(--ui-line); padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .15s var(--ui-ease), box-shadow .15s; min-height: 0; }
.btile > .ic { width: 66px; height: 66px; margin: 0; }
.btile em { font-style: normal; font-size: 11.5px; font-weight: 900; color: var(--ui-text); background: var(--ui-coin); border-radius: 50px; padding: 0 7px 0 2px; display: inline-flex; align-items: center; margin-top: -4px; }
.btile em .ic { width: 18px; height: 18px; }
.btile s { position: absolute; top: 3px; right: 3px; text-decoration: none; }
.btile s .ic { width: 22px; height: 22px; }
.btile:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--ui-paper3), 0 4px 10px rgba(61, 52, 40, .12); }
.btile.on { box-shadow: 0 0 0 3px var(--ui-teal); background: var(--ui-teal-bg); }
.bempty { color: var(--ui-muted); font-weight: 700; padding: 20px; grid-row: span 2; }
#build-card { position: fixed; left: 104px; bottom: 278px; z-index: 31; width: 300px; display: flex; gap: 12px; background: var(--ui-paper); border-radius: 26px; padding: 12px 14px 12px 10px; box-shadow: var(--ui-shadow); color: var(--ui-text2); pointer-events: none; animation: ui-pop .18s var(--ui-ease); }
.bc-pic { flex: none; width: 112px; height: 112px; border-radius: 20px; background: radial-gradient(circle at 50% 62%, #fff 0 40%, var(--ui-paper2) 75%); display: grid; place-items: center; }
.bc-pic .ic { width: 108px; height: 108px; margin: 0; }
.bc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bc-text b { color: var(--ui-text); font-weight: 900; font-size: 16px; line-height: 1.2; }
.bc-text small { color: var(--ui-muted); font-weight: 700; font-size: 12px; }
.bc-text .price { align-self: flex-start; }
.bc-text p { margin: 0; font-size: 12.5px; font-weight: 700; }
.bc-eff { display: flex; gap: 6px; flex-wrap: wrap; font-weight: 900; font-size: 12.5px; } .bc-eff .ic { width: 22px; height: 22px; }
#build-bar { position: fixed; z-index: 31; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 6px; background: var(--ui-paper); border-radius: 50px; padding: 6px; box-shadow: var(--ui-shadow); color: var(--ui-text); white-space: nowrap; }
#build-bar b { font-weight: 900; font-size: 14px; padding: 0 6px 0 10px; }
#build-bar small { font-weight: 700; color: var(--ui-muted); padding: 0 6px; }
#build-bar button { display: flex; align-items: center; gap: 4px; border: 0; border-radius: 50px; background: var(--ui-bg); color: var(--ui-text); font-weight: 800; font-size: 13px; padding: 4px 12px 4px 6px; box-shadow: 0 0 0 2px var(--ui-line); }
#build-bar button .ic { width: 28px; height: 28px; margin: 0; }
#build-bar button.go { background: var(--ui-teal); color: #fff; box-shadow: 0 4px 0 0 var(--ui-teal-lo); }
#build-bar button.go:disabled { background: var(--ui-paper3); color: var(--ui-muted); box-shadow: none; }
#build-bar button.sell.armed { background: var(--ui-red); color: #fff; box-shadow: 0 4px 0 0 #C94444; }
#build-bar button[data-b="cancel"] { padding: 4px; }
@media (max-width: 640px), (max-height: 520px) {
  #build { height: 210px; grid-template-columns: 1fr; grid-template-rows: auto 1fr; left: 8px; right: 8px; bottom: 8px; border-radius: 26px; }
  .bcats { flex-direction: row; overflow-x: auto; padding: 6px 8px; }
  .bcats button { width: 50px; height: 50px; border-radius: 16px; } .bcats button .ic { width: 42px; height: 42px; } .bcats button span { display: none; }
  .bmain { padding: 6px 10px 8px; gap: 6px; } .bhead h4 { display: none; } .bsearch input { width: 90px; }
  .bgrid { grid-template-rows: 1fr; grid-auto-columns: 84px; }
  #build-card { display: none; }
  #build-top { top: 10px; } .bt-title span { display: none; }
}
.phone .apps button:not(.exit-tab):not(.back) { background: transparent; color: var(--ui-text2); box-shadow: none; padding: 0; border-radius: 0; }
.phone .apps button:not(.exit-tab):not(.back):hover { background: transparent; box-shadow: none; transform: translateY(-2px); }
.phone .apps span { color: var(--ui-text2); font-weight: 800; }
@media (max-width: 640px) {
  body.building #loc, body.building #topright { display: none; }
  #build-top { left: 10px; right: 10px; transform: none; justify-content: space-between; }
  #needs { width: 138px; padding: 8px 10px; gap: 3px; border-radius: 18px; }
  .need i, .need i .ic { width: 20px; height: 20px; } .need b { height: 7px; }
}
@media (pointer: coarse) { #prompt { bottom: 34%; } }

/* ---------- HUD layout (after the island street mock) ---------- */
:root { --hud: rgba(255, 253, 248, 0.95); --hud-text: #24504B; --hud-sub: #7C8A86; --hud-shadow: 0 6px 18px rgba(40, 60, 55, 0.13); }
#loc { top: 16px; left: 16px; flex-direction: row; align-items: center; gap: 12px; padding: 9px 18px 9px 9px; border-radius: 20px; background: var(--hud); box-shadow: var(--hud-shadow); min-width: 0; }
#loc-ic { width: 42px; height: 42px; border-radius: 14px; background: #E5F3EE; display: grid; place-items: center; flex: none; }
#loc-ic .ic { width: 34px; height: 34px; margin: 0; }
#loc > div { display: flex; flex-direction: column; min-width: 0; }
#loc-name { font-size: 18px; font-weight: 900; color: var(--hud-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#clock { font-size: 12.5px; font-weight: 700; color: var(--hud-sub); white-space: nowrap; }
#goal { position: fixed; top: 92px; left: 16px; display: flex !important; align-items: center; gap: 10px; padding: 9px 12px 9px 9px !important; border-radius: 18px !important; background: var(--hud) !important; box-shadow: var(--hud-shadow) !important; color: var(--hud-text) !important; text-align: left; max-width: 330px; border: 0 !important; font-size: 13px; }
#goal[hidden] { display: none !important; }
#goal .gl-ic { width: 38px; height: 38px; border-radius: 12px; background: #EEF4F1; display: grid; place-items: center; flex: none; }
#goal .gl-ic .ic { width: 32px; height: 32px; margin: 0; }
#goal span { display: flex; flex-direction: column; min-width: 0; }
#goal b { font-weight: 800; font-size: 14px; color: var(--hud-text); }
#goal small { font-weight: 700; font-size: 11.5px; color: var(--hud-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#goal em { flex: none; font-style: normal; font-weight: 900; font-size: 12px; color: #8A6A12; background: #FCE7A6; border-radius: 10px; padding: 3px 8px 3px 3px; display: inline-flex; align-items: center; }
#goal em .ic { width: 20px; height: 20px; margin: 0; }
#topright { top: 16px; right: 16px; gap: 10px; }
#money { height: 48px; background: #FCE9A9; color: var(--hud-text); box-shadow: var(--hud-shadow); border-radius: 18px; padding: 0 18px 0 8px; font-size: 18px; }
#money .ic { width: 34px; height: 34px; }
#money.neg { background: #F8CCD8; box-shadow: var(--hud-shadow); }
#topright button { width: 48px; height: 48px; border-radius: 16px; background: var(--hud); box-shadow: var(--hud-shadow); }
#topright button:hover { box-shadow: var(--hud-shadow); }
#topright #mood-btn { background: #F8CCD8; }
#topright button .ic { width: 36px; height: 36px; }
#needs { top: 80px; right: 16px; bottom: auto; width: 178px; border-radius: 18px; background: var(--hud); box-shadow: var(--hud-shadow); padding: 10px 12px 11px; gap: 6px; cursor: pointer; color: var(--hud-text); }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 1px; }
.st-head b { font-size: 12.5px; font-weight: 800; color: var(--hud-sub); }
.st-head .ic { width: 22px; height: 22px; margin: 0; }
#needs .need { display: grid; grid-template-columns: 22px 34px 1fr; align-items: center; gap: 4px; }
#needs .need .ic { width: 22px; height: 22px; margin: 0; }
#needs .need span { font-size: 12px; font-weight: 800; color: var(--hud-text); white-space: nowrap; overflow: hidden; }
#needs .need b { height: 7px; background: #ECEFEC; }
#needs .need s { background: #7FC79A; } #needs .need.energy s { background: #EBC55A; } #needs .need.mood s { background: #E99AB5; }
#needs .need.low s { background: #F0B44C; } #needs .need.crit s { background: var(--ui-red); }
#dock { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; padding: 8px 12px; border-radius: 24px; background: var(--hud); box-shadow: var(--hud-shadow); }
#dock button { width: 66px; border: 0; background: transparent; border-radius: 16px; padding: 4px 0 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--hud-text); font-weight: 800; font-size: 12px; transition: background .15s var(--ui-ease), transform .15s var(--ui-ease); }
#dock button .ic { width: 36px; height: 36px; margin: 0; }
#dock button:hover { background: #EEF5F1; transform: translateY(-2px); }
#hint { position: fixed; left: 16px; bottom: 20px; display: flex; align-items: center; gap: 6px; padding: 7px 14px 7px 8px; border-radius: 50px; background: var(--hud); box-shadow: var(--hud-shadow); color: var(--hud-text); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; pointer-events: none; }
#hint .ic { width: 24px; height: 24px; margin: 0; }
#life-shop { position: fixed; right: 16px; bottom: 20px; display: flex; align-items: center; gap: 6px; padding: 7px 16px 7px 8px; border: 0; border-radius: 18px; background: var(--hud); box-shadow: var(--hud-shadow); color: var(--hud-text); font-size: 14px; font-weight: 800; }
#life-shop .ic { width: 30px; height: 30px; margin: 0; }
#life-shop:hover { transform: translateY(-2px); }
#chat-toggle { display: grid !important; place-items: center; position: fixed; left: 16px; bottom: 68px; width: 46px; height: 46px; border-radius: 50% !important; padding: 0; background: var(--hud) !important; box-shadow: var(--hud-shadow) !important; border: 0 !important; }
#chat-toggle .ic { width: 32px; height: 32px; margin: 0; }
#chat-toggle[data-n]:not([data-n=""])::after { content: attr(data-n); position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ui-red); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; padding: 0 5px; }
#chat { left: 16px; bottom: 124px; width: min(340px, calc(100vw - 32px)); z-index: 5; }
#chat.collapsed { display: none; }
#prompt { left: auto; right: 18%; bottom: 112px; transform: none; background: var(--ui-ribbon); color: #fff; border-radius: 18px; padding: 12px 20px 12px 12px; box-shadow: 0 5px 0 0 var(--ui-ribbon2), var(--hud-shadow); font-size: 15px; gap: 8px; }
#prompt .ic.go { width: 26px; height: 26px; margin: 0; padding: 0; background: none; border-radius: 0; box-shadow: none; font-size: 0; }   /* not the big .go button style */
#prompt kbd { background: rgba(255, 255, 255, .18); color: #fff; width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
#prompt q { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); quotes: none; background: var(--hud); color: var(--hud-text); font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 50px; white-space: nowrap; box-shadow: var(--hud-shadow); }
#prompt q::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--hud); }
#prompt::before { content: none !important; }
#activity { top: 16px; }
#toasts { top: 84px; }
body.building #dock, body.building #hint, body.building #life-shop, body.building #chat-toggle { display: none !important; }
.row.lifeshop .ic.big { width: 54px; height: 54px; margin: -4px 0; flex: none; }
@media (pointer: coarse), (max-width: 640px) {
  #loc { top: calc(10px + var(--st)); left: calc(10px + var(--sl)); padding: 6px 12px 6px 6px; gap: 8px; max-width: calc(100vw - 200px); border-radius: 18px; }
  #loc-ic { width: 34px; height: 34px; border-radius: 12px; } #loc-ic .ic { width: 28px; height: 28px; }
  #loc-name { font-size: 15px; } #clock { font-size: 10.5px; }
  #topright { top: calc(10px + var(--st)); right: calc(10px + var(--sr)); gap: 6px; }
  #money { height: 42px; font-size: 15px; padding: 0 12px 0 4px; border-radius: 15px; } #money .ic { width: 30px; height: 30px; }
  #topright button { width: 42px; height: 42px; border-radius: 14px; } #topright button .ic { width: 32px; height: 32px; }
  #topright #set-btn { display: none; }
  #goal { top: calc(64px + var(--st)); left: calc(10px + var(--sl)); max-width: calc(100vw - 170px); padding: 6px 8px 6px 6px !important; gap: 6px; border-radius: 15px !important; }
  #goal .gl-ic { width: 30px; height: 30px; border-radius: 10px; } #goal .gl-ic .ic { width: 26px; height: 26px; }
  #goal b { font-size: 12px; } #goal small { display: none; }
  #needs { top: calc(62px + var(--st)); right: calc(10px + var(--sr)); width: 142px; padding: 7px 9px 8px; gap: 3px; border-radius: 15px; }
  .st-head b { font-size: 11px; } #needs .need { grid-template-columns: 18px 28px 1fr; } #needs .need .ic { width: 18px; height: 18px; } #needs .need span { font-size: 10.5px; }
  #dock { left: calc(8px + var(--sl)); right: calc(8px + var(--sr)); bottom: calc(8px + var(--sb)); transform: none; justify-content: space-around; padding: 5px 4px; border-radius: 22px; }
  #dock button { width: auto; flex: 1; font-size: 11px; } #dock button .ic { width: 30px; height: 30px; }
  #hint { display: none; }
  #life-shop { right: calc(10px + var(--sr)); bottom: calc(86px + var(--sb)); padding: 6px; border-radius: 16px; } #life-shop span { display: none; }
  #chat-toggle { left: auto; right: calc(62px + var(--sr)); bottom: calc(86px + var(--sb)); width: 44px; height: 44px; }
  #chat { left: calc(10px + var(--sl)); right: calc(10px + var(--sr)); width: auto; bottom: calc(140px + var(--sb)); }
  #joy { left: calc(18px + var(--sl)); bottom: calc(92px + var(--sb)); width: 118px; height: 118px; } #joy i { left: 37px; top: 37px; }
  #prompt { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(170px + var(--sb)); font-size: 15px; padding: 11px 18px 11px 11px; }
  #activity { top: calc(118px + var(--st)); }
  #toasts { top: calc(118px + var(--st)); }
}
#goal b { margin: 0; font-family: var(--font); }
#modal { z-index: 40; }
#needs .need { grid-template-columns: 22px auto 1fr; } #needs .need span { min-width: 30px; padding-right: 4px; }
@media (pointer: coarse), (max-width: 640px) {
  .st-head b { display: none; } .st-head { justify-content: flex-end; margin-bottom: -2px; }
  #needs .need { grid-template-columns: 18px auto 1fr; } #needs .need span { min-width: 24px; }
  #prompt { left: auto; right: calc(12px + var(--sr)); transform: none; bottom: calc(140px + var(--sb)); }
  #toasts { top: calc(150px + var(--st)); }
}

/* ---------- build mode v2 (catalogue row, in-world tools) ---------- */
#build { display: flex; flex-direction: column; grid-template-columns: none; gap: 8px; height: auto; max-height: 300px; padding: 12px 16px 14px; border-radius: 28px; background: #FBF5EA; box-shadow: var(--ui-shadow), 0 0 0 3px #1E6E64; }
#build .bhead { display: flex; align-items: center; gap: 14px; }
.btitle { display: flex; align-items: center; gap: 6px; padding-right: 14px; border-right: 2px solid var(--ui-line); }
.btitle .ic { width: 40px; height: 40px; margin: -4px 0; }
.btitle b { font-size: 21px; font-weight: 900; color: #1E4F4A; white-space: nowrap; }
#build .bsearch { flex: 1; max-width: 420px; background: #fff; }
#build .bsearch input { width: 100%; }
.btabs { margin-left: auto; display: flex; gap: 8px; }
.btabs button { border: 0; border-radius: 50px; padding: 8px 22px; font-weight: 900; font-size: 15px; background: #F3EBDD; color: #1E4F4A; box-shadow: 0 3px 0 rgba(61, 52, 40, .15); }
.btabs button.on { background: #1E6E64; color: #fff; box-shadow: 0 3px 0 #155850; }
.btabs button i { font-style: normal; background: #F5C31C; color: #5A4210; border-radius: 50px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.bchips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.bchips button { flex: none; border: 0; border-radius: 50px; padding: 6px 18px; font-weight: 900; font-size: 14px; background: #F3EBDD; color: #1E4F4A; box-shadow: 0 2px 0 rgba(61, 52, 40, .12); }
.bchips button.on { background: #1E6E64; color: #fff; }
#build .bgrid { grid-template-rows: 1fr; grid-auto-columns: 132px; height: 150px; flex: none; gap: 10px; }
#build .btile { border-radius: 22px; background: #fff; box-shadow: 0 0 0 2px #EADFCB; padding: 6px 4px 8px; justify-content: space-between; }
#build .btile > .ic { width: 106px; height: 106px; }   /* only the item picture: the coin in the price pill and the 'usable' badge keep their small size */
#build .btile em .ic { width: 18px; height: 18px; } #build .btile s .ic { width: 22px; height: 22px; }
#build .btile em { font-size: 12.5px; padding: 1px 10px 1px 3px; margin: 0; }
#build .btile em.own { background: #E6F4EE; color: #1E6E64; box-shadow: inset 0 0 0 2px #BFE3D3; padding: 2px 12px; }
#build .btile.on { box-shadow: 0 0 0 3px #1E9C83; background: #F2FBF7; }
#build-top { gap: 12px; }
#build-top .bt-title { padding: 10px 40px 10px 26px; gap: 14px; background: #1E6E64; }
#build-top .bt-title b { font-size: 22px; }
#build-top .bt-title em { background: #155850; color: #fff; font-size: 15px; padding: 3px 12px; }
#build-top .bt-done { font-size: 18px; padding: 10px 28px; }
#build-tip { position: fixed; z-index: 32; transform: translate(-50%, -100%); background: #E8F7EF; color: #1E6E64; border: 2px solid #8FD3B4; font-weight: 900; font-size: 15px; padding: 6px 16px; border-radius: 50px; box-shadow: var(--hud-shadow); pointer-events: none; white-space: nowrap; }
#build-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -7px; border: 7px solid transparent; border-top-color: #8FD3B4; }
#build-tip.bad { background: #FDE6E3; color: #B23B33; border-color: #F2A79F; } #build-tip.bad::after { border-top-color: #F2A79F; }
#build-bar { transform: none; flex-direction: row; align-items: center; gap: 10px; background: transparent; box-shadow: none; padding: 0; }
.btools { display: flex; flex-direction: column; gap: 6px; background: #FBF5EA; border-radius: 30px; padding: 7px; box-shadow: var(--hud-shadow); }
.btools button, #build-bar .bok { width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: #fff; box-shadow: 0 3px 0 rgba(61, 52, 40, .15); }
.btools button .ic, #build-bar .bok .ic { width: 36px; height: 36px; margin: 0; }
.btools button.del { background: #FDECEA; }
.btools button.sell.armed { background: #F5C31C; }
#build-bar .bok { background: #2FA56F; box-shadow: 0 4px 0 #1F7A50; width: 56px; height: 56px; }
#build-bar .bok:disabled { background: #D9D2C6; box-shadow: none; opacity: .7; }
#build-bar .bprice { background: #FCE9A9; color: #5A4210; font-weight: 900; border-radius: 50px; padding: 3px 12px; font-size: 13px; }
@media (max-width: 640px), (max-height: 520px) {
  #build { max-height: 230px; padding: 8px 10px 10px; }
  .btitle b { display: none; } .btitle { border: 0; padding: 0; } .btitle .ic { width: 32px; height: 32px; }
  .btabs button { padding: 6px 12px; font-size: 13px; } .bchips button { padding: 5px 12px; font-size: 12.5px; }
  #build .bgrid { grid-auto-columns: 96px; height: 116px; } #build .btile > .ic { width: 76px; height: 76px; }
  #build-top .bt-title b { font-size: 17px; } #build-top .bt-done { font-size: 15px; padding: 8px 18px; }
  .btools button, #build-bar .bok { width: 44px; height: 44px; } .btools button .ic, #build-bar .bok .ic { width: 30px; height: 30px; }
}

/* ---------- mall ---------- */
#modal .mall { width: min(1060px, 96vw); height: min(640px, 88vh); display: flex; flex-direction: column; background: #FBF5EA; border-radius: 34px; overflow: hidden; box-shadow: var(--ui-shadow), 0 0 0 6px rgba(255, 249, 238, .6); color: #1E4F4A; animation: ui-pop .25s var(--ui-ease); }
.mall header { display: flex; align-items: center; gap: 10px; background: #1E6E64; color: #fff; padding: 12px 18px 12px 22px; }
.mall header i .ic { width: 44px; height: 44px; margin: -6px 0; }
.mall header h2 { margin: 0; font-size: 28px; font-weight: 900; flex: 1; }
.mcoin { display: flex; align-items: center; gap: 4px; background: #FCD866; color: #4A3608; font-weight: 900; font-size: 20px; border-radius: 50px; padding: 4px 18px 4px 6px; box-shadow: 0 3px 0 #D8A93F; }
.mcoin .ic { width: 32px; height: 32px; }
.mall .mx { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #FBF5EA; display: grid; place-items: center; padding: 0; margin-left: 8px; }
.mall .mx .ic { width: 34px; height: 34px; }
.mall-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 170px 1fr 300px; gap: 14px; padding: 16px; }
.mcats { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.mcats button { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 18px; background: #F3EBDD; color: #1E4F4A; padding: 8px 12px; font-weight: 900; font-size: 16px; box-shadow: 0 3px 0 rgba(61, 52, 40, .12); text-align: left; }
.mcats button .ic { width: 34px; height: 34px; margin: 0; }
.mcats button.on { background: #1E6E64; color: #fff; box-shadow: 0 3px 0 #155850; }
.mmain { display: flex; flex-direction: column; min-width: 0; gap: 10px; }
.mtools { display: flex; gap: 10px; }
.msearch { flex: 1; display: flex; align-items: center; background: #fff; border: 2.5px solid #E6D9C2; border-radius: 50px; padding: 0 12px 0 6px; }
.msearch .ic { width: 28px; height: 28px; } .msearch input { border: 0 !important; background: transparent !important; width: 100%; padding: 8px 4px !important; font-size: 15px; }
#mall-sort { width: 190px; max-width: none; border-radius: 50px; border: 2.5px solid #E6D9C2; background: #FFF9EC; font-weight: 800; color: #1E4F4A; padding: 8px 14px; }
.mgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 10px; }
.mtile { position: relative; border: 0; background: #fff; border-radius: 22px; box-shadow: 0 0 0 2px #EADFCB; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 6px 10px; min-height: 0; color: #1E4F4A; transition: transform .15s var(--ui-ease); }
.mtile:hover { transform: translateY(-2px); }
.mtile .ic { width: 100%; max-width: 116px; height: auto; aspect-ratio: 1; flex: 1 1 auto; min-height: 0; margin: 0; }
.mtile b { font-size: 14.5px; font-weight: 900; line-height: 1.15; text-align: center; }
.mtile .price { margin-top: 4px; }
.mtile.on { box-shadow: 0 0 0 3px #1E9C83; }
.mtile.on::after { content: ""; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: #1E9C83 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.mown { position: absolute; top: 8px; right: 8px; background: #4FB89A; color: #fff; font-size: 11.5px; font-weight: 900; border-radius: 50px; padding: 2px 9px; z-index: 1; }
.mtile.on .mown { right: 38px; }
.mpager { display: flex; justify-content: center; align-items: center; gap: 14px; font-weight: 900; }
.mpager button { width: 44px; height: 34px; border-radius: 14px; border: 2px solid #E6D9C2; background: #FFF9EC; display: grid; place-items: center; padding: 0; }
.mpager button .ic { width: 26px; height: 26px; margin: 0; } .mpager button:disabled { opacity: .4; }
.mdetail { background: #fff; border-radius: 26px; box-shadow: 0 0 0 2px #EADFCB; padding: 14px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-y: auto; }
.mbig { width: 190px; height: 190px; display: grid; place-items: center; }
.mbig .ic { width: 190px; height: 190px; margin: 0; }
.mdetail h3 { margin: 0; font-size: 24px; font-weight: 900; color: #1E4F4A; text-align: center; }
.mdetail small { color: #7C8A86; font-weight: 800; }
.mdetail .price.big { font-size: 20px; padding: 4px 18px 4px 6px; margin: 6px 0 2px; } .mdetail .price.big .ic { width: 30px; height: 30px; }
.mall .mdetail button { width: 100%; border: 0; border-radius: 50px; padding: 12px; font-size: 16px; font-weight: 900; background: #1E8C78; color: #fff; box-shadow: 0 4px 0 #156A5A; margin-top: 4px; }
.mall .mdetail button.ghost { background: #FFF9EC; color: #1E4F4A; box-shadow: 0 0 0 2px #E6D9C2, 0 3px 0 rgba(61, 52, 40, .12); }
.mdetail .note { text-align: center; font-size: 12px; margin-top: auto; }
@media (max-width: 760px) {
  #modal .mall { height: calc(100dvh - 24px); border-radius: 26px; }
  .mall header h2 { font-size: 22px; } .mcoin { font-size: 16px; }
  .mall-body { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; padding: 10px; gap: 8px; overflow-y: auto; }
  .mcats { flex-direction: row; overflow-x: auto; } .mcats button { flex: none; font-size: 13px; padding: 6px 10px; } .mcats button .ic { width: 26px; height: 26px; }
  #mall-sort { width: 120px; }
  .mgrid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; }
  .mdetail { order: -1; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 10px; }
  .mbig, .mbig .ic { width: 110px; height: 110px; } .mdetail h3 { font-size: 18px; width: 100%; } .mdetail .note { display: none; }
}

/* ---------- phone v2 ("my life": dark body, cream app tiles on green wells) ---------- */
.phone.dark { background: #2E323A; color: #fff; border-radius: 44px; box-shadow: 0 0 0 7px #23262C, 0 24px 60px rgba(0, 0, 0, .4); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; width: min(410px, 96vw); height: auto; max-height: calc(100dvh - 40px); }
.phone.dark .ptab { position: absolute; top: -22px; right: 18px; background: #1E6E64; color: #fff; border: 0; border-radius: 16px; padding: 9px 22px; font-weight: 900; font-size: 16px; box-shadow: 0 4px 0 #155850; z-index: 2; }
.phone.dark .phone-top { padding: 6px 4px 0; justify-content: space-between; }
.ptime { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; }
.pcoin { display: flex; align-items: center; gap: 4px; background: #FCD866; color: #3E2D07; font-weight: 900; font-size: 19px; border-radius: 50px; padding: 3px 16px 3px 5px; }
.pcoin .ic { width: 30px; height: 30px; margin: 0; }
.ptitle { margin: 2px 0 2px; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 900; color: #fff; }
.ptitle::before, .ptitle::after { content: ""; flex: 1; height: 2px; background: #E9D9B8; border-radius: 2px; opacity: .8; }
.apps2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; overflow-y: auto; scrollbar-width: none; }
.phone.dark .papp { position: relative; background: #FBF3E4; border: 0; border-radius: 18px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); color: #1E5A50; font-weight: 900; font-size: 15px; transition: transform .15s var(--ui-ease); }
.phone.dark .papp:hover { transform: translateY(-2px); }
.papp i { width: 78px; height: 78px; border-radius: 22px; background: #1E6E64; display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }
.papp i .ic { width: 66px; height: 66px; margin: 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.papp em { position: absolute; top: 6px; right: 6px; background: var(--ui-red); color: #fff; font-style: normal; font-size: 12px; border-radius: 50px; padding: 1px 7px; }
.pmore { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.phone.dark .pmore button { position: relative; background: rgba(255, 255, 255, .1); color: #F3E6CF; border: 0; border-radius: 50px; padding: 5px 14px; font-weight: 800; font-size: 13px; }
.pmore em { font-style: normal; background: var(--ui-red); color: #fff; border-radius: 50px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.pbar { display: flex; align-items: center; gap: 10px; background: #23262C; border-radius: 22px; padding: 8px 10px; }
.pbar span { flex: 1; text-align: center; color: #F3E6CF; font-weight: 900; }
.phone.dark .pbar span button { background: transparent; color: #F3E6CF; border: 0; padding: 0 4px; font-weight: 900; font-size: 15px; box-shadow: none; }
.pbar i { width: 2px; height: 26px; background: rgba(255, 255, 255, .25); }
.phone.dark .pbar .pill { border-radius: 50px; padding: 7px 22px; font-weight: 900; font-size: 15px; background: transparent; color: #8FE3CC; border: 2px solid #4FB89A; box-shadow: none; }
.phone.dark .pbar .pill.on { background: #3FBF9F; color: #0F3B33; border-color: #3FBF9F; }
@media (max-width: 420px) { .papp i { width: 64px; height: 64px; } .papp i .ic { width: 54px; height: 54px; } .phone.dark .papp { font-size: 13px; } }

/* ---------- creator, mockup v2: every group in a soft bubble panel ---------- */
#auth .cc-card { width: min(1320px, 100%); background: #FBF5EA; border: 2px solid #EADBC2; border-radius: 34px; padding: 22px 30px 0; box-shadow: 0 22px 60px rgba(80, 55, 30, .22), inset 0 2px 0 #FFFDF8; }
#auth .cc-top { border-bottom: 0; padding-bottom: 6px; }
#auth .cc-mark { width: 74px; height: 64px; border: 0; background: none; border-radius: 0; overflow: visible; }
#auth .cc-mark-sky { width: 62px; height: 62px; right: -2px; bottom: 0; } #auth .cc-mark-palm { width: 50px; height: 50px; left: -4px; bottom: 2px; }
#auth .cc-vr { flex: none; width: 2px; height: 54px; border-radius: 2px; background: #1D6B52; opacity: .55; }
#auth .cc-brand { gap: 16px; }
#auth .cc-brand h1 { font-size: 34px; color: #155B43; letter-spacing: .01em; }
#auth .cc-brand p { font-size: 15px; color: #4F4234; margin-top: 4px; }
#auth .cc-steps { gap: 0; }
#auth .cc-step { gap: 12px; padding: 6px 30px 6px 7px; min-height: 50px; font-size: 17px; background: #F4ECDE; border: 2px solid #EADDC6; color: #4F4234; }
#auth .cc-step b { width: 32px; height: 32px; font-size: 16px; background: #DCCCB0; color: #FFFFFF; }
#auth .cc-step.on { background: #1D6B52; border-color: #1D6B52; }
#auth .cc-step.on b { background: #FFFFFF; color: #1D6B52; }
#auth .cc-step.done b { background: #1D6B52; color: #FFFFFF; }
#auth .cc-dash { width: 42px; border-top: 2px solid #CFC1A9; }
#auth .cc-lang-float { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 3; }
#auth .cc-lang-float .cc-lang { background: rgba(251, 245, 234, .92); border: 2px solid #EADBC2; box-shadow: 0 6px 16px rgba(80, 55, 30, .16); }
#auth .cc-lang-float .cc-lang button.on { color: #1D6B52; }

#auth .cc-bub { background: #FDF9F1; border: 2px solid #EFE3CE; border-radius: 26px; padding: 16px; box-shadow: inset 0 2px 0 #FFFFFF, 0 3px 0 rgba(150, 120, 80, .06); }
#auth .cc-s1 { grid-template-columns: minmax(0, 1fr) minmax(260px, .78fr) minmax(0, 1.06fr); gap: 22px; align-items: stretch; }
#auth .cc-left { display: flex; flex-direction: column; gap: 14px; }
#auth .cc-presets { flex: 1; gap: 14px; align-content: center; }
#auth .cc-preset { padding: 12px 10px 10px; border: 2px solid #EDE1CC; border-radius: 22px; background: #FBF5EA; justify-content: flex-start; }
#auth .cc-preset-tag { align-self: stretch; border-radius: 14px; padding: 9px 0 8px; background: #1D6B52; color: #FFFFFF; font-size: 18px; font-weight: 900; }
#auth .cc-preset.on { border: 3px solid #1D6B52; box-shadow: none; padding: 11px 9px 9px; }
#auth .cc-preset.on .cc-preset-tag { border-radius: 14px; }
#auth .cc-preset .cc-check { top: -12px; right: -12px; }
#auth .cc-preset-pic { max-width: 200px; margin-top: 8px; }
#auth .cc-check { background: #1D6B52; }
#auth .cc-name { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
#auth .cc-name .cc-label { margin: 0 4px 0 2px; flex: none; font-size: 17px; color: #4F4234; }
#auth .cc-name input { flex: 1; padding: 11px 16px; font-size: 18px; color: #3B3026; background: #FFFFFF; border: 2px solid #E8DCC6; border-radius: 16px; }
#auth .cc-name .cc-mint.sm { align-self: stretch; padding: 0 20px; border-radius: 14px; font-size: 16px; background: #1BAF8E; box-shadow: 0 4px 0 0 #13906F; }
#auth .cc-center { display: flex; flex-direction: column; justify-content: center; }
#auth .cc-stagebox { max-width: 360px; }
#auth .cc-turn { gap: 22px; margin-top: 8px; font-size: 17px; color: #2F3A2F; }
#auth .cc-sq { width: 50px; height: 50px; border-radius: 16px; background: #1D6B52; box-shadow: 0 4px 0 0 #134D3A; }
#auth .cc-right.cc-bub { padding: 16px 16px 14px; display: flex; flex-direction: column; }
#auth .cc-tabs2 { gap: 10px; }
#auth .cc-pill { padding: 11px 0; font-size: 18px; font-weight: 800; color: #4F4234; background: #F6EEDF; border: 2px solid #EADDC6; }
#auth .cc-pill.on { background: #1D6B52; border-color: #1D6B52; color: #FFFFFF; }
#auth .cc-pill:hover:not(.on) { border-color: #9CC8B4; }
#auth .cc-body { flex: 1; height: 452px; margin-top: 14px; }
#auth .cc-tile { border: 2px solid #EDE1CC; background: #F8F1E4; border-radius: 20px; }
#auth .cc-tile:hover { border-color: #9CC8B4; }
#auth .cc-tile.on { border: 3px solid #1D6B52; background: #FDF9F1; box-shadow: none; }
#auth .cc-grid.heads { gap: 12px; max-height: none; overflow: visible; margin: 0 0 12px; padding: 0; }
#auth .cc-grid.heads .cc-tile { aspect-ratio: 1 / .92; justify-content: center; padding: 8px; }
#auth .cc-grid.heads .cc-tile > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#auth .cc-grid.heads .cc-pic { width: 112px; height: 112px; }
#auth .cc-wells { display: flex; flex-direction: column; gap: 12px; }
#auth .cc-well { background: #F6EEE0; border: 2px solid #EFE3CE; border-radius: 22px; padding: 14px 16px; justify-content: center; }
#auth .cc-well.row { gap: 18px; }
#auth .cc-well.row .cc-dot, #auth .cc-well:not(.big) .cc-dot { width: 46px; height: 46px; }
#auth .cc-dot { border: 3px solid #FFFFFF; box-shadow: 0 0 0 1px #E3D5BE, inset 0 -3px 0 rgba(0, 0, 0, .12); }
#auth .cc-dot.on { box-shadow: 0 0 0 3px #1D6B52, inset 0 -3px 0 rgba(0, 0, 0, .12); }
#auth .cc-dot .cc-check { display: none; }
#auth .cc-bar { border-top: 0; padding: 18px 0 24px; gap: 24px; }
#auth .cc-out { min-width: 190px; justify-content: center; border: 2px solid #1D6B52; color: #1D6B52; background: #FDF9F1; font-size: 19px; padding: 13px 26px; }
#auth .cc-out .cc-chev { display: none; }
#auth .cc-hint { display: flex; align-items: center; gap: 18px; color: #6B5D4D; font-size: 16px; }
#auth .cc-hint::before, #auth .cc-hint::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: #D9CDB9; }
#auth .cc-hint > span { flex: none; max-width: 60%; }
#auth .cc-go { background: #1BAF8E; box-shadow: 0 5px 0 0 #13906F; font-size: 20px; padding: 15px 38px; }
#auth .cc-go:hover { background: #22BE9C; box-shadow: 0 6px 0 0 #13906F; }
#auth .cc-go .cc-chev { display: none; }
#auth .cc-s2 { gap: 16px; }
#auth .cc-s2 .cc-bub { display: flex; flex-direction: column; gap: 12px; }
#auth .cc-tower, #auth .cc-plan { background: #FBF5EA; border-color: #EDE1CC; }
#auth .cc-tower.on, #auth .cc-plan.on { border-color: #1D6B52; box-shadow: none; }
#auth .cc-summary.cc-bub, #auth .cc-account.cc-bub { padding: 18px 20px; }
#auth .cc-h2 { color: #155B43; }
@media (max-width: 860px) {
  #auth .cc-card { padding: 12px 12px 0; border-radius: 24px; }
  #auth .cc-vr { height: 38px; }
  #auth .cc-brand h1 { font-size: 23px; }
  #auth .cc-step { min-height: 0; padding: 4px; font-size: 14px; } #auth .cc-step.on { padding-right: 14px; }
  #auth .cc-step b { width: 26px; height: 26px; font-size: 13px; }
  #auth .cc-dash { width: 14px; }
  #auth .cc-bub { padding: 10px; border-radius: 20px; }
  #auth .cc-s1 { gap: 12px; }
  #auth .cc-preset { padding: 0; } #auth .cc-preset.on { padding: 0; }
  #auth .cc-preset-tag { border-radius: 14px 0 0 14px; font-size: 13px; padding: 0 6px; }
  #auth .cc-preset .cc-check { top: 4px; right: 4px; }
  #auth .cc-name { padding: 10px; gap: 8px; } #auth .cc-name .cc-label { font-size: 14px; }
  #auth .cc-name input { font-size: 16px; padding: 9px 12px; }
  #auth .cc-pill { font-size: 14px; padding: 8px 0; }
  #auth .cc-body { height: auto; }
  #auth .cc-grid.heads .cc-pic { width: 76px; height: 76px; }
  #auth .cc-well.row { gap: 10px; } #auth .cc-well.row .cc-dot { width: 38px; height: 38px; }
  #auth .cc-out { min-width: 0; font-size: 15px; padding: 11px 18px; }
  #auth .cc-go { font-size: 16px; padding: 13px 16px; }
}
/* creator v2: fixed-height right panel (2 rows of hair, scroll for more), left cards fill their bubble */
@media (min-width: 861px) {
  #auth .cc-card:not(.cc-signin) .cc-main { min-height: 0; display: block; padding: 14px 0 6px; }
  #auth .cc-s1 { height: min(566px, calc(100vh - 250px)); min-height: 470px; }
  #auth .cc-right.cc-bub { min-height: 0; overflow: hidden; }
  #auth .cc-body { height: auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0; margin: 14px 0 0; }
  #auth .cc-body > .cc-grid.heads { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -6px 12px; padding: 4px 6px; }
  #auth .cc-body > .cc-wells { flex: none; }
  #auth .cc-body:not(:has(.cc-wells)) { overflow-y: auto; margin-right: -8px; padding-right: 8px; }
  #auth .cc-presets { display: grid; grid-template-rows: minmax(0, 1fr); align-items: stretch; min-height: 0; }
  #auth .cc-preset { min-height: 0; overflow: hidden; }
  #auth .cc-preset-pic { flex: 1 1 auto; min-height: 0; width: auto; max-width: 100%; object-fit: contain; }
  #auth .cc-center { min-height: 0; }
  #auth .cc-stagebox { max-height: calc(100% - 64px); width: auto; }
}
#auth .cc-grid.heads .cc-pic { width: min(100px, 76%); height: auto; aspect-ratio: 1; }
#auth .cc-grid.heads .cc-tile { min-width: 0; }
@media (min-width: 861px) {
  #auth .cc-preset { overflow: visible; }
  #auth .cc-preset-pic { width: 100%; height: 100%; max-width: none; object-fit: contain; transform: scale(1.18); transform-origin: 50% 60%; }
}

/* stamina: a slim bar at the bottom of the status card, shown (fading in) only while it is not full */
#needs .need.stamina { display: none; grid-column: 1 / -1; }
#needs .need.stamina.show { display: grid; animation: stam-in .25s ease-out; }
#needs .need.stamina b { height: 5px; } #needs .need.stamina s { background: #5FB3D9; transition: width .12s linear; }
#needs .need.stamina.low s { background: #F0B44C; } #needs .need.stamina.crit s { background: var(--ui-red); }
@keyframes stam-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
/* run toggle beside the joystick (phones held sideways) */
#run-btn { display: none; }
@media (pointer: coarse) and (orientation: landscape) {
  #run-btn { display: grid; place-items: center; position: fixed; left: calc(146px + var(--sl)); bottom: calc(96px + var(--sb)); width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--ui-paper); box-shadow: 0 3px 0 0 var(--ui-btn3d), var(--ui-shadow); touch-action: none; }
  #run-btn .ic { width: 38px; height: 38px; margin: 0; }
  #run-btn.on { background: #CDEFE3; box-shadow: 0 0 0 3px #1E9C83, 0 3px 0 0 var(--ui-btn3d); }
}
body.building #run-btn { display: none !important; }
