/* POCKET METROPOLIS */
:root {
  --bg: #0f1a2b; --panel: rgba(14, 22, 34, .93); --panel2: rgba(24, 35, 52, .96); --line: rgba(255, 255, 255, .09); --line2: rgba(255, 255, 255, .16);
  --text: #e9eef5; --mut: #8fa0b5; --gold: #ffb43a; --gold2: #f08a1c; --red: #e8574f; --green: #46c98b; --blue: #4aa8ff; --warn: #f0a53a; --purple: #a98aea;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --display: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
body { -webkit-touch-callout: none; }
.hidden { display: none !important; }
svg { display: block; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; outline: none; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5, 10, 22, .45) 100%); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line2); font-weight: 600; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { background: rgba(255, 255, 255, .14); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, #f6cf6a, #d9a52e); color: #2a1d05; border-color: #f6d780; text-shadow: 0 1px 0 rgba(255, 255, 255, .3); box-shadow: 0 4px 18px rgba(217, 165, 46, .35); }
.btn.primary:hover { background: linear-gradient(180deg, #fbd978, #e4b13a); }
.btn.ghost { background: rgba(255, 255, 255, .04); }
.btn.big { padding: 14px 26px; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; min-width: 240px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: rgba(232, 87, 79, .18); border-color: rgba(232, 87, 79, .5); color: #ffb3ae; }
.btn:disabled { opacity: .45; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); transition: background .15s, transform .08s; }
.iconbtn:hover { background: var(--panel2); }
.iconbtn:active { transform: scale(.93); }
.iconbtn.on { background: var(--gold); color: #2a1d05; border-color: #f6d780; }
.iconbtn svg { width: 22px; height: 22px; }

/* ---------- main menu (left-aligned list over the live city, like a tycoon game) ---------- */
.screen { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; }
#scr-main { justify-content: flex-start; align-items: stretch; }
.menu-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 14, 28, .94) 0%, rgba(8, 14, 28, .78) 28%, rgba(8, 14, 28, .25) 58%, rgba(8, 14, 28, 0) 80%), linear-gradient(0deg, rgba(8, 14, 28, .55), transparent 28%); pointer-events: none; }
.menu-left { position: relative; width: min(470px, 100%); padding: calc(34px + var(--sat)) 30px 40px calc(34px + var(--sal)); display: flex; flex-direction: column; justify-content: center; animation: slidein .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes slidein { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.logo { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.logo-mark { width: 74px; flex: none; filter: drop-shadow(0 6px 14px rgba(240, 138, 28, .45)); }
.title { margin: 0; font-family: var(--display); font-weight: 900; line-height: .95; letter-spacing: .01em; font-size: clamp(34px, 6.4vw, 58px); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 8px 26px rgba(0, 0, 0, .5); }
.title span { display: block; }
.title span:nth-child(2) { color: var(--gold); font-size: .72em; letter-spacing: .05em; }
.tag { margin: 6px 0 28px; color: #b8c6da; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.menu-list { display: flex; flex-direction: column; gap: 7px; max-width: 340px; }
.mi { position: relative; text-align: left; padding: 15px 22px 15px 24px; border-radius: 6px; background: rgba(22, 34, 54, .82); border: 1px solid rgba(255, 255, 255, .09); font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .02em; color: #e8eef6; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .15s, transform .12s, padding .12s; overflow: hidden; }
.mi .mi-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gold); transform: scaleY(0); transform-origin: center; transition: transform .15s; }
.mi:hover, .mi:focus-visible { background: rgba(40, 58, 88, .92); padding-left: 30px; outline: none; }
.mi:hover .mi-bar, .mi:focus-visible .mi-bar { transform: scaleY(1); }
.mi:active { transform: scale(.985); }
.mi#btn-play, .mi#btn-continue { background: rgba(255, 180, 58, .94); color: #2a1a05; border-color: rgba(255, 220, 140, .6); }
.mi#btn-continue:not(.hidden) + #btn-play { background: rgba(22, 34, 54, .82); color: #e8eef6; border-color: rgba(255, 255, 255, .09); }
.mi#btn-play:hover, .mi#btn-continue:hover { background: #ffc35c; }
.mi#btn-continue:not(.hidden) + #btn-play:hover { background: rgba(40, 58, 88, .92); }
.mi#btn-play .mi-bar, .mi#btn-continue .mi-bar { background: #2a1a05; }
.mi#btn-continue:not(.hidden) + #btn-play .mi-bar { background: var(--gold); }
.menu-foot { position: absolute; bottom: calc(14px + var(--sab)); left: calc(34px + var(--sal)); right: 14px; color: #8fa0b5; font-size: 12px; letter-spacing: .03em; opacity: .85; }
.laurel { width: 74px; margin: 0 auto 6px; }
@media (max-width: 760px) {
  .menu-shade { background: linear-gradient(0deg, rgba(8, 14, 28, .95) 0%, rgba(8, 14, 28, .78) 55%, rgba(8, 14, 28, .1) 100%); }
  #scr-main { align-items: flex-end; }
  .menu-left { width: 100%; padding: 20px 20px calc(54px + var(--sab)); justify-content: flex-end; }
  .menu-list { max-width: none; }
  .logo-mark { width: 56px; } .tag { margin-bottom: 16px; }
  .menu-foot { left: 20px; }
}
/* ---------- world setup ---------- */
#scr-world { background: linear-gradient(180deg, rgba(6, 11, 22, .86), rgba(6, 11, 22, .93)); align-items: stretch; justify-content: center; padding: calc(14px + var(--sat)) calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); overflow: hidden; }
.ws { display: grid; grid-template-columns: minmax(280px, 440px) minmax(320px, 560px); grid-template-rows: minmax(0, 1fr); gap: 18px; max-width: 1060px; width: 100%; margin: auto; height: 100%; max-height: 800px; justify-content: center; }
.ws-left { overflow-y: auto; scrollbar-width: none; }
.ws > * { min-width: 0; }
.seg { min-width: 0; } .seg button { min-width: 0; padding-left: 2px; padding-right: 2px; }
.ws-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ws-head { font-family: var(--display); font-weight: 800; letter-spacing: .1em; font-size: 22px; margin: 0; }
.ws-head small { display: block; font-family: system-ui; font-weight: 500; letter-spacing: .02em; color: var(--mut); font-size: 13px; margin-top: 2px; }
.prev-wrap { position: relative; background: #0a1220; border: 1px solid var(--line2); border-radius: 14px; padding: 10px; aspect-ratio: 1; max-height: 56vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.prev-wrap canvas { width: 100%; height: 100%; image-rendering: pixelated; border-radius: 8px; object-fit: contain; }
.prev-wrap .busy { position: absolute; inset: 0; background: rgba(8, 14, 26, .55); display: flex; align-items: center; justify-content: center; color: var(--gold); font-weight: 700; letter-spacing: .15em; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.prev-wrap.busy .busy { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--mut); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.wstats { font-size: 12.5px; color: var(--mut); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wstats div { background: rgba(255, 255, 255, .05); border-radius: 8px; padding: 6px 8px; }
.wstats b { display: block; color: var(--text); font-size: 15px; }
.ws-right { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; overflow: hidden; }
.ws-scroll { overflow-y: auto; padding: 14px 16px 6px; flex: 1; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.ws-actions { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel2); }
.ws-actions .btn { flex: 1; }
.ws-actions .btn.primary { flex: 2; }
.sec { margin: 0 0 16px; }
.sec h3 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.row label { flex: 0 0 118px; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.row .ctl { flex: 1; min-width: 0; }
.row .val { flex: 0 0 38px; text-align: right; color: var(--mut); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
input[type=text] { width: 100%; background: rgba(255, 255, 255, .07); border: 1px solid var(--line2); color: var(--text); padding: 9px 11px; border-radius: 9px; font: inherit; user-select: text; -webkit-user-select: text; }
input[type=text]:focus { outline: 2px solid rgba(242, 193, 78, .5); }
input[type=range] { width: 100%; accent-color: var(--gold); height: 28px; margin: 0; touch-action: pan-y; }
.seg { display: flex; background: rgba(255, 255, 255, .06); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 7px 4px; border-radius: 7px; font-size: 12.5px; color: var(--mut); font-weight: 600; transition: background .12s, color .12s; white-space: nowrap; }
.seg button.on { background: var(--gold); color: #2a1d05; }
.seg button:not(.on):hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.types button { text-align: left; padding: 8px 10px; background: rgba(255, 255, 255, .05); border: 1px solid transparent; border-radius: 10px; }
.types button b { display: block; font-size: 13px; }
.types button span { font-size: 11px; color: var(--mut); line-height: 1.2; display: block; }
.types button.on { border-color: var(--gold); background: rgba(242, 193, 78, .12); }
.seedrow { display: flex; gap: 8px; min-width: 0; }
.seedrow input { min-width: 0; flex: 1; }
.seedrow .btn { flex: none; }
.seedrow .btn { padding: 0 12px; }
.toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: rgba(255, 255, 255, .05); border-radius: 10px; text-align: left; }
.toggle .sw { width: 38px; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .15); position: relative; flex: none; transition: background .15s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle.on .sw { background: var(--green); }
.toggle.on .sw::after { transform: translateX(16px); }
.toggle small { display: block; color: var(--mut); font-size: 11.5px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#topbar { position: absolute; top: 0; left: 0; right: 0; padding: calc(8px + var(--sat)) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.tb { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 10px; border-radius: var(--r); min-height: 48px; text-align: left; }
button.tb:hover { background: var(--panel2); border-color: var(--line2); }
.tb .ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.tb .ic svg { width: 18px; height: 18px; }
.tb .lab { font-size: 10.5px; letter-spacing: .12em; color: var(--mut); text-transform: uppercase; font-weight: 700; line-height: 1; }
.tb .num { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tb .sub { font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pos { color: var(--green) !important; } .neg { color: var(--red) !important; } .warn { color: var(--warn) !important; }
#tb-citizen { display: flex; gap: 4px; padding: 5px 6px; border-radius: var(--r); align-items: stretch; }
.chip { display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 6px; border-radius: 9px; text-align: left; min-width: 0; }
.chip:hover { background: rgba(255, 255, 255, .08); }
.chip .ring { width: 32px; height: 32px; flex: none; position: relative; }
.chip .ring svg { width: 32px; height: 32px; }
.chip .ring .ic2 { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.chip .ring .ic2 svg { width: 15px; height: 15px; }
.chip .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chip .l { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); font-weight: 700; line-height: 1; }
.chip.alert { background: rgba(232, 87, 79, .16); }
.chip.alert .v { color: #ff9a93; }
.chip.alert.s2 { background: rgba(240, 165, 58, .16); } .chip.alert.s2 .v { color: #ffc57a; }
#tb-time { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: var(--r); }
#tb-time .date { font-weight: 700; font-size: 14px; line-height: 1.1; }
#tb-time .clock { font-size: 11px; color: var(--mut); display: flex; align-items: center; gap: 5px; }
.speed { display: flex; background: rgba(255, 255, 255, .06); border-radius: 9px; padding: 2px; }
.speed button { width: 34px; height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--mut); }
.speed button svg { width: 16px; height: 16px; }
.speed button.on { background: var(--gold); color: #2a1d05; }
.rci { display: flex; gap: 3px; align-items: flex-end; height: 34px; padding: 0 4px; }
.rci div { width: 9px; height: 100%; background: rgba(255, 255, 255, .08); border-radius: 3px; position: relative; overflow: hidden; }
.rci i { position: absolute; left: 0; right: 0; bottom: 50%; background: currentColor; transition: height .4s, bottom .4s; }
.rci .r { color: #46c98b; } .rci .c { color: #4aa8ff; } .rci .i { color: #e8b84a; }
.rci b { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, .35); }

#advisor { position: absolute; left: 50%; transform: translateX(-50%); top: calc(66px + var(--sat)); max-width: min(520px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; font-size: 13px; text-align: left; border-color: rgba(242, 193, 78, .35); }
#advisor b { color: var(--gold); letter-spacing: .08em; font-size: 10.5px; text-transform: uppercase; flex: none; }
#advisor span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#advisor .x { width: 20px; height: 20px; flex: none; opacity: .6; }

#toasts { position: absolute; left: calc(10px + var(--sal)); top: calc(118px + var(--sat)); display: flex; flex-direction: column; gap: 6px; width: min(340px, calc(100vw - 80px)); pointer-events: none !important; }
.toast { pointer-events: auto; padding: 8px 12px 8px 10px; border-radius: 10px; font-size: 13px; display: flex; gap: 9px; align-items: flex-start; animation: tin .3s ease both; border-left: 3px solid var(--blue); }
.toast.good { border-left-color: var(--green); } .toast.bad { border-left-color: var(--red); } .toast.warn { border-left-color: var(--warn); }
.toast.out { animation: tout .4s ease both; }
@keyframes tin { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes tout { to { opacity: 0; transform: translateX(-16px); } }

#side { position: absolute; right: calc(8px + var(--sar)); top: 50%; transform: translateY(-58%); display: flex; flex-direction: column; gap: 8px; }
#minimap { position: absolute; left: calc(8px + var(--sal)); bottom: calc(var(--bh, 150px) + 8px); width: 168px; height: 168px; border-radius: 12px; overflow: hidden; padding: 5px; }
#minimap canvas { width: 100%; height: 100%; border-radius: 8px; display: block; touch-action: none; }

#toolinfo { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bh, 150px) + 8px); width: min(560px, calc(100vw - 16px)); border-radius: 12px; padding: 9px 12px; display: flex; gap: 12px; align-items: center; }
#toolinfo .ti-main { flex: 1; min-width: 0; }
#toolinfo b { font-size: 14px; }
#toolinfo .d { color: var(--mut); font-size: 12.5px; line-height: 1.3; margin-top: 2px; }
#toolinfo .meta { display: flex; gap: 12px; margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
#toolinfo .meta span { color: var(--mut); } #toolinfo .meta em { font-style: normal; color: var(--text); font-weight: 600; }
#confirm { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--bh, 150px) + 84px); display: flex; gap: 10px; }
#confirm .btn { padding: 12px 22px; font-size: 15px; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }
#cost-tip { position: absolute; transform: translate(-50%, -140%); padding: 4px 9px; border-radius: 8px; background: rgba(10, 16, 28, .92); border: 1px solid var(--line2); font-weight: 700; font-size: 13px; pointer-events: none !important; white-space: nowrap; }

#bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 calc(8px + var(--sar)) calc(6px + var(--sab)) calc(8px + var(--sal)); }
#build { border-radius: 16px 16px 12px 12px; overflow: hidden; }
#cats { display: flex; gap: 2px; padding: 5px 5px 0; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; border-bottom: 1px solid var(--line); }
#cats::-webkit-scrollbar, #items::-webkit-scrollbar { display: none; }
#cats button { flex: 1 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px 7px; border-radius: 10px 10px 0 0; color: var(--mut); font-size: 11px; font-weight: 600; letter-spacing: .02em; position: relative; }
#cats button svg { width: 22px; height: 22px; }
#cats button.on { color: var(--gold); background: rgba(242, 193, 78, .1); }
#cats button.on::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--gold); }
#cats .collapse { flex: 0 0 38px; min-width: 38px; padding: 0; justify-content: center; }
#items { display: flex; gap: 7px; padding: 9px 9px 10px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.card { flex: 0 0 auto; width: 92px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid transparent; padding: 5px 4px 6px; text-align: center; position: relative; transition: background .12s, border-color .12s, transform .08s; }
.card:hover { background: rgba(255, 255, 255, .1); }
.card:active { transform: scale(.96); }
.card.on { border-color: var(--gold); background: rgba(242, 193, 78, .14); }
.card canvas { width: 64px; height: 56px; display: block; margin: 0 auto; }
.card .n { font-size: 11.5px; font-weight: 600; line-height: 1.15; height: 27px; display: flex; align-items: center; justify-content: center; }
.card .p { font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 700; }
.card.locked { opacity: .5; }
.card.locked .p { color: var(--mut); }
.card.poor .p { color: var(--red); }
.card .lock { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; color: var(--mut); }
#bottom.min #items, #bottom.min #cats button:not(.collapse) { display: none; }
#bottom.min #cats { border-bottom: 0; padding-bottom: 5px; }

/* ---------- sheets (panels) ---------- */
#modal-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(4, 8, 16, .55); pointer-events: auto; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100vw - 20px)); max-height: min(86vh, 760px); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; pointer-events: auto; animation: pop .22s cubic-bezier(.2, .9, .3, 1) both; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.sheet.narrow { width: min(460px, calc(100vw - 20px)); }
.sh-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.sh-head h2 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: .08em; flex: 1; font-weight: 800; }
.sh-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.sh-tabs button { padding: 8px 14px; border-radius: 9px 9px 0 0; color: var(--mut); font-weight: 600; position: relative; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sh-tabs button.on { color: var(--gold); background: rgba(242, 193, 78, .1); }
.sh-tabs button.on::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 3px; background: var(--gold); border-radius: 2px 2px 0 0; }
.sh-tabs .badge { background: var(--red); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 1px 6px; font-weight: 700; }
.sh-body { padding: 16px 18px 20px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; user-select: text; -webkit-user-select: text; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.box { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.box h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.box h4 svg { width: 15px; height: 15px; }
.big-n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.kv span:first-child { color: var(--mut); }
.bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 5px 0 3px; position: relative; }
.bar > i { display: block; height: 100%; border-radius: 5px; background: var(--green); transition: width .3s; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--red); } .bar.blue > i { background: var(--blue); }
.bar2 { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin: 5px 0; }
.bar2 .nm { flex: 0 0 96px; color: var(--mut); }
.bar2 .tr { flex: 1; height: 8px; background: rgba(255, 255, 255, .08); border-radius: 4px; position: relative; }
.bar2 .tr i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.bar2 .tr::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, .3); }
.bar2 .vv { flex: 0 0 46px; text-align: right; font-variant-numeric: tabular-nums; }
.prob { display: flex; gap: 12px; padding: 11px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); margin-bottom: 8px; align-items: flex-start; }
.prob .sv { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex: none; background: var(--blue); }
.prob.s2 .sv { background: var(--warn); } .prob.s3 .sv { background: var(--red); box-shadow: 0 0 10px var(--red); }
.prob .tx { flex: 1; } .prob .tx b { display: block; font-size: 14px; } .prob .tx span { color: var(--mut); font-size: 12.5px; }
.empty { text-align: center; padding: 30px 10px; color: var(--mut); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 10px; color: var(--green); }
.slider-row { display: grid; grid-template-columns: 110px 1fr 50px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.slider-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
table.led { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.led td { padding: 4px 0; border-bottom: 1px solid var(--line); } table.led td:last-child { text-align: right; }
table.led tr.t td { font-weight: 800; border-bottom: 0; padding-top: 8px; }
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layers button { padding: 12px 6px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.layers button svg { width: 24px; height: 24px; }
.layers button.on { border-color: var(--gold); background: rgba(242, 193, 78, .14); color: var(--gold); }
.goal { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); margin-bottom: 7px; align-items: flex-start; }
.goal .ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.goal.done .ck { background: var(--green); border-color: var(--green); color: #05230f; }
.goal.done { opacity: .6; } .goal.cur { border: 1px solid rgba(242, 193, 78, .45); background: rgba(242, 193, 78, .08); }
.goal .ck svg { width: 13px; height: 13px; }
.goal b { display: block; } .goal span { color: var(--mut); font-size: 12.5px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: rgba(255, 255, 255, .1); }
.pill.ok { background: rgba(70, 201, 139, .2); color: #7de7b2; } .pill.bad { background: rgba(232, 87, 79, .22); color: #ff9d97; } .pill.warn { background: rgba(240, 165, 58, .22); color: #ffc57a; }
.help h3 { margin: 18px 0 6px; font-family: var(--display); letter-spacing: .06em; color: var(--gold); font-size: 16px; }
.help h3:first-child { margin-top: 0; }
.help p, .help li { color: #c8d3e0; font-size: 13.5px; line-height: 1.5; margin: 0 0 6px; }
.help ul { padding-left: 18px; margin: 0 0 6px; }
.keys kbd { background: rgba(255, 255, 255, .12); border-radius: 5px; padding: 1px 6px; font-family: inherit; font-size: 12px; border: 1px solid var(--line2); }
.hero { text-align: center; padding: 10px 6px 4px; }
.hero h2 { font-family: var(--display); font-size: 26px; margin: 8px 0 4px; letter-spacing: .08em; color: var(--gold); }
.hero p { color: #c8d3e0; margin: 0 auto 14px; max-width: 420px; }
.hero .laurel { width: 90px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btnrow .btn { flex: 1; min-width: 120px; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); margin-bottom: 8px; font-weight: 600; font-size: 15px; }
.list-btn:hover { background: rgba(255, 255, 255, .11); }
.list-btn svg { width: 22px; height: 22px; color: var(--gold); }
.list-btn small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }

#loading { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 40%, #12202f, #070c15); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
#loading .t { font-family: var(--display); letter-spacing: .2em; color: var(--gold); font-weight: 800; }
#loading .sp { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .12); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#fps { position: fixed; right: 8px; bottom: 4px; z-index: 5; font-size: 11px; color: rgba(255, 255, 255, .6); pointer-events: none; }

/* ---------- tech tree, garage, misc additions ---------- */
.iconbtn { position: relative; }
.iconbtn:disabled { opacity: .38; pointer-events: none; }
.dot-badge { position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); border: 2px solid var(--panel); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }
.card.locked .p { color: #b9a3f0; }
.sheet.wide { width: min(1040px, calc(100vw - 20px)); max-height: min(92vh, 840px); }
.tdetail { display: flex; gap: 16px; align-items: flex-start; padding: 12px 14px; margin-bottom: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; }
.td-main { flex: 1; min-width: 0; }
.td-main h3 { margin: 0 0 4px; font-family: var(--display); font-size: 19px; font-weight: 800; }
.td-main p { margin: 0 0 8px; color: #c8d3e0; font-size: 13px; }
.rqs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.rq { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .08); font-weight: 700; }
.rq.ok { background: rgba(70, 201, 139, .2); color: #7de7b2; } .rq.no { background: rgba(232, 87, 79, .2); color: #ff9d97; }
.unl { font-size: 12.5px; color: var(--mut); }
.td-act { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 150px; }
.td-act small { color: var(--mut); font-size: 11.5px; text-align: right; max-width: 180px; }
.tree-wrap { overflow: auto; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); max-height: 50vh; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.tree { position: relative; }
.tr-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.tr-lines path { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 2; }
.tr-lines path.on { stroke: var(--green); stroke-width: 2.6; }
.tr-row { position: absolute; left: 10px; width: 92px; display: flex; align-items: center; height: 76px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.tnode { position: absolute; border-radius: 12px; padding: 9px 30px 9px 12px; text-align: left; background: rgba(40, 56, 84, .92); border: 2px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 3px; justify-content: center; overflow: hidden; transition: transform .1s, border-color .15s; }
.tnode:hover { transform: translateY(-2px); }
.tnode b { font-size: 13.5px; line-height: 1.15; } .tnode span { font-size: 11.5px; color: var(--mut); line-height: 1.2; }
.tnode.locked { opacity: .5; } .tnode.pop, .tnode.cash { opacity: .88; }
.tnode.ready { border-color: var(--gold); background: rgba(255, 180, 58, .16); animation: glow 1.6s ease-in-out infinite; }
.tnode.done { border-color: rgba(70, 201, 139, .7); background: rgba(70, 201, 139, .15); }
.tnode.sel { box-shadow: 0 0 0 3px rgba(255, 255, 255, .4); }
.tnode i { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; color: var(--green); }
.tnode i.rd { color: var(--gold); }
@keyframes glow { 50% { box-shadow: 0 0 14px rgba(255, 180, 58, .55); } }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow canvas { width: 76px; height: 48px; flex: none; }
.trow > div { flex: 1; min-width: 0; }
.trow b { display: block; font-size: 13.5px; } .trow span { display: block; color: var(--mut); font-size: 12px; line-height: 1.3; }
.trow .bar { margin: 4px 0 0; }
/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 10px; overflow-y: auto; margin: 0; align-content: start; max-height: none; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .ws-left { overflow: visible; }
  #scr-world { align-items: flex-start; }
  .ws-left { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .ws-left > .ws-head { flex: 1 1 100%; }
  .prev-wrap { flex: 0 0 min(46vw, 260px); max-height: none; padding: 6px; }
  .ws-left .side-info { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 8px; }
  .ws-right { overflow: visible; background: none; border: 0; }
  .ws-scroll { overflow: visible; padding: 0 2px; }
  .ws-actions { position: sticky; bottom: 0; border-radius: 14px; border: 1px solid var(--line2); }
  .wstats { grid-template-columns: repeat(2, 1fr); }
  #prev-mode { flex-wrap: wrap; } #prev-mode button { flex: 1 0 44%; }
}
@media (max-width: 720px) {
  .tb { padding: 5px 9px 5px 7px; min-height: 44px; gap: 7px; }
  .tb .ic { width: 26px; height: 26px; } .tb .num { font-size: 16px; }
  #tb-citizen { order: 5; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
  #tb-citizen .chip { flex: 1 0 auto; }
  #tb-time { margin-left: auto; padding-left: 8px; }
  #tb-time .clock, .rci { display: none; }
  #advisor { top: calc(112px + var(--sat)); font-size: 12px; padding: 6px 12px; }
  #toasts { top: calc(150px + var(--sat)); }
  .speed button { width: 28px; height: 32px; }
  #tb-menu { padding: 0 9px; } #topbar { gap: 6px; }
  #tb-time { padding: 4px; } #tb-time .date { display: none; }
  .toast { font-size: 12px; padding: 6px 10px; }
  #side { top: calc(178px + var(--sat)); transform: none; gap: 6px; display: grid; grid-template-columns: repeat(2, 40px); }
  #toolinfo .d { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .iconbtn { width: 40px; height: 40px; }
  #minimap { width: 128px; height: 128px; }
  .card { width: 82px; } .card canvas { width: 56px; height: 50px; }
  #cats button { min-width: 52px; padding: 5px 7px 6px; font-size: 10.5px; }
  .sheet { top: auto; bottom: 0; left: 0; transform: none; width: 100vw !important; max-height: 88vh; border-radius: 18px 18px 0 0; animation: slide .25s cubic-bezier(.2, .9, .3, 1) both; padding-bottom: var(--sab); }
  @keyframes slide { from { transform: translateY(40px); opacity: 0; } }
  .grid2 { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr 1fr; }
  .tdetail { flex-direction: column; } .td-act { align-items: stretch; min-width: 0; width: 100%; } .td-act small { text-align: left; max-width: none; }
  .tree-wrap { max-height: 46vh; } .sheet.wide { width: 100vw !important; }
  .types { grid-template-columns: 1fr 1fr; }
  .row label { flex-basis: 96px; font-size: 12.5px; }
  .layers { grid-template-columns: repeat(3, 1fr); }
  .slider-row { grid-template-columns: 86px 1fr 46px; }
  .btn.big { min-width: 220px; }
}
@media (max-width: 420px) {
  #tb-cash .ic, #tb-pop .ic { display: none; } .tb { padding: 5px 10px; }
  #tb-menu { padding: 0 10px; } .speed button { width: 24px; height: 30px; } .speed button svg { width: 14px; height: 14px; } #topbar { gap: 5px; }
  .tb .num { font-size: 15px; } .tb .lab { font-size: 9.5px; letter-spacing: .08em; }
  .chip { padding: 3px 5px 3px 3px; gap: 5px; } .chip .ring, .chip .ring svg { width: 26px; height: 26px; } .chip .ring .ic2 svg { width: 12px; height: 12px; } .chip .v { font-size: 13px; } .chip .l { font-size: 9px; letter-spacing: .06em; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #minimap { display: none; }
  #toasts { top: calc(64px + var(--sat)); width: min(300px, 40vw); }
  #advisor { display: none; }
  #topbar { padding-top: calc(5px + var(--sat)); }
  .tb { min-height: 42px; padding-top: 3px; padding-bottom: 3px; }
  #toolinfo { padding: 6px 10px; bottom: calc(var(--bh, 120px) + 4px); }
  #toolinfo .d { display: none; }
  #cats button span { display: none; }
  #cats button { min-width: 44px; padding: 5px 10px; flex-direction: row; }
  #cats button svg { width: 19px; height: 19px; }
  #items { padding: 6px 8px 8px; gap: 6px; }
  .card { width: 70px; padding: 3px 3px 4px; } .card canvas { width: 48px; height: 40px; } .card .n { height: 22px; font-size: 10px; }
  #side { top: calc(60px + var(--sat)); transform: none; display: grid; grid-template-columns: repeat(2, 38px); gap: 6px; }
  .iconbtn { width: 38px; height: 38px; } .iconbtn svg { width: 19px; height: 19px; }
  #tb-time .clock { display: none; }
  .sheet { max-height: 94vh; width: min(720px, calc(100vw - 20px)) !important; left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); border-radius: 16px; }
}
/* ---------- military & attack planning ---------- */
.cityic { width: 38px; height: 38px; flex: none; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--gold); }
.cityic svg { width: 20px; height: 20px; }
#alert { position: absolute; left: 50%; transform: translateX(-50%); top: calc(108px + var(--sat)); max-width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: rgba(60, 14, 12, .92); border: 1px solid rgba(232, 87, 79, .7); color: #ffd9d5; font-size: 13px; cursor: pointer; z-index: 6; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
#alert.urgent { animation: alertpulse .9s ease-in-out infinite; }
#alert b { color: #ff6b61; letter-spacing: .1em; font-size: 11px; flex: none; }
#alert span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes alertpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,87,79,.6), 0 6px 24px rgba(0,0,0,.45); } 50% { box-shadow: 0 0 0 7px rgba(232,87,79,0), 0 6px 24px rgba(0,0,0,.45); } }
#alert.hidden { display: none; }
#advisor { z-index: 5; }
body.attacking #bottom, body.attacking #side, body.attacking #toolinfo, body.attacking #inspector, body.attacking #alert, body.attacking #advisor, body.attacking #tb-citizen { display: none !important; }
#atk { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(8px + var(--sab)); width: min(760px, calc(100vw - 16px)); border-radius: 14px; padding: 10px 12px; z-index: 7; }
#atk .atk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#atk .atk-head b { font-size: 16px; color: var(--red); display: block; }
#atk .atk-head span { color: var(--mut); font-size: 12.5px; }
#atk .atk-hint { font-size: 13px; margin: 6px 0; color: var(--text); }
#atk .atk-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.atk-card { flex: none; width: 132px; border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; text-align: center; }
.atk-card canvas { width: 64px; height: 38px; }
.atk-card b { font-size: 12.5px; } .atk-card span { font-size: 11px; color: var(--mut); }
.atk-card.sel { border-color: var(--gold); background: rgba(242,193,78,.12); }
.atk-card.aimed { box-shadow: inset 0 0 0 1px rgba(125,231,178,.5); }
.atk-card .stp { display: flex; align-items: center; gap: 4px; margin: 3px 0; }
.atk-card .stp button { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.1); font-size: 17px; font-weight: 800; }
.atk-card .stp i { font-style: normal; font-size: 12px; min-width: 40px; font-variant-numeric: tabular-nums; }
.atk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12.5px; color: var(--mut); }
.badge { background: var(--red); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 1px 6px; font-weight: 700; margin-left: 4px; }
@media (max-width: 720px) { #alert { top: calc(154px + var(--sat)); font-size: 12px; } #atk { padding: 8px; } .atk-card { width: 118px; } }

/* ---------- inspector ---------- */
#inspector { position: absolute; right: calc(62px + var(--sar)); top: calc(80px + var(--sat)); width: min(300px, calc(100vw - 80px)); max-height: calc(100vh - var(--bh, 150px) - 110px); overflow-y: auto; border-radius: 14px; padding: 12px 14px; z-index: 4; font-size: 13px; scrollbar-width: thin; }
#inspector .btnrow { margin-top: 8px; } #inspector .btnrow .btn { min-width: 0; }
@media (max-width: 720px) { #inspector { right: calc(58px + var(--sar)); left: calc(8px + var(--sal)); width: auto; top: auto; bottom: calc(var(--bh, 150px) + 8px); max-height: 38vh; } }

.trow > .cityic { flex: none; }
.trow span.pill { display: inline-block; font-size: 11px; line-height: 1.4; }

/* ---------- themed scrollbars (gold on night blue) ---------- */
* { scrollbar-width: thin; scrollbar-color: #d9a52e rgba(255, 255, 255, .07); }
#cats, #items, .sh-tabs, #tb-citizen, #atk .atk-list { scrollbar-width: thin; scrollbar-color: #d9a52e rgba(255, 255, 255, .07); }
#cats::-webkit-scrollbar, #items::-webkit-scrollbar, .sh-tabs::-webkit-scrollbar, #tb-citizen::-webkit-scrollbar, #atk .atk-list::-webkit-scrollbar { display: block; height: 7px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, .06); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #f6cf6a, #d9a52e); border-radius: 8px; border: 1px solid rgba(20, 14, 2, .45); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffe08a, #e8b83e); }
::-webkit-scrollbar-corner { background: transparent; }
#cats { padding-bottom: 2px; }
#cats button { scroll-margin: 0 24px; }
#items { scroll-snap-type: x proximity; }
.card { scroll-snap-align: start; }

/* ---------- trade menu ---------- */
.goods { display: flex; flex-direction: column; gap: 2px; }
.grow { display: grid; grid-template-columns: 1.1fr .9fr .8fr auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.grow:last-child { border-bottom: 0; } .grow.dim { opacity: .5; } .grow .gs, .grow .gp { color: var(--mut); font-size: 12px; font-variant-numeric: tabular-nums; }
.stp2 { display: flex; align-items: center; gap: 3px; } .stp2 i { font-style: normal; min-width: 44px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.stp2 button { padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.09); font-size: 11.5px; font-weight: 700; }
.stp2 button:hover { background: rgba(242,193,78,.25); }
.shipcards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.shipcard { flex: none; width: 128px; border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 12px; padding: 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.shipcard.sel { border-color: var(--gold); background: rgba(242,193,78,.12); } .shipcard b { font-size: 12.5px; } .shipcard span { font-size: 11px; color: var(--mut); } .shipcard .bar { width: 100%; }
.autos { display: flex; flex-wrap: wrap; gap: 6px; } .autos .toggle { flex: 1 1 150px; }
.trow canvas[data-ship] { height: auto; }
select, input[type=number] { background: rgba(255,255,255,.08); border: 1px solid var(--line2); color: var(--text); padding: 6px 8px; border-radius: 8px; font: inherit; }
select option { background: #1b2433; }
@media (max-width: 720px) { .grow { grid-template-columns: 1fr 1fr; } .grow .stp2 { grid-column: 1 / -1; } }

.trow span b, .trow small b { display: inline; }

/* ---------- one big tech tree ---------- */
.tree-wrap { max-height: 56vh; background: radial-gradient(ellipse at 6% 50%, rgba(242,193,78,.08), transparent 40%), rgba(0,0,0,.24); }
.tr-band { position: absolute; border-radius: 16px; background: linear-gradient(90deg, color-mix(in srgb, var(--bc) 9%, transparent), transparent 85%); border-top: 1px solid color-mix(in srgb, var(--bc) 35%, transparent); pointer-events: none; }
.tr-band em { position: absolute; left: 4px; top: -2px; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--bc); opacity: .95; transform: translateY(-1px); }
.tr-group { position: absolute; left: 0; width: 20px; border-left: 3px solid rgba(255,255,255,.16); pointer-events: none; }
.tr-group span { position: absolute; left: -4px; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.tnode.root { border-radius: 22px; background: radial-gradient(circle at 30% 30%, rgba(242,193,78,.35), rgba(40,56,84,.95)); border-color: rgba(242,193,78,.8); text-align: center; align-items: center; padding: 8px 12px; }
.tnode.root i { display: none; }
.tr-lines path { stroke-width: 2.2; }

.tr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tr-tools span { font-size: 12px; color: var(--mut); }

.tree-wrap { cursor: grab; user-select: none; -webkit-user-select: none; }
.tree-wrap.panning, .tree-wrap.panning .tnode { cursor: grabbing; }
.tree-wrap.panning .tnode:hover { transform: none; }

/* ---------- news bar: the very top of the screen ---------- */
#hud { top: 28px; }
#newsbar { position: absolute; top: -28px; left: 0; right: 0; height: 28px; z-index: 7; display: flex; align-items: center; gap: 6px; padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal)); border-radius: 0 0 12px 12px; border-top: 0; background: rgba(10, 16, 28, .92); pointer-events: auto; }
#newsbar .nb { position: relative; flex: none; height: 20px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line2); color: var(--text); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
#newsbar .nb:hover { background: rgba(242, 193, 78, .18); border-color: rgba(242, 193, 78, .6); }
#newsbar .nb b { font-weight: 800; }
#newsbar .nbdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1.4s ease-in-out infinite; }
#newsbar .nbdot.hidden { display: none; }
#nb-tick { flex: 1; min-width: 0; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; }
#nb-tick em { font-style: normal; font-weight: 800; letter-spacing: .08em; font-size: 10.5px; margin-right: 4px; }
@media (max-width: 720px) { #nb-tick { font-size: 11px; } #newsbar .nb { padding: 0 8px; font-size: 10px; } }
.nrow { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); margin-bottom: 7px; }
.nrow.go { cursor: pointer; } .nrow.go:hover { background: rgba(242, 193, 78, .1); border-color: rgba(242, 193, 78, .4); }
.nrow > i { flex: none; width: 5px; border-radius: 3px; }
.nrow .ntag { font-size: 10px; font-weight: 800; letter-spacing: .12em; } .nrow .nwhen { float: right; font-size: 11px; color: var(--mut); }
.nrow .ntxt { font-size: 13.5px; line-height: 1.35; margin-top: 2px; }


/* =====================================================================
   VOXEL-TYCOON STYLE: flat charcoal panels, square corners, orange accent,
   one tidy toolbar along the bottom and drop-down style menus.
   ===================================================================== */
:root {
  --bg: #1b1e22; --panel: #2b2f34; --panel2: #262a2f; --line: #3a3f46; --line2: #4b525b;
  --text: #eef0f2; --mut: #9ba3ad; --gold: #f5a623; --gold2: #e08a0b; --red: #e5584f; --green: #5ccf8a; --blue: #58b0ff; --warn: #f5a623; --purple: #b79af0;
  --display: "Nunito", "Segoe UI", system-ui, sans-serif; --r: 3px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
html, body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
#vignette { background: radial-gradient(ellipse at 50% 45%, transparent 62%, rgba(0, 0, 0, .35) 100%); }
.glass { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 2px 0 rgba(0, 0, 0, .4), 0 8px 18px rgba(0, 0, 0, .28); }

/* buttons */
.btn { border-radius: 3px; background: #3a3f46; border: 1px solid var(--line2); font-weight: 700; letter-spacing: .03em; transition: background .15s var(--ease), transform .12s var(--ease), border-color .15s; }
.btn:hover { background: #454b53; border-color: #5c646e; }
.btn.primary { background: var(--gold); border-color: #ffc15a; color: #20160a; box-shadow: 0 2px 0 #a86408; text-shadow: none; text-transform: uppercase; letter-spacing: .06em; }
.btn.primary:hover { background: #ffb842; }
.btn.sm { border-radius: 3px; } .btn.danger { border-radius: 3px; }
.iconbtn { border-radius: 3px; width: 42px; height: 42px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(0, 0, 0, .4); transition: background .15s, border-color .15s, transform .12s var(--ease); }
.iconbtn:hover { background: #363b42; border-color: var(--gold); }
.iconbtn:active { transform: translateY(1px); }

/* top bar: flat info blocks */
.tb { border-radius: 3px; min-height: 44px; padding: 5px 12px 5px 8px; }
.tb .ic { border-radius: 3px; }
.tb .lab { letter-spacing: .14em; }
.tb .num { font-family: var(--display); font-weight: 800; }
#tb-citizen, #tb-time { border-radius: 3px; }
.chip { border-radius: 3px; }
.speed { background: #1f2226; border-radius: 3px; }
.speed button { border-radius: 3px; transition: background .15s, color .15s; }
.speed button.on { background: var(--gold); color: #20160a; }
#advisor { border-radius: 3px; border-color: rgba(245, 166, 35, .5); }

/* the build bar: a single dark toolbar along the bottom, tall square category buttons */
#bottom { padding: 0; }
#build { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; border-top: 2px solid var(--gold); background: var(--panel); }
#cats { gap: 0; padding: 0; border-bottom: 1px solid var(--line); background: #22262a; }
#cats button { min-width: 66px; padding: 8px 10px 7px; border-radius: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; transition: background .2s var(--ease), color .2s; border-right: 1px solid rgba(255, 255, 255, .04); }
#cats button:hover { background: #2d3237; color: var(--text); }
#cats button.on { color: var(--gold); background: #343a41; }
#cats button.on::after { left: 0; right: 0; height: 3px; border-radius: 0; top: 0; bottom: auto; background: var(--gold); }
#items { padding: 10px; gap: 8px; background: var(--panel); transition: max-height .3s var(--ease), padding .3s var(--ease), opacity .25s; max-height: 190px; }
.card { border-radius: 3px; background: #343940; border: 1px solid #434a52; width: 96px; transition: background .15s, border-color .15s, transform .15s var(--ease); }
.card:hover { background: #3d434b; border-color: var(--gold); transform: translateY(-2px); }
.card.on { border-color: var(--gold); background: #4a3d24; box-shadow: inset 0 0 0 1px var(--gold); }
.card .p { color: var(--gold); }
#bottom.min #items { display: block; max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; }
#bottom.min #cats { border-bottom: 0; padding-bottom: 0; }

/* sheets / menus: slide in, square, orange title */
.sheet { border-radius: 3px; background: var(--panel); border: 1px solid var(--line2); animation: vtIn .26s var(--ease) both; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
@keyframes vtIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); } to { opacity: 1; transform: translate(-50%, -50%); } }
.sh-head { background: #22262a; border-bottom: 2px solid var(--gold); }
.sh-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .12em; color: var(--text); }
.sh-tabs { background: #22262a; padding: 0 8px; }
.sh-tabs button { border-radius: 0; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.sh-tabs button.on { background: #343a41; color: var(--gold); }
.sh-tabs button.on::after { top: 0; bottom: auto; left: 0; right: 0; border-radius: 0; }
.scrim { transition: opacity .2s; }
.box { border-radius: 3px; background: #2f343a; border: 1px solid var(--line); }
.pill { border-radius: 3px; }
input[type=range] { accent-color: var(--gold); }
.toggle .sw { border-radius: 3px; }
.seg button { border-radius: 3px; }
#inspector { border-radius: 3px; background: var(--panel); border: 1px solid var(--line2); border-top: 3px solid var(--gold); animation: vtSlide .25s var(--ease) both; }
@keyframes vtSlide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
#minimap, #toolinfo, #alert { border-radius: 3px; }
.kv { border-bottom: 1px solid rgba(255, 255, 255, .05); }

/* news strip */
#newsbar { background: #1b1e22; border-bottom: 1px solid var(--line2); border-radius: 0; }
#newsbar .nb { border-radius: 3px; background: #343a41; text-transform: uppercase; letter-spacing: .08em; }

/* main menu */
.menu-shade { background: linear-gradient(90deg, rgba(20, 22, 26, .92) 0%, rgba(20, 22, 26, .7) 34%, transparent 62%); }
.mi { border-radius: 3px; background: rgba(36, 40, 45, .94); border: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; text-transform: uppercase; letter-spacing: .1em; font-size: 15px; transition: background .2s var(--ease), padding .2s var(--ease); }
.mi:hover, .mi:focus-visible { background: #343a41; padding-left: 32px; }
.mi#btn-play, .mi#btn-continue { background: var(--gold); color: #20160a; border-color: #ffc15a; }
.mi#btn-play:hover, .mi#btn-continue:hover { background: #ffb842; }
.mi#btn-continue:not(.hidden) + #btn-play { background: rgba(36, 40, 45, .94); color: var(--text); border-color: var(--line); }
.mi#btn-continue:not(.hidden) + #btn-play:hover { background: #343a41; }
.title { font-family: var(--display); font-weight: 900; letter-spacing: .12em; }
.logo-mark { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }

/* infographic */
.infog { margin: 8px 0 10px; background: #1f2327; border: 1px solid var(--line2); border-left: 3px solid var(--gold); padding: 9px 10px; }
.ig-h { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: 7px; }
.ig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ig-t { background: #2b2f34; padding: 6px 8px; }
.ig-t span { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.ig-t b { display: block; font-family: var(--display); font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ig-t b.pos { color: var(--green); }
.ig-t small { color: var(--mut); font-size: 10.5px; }
.ig-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 11px; color: var(--mut); }
.ig-bar > div { flex: 1; height: 8px; background: #111316; } .ig-bar i { display: block; height: 100%; transition: width .4s var(--ease); }
.ig-bar em { font-style: normal; color: var(--text); min-width: 32px; text-align: right; font-weight: 700; }
.ig-spark { display: flex; align-items: flex-end; gap: 3px; height: 48px; padding: 2px 0; border-bottom: 1px solid var(--line2); }
.ig-spark i { flex: 1; background: #5c6570; min-height: 2px; transition: height .4s var(--ease); } .ig-spark i.e { background: #2f343a; } .ig-spark i.now { background: var(--gold); }
.ig-note { font-size: 11.5px; color: var(--mut); margin-top: 6px; line-height: 1.35; }

/* ---------------- phones: a very basic menu, everything else in drop-downs ---------------- */
#b-more { display: none; }
@media (max-width: 720px) {
  #cats { overflow-x: auto; }
  #cats button { flex: 1 0 auto; min-width: 0; width: 20vw; max-width: 84px; padding: 9px 4px 8px; }
  #cats button span { font-size: 9.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #cats .collapse { display: none; }
  #bottom.min #cats button:not(.collapse) { display: flex; }
  #items { max-height: 150px; padding: 8px; gap: 6px; }
  .card { width: 82px; }
  /* top: money, residents, date + speed - the rest folds into the Issues chip */
  #tb-citizen .chip:not(#ch-prob) { display: none; }
  #tb-citizen { padding: 0; background: none; border: 0; box-shadow: none; }
  .tb .sub { display: none; }
  #topbar { gap: 4px; }
  #tb-time .rci { display: none; }
  /* side buttons: three always visible, the rest drop down from the ... button */
  #side { gap: 6px; }
  #side > .iconbtn { width: 40px; height: 40px; }
  #side > #b-atk, #side > #b-ops, #side > #b-zi, #side > #b-zo, #side > #b-map, #side > #b-goals, #side > #b-undo, #side > #b-redo { max-height: 0; opacity: 0; margin: 0; padding: 0; border-width: 0; overflow: hidden; pointer-events: none; transition: max-height .3s var(--ease), opacity .25s, margin .3s; }
  #side.open > #b-atk, #side.open > #b-ops, #side.open > #b-zi, #side.open > #b-zo, #side.open > #b-map, #side.open > #b-goals, #side.open > #b-undo, #side.open > #b-redo { max-height: 44px; opacity: 1; border-width: 1px; pointer-events: auto; }
  #b-more { display: flex; }
  #side.open #b-more { background: var(--gold); color: #20160a; }
  #minimap { bottom: calc(var(--bh, 150px) + 8px); }
  #newsbar #nb-tick { display: none; }
  #newsbar .nb { flex: 1; justify-content: center; }
  .sheet { border-radius: 3px 3px 0 0; top: auto; bottom: 0; transform: none; left: 0; width: 100vw !important; max-height: 88vh; animation: vtUp .3s var(--ease) both; }
  @keyframes vtUp { from { transform: translateY(100%); } to { transform: none; } }
  #inspector { animation: vtUp .28s var(--ease) both; }
}

/* ---- sandbox panel, mode cards, illness ---- */
#sandbox { position: absolute; left: calc(8px + var(--sal)); top: 78px; width: 188px; max-height: calc(100vh - var(--bh, 150px) - 120px); display: flex; flex-direction: column; z-index: 5; }
#sandbox .sb-h { padding: 8px 10px; font-weight: 900; letter-spacing: .14em; font-size: 12px; color: var(--gold); border-bottom: 2px solid var(--gold); } #sandbox .sb-h small { display: block; font-weight: 600; letter-spacing: 0; color: var(--mut); font-size: 10.5px; }
#sandbox .sb-body { overflow-y: auto; padding: 4px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
#sandbox .sb-g { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); padding: 8px 6px 3px; }
#sandbox button[data-sb] { display: block; width: 100%; text-align: left; padding: 6px 8px; font-size: 12.5px; background: #343a41; margin-bottom: 2px; border-left: 3px solid transparent; transition: background .15s, border-color .15s; }
#sandbox button[data-sb]:hover { background: #3f464e; } #sandbox button[data-sb].on { border-left-color: var(--gold); background: #4a3d24; color: var(--gold); }
#sandbox .sb-x { padding: 8px; background: #22262a; color: var(--mut); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
@media (max-width: 720px) { #sandbox { width: 148px; top: 70px; max-height: 38vh; } }
.modecard { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px; background: #343a41; border: 1px solid var(--line2); border-left: 4px solid var(--gold); transition: background .15s, transform .15s; }
.modecard:hover { background: #3f464e; transform: translateX(3px); } .modecard b { display: block; font-size: 17px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; } .modecard span { color: var(--mut); font-size: 13px; }
.ill-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.06); } .ill-row > div:first-child { flex: 1; } .ill-row em { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.ill-d { font-size: 11.5px; color: var(--mut); line-height: 1.3; } .ill-n { text-align: right; font-weight: 900; font-size: 18px; } .ill-n small { display: block; font-size: 9.5px; color: var(--mut); font-weight: 600; }

.illmap { margin: 6px 0 12px; } .illmap canvas { width: 100%; max-width: 340px; display: block; border: 1px solid var(--line2); image-rendering: pixelated; background: #1d4f86; }
.illkey { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--mut); margin-top: 5px; } .illkey i { width: 90px; height: 8px; background: linear-gradient(90deg, #7fb35a, #e8161e); display: block; } .illkey b { color: var(--text); }

#b-rl, #b-rr { position: relative; }
#b-rl .rlab, #b-rr .rlab { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font: 800 7px system-ui, sans-serif; letter-spacing: .04em; opacity: .75; pointer-events: none; }
#b-rl svg, #b-rr svg { margin-top: -5px; }

#sandbox.folded .sb-body, #sandbox.folded .sb-x { display: none; }
#sandbox.folded .sb-h { border-bottom: 0; }

#items .sep { flex: none; display: flex; align-items: stretch; margin: 6px 8px 6px 4px; padding-left: 7px; border-left: 1px solid rgba(255,255,255,.22); }
#items .sep span { writing-mode: vertical-rl; transform: rotate(180deg); font: 800 9px system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); white-space: nowrap; }

@media (max-width: 720px) { #rot-float kbd { display: none; } #rot-float, #prot-mode { padding: 8px 12px !important; font-size: 13px !important; } }

/* ---- swipe bars: the tab strip and the item list scroll sideways, with arrows, edge fades, drag-scrolling and a hint ---- */
.swipe { position: relative; min-width: 0; }
#sw-cats { --swbg: #22262a; }
#sw-items { --swbg: var(--panel, #2b3036); }
.swipe > #cats, .swipe > #items { cursor: grab; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.swipe.dragging > #cats, .swipe.dragging > #items { cursor: grabbing; scroll-snap-type: none; }
.swipe.dragging { user-select: none; }
.sw-ar { position: absolute; top: 0; bottom: 0; width: 34px; z-index: 3; display: none; align-items: center; justify-content: center; border: 0; padding: 0; color: #fff; font: 800 28px/1 system-ui, sans-serif; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.sw-ar.l { left: 0; background: linear-gradient(90deg, var(--swbg) 25%, transparent); }
.sw-ar.r { right: 0; background: linear-gradient(270deg, var(--swbg) 25%, transparent); }
#sw-cats .sw-ar.r { right: 38px; }
.swipe.can-l > .sw-ar.l, .swipe.can-r > .sw-ar.r { display: flex; }
.sw-ar:hover { color: var(--gold, #f2c14e); }
.sw-ar:active { transform: scale(.92); }
.sw-hint { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(242,193,78,.96); color: #2a2208; font: 800 12px system-ui, sans-serif; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.4); pointer-events: none; animation: swhint 1.6s ease-in-out infinite; }
.sw-hint i { font-style: normal; font-size: 15px; }
@keyframes swhint { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(3px); } }
@media (max-width: 720px) { #sw-cats .sw-ar.r { right: 0; } .sw-ar { width: 30px; } }

/* ---- tutorial ---- */
#tut { position: fixed; left: 50%; transform: translateX(-50%); top: 72px; width: min(440px, calc(100vw - 20px)); z-index: 12; border-radius: 14px; padding: 12px 14px 12px; background: rgba(24, 28, 34, .97); border: 1px solid rgba(242,193,78,.55); box-shadow: 0 10px 40px rgba(0,0,0,.55); color: var(--text, #eef2f6); }
#tut .tut-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#tut .tut-n { font: 800 10.5px system-ui, sans-serif; letter-spacing: .14em; color: var(--gold, #f2c14e); }
#tut .tut-stop { border: 1px solid rgba(255,255,255,.22); background: transparent; color: #cfd6de; border-radius: 999px; padding: 3px 10px; font: 700 11px system-ui, sans-serif; cursor: pointer; }
#tut .tut-stop:hover { background: rgba(232,87,79,.2); border-color: #e8574f; color: #fff; }
#tut .tut-t { font: 800 17px system-ui, sans-serif; margin: 6px 0 4px; }
#tut .tut-d { font: 13.5px/1.5 system-ui, sans-serif; color: #c9d2de; }
#tut .tut-d b { color: #ffd08a; }
#tut .tut-bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); margin: 10px 0 9px; overflow: hidden; }
#tut .tut-bar i { display: block; height: 100%; background: var(--gold, #f2c14e); transition: width .4s; }
#tut .tut-btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#tut .tut-ok { font: 800 13px system-ui, sans-serif; color: #7de7b2; }
#tut.done { border-color: rgba(125,231,178,.8); }
#tut button.btn { padding: 7px 14px; font-size: 13px; }
.tut-hi { position: relative; z-index: 4; outline: 3px solid #f2c14e !important; outline-offset: -2px; border-radius: 6px; animation: tuthi 1.1s ease-in-out infinite; }
@keyframes tuthi { 0%, 100% { box-shadow: 0 0 0 0 rgba(242,193,78,.65); } 50% { box-shadow: 0 0 0 9px rgba(242,193,78,0); } }
#tut-offer { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: rgba(8,10,14,.6); padding: 16px; backdrop-filter: blur(2px); }
#tut-offer .box { max-width: 420px; width: 100%; border-radius: 16px; padding: 22px 22px 18px; background: rgba(24,28,34,.98); border: 1px solid rgba(242,193,78,.5); box-shadow: 0 20px 60px rgba(0,0,0,.6); text-align: center; }
#tut-offer h2 { margin: 0 0 6px; font: 800 22px system-ui, sans-serif; color: #fff; }
#tut-offer p { margin: 0 0 16px; font: 14px/1.5 system-ui, sans-serif; color: #c9d2de; }
#tut-offer .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#tut-offer .btn { padding: 10px 18px; font-size: 14px; }
.help .help-new { border: 1px solid rgba(242,193,78,.4); border-radius: 12px; padding: 4px 14px 10px; margin: 0 0 14px; background: rgba(242,193,78,.06); }
.help .help-new h3:first-child { margin-top: 10px; }
.help .help-tut { margin: 6px 0 4px; }

/* ---- food: kitchen panel, hunger bars ---- */
.kit-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12.5px; }
.kit-row .nm { flex: 0 0 104px; color: var(--mut); }
.kit-row .tr { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.kit-row .tr i { display: block; height: 100%; }
.kit-row .vv { flex: 0 0 50px; text-align: right; font-weight: 700; }
.food-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.food-tbl th { text-align: right; color: var(--mut); font-weight: 700; padding: 4px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.food-tbl th:first-child, .food-tbl td:first-child { text-align: left; }
.food-tbl td { text-align: right; padding: 5px 6px; border-top: 1px solid rgba(255,255,255,.07); }
.mood-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: 11.5px; color: #1a1a1a; }