@font-face { font-family: 'Baloo 2'; font-weight: 400 800; font-display: swap; src: url(fonts/baloo2-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-weight: 400 800; font-display: swap; src: url(fonts/baloo2-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02AF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #14213d; --soft: #5c6b80; --green: #0fa968; --green-d: #0a7a4b; --gold: #ffc93c; --gold-d: #d99a00;
  --red: #ff4d4f; --panel: rgba(255, 255, 255, 0.94); --glass: rgba(14, 42, 34, 0.72); --line: #e6e9ef;
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e2a22; color: var(--ink); font-family: 'Baloo 2', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { display: block; }
#app { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; cursor: grab; }
#stage canvas:active { cursor: grabbing; }

/* ---------- 3D labels ---------- */
#labels, #pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.badge { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 12px 4px; border-radius: 14px; background: rgba(20, 33, 61, 0.86); color: #fff; line-height: 1.05; white-space: nowrap; margin: -24px 0 0 0; translate: -50% 0; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); transition: background .2s, scale .15s; }
.badge:hover { scale: 1.06; }
.badge .b-name { font-size: 12px; font-weight: 600; opacity: .85; }
.badge .b-lvl { font-size: 16px; font-weight: 800; }
.badge.can { background: var(--green); }
.badge.can::after { content: ''; position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5l6 7h-4v7h-4v-7H6z' fill='%2314213d'/%3E%3C/svg%3E") center/14px no-repeat; box-shadow: 0 2px 0 var(--gold-d); }
.badge.neck { outline: 3px solid var(--red); outline-offset: 2px; animation: neck 1.2s infinite; }
.badge.neck::before { content: 'SLOWEST'; position: absolute; top: -18px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #fff; background: var(--red); border-radius: 8px; padding: 0 6px; }
@keyframes neck { 50% { outline-color: rgba(255, 77, 79, 0.2); } }
.badge.manager { background: rgba(20, 33, 61, 0.7); }
.badge.manager.hired { background: #1b2a49; border: 2px solid var(--gold); }
.badge.manager.can { background: var(--green); }
.badge.marketing { background: #8e44ad; }
.badge.marketing.can { background: var(--green); }
.badge.vip { background: linear-gradient(135deg, #ffd700, #ff9f1c); color: var(--ink); animation: vip .6s infinite alternate; }
@keyframes vip { to { scale: 1.12; } }
.badge.district { padding: 4px 14px 6px; background: rgba(255, 255, 255, 0.95); color: var(--ink); }
.badge.district .b-name { font-size: 16px; font-weight: 800; opacity: 1; }
.badge.district .b-lvl { font-size: 12px; font-weight: 600; color: var(--soft); }
.badge.district.ready { background: var(--gold); animation: vip .7s infinite alternate; }
.badge.district.ready .b-lvl { color: var(--ink); }
.badge.district.locked { background: rgba(60, 60, 60, 0.75); color: #ddd; }
.badge.district.locked .b-lvl { color: #bbb; }
.badge.tip::after, .tip-pulse::after { content: ''; position: absolute; width: 38px; height: 38px; bottom: -36px; left: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11V5a1.5 1.5 0 013 0v5l1-.2a1.5 1.5 0 012 .6l.2-.1a1.5 1.5 0 012 .9 1.5 1.5 0 012 1.3V17a5 5 0 01-5 5h-1.5a5 5 0 01-4-2l-3-4a1.5 1.5 0 012.3-1.9z' fill='white' stroke='%2314213d' stroke-width='1.3'/%3E%3C/svg%3E") center/contain no-repeat; animation: point .7s infinite alternate; pointer-events: none; }
@keyframes point { from { transform: translate(-30%, 0); } to { transform: translate(-30%, -8px); } }

.pop { position: absolute; left: 0; top: 0; font-weight: 800; font-size: 20px; color: #fff; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.25); text-shadow: 0 2px 0 var(--green-d), 0 0 10px rgba(0, 0, 0, .25); translate: -50% -50%; animation: pop 1.3s ease-out forwards; white-space: nowrap; }
.pop.up { color: var(--gold); text-shadow: 0 2px 0 #8a5a00; font-size: 22px; }
.pop.lost { color: #ffd6d6; text-shadow: 0 2px 0 #a3191b; font-size: 15px; }
.pop.big { font-size: 34px; color: var(--gold); text-shadow: 0 3px 0 #8a5a00; animation-duration: 1.8s; }
@keyframes pop { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.08); } 100% { opacity: 0; transform: translateY(-60px) scale(1); } }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--safe-t) + 10px) 12px 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.me { display: flex; align-items: center; gap: 8px; background: var(--glass); backdrop-filter: blur(8px); padding: 4px 14px 4px 4px; border-radius: 999px; color: #fff; }
.me .face { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #ffe08a, #ffb84d); }
.me-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.me-text b { font-size: 16px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.respect { font-size: 13px; color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 3px; }
.money { text-align: center; background: var(--glass); backdrop-filter: blur(8px); padding: 2px 22px 4px; border-radius: 20px; color: #fff; min-width: 170px; }
.cash { font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: .3px; }
.rate { font-size: 14px; color: #7dffb8; font-weight: 700; line-height: 1; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.chip { background: var(--gold); color: var(--ink); font-weight: 800; font-size: 15px; padding: 6px 14px; border-radius: 999px; box-shadow: 0 3px 0 var(--gold-d); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--glass); backdrop-filter: blur(8px); display: grid; place-items: center; color: #fff; }
.icon-btn.small { width: 38px; height: 38px; }
.icon-btn svg { width: 22px; height: 22px; }

.event-bar { position: absolute; top: calc(var(--safe-t) + 70px); left: 50%; translate: -50% 0; background: linear-gradient(90deg, #ff9f1c, #ff4d6d); color: #fff; border-radius: 999px; padding: 4px 18px; font-weight: 700; font-size: 15px; display: none; align-items: center; gap: 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); white-space: nowrap; }
.event-bar.on { display: flex; }
.event-bar b { background: rgba(0, 0, 0, .2); border-radius: 999px; padding: 0 8px; }

/* ---------- mission card ---------- */
.mission { position: absolute; left: 12px; top: calc(var(--safe-t) + 70px); width: 290px; background: var(--panel); border-radius: 18px; padding: 10px 14px 12px; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); }
.mission .m-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .8px; }
.mission .m-title { font-size: 18px; font-weight: 800; line-height: 1.1; margin: 2px 0; }
.mission .m-goal { font-size: 15px; line-height: 1.2; color: var(--ink); }
.mission .m-bar { height: 10px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin: 7px 0 8px; }
.mission .m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #6ee7a8); border-radius: 99px; transition: width .3s; }
.mission .m-row { display: flex; gap: 8px; align-items: center; }
.mission .m-num { font-size: 13px; color: var(--soft); flex: 1; }
.mission.done { box-shadow: 0 0 0 3px var(--gold), 0 6px 0 rgba(0, 0, 0, .18); animation: glow 1s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 6px rgba(255, 201, 60, .5), 0 6px 0 rgba(0, 0, 0, .18); } }
.mission.min .m-goal, .mission.min .m-bar, .mission.min .m-row { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--green); color: #fff; font-weight: 800; font-size: 16px; padding: 8px 16px; border-radius: 14px; box-shadow: 0 4px 0 var(--green-d); transition: transform .08s; line-height: 1.1; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-d); }
.btn.dark { background: var(--ink); box-shadow: 0 4px 0 #000; }
.btn.ghost { background: #eef1f5; color: var(--ink); box-shadow: 0 4px 0 #d3d9e2; }
.btn.red { background: var(--red); box-shadow: 0 4px 0 #b3282a; }
.btn.purple { background: #8e44ad; box-shadow: 0 4px 0 #5e2d73; }
.btn[disabled], .btn.off { background: #cfd5de; color: #8a94a6; box-shadow: 0 4px 0 #b6bfcc; cursor: default; }
.btn.small { font-size: 14px; padding: 5px 12px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn .sub { display: block; font-size: 12px; font-weight: 600; opacity: .9; }
.btn.col { flex-direction: column; gap: 0; }

/* ---------- business bar ---------- */
.bizbar { position: absolute; bottom: calc(var(--safe-b) + 84px); left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 8px; }
.biz-title { background: var(--glass); backdrop-filter: blur(8px); color: #fff; border-radius: 16px; padding: 3px 18px 5px; text-align: center; line-height: 1.1; min-width: 200px; }
.biz-title b { display: block; font-size: 18px; }
.biz-title span { font-size: 14px; color: #7dffb8; font-weight: 700; }

/* ---------- bottom nav ---------- */
.nav { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 10px); translate: -50% 0; display: flex; gap: 4px; background: var(--panel); padding: 5px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 12px 2px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--soft); min-width: 66px; position: relative; }
.nav button .ico svg { width: 26px; height: 26px; }
.nav button.on { background: var(--ink); color: #fff; }
.nav button .dot { position: absolute; top: 2px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }
.nav button.tip-pulse::after { bottom: auto; top: -38px; transform: rotate(180deg); }

/* ---------- sheets and modals ---------- */
.sheet { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 20, 30, 0.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet.on { opacity: 1; pointer-events: auto; }
.sheet-card { position: relative; width: min(560px, 100%); max-height: 78vh; overflow: auto; background: #fff; border-radius: 26px 26px 0 0; padding: 18px 18px calc(var(--safe-b) + 18px); transform: translateY(40px); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); touch-action: pan-y; }
.sheet.on .sheet-card { transform: none; }
.close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: #eef1f5; display: grid; place-items: center; z-index: 2; }
.close svg { width: 18px; height: 18px; }
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 20, 30, 0.55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; padding: 16px; }
.modal.on { opacity: 1; pointer-events: auto; }
.modal-card { width: min(440px, 100%); max-height: 88vh; overflow: auto; background: #fff; border-radius: 26px; padding: 22px 20px; text-align: center; transform: scale(.9); transition: transform .3s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 10px 0 rgba(0, 0, 0, .2); touch-action: pan-y; }
.modal.on .modal-card { transform: none; }
.modal h2, .sheet h2 { margin: 0 0 2px; font-size: 26px; line-height: 1.1; }
.modal p, .sheet p { margin: 4px 0 12px; color: var(--soft); font-size: 16px; line-height: 1.3; }
.big-num { font-size: 38px; font-weight: 800; color: var(--green-d); line-height: 1.1; margin: 6px 0; }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.st-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; padding-right: 40px; }
.st-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
.st-icon svg { width: 34px; height: 34px; }
.st-head h2 { font-size: 24px; }
.st-head .lv { font-size: 15px; color: var(--soft); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.stat { background: #f5f7fa; border-radius: 14px; padding: 6px 10px; }
.stat .k { font-size: 12px; color: var(--soft); font-weight: 600; }
.stat .v { font-size: 18px; font-weight: 800; line-height: 1.1; }
.stat .d { font-size: 12px; color: var(--green-d); font-weight: 700; }
.milestone { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--soft); margin-bottom: 12px; }
.milestone .m-bar { flex: 1; height: 10px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.milestone .m-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffe08a); }
.warn { background: #fff1f0; color: #b3282a; border-radius: 12px; padding: 6px 10px; font-size: 14px; font-weight: 600; margin-bottom: 10px; text-align: left; }
.good { background: #e8fff3; color: var(--green-d); border-radius: 12px; padding: 6px 10px; font-size: 14px; font-weight: 600; margin-bottom: 10px; text-align: left; }
.buy-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.buy-row .btn { flex-direction: column; padding: 8px 6px; gap: 0; }

.list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: #f5f7fa; border-radius: 16px; padding: 8px 10px; text-align: left; }
.item .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.item .ic svg { width: 26px; height: 26px; }
.item .tx { flex: 1; min-width: 0; line-height: 1.15; }
.item .tx b { display: block; font-size: 16px; }
.item .tx span { font-size: 13px; color: var(--soft); }
.item.locked { opacity: .55; }
.item.owned { background: #e8fff3; }
.item.you { background: #fff5d6; box-shadow: inset 0 0 0 2px var(--gold); }
.tabs { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.tabs button { padding: 4px 14px; border-radius: 999px; background: #eef1f5; font-weight: 700; font-size: 14px; }
.tabs button.on { background: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.card { background: #f5f7fa; border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.card .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; }
.card .ic svg { width: 36px; height: 36px; }
.card b { font-size: 15px; line-height: 1.1; }
.card span { font-size: 12px; color: var(--soft); }
.card.owned { background: #e8fff3; }
.rank { font-weight: 800; width: 34px; text-align: center; font-size: 18px; color: var(--soft); }
.section { font-size: 13px; font-weight: 800; color: var(--soft); text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 0; text-align: left; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line); font-weight: 600; gap: 10px; }
.toggle { width: 54px; height: 30px; border-radius: 99px; background: #cfd5de; position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { left: 27px; }
.seg { display: flex; gap: 4px; }
.seg button { padding: 3px 10px; border-radius: 10px; background: #eef1f5; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- creator ---------- */
.creator { display: grid; grid-template-columns: 150px 1fr; gap: 14px; text-align: left; align-items: start; }
.creator .preview { width: 150px; height: 160px; border-radius: 24px; background: linear-gradient(160deg, #ffe08a, #ffb84d); overflow: hidden; }
.creator input { width: 100%; font-family: inherit; font-size: 20px; font-weight: 700; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line); outline: none; color: var(--ink); user-select: text; -webkit-user-select: text; }
.creator input:focus { border-color: var(--green); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1); }
.swatches button.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.swatches.text button { width: auto; height: auto; border-radius: 10px; padding: 2px 10px; background: #eef1f5; font-weight: 700; font-size: 13px; box-shadow: none; }
.swatches.text button.on { background: var(--ink); color: #fff; }
.lbl { font-size: 13px; font-weight: 800; color: var(--soft); text-transform: uppercase; letter-spacing: .8px; }

/* ---------- story ---------- */
.story { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: flex-end; z-index: 20; cursor: pointer; }
.story.on { display: flex; }
.story-bg { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 42, 34, .35), rgba(14, 42, 34, .92)); backdrop-filter: blur(2px); }
.story-chapter { position: absolute; top: calc(var(--safe-t) + 18px); left: 0; right: 0; text-align: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.story-stage { position: relative; height: min(46vh, 380px); display: flex; justify-content: space-between; align-items: flex-end; padding: 0 4vw; pointer-events: none; }
.portrait { width: min(36vw, 300px); aspect-ratio: 200/210; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), opacity .3s, filter .3s; filter: drop-shadow(0 12px 0 rgba(0, 0, 0, .25)); opacity: 0; transform: translateY(30px); }
.portrait.on { opacity: 1; transform: none; }
.portrait.dim { filter: brightness(.55) drop-shadow(0 12px 0 rgba(0, 0, 0, .25)); transform: scale(.92); }
.portrait.right svg { transform: scaleX(-1); }
.story-box { position: relative; margin: 0 auto calc(var(--safe-b) + 18px); width: min(760px, 94vw); background: #fff; border-radius: 24px; padding: 22px 22px 14px; min-height: 130px; box-shadow: 0 8px 0 rgba(0, 0, 0, .25); }
.story-name { position: absolute; top: -18px; left: 22px; background: var(--gold); color: var(--ink); font-weight: 800; padding: 2px 16px; border-radius: 12px; font-size: 18px; box-shadow: 0 3px 0 var(--gold-d); }
.story-name:empty { display: none; }
.story-name small { font-weight: 600; font-size: 13px; opacity: .8; margin-left: 6px; }
.story-text { font-size: 21px; line-height: 1.35; font-weight: 600; min-height: 58px; }
.story-text.narr { font-style: italic; color: var(--soft); }
.story-next { text-align: right; font-size: 13px; color: var(--soft); font-weight: 700; margin-top: 4px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.story-skip { position: absolute; right: 14px; top: calc(var(--safe-t) + 12px); background: rgba(255, 255, 255, .2); color: #fff; font-weight: 700; border-radius: 999px; padding: 4px 16px; z-index: 2; }

.title-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(14, 42, 34, .85), rgba(5, 15, 12, .97)); color: #fff; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .6s; text-align: center; padding: 20px; }
.title-card.on { opacity: 1; pointer-events: auto; }
.t-act { font-size: 20px; letter-spacing: 8px; color: var(--gold); font-weight: 700; }
.t-name { font-size: clamp(40px, 9vw, 84px); font-weight: 800; line-height: 1; margin: 6px 0; }
.t-place { font-size: 20px; opacity: .8; }

.toasts { position: absolute; top: calc(var(--safe-t) + 110px); left: 50%; translate: -50% 0; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 40; }
.toast { background: var(--ink); color: #fff; border-radius: 16px; padding: 8px 18px; font-weight: 700; font-size: 16px; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); animation: toast 3.4s forwards; text-align: center; max-width: 90vw; }
.toast.gold { background: var(--gold); color: var(--ink); }
.toast.green { background: var(--green); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px) scale(.9); } 8% { opacity: 1; transform: none; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------- auction ---------- */
.auction-face { width: 110px; height: 116px; margin: 0 auto; }
.bubble { background: #f5f7fa; border-radius: 16px; padding: 8px 12px; font-weight: 700; margin: 6px auto 10px; max-width: 320px; position: relative; }
.timer { height: 10px; border-radius: 99px; background: #eef1f5; overflow: hidden; margin: 8px 0 12px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }


.loading { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, #145c45, #0b231c); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 50; color: #fff; transition: opacity .6s; }
.loading.done { opacity: 0; pointer-events: none; }
.logo { font-size: clamp(44px, 10vw, 80px); font-weight: 800; line-height: .9; text-align: center; }
.logo span { display: block; color: var(--gold); }
.load-bar { width: 220px; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 30%; background: var(--gold); animation: load 1.2s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.load-note { opacity: .7; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .mission { width: auto; right: 12px; top: calc(var(--safe-t) + 66px); padding: 8px 12px 10px; }
  .money { min-width: 0; padding: 2px 12px 3px; }
  .cash { font-size: 22px; }
  .me-text { display: none; }
  .me { padding: 3px; }
  .nav button { min-width: 56px; padding: 4px 6px 2px; font-size: 11px; }
  .bizbar { bottom: calc(var(--safe-b) + 80px); }
  .story-text { font-size: 18px; }
  .creator { grid-template-columns: 1fr; justify-items: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 560px) {
  .mission.auto-min .m-goal, .mission.auto-min .m-bar { display: none; }
}

/* ---------- gold, clock, side buttons ---------- */
.gold-chip { display: flex; align-items: center; gap: 4px; background: var(--glass); color: #ffe08a; box-shadow: none; backdrop-filter: blur(8px); padding: 5px 12px 5px 8px; }
.gold-chip svg { width: 22px; height: 22px; }
.clock-chip { display: flex; align-items: center; gap: 4px; background: var(--glass); color: #fff; box-shadow: none; backdrop-filter: blur(8px); font-variant-numeric: tabular-nums; }
.clock-chip svg { width: 18px; height: 18px; }
.clock-chip.night { color: #c5cbff; }
.side { position: absolute; right: 12px; top: calc(var(--safe-t) + 74px); display: flex; flex-direction: column; gap: 10px; }
.side-btn { position: relative; width: 62px; height: 62px; border-radius: 18px; background: var(--panel); box-shadow: 0 5px 0 rgba(0, 0, 0, .2); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink); }
.side-btn .ico svg { width: 30px; height: 30px; }
.side-btn .lbl { font-size: 11px; font-weight: 800; line-height: 1; margin-top: 1px; }
.side-btn .count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; box-shadow: 0 0 0 2px #fff; }
.side-btn.ready { background: var(--gold); animation: vip .7s infinite alternate; }
#phoneBtn { color: #0a7a4b; }
#tasksBtn { color: #1e5bb8; }

/* ---------- business badges: rooms, breakdowns ---------- */
.badge.room { background: rgba(20, 33, 61, 0.8); }
.badge.room.locked { background: rgba(40, 40, 48, 0.88); color: #e8e8e8; }
.badge.room.can { background: var(--green); }
.badge.room.building { background: #e17055; }
.badge.room.short { background: var(--red); outline: 3px solid #fff; animation: neck 0.8s infinite; }
.badge.room.short::before { content: 'LOW POWER'; position: absolute; top: -18px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #fff; background: var(--red); border-radius: 8px; padding: 0 6px; }
.badge.broken { flex-direction: row; gap: 6px; background: #ff6b35; padding: 4px 12px 4px 8px; animation: vip .45s infinite alternate; }
.badge.broken svg { width: 22px; height: 22px; }
.badge.broken span { display: flex; flex-direction: column; align-items: flex-start; }
.stars { color: #ffc93c; font-size: 15px; display: inline-flex; gap: 1px; vertical-align: middle; }
.stars span { display: inline-flex; color: #ffc93c; }
.stars svg { display: inline-block; width: 1em; height: 1em; }
.stars span.off { color: rgba(255, 255, 255, .3); }
.biz-title { cursor: pointer; position: relative; }
#bizStars { display: block; line-height: 1; margin: 1px 0; }
#bizStars .stars span { font-size: 15px; }
.biz-title .manage { display: block; font-size: 11px; color: #fff; opacity: .75; font-weight: 700; letter-spacing: .5px; }

/* ---------- manage sheet ---------- */
.rating-big { display: flex; align-items: center; gap: 12px; background: #fff8e1; border-radius: 16px; padding: 8px 12px; margin: 6px 0 4px; text-align: left; }
.rating-big .num { font-size: 34px; font-weight: 800; line-height: 1; }
.rating-big .stars { font-size: 22px; }
.rating-big .stars span.off { color: #e3d9b9; }
.rating-big small { display: block; color: var(--soft); font-size: 13px; font-weight: 600; line-height: 1.2; }
.why { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.why span { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #e8fff3; color: var(--green-d); }
.why span.bad { background: #fff1f0; color: #b3282a; }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0; }
.tier { background: #f5f7fa; border-radius: 14px; padding: 6px 4px; text-align: center; line-height: 1.1; border: 3px solid transparent; }
.tier b { display: block; font-size: 15px; }
.tier span { font-size: 11px; color: var(--soft); font-weight: 600; display: block; }
.tier.on { border-color: var(--green); background: #e8fff3; }
.tier.locked { opacity: .5; }
.tier .best { display: block; font-size: 10px; font-weight: 800; color: #fff; background: var(--gold-d); border-radius: 8px; margin: 3px auto 0; width: max-content; padding: 0 6px; }
.fx-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.fx { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; background: #f5f7fa; border-radius: 12px; padding: 5px 10px; text-align: left; }
.fx b { margin-left: auto; font-size: 13px; color: var(--soft); white-space: nowrap; }
.fx.good { background: #e8fff3; color: var(--green-d); }
.fx.bad { background: #fff1f0; color: #b3282a; }
.prog { height: 8px; border-radius: 99px; background: #e3e8ef; overflow: hidden; margin-top: 4px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #6ee7a8); border-radius: 99px; }
.prog.orange i { background: linear-gradient(90deg, #e17055, #fdcb6e); }
.room-row .ic { position: relative; }

/* ---------- tasks ---------- */
.task { background: #f5f7fa; border-radius: 16px; padding: 10px 12px; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.task.done { background: #fff8e1; box-shadow: inset 0 0 0 2px var(--gold); }
.task .t-text { font-weight: 700; font-size: 15px; line-height: 1.2; }
.task .t-rew { font-size: 13px; color: var(--green-d); font-weight: 700; display: flex; gap: 10px; align-items: center; }
.task .t-btns { grid-row: span 2; display: flex; flex-direction: column; gap: 6px; }
.chest-row { display: flex; align-items: center; gap: 10px; background: #fff8e1; border-radius: 16px; padding: 8px 12px; margin: 6px 0 10px; text-align: left; font-weight: 700; font-size: 14px; }
.chest-row > svg { width: 34px; height: 34px; color: #b7860b; flex: none; }
.chest-row > div { flex: 1; }
.chest-row .prog i { background: linear-gradient(90deg, var(--gold), #ffe08a); }
.gold-num { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: #b7860b; }
.gold-num svg { width: 18px; height: 18px; }

/* ---------- decisions ---------- */
.decision .who { width: 104px; height: 110px; margin: 0 auto 4px; border-radius: 22px; background: linear-gradient(160deg, #dff9ec, #9ee6c3); overflow: hidden; }
.decision .where { font-size: 13px; font-weight: 800; color: var(--soft); text-transform: uppercase; letter-spacing: 1px; }
.decision .quote { font-size: 17px; font-weight: 600; color: var(--ink); background: #f5f7fa; border-radius: 16px; padding: 10px 14px; margin: 8px 0 12px; }
.decision .choices { display: flex; flex-direction: column; gap: 10px; }
.decision .choices .btn { width: 100%; }
.decision .outcome { font-size: 18px; font-weight: 700; color: var(--green-d); background: #e8fff3; border-radius: 16px; padding: 12px; margin: 10px 0; }

/* ---------- daily ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 10px 0 14px; }
.day { background: #f5f7fa; border-radius: 12px; padding: 6px 2px; font-size: 11px; font-weight: 800; color: var(--soft); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day svg { width: 20px; height: 20px; }
.day.got { background: #e8fff3; color: var(--green-d); }
.day.today { background: var(--gold); color: var(--ink); transform: scale(1.08); box-shadow: 0 3px 0 var(--gold-d); }

/* ---------- the phone ---------- */
.phone-wrap { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(5, 12, 18, .6); opacity: 0; pointer-events: none; transition: opacity .2s; padding: 12px; }
.phone-wrap.on { opacity: 1; pointer-events: auto; }
.phone { width: min(380px, 100%); height: min(720px, calc(100vh - 24px)); background: #f0f2f5; border-radius: 40px; border: 10px solid #5b6fd6; box-shadow: 0 0 0 3px #3b4ba8, 0 18px 0 rgba(0, 0, 0, .3); display: flex; flex-direction: column; overflow: hidden; transform: translateY(40px) scale(.96); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); position: relative; }
.phone-wrap.on .phone { transform: none; }
.ph-status { display: flex; justify-content: space-between; align-items: center; padding: 8px 22px 2px; font-size: 14px; font-weight: 800; background: #fff; }
.ph-bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.ph-bars i { display: block; width: 3px; background: var(--ink); border-radius: 1px; }
.ph-bars i:nth-child(1) { height: 4px; } .ph-bars i:nth-child(2) { height: 6px; } .ph-bars i:nth-child(3) { height: 9px; } .ph-bars i:nth-child(4) { height: 12px; }
.ph-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.ph-head b { flex: 1; text-align: center; font-size: 18px; }
.ph-back, .ph-close { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; }
.ph-back svg, .ph-close svg { width: 18px; height: 18px; }
.ph-back.hide { visibility: hidden; }
.ph-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }
.ph-foot { background: #e4e7ec; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 6px; }
.ph-foot:empty { display: none; }
.ph-home { height: 18px; display: grid; place-items: center; background: #e4e7ec; }
.ph-home::after { content: ''; width: 110px; height: 5px; border-radius: 3px; background: #2d3436; }
.contact { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 10px; text-align: left; width: 100%; flex: none; }
.contact .av { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; flex: none; background: linear-gradient(160deg, #a5f3d0, #4fd1c5); }
.contact .tx { flex: 1; min-width: 0; line-height: 1.2; }
.contact .tx b { display: block; font-size: 15px; }
.contact .tx span { display: block; font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact .unread { width: 12px; height: 12px; border-radius: 50%; background: var(--red); flex: none; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; flex: none; }
.msg.new { animation: msgIn .25s ease-out; }
.msg .av { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex: none; background: linear-gradient(160deg, #a5f3d0, #4fd1c5); }
.msg .bub { background: #fff; border-radius: 4px 16px 16px 16px; padding: 8px 12px; font-size: 15px; font-weight: 600; line-height: 1.3; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); text-align: left; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bub { background: #7bd96a; border-radius: 16px 4px 16px 16px; }
.msg.mine .av { background: linear-gradient(160deg, #ffe08a, #ffb84d); }
.typing .bub { display: flex; gap: 4px; padding: 12px 14px; }
.typing .bub i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b4; animation: blink 1s infinite; }
.typing .bub i:nth-child(2) { animation-delay: .2s; } .typing .bub i:nth-child(3) { animation-delay: .4s; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.envelope { align-self: flex-start; margin-left: 44px; width: 220px; border-radius: 12px; overflow: hidden; background: #f39c6b; color: #fff; text-align: left; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); flex: none; }
.envelope .e-top { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-weight: 700; font-size: 14px; line-height: 1.2; }
.envelope .e-top svg { width: 30px; height: 30px; flex: none; }
.envelope .e-bot { background: #fff; color: var(--soft); font-size: 12px; font-weight: 700; padding: 3px 12px; }
.envelope.open { background: #f7c6a8; cursor: default; }
.sysline { align-self: center; font-size: 13px; font-weight: 700; color: var(--soft); text-align: center; flex: none; }
.sysline b { color: #e17055; }
.reply { background: #fff; border-radius: 14px; padding: 9px 12px; font-size: 15px; font-weight: 700; text-align: left; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); display: flex; gap: 8px; align-items: center; }
.reply::after { content: 'Send'; margin-left: auto; background: #3b6fe0; color: #fff; border-radius: 10px; padding: 3px 12px; font-size: 13px; flex: none; }
.empty-note { text-align: center; color: var(--soft); font-weight: 600; margin-top: 30px; }

@media (max-width: 720px) {
  .side { top: calc(var(--safe-t) + 168px); right: 8px; }
  .side-btn { width: 54px; height: 54px; border-radius: 16px; }
  .side-btn .ico svg { width: 26px; height: 26px; }
  .clock-chip { display: none; }
  .gold-chip { padding: 4px 8px 4px 6px; font-size: 14px; }
  .hud-right { gap: 5px; }
  .tiers { grid-template-columns: repeat(2, 1fr); }
  .phone { border-width: 7px; border-radius: 30px; }
}
.item.founder { background: linear-gradient(90deg, #fff3c4, #ffe08a); box-shadow: inset 0 0 0 2px var(--gold-d); }
.item.founder .rank { color: var(--gold-d); }
@media (max-width: 720px) {
  .mission { right: 72px; top: calc(var(--safe-t) + 62px); padding: 6px 10px 8px; border-radius: 14px; }
  .mission .m-top { font-size: 10px; }
  .mission .m-title { font-size: 15px; }
  .mission .m-goal { font-size: 13px; }
  .mission .m-bar { height: 7px; margin: 4px 0 5px; }
  .mission .m-num { font-size: 12px; }
  .mission .btn.small { padding: 3px 10px; font-size: 13px; }
  .side { top: calc(var(--safe-t) + 62px); gap: 8px; }
  .side-btn { width: 52px; height: 52px; border-radius: 15px; }
  .side-btn .ico svg { width: 24px; height: 24px; }
  .side-btn .lbl { font-size: 10px; }
}
@media (max-width: 720px) {
  .mission .m-top { display: none; }
  .mission .m-title { font-size: 14px; }
  .mission .m-bar { margin: 3px 0 4px; }
  .badge.district { padding: 2px 9px 3px; }
  .badge.district .b-name { font-size: 13px; }
  .badge.district .b-lvl { font-size: 10px; }
}
