/* Menagerie Golems: the shell, HUD, trays, sheets, menus. The studio look (dark green panels, italic yellow display
   type, big round touch buttons). Three layouts by a class on <body>: .port (phone portrait, the default), .land
   (phone landscape: a left rail of categories, cards along the bottom, side sheets) and .desk (everything at once). */
:root {
  --bg: #0b1410; --panel: #12201a; --panel2: #182b22; --line: #2a4436;
  --text: #eef5f0; --muted: #8fa89a; --accent: #ffd23f; --accent2: #3ee08f; --danger: #ff5a5f; --blue: #58a6ff;
  --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);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
input, select { font: inherit; color: inherit; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; }
.y { color: var(--accent); } .gr { color: var(--accent2); } .mu { color: var(--muted); } .rd { color: #ff8a8d; }
@keyframes fin { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud .pin, #hud .tray, #hud .panel, #hud .feed div, #hud .hab, #hud .mini, #hud .ovbtns { pointer-events: auto; }
.box { background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 12px; box-shadow: 0 6px 20px #0008; }
.money { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); padding: 5px 11px 7px; min-width: 128px; }
.money b { display: block; white-space: nowrap; font-size: 22px; font-weight: 900; font-style: italic; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }
.money b.neg { color: #ff8a8d; }
.money span { display: block; white-space: nowrap; font-size: 10.5px; font-weight: 900; color: var(--accent2); margin-top: 2px; letter-spacing: .02em; }
.money span.bad { color: #ff8a8d; }
.date { position: absolute; top: calc(10px + var(--sat)); right: calc(62px + var(--sar)); padding: 5px 11px 6px; text-align: center; white-space: nowrap; pointer-events: auto; }
.date b { display: block; font-size: 15px; font-weight: 900; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.spd { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.spd button { font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 6px; background: #ffffff12; color: var(--muted); min-width: 28px; text-align: center; }
.spd button.sel { background: var(--accent); color: #1a1400; }
.mbtn { position: absolute; top: calc(12px + var(--sat)); right: calc(12px + var(--sar)); width: 42px; height: 42px; border-radius: 11px; border: 1px solid #ffffff2a;
  background: rgba(8, 14, 11, .8); font-weight: 900; display: grid; place-items: center; font-size: 18px; text-align: center; }
.fame { position: absolute; top: calc(66px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); padding: 6px 10px 7px; text-align: left; }
.fame .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 9.5px; font-weight: 900; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.fame .t b { color: var(--accent); font-size: 14px; letter-spacing: .05em; margin-left: 6px; }
.fame .t b s { text-decoration: none; color: #ffffff30; }
.fame .t em { font-style: normal; color: var(--text); letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 8px; border-radius: 5px; background: #ffffff14; margin-top: 5px; overflow: hidden; }
.bar div { height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #1fb46d, var(--accent2) 70%, var(--accent)); transition: width .4s; }
.fame .sub { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 800; color: var(--muted); margin-top: 4px; white-space: nowrap; gap: 8px; }
.fame .sub b { color: var(--text); }
.chips-top { display: none; }
.ovbtns { display: none; }
.feed { position: absolute; top: calc(134px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.feed div { background: rgba(8, 14, 11, .9); border: 1px solid #ffffff1c; border-radius: 999px; padding: 3px 11px 3px 4px; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; gap: 7px; max-width: 100%; animation: fin .25s ease-out; transition: opacity .6s; cursor: pointer; }
.feed div > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed div.hot { border-color: #ff5a5f88; }
.feed div.fade { opacity: 0; }
.feed i { color: var(--accent); font-style: normal; font-weight: 900; white-space: nowrap; }
.feed div.hot i { color: #ff8a8d; }
.av { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px; background: #aaa497; position: relative; border: 1.5px solid #6f6a60; }
.av::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 2px; border-left: 2.5px solid #ffd23f; border-right: 2.5px solid #ffd23f; }
.av.sys { background: #2a4436; border-color: var(--accent); } .av.sys::after { display: none; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(232px + var(--sab)); background: rgba(8, 14, 11, .95); border: 1px solid #ffffff22;
  border-left: 4px solid var(--danger); padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; width: max-content; max-width: min(92vw, 420px); line-height: 1.35; animation: fin .2s ease-out; pointer-events: none; z-index: 5; }
.toast.ok { border-left-color: var(--accent2); }
.toast b { color: var(--accent); }
.banner { position: absolute; left: 50%; top: calc(190px + var(--sat)); transform: translateX(-50%); background: linear-gradient(180deg, #1d3a2a, #12201a); border: 1.5px solid var(--accent); border-radius: 16px;
  padding: 10px 18px; text-align: center; box-shadow: 0 12px 40px #000c; animation: pop .25s ease-out; min-width: 240px; max-width: 92vw; }
.banner .big { display: block; font-size: 22px; color: var(--accent); }
.banner .small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.legend { position: absolute; top: calc(134px + var(--sat)); right: calc(10px + var(--sar)); padding: 6px 10px; font-size: 10.5px; font-weight: 800; }
.legend .lt { font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); margin-bottom: 3px; }
.legend .r { display: flex; align-items: center; gap: 6px; margin-top: 2px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* map-pinned chips */
.pin { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; z-index: 3; }
.ghostchip { background: rgba(8, 14, 11, .93); border: 1.5px solid var(--accent2); border-radius: 12px; padding: 5px 10px 6px; box-shadow: 0 8px 20px #0009; pointer-events: none; }
.ghostchip .a { font-size: 9.5px; font-weight: 900; letter-spacing: .14em; color: var(--accent2); text-transform: uppercase; }
.ghostchip .b { font-size: 13px; font-weight: 900; margin-top: 1px; } .ghostchip .b em { font-style: normal; color: var(--accent); }
.ghostchip.yl { border-color: var(--accent); } .ghostchip.yl .a { color: var(--accent); }
.ghostchip.bad { border-color: var(--danger); } .ghostchip.bad .a { color: #ff8a8d; }
.okx { display: flex; gap: 12px; }
.okx button { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 900; border: 2px solid #ffffff55; box-shadow: 0 6px 16px #0009; text-align: center; }
.okx .ok { background: radial-gradient(circle at 35% 30%, #8ff7c1, #1fb46d); color: #002313; }
.okx .ok:disabled { filter: grayscale(1) brightness(.7); }
.okx .x { background: radial-gradient(circle at 35% 30%, #ff9a9d, #d8323a); color: #fff; }

/* the habitat card */
body.port.habon .fame, body.port.habon .feed { visibility: hidden; }
.hab { position: absolute; top: calc(62px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); padding: 9px 11px 10px; z-index: 2; background: rgba(8, 14, 11, .94); }
.hab .hd { display: flex; align-items: center; gap: 9px; }
.hab .hd canvas { width: 46px; height: 40px; border-radius: 9px; background: #203a2c; flex: 0 0 46px; }
.hab .hd .nm { font-size: 16px; line-height: 1; } .hab .hd small { display: block; font-size: 10.5px; font-weight: 800; color: var(--muted); margin-top: 3px; font-style: normal; text-transform: none; letter-spacing: 0; }
.hab .hd small b { color: var(--text); }
.hab .hd .pct { margin-left: auto; text-align: right; } .hab .hd .pct b { font-size: 28px; font-weight: 900; font-style: italic; color: var(--accent); line-height: 1; }
.hab .hd .pct b.g { color: var(--accent2); }
.hab .hd .pct span { display: block; font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.meter { position: relative; height: 10px; border-radius: 6px; background: #ffffff14; margin: 8px 0 9px; }
.meter div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #ff5a5f, #ffb13b 45%, #ffd23f); transition: width .25s; }
.meter div.g { background: linear-gradient(90deg, #1fb46d, #3ee08f); }
.meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #3ee08f; box-shadow: 0 0 6px #3ee08f; }
.parts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.part { display: grid; grid-template-columns: 58px 1fr 34px; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; }
.part span { color: var(--muted); white-space: nowrap; } .part em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part .b { height: 6px; border-radius: 3px; background: #ffffff14; position: relative; }
.part .b i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.part .b u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #ffffffaa; }
.advice { margin-top: 7px; font-size: 11px; line-height: 1.35; font-weight: 700; color: var(--muted); background: #ffffff08; border-radius: 8px; padding: 5px 8px; }
.advice b { color: var(--accent); }
.warn { margin-top: 6px; font-size: 11px; font-weight: 800; color: #ff8a8d; background: #ff5a5f18; border-radius: 8px; padding: 4px 8px; }

/* ------------------------------------------------------------ tool tray (phone portrait) */
.tray { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px calc(8px + var(--sar)) calc(12px + var(--sab)) calc(8px + var(--sal));
  background: linear-gradient(180deg, rgba(11, 20, 16, 0), rgba(11, 20, 16, .9) 26px, rgba(11, 20, 16, .97)); }
.brush { display: flex; gap: 6px; margin: 0 2px 8px; align-items: center; min-height: 38px; }
.chips-row { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.chips-row::-webkit-scrollbar { display: none; }
.bc { flex: 0 0 auto; background: rgba(18, 32, 26, .96); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 11.5px; font-weight: 900; letter-spacing: .03em; white-space: nowrap; }
.bc.sel { background: #2a2a10; border-color: var(--accent); color: var(--accent); }
.bc.info { border-style: dashed; color: var(--muted); cursor: default; }
.rnd { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: rgba(18, 32, 26, .96); border: 1px solid var(--line); display: grid; place-items: center; font-size: 17px; font-weight: 900; text-align: center; }
.rnd.sel { background: var(--danger); border-color: #fff8; }
.rnd:disabled { opacity: .35; }
.items { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.items::-webkit-scrollbar { display: none; }
.items:empty { display: none; }
.it { flex: 0 0 84px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 4px 4px 6px; text-align: center; position: relative; }
.it canvas { display: block; width: 100%; height: 42px; border-radius: 8px; background: #0e1a14; }
.it .nm { font-size: 10px; font-weight: 900; margin-top: 4px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .pr { font-size: 9.5px; font-weight: 800; color: var(--accent); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .pr.g { color: var(--accent2); } .it .pr.m { color: var(--muted); }
.it.sel { border-color: var(--accent); background: #2a2a10; }
.it.lock { opacity: .5; }
.it .k { position: absolute; top: -6px; right: -5px; background: #0b1410; color: var(--text); border: 1px solid #ffffff44; border-radius: 5px; font-size: 9.5px; font-weight: 900; padding: 0 5px; line-height: 16px; display: none; }
.cats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cat { background: rgba(18, 32, 26, .96); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0 5px; text-align: center; font-size: 18px; line-height: 1.1; position: relative; }
.cat small { display: block; font-size: 8.5px; font-weight: 900; letter-spacing: .04em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.cat.sel { background: var(--accent); border-color: var(--accent); } .cat.sel small { color: #1a1400; }
.cat .dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.cat .kk { display: none; position: absolute; top: 3px; left: 6px; font-size: 9px; font-weight: 900; color: var(--muted); font-style: normal; }
.cat.desk-only { display: none; }

/* ------------------------------------------------------------ sheets (inspect, zoo panel) */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 70vh; overflow-y: auto; background: var(--panel); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 8px calc(14px + var(--sar)) calc(14px + var(--sab)) calc(14px + var(--sal)); box-shadow: 0 -10px 30px #000a; z-index: 10; animation: fin .2s ease-out; scrollbar-width: thin; }
.sheet.tall { max-height: 86vh; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: #ffffff30; margin: 0 auto 8px; }
.sh-hd { display: flex; align-items: center; gap: 10px; }
.sh-hd canvas { width: 64px; height: 54px; border-radius: 12px; background: #203a2c; border: 1px solid #ffffff1a; flex: 0 0 64px; }
.sh-hd .nm { font-size: 23px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sh-hd .ds { font-size: 11px; color: var(--muted); font-weight: 800; margin-top: 4px; }
.sh-hd > div { min-width: 0; }
.xbtn { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 900; color: var(--muted); flex: 0 0 36px; text-align: center; }
.happy { display: flex; gap: 8px; margin: 11px 0 9px; }
.happy > div { background: var(--panel2); border-radius: 12px; padding: 7px 10px; flex: 1; min-width: 0; }
.happy span { display: block; font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.happy b { font-size: 22px; font-weight: 900; font-style: italic; white-space: nowrap; } .happy small { font-size: 10.5px; font-weight: 800; color: var(--muted); margin-left: 3px; }
.happy .big { flex: 1.3; background: linear-gradient(180deg, #1d3a2a, #183024); border: 1px solid #3ee08f55; } .happy .big b { color: var(--accent2); font-size: 26px; }
.happy .big.mid b { color: var(--accent); } .happy .big.low { border-color: #ff5a5f55; background: linear-gradient(180deg, #3a1d1f, #2a1618); } .happy .big.low b { color: #ff8a8d; }
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.need { display: grid; grid-template-columns: 18px 70px 1fr 28px; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; }
.need span { color: var(--muted); white-space: nowrap; } .need em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.nb { height: 8px; border-radius: 4px; background: #ffffff12; overflow: hidden; } .nb i { display: block; height: 100%; border-radius: 4px; }
.thought { margin-top: 10px; background: #ffffff0a; border: 1px solid #ffffff14; border-radius: 12px; padding: 7px 10px; font-size: 12px; font-weight: 700; line-height: 1.35; }
.thought b { color: var(--accent); }
.fam { display: flex; gap: 7px; margin-top: 9px; align-items: center; flex-wrap: wrap; }
.fam .lbl { font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); margin-right: 2px; }
.fam > button.m { display: flex; align-items: center; gap: 6px; background: var(--panel2); border-radius: 10px; padding: 3px 8px 3px 3px; font-size: 11px; font-weight: 900; }
.fam canvas { width: 34px; height: 28px; border-radius: 7px; background: #203a2c; }
.fam small { display: block; font-size: 9.5px; color: var(--muted); font-weight: 800; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 11px; }
.acts button { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 2px 7px; text-align: center; font-size: 18px; }
.acts button small { display: block; font-size: 10px; font-weight: 900; margin-top: 3px; letter-spacing: .03em; }
.acts button.y { background: linear-gradient(180deg, #ffe066, #f0b400); border: 0; color: #241900; }
.acts button:disabled { opacity: .4; }
.sec { font-size: 9.5px; font-weight: 900; letter-spacing: .16em; color: var(--muted); margin: 12px 0 6px; display: flex; justify-content: space-between; gap: 8px; text-transform: uppercase; }
.sec b { color: var(--accent); letter-spacing: .04em; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; padding: 4px 0; border-top: 1px solid #ffffff0c; }
.row:first-child { border-top: 0; }
.row span { color: var(--muted); } .row b.g { color: var(--accent2); } .row b.r { color: #ff8a8d; } .row b.y { color: var(--accent); }
.roster { display: flex; flex-direction: column; gap: 5px; }
.roster button { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 3px 8px 3px 3px; font-size: 12px; font-weight: 900; width: 100%; }
.roster canvas { width: 40px; height: 32px; border-radius: 8px; background: #203a2c; flex: 0 0 40px; }
.roster small { color: var(--muted); font-weight: 800; font-size: 10.5px; margin-left: auto; white-space: nowrap; }
.tabs { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; min-height: 34px; font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.tabs button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.btn { display: inline-block; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; font-size: 13px; font-weight: 900; text-align: center; }
.btn.y, .go { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; border: 0; font-style: italic; }
.btn.r { background: #3a1d1f; border-color: #ff5a5f66; color: #ff8a8d; }
.btn.wide { display: block; width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .4; }
.slider { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.slider input { flex: 1; accent-color: var(--accent); }
.slider b { min-width: 70px; text-align: right; font-size: 16px; font-style: italic; color: var(--accent); }
.res-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--panel2); margin-bottom: 5px; font-size: 12px; font-weight: 800; width: 100%; text-align: left; }
.res-line small { grid-column: 1 / -1; color: var(--muted); font-weight: 700; font-size: 10.5px; }
.res-line .nb { grid-column: 1 / -1; height: 6px; }
.res-line.done { opacity: .55; } .res-line.lock { opacity: .4; } .res-line.cur { border: 1px solid var(--accent); }
.goal { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; align-items: center; font-size: 12px; font-weight: 800; padding: 5px 0; }
.goal .nb { grid-column: 2 / -1; height: 6px; }
.medal { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1.5px solid #ffffff30; background: #ffffff0a; vertical-align: middle; }
.medal.b { background: radial-gradient(circle at 35% 30%, #f2b27a, #a8642f); border-color: #d79a63; } .medal.s { background: radial-gradient(circle at 35% 30%, #ffffff, #9aa4ab); border-color: #d6dde2; } .medal.g { background: radial-gradient(circle at 35% 30%, #fff2a0, #e0a800); border-color: #ffd23f; }
.post { display: flex; gap: 8px; padding: 7px 6px; border-radius: 9px; background: #ffffff07; margin-bottom: 5px; font-size: 11.5px; line-height: 1.3; width: 100%; text-align: left; }
.post .av { width: 26px; height: 26px; flex: 0 0 26px; border-width: 2px; } .post .av::after { left: 5px; right: 5px; top: 8px; height: 3px; border-left-width: 3px; border-right-width: 3px; }
.post b { font-size: 11px; } .post b span { color: var(--muted); font-weight: 700; margin-left: 3px; }
.post .lk { font-size: 10px; color: var(--muted); font-weight: 800; margin-top: 2px; }
.post.hot { background: #ff5a5f1a; border: 1px solid #ff5a5f55; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.stat { background: var(--panel2); border-radius: 9px; padding: 6px 8px; } .stat span { display: block; font-size: 9px; font-weight: 900; letter-spacing: .12em; color: var(--muted); } .stat b { font-size: 17px; font-style: italic; }
.ledger { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 800; }
.ledger td { padding: 3px 0; border-top: 1px solid #ffffff0c; } .ledger td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; } .ledger td.mu { color: var(--muted); }
.ledger tr.tot td { border-top: 1px solid #ffffff30; font-size: 13px; }

/* ------------------------------------------------------------ adoption market */
.overlay { position: fixed; inset: 0; background: rgba(4, 8, 6, .72); z-index: 20; display: grid; place-items: center; padding: calc(10px + var(--sat)) calc(8px + var(--sar)) calc(10px + var(--sab)) calc(8px + var(--sal)); }
.shop { width: min(560px, 100%); height: 100%; max-height: 980px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px #000c; overflow: hidden; display: flex; flex-direction: column; animation: pop .2s ease-out; }
.shop .top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.shop .top .t { font-size: 24px; line-height: .95; } .shop .top small { display: block; font-size: 10.5px; font-weight: 800; color: var(--muted); margin-top: 4px; font-style: normal; text-transform: none; letter-spacing: 0; }
.shop .top .cash { margin-left: auto; font-size: 18px; font-weight: 900; font-style: italic; color: var(--accent); white-space: nowrap; }
.shop .tabs { padding: 0 12px 9px; }
.agrid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 8px; padding: 0 12px 8px; flex: 1; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; }
.ac { background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; padding: 6px 8px 8px; position: relative; overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.ac canvas { display: block; width: 100%; height: 108px; border-radius: 9px; background: radial-gradient(120% 90% at 50% 100%, #2c4a33, #1a2e22); }
.ac .nm { font-size: 13px; font-weight: 900; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac .ds { font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac .rw { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; gap: 4px; }
.ac .pr { font-size: 13.5px; font-weight: 900; font-style: italic; color: var(--accent); white-space: nowrap; }
.badge { font-size: 8.5px; font-weight: 900; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; white-space: nowrap; text-transform: uppercase; }
.badge.lc { background: #3ee08f22; color: #3ee08f; } .badge.vu { background: #ffd23f22; color: #ffd23f; } .badge.en { background: #ff5a5f2a; color: #ff8a8d; } .badge.el { background: #b48cff2a; color: #cdb3ff; }
.ac.sel { border-color: var(--accent); background: #262a12; }
.ac.lock canvas { filter: grayscale(.9) brightness(.55); } .ac.lock .nm, .ac.lock .ds { opacity: .6; }
.ac .lk { position: absolute; top: 10px; right: 10px; background: #0b1410dd; border: 1px solid #ffffff33; border-radius: 8px; padding: 2px 7px; font-size: 10px; font-weight: 900; }
.where { margin: 4px 12px 12px; background: #0d1813; border: 1px solid var(--line); border-radius: 14px; padding: 9px 10px; }
.where .lbl { font-size: 9px; font-weight: 900; letter-spacing: .14em; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.where .lbl b { color: var(--accent); }
.opts { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.opts::-webkit-scrollbar { display: none; }
.opts button { flex: 1 0 128px; background: var(--panel2); border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 7px; font-size: 11px; font-weight: 900; line-height: 1.2; white-space: nowrap; text-align: left; }
.opts button small { display: block; font-size: 9.5px; font-weight: 800; color: var(--muted); }
.opts button.sel { border-color: var(--accent2); background: #173322; }
.opts button.bad { opacity: .55; }
.buy { margin-top: 8px; display: flex; gap: 8px; }
.buy button { flex: 1; border-radius: 14px; padding: 12px 0; text-align: center; font-weight: 900; font-size: 15px; }
.buy .y { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; font-style: italic; flex: 2; }
.buy .y:disabled { filter: grayscale(1); opacity: .6; }
.buy .n { background: var(--panel2); border: 1px solid var(--line); font-size: 13px; }

/* ------------------------------------------------------------ menu-like pages */
.screen { position: fixed; inset: 0; z-index: 15; }
.page { overflow-y: auto; background: radial-gradient(120% 60% at 50% 0%, #1e4a30 0%, var(--bg) 62%); touch-action: pan-y; padding-top: var(--sat); padding-bottom: var(--sab); }
.page .wrap { padding: 12px 16px 24px; max-width: 520px; margin: 0 auto; }
.logo { text-align: center; margin: 0 0 10px; }
.logo canvas { display: block; width: 250px; height: 92px; margin: 0 auto; }
.logo .t1, .logo .t2 { font-size: 38px; line-height: .92; }
.logo .t2 { color: var(--accent); }
.logo .sub { color: var(--muted); font-size: 11px; letter-spacing: .3em; margin-top: 6px; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.card .lbl { font-size: 9.5px; font-weight: 900; letter-spacing: .16em; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; text-transform: uppercase; }
.card .lbl b { color: var(--accent); }
.cont { display: flex; gap: 10px; align-items: center; }
.cont img, .cont canvas { width: 96px; height: 66px; border-radius: 10px; flex: 0 0 96px; border: 1px solid #ffffff22; object-fit: cover; background: #2f6428; }
.cont .nm { font-size: 19px; line-height: 1; } .cont .ds { font-size: 11px; font-weight: 800; color: var(--muted); margin-top: 3px; }
.cont .st { display: flex; gap: 8px; margin-top: 5px; font-size: 11px; font-weight: 900; white-space: nowrap; flex-wrap: wrap; }
.go { display: block; width: 100%; border-radius: 16px; text-align: center; font-weight: 900; font-style: italic; font-size: 20px; padding: 13px 0; box-shadow: 0 8px 24px #f0b40033; letter-spacing: .03em; margin-top: 8px; text-transform: uppercase; }
.modes { display: flex; gap: 6px; margin: 2px 0 8px; }
.modes button { flex: 1; text-align: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 0; font-size: 12.5px; font-weight: 900; }
.modes button.sel { background: var(--accent); border-color: var(--accent); color: #1a1400; }
.scn { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-top: 1px solid #ffffff10; width: 100%; text-align: left; }
.scn:first-of-type { border-top: 0; }
.scn .n { width: 26px; height: 26px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: 0 0 26px; border: 1px solid var(--line); }
.scn canvas, .scn img { width: 58px; height: 38px; border-radius: 7px; flex: 0 0 58px; }
.scn .nm { font-size: 13.5px; font-weight: 900; } .scn .ds { font-size: 10.5px; color: var(--muted); font-weight: 800; margin-top: 1px; }
.scn .md { margin-left: auto; display: flex; gap: 3px; flex: 0 0 auto; }
.scn.cur { background: #ffd23f12; border-radius: 10px; border-top-color: transparent; } .scn.cur .n { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.scn.lock { opacity: .45; }
.scn > div { min-width: 0; }
.foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; font-weight: 800; color: var(--muted); margin-top: 8px; gap: 8px; }
.foot .cl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 800; }
.foot .cl i { width: 8px; height: 8px; border-radius: 50%; background: #8fa89a; flex: 0 0 8px; }
.foot .cl.on i { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); } .foot .cl.warn i { background: var(--accent); }
.ib { display: flex; gap: 6px; } .ib button { width: 40px; height: 40px; border-radius: 11px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 17px; text-align: center; }
.ggs-foot { text-align: center; margin-top: 14px; font-size: 11px; } .ggs-foot a { color: var(--muted); }
.field { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.field input[type=text] { flex: 1; background: #0b1410; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 800; color: var(--text); min-width: 0; }
.seg { display: flex; background: #ffffff10; border-radius: 10px; padding: 2px; flex-wrap: wrap; }
.seg button { font-size: 11.5px; font-weight: 900; padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.seg button.sel { background: var(--accent); color: #1a1400; }
.zrow { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #ffffff10; }
.zrow:first-of-type { border-top: 0; }
.zrow img, .zrow .ph { width: 60px; height: 40px; border-radius: 7px; flex: 0 0 60px; object-fit: cover; background: var(--panel2); display: grid; place-items: center; font-size: 20px; }
.zrow .nm { font-size: 13px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .zrow .ds { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.zrow > div { min-width: 0; flex: 1; }
.zrow .zb { display: flex; gap: 4px; flex: 0 0 auto; }
.zrow .zb button { width: 32px; height: 32px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; text-align: center; }
.st8 { margin-left: auto; font-size: 10.5px; font-weight: 900; padding: 3px 8px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.st8.ok { background: #3ee08f22; color: #3ee08f; } .st8.wn { background: #ffd23f22; color: #ffd23f; } .st8.up { background: #58a6ff22; color: #9ccbff; } .st8.off { background: #ffffff10; color: var(--muted); }
.bar2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar2 .bk { width: 40px; height: 40px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 20px; font-weight: 900; text-align: center; }
.bar2 .t { font-size: 24px; }
.pl { display: flex; align-items: center; gap: 10px; }
.pl canvas { width: 42px; height: 42px; border-radius: 50%; background: var(--panel2); }
.pl .nm { font-size: 15px; font-weight: 900; } .pl .ds { font-size: 11px; color: var(--muted); font-weight: 800; }
.how { font-size: 12.5px; line-height: 1.45; font-weight: 600; color: #cfe0d6; } .how li { margin: 0 0 6px 16px; } .how b { color: var(--accent); }

/* pause, results, dialogs, cloud conflict */
.panel2 { width: min(420px, 100%); max-height: 100%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 20px 60px #000c; animation: pop .2s ease-out; }
.ptitle { font-size: 26px; margin-bottom: 8px; }
.res { width: min(420px, 100%); background: linear-gradient(180deg, #1d3a2a, var(--panel)); border: 1.5px solid var(--accent); border-radius: 20px; padding: 18px 16px; text-align: center; box-shadow: 0 20px 60px #000c; animation: pop .25s ease-out; }
.res .pre { font-size: 10px; font-weight: 900; letter-spacing: .2em; color: var(--muted); }
.res .ttl { font-size: 30px; color: var(--accent); margin-top: 4px; line-height: 1; }
.res .medals { display: flex; gap: 10px; justify-content: center; margin: 14px 0 10px; }
.res .medals .medal { width: 40px; height: 40px; }
.conflict { width: min(460px, 100%); background: var(--panel); border: 1.5px solid var(--accent); border-radius: 18px; padding: 14px; box-shadow: 0 20px 60px #000; animation: pop .2s ease-out; align-self: end; margin-bottom: 4px; }
.conflict .t { font-size: 21px; line-height: 1.05; } .conflict .s { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cmp > div { background: var(--panel2); border: 1.5px solid var(--line); border-radius: 13px; padding: 8px; min-width: 0; }
.cmp > div.new { border-color: var(--accent2); }
.cmp img { display: block; width: 100%; height: 76px; border-radius: 8px; object-fit: cover; background: #2f6428; }
.cmp .who { font-size: 9.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); margin: 6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.cmp .when { font-size: 12.5px; font-weight: 900; }
.cmp .kv { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 800; margin-top: 3px; } .cmp .kv span { color: var(--muted); }
.cmp .kv b.up { color: var(--accent2); }
.cbtn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cbtn button { border-radius: 13px; text-align: center; padding: 12px 0; font-weight: 900; font-size: 13.5px; background: var(--panel2); border: 1px solid var(--line); }
.cbtn button.y { background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; border: 0; font-style: italic; }
.note { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 8px; }

/* the habitat card inside a sheet: narrower, one column where the sheet is a side panel */
.sheet .hab { padding: 8px 9px; }
body.desk .sheet .parts, body.land .sheet .parts { grid-template-columns: 1fr; }
body.desk .sheet .hab .hd .pct b, body.land .sheet .hab .hd .pct b { font-size: 24px; }
body.desk .sheet .hab .hd .nm, body.land .sheet .hab .hd .nm { font-size: 14px; }
/* desktop panels: hidden on phones */
.rumble, .mini, .keys { display: none; }

/* ============================================================ phone landscape */
body.land .money { top: calc(8px + var(--sat)); left: calc(84px + var(--sal)); padding: 4px 10px 5px; min-width: 0; } body.land .money b { font-size: 19px; }
body.land .date { top: calc(8px + var(--sat)); right: calc(58px + var(--sar)); } body.land .mbtn { top: calc(8px + var(--sat)); right: calc(10px + var(--sar)); width: 40px; height: 40px; }
body.land .fame { top: calc(8px + var(--sat)); left: calc(240px + var(--sal)); right: auto; width: min(330px, calc(100vw - 500px)); padding: 5px 10px 6px; }
body.land .fame .sub { display: none; }
body.land .feed { top: calc(64px + var(--sat)); left: calc(84px + var(--sal)); right: auto; max-width: 46vw; }
body.land .tray { left: 0; top: 0; bottom: 0; right: auto; width: 100%; padding: 0; background: none; pointer-events: none; }
body.land #hud .tray { pointer-events: none; }
body.land .tray > * { pointer-events: auto; }
body.land .cats { position: absolute; left: 0; top: 0; bottom: 0; width: 76px; padding: calc(8px + var(--sat)) 7px calc(8px + var(--sab)) calc(7px + var(--sal)); display: flex; flex-direction: column; gap: 5px;
  background: linear-gradient(90deg, rgba(11, 20, 16, .97), rgba(11, 20, 16, .9) 85%, rgba(11, 20, 16, 0)); overflow-y: auto; scrollbar-width: none; }
body.land .cat { padding: 4px 0 3px; font-size: 16px; flex: 0 0 auto; } body.land .cat small { margin-top: 1px; font-size: 8px; }
body.land .items { position: absolute; left: 82px; right: calc(10px + var(--sar)); bottom: calc(6px + var(--sab)); padding: 4px 2px 2px; }
body.land .brush { position: absolute; left: 82px; right: calc(10px + var(--sar)); bottom: calc(96px + var(--sab)); margin: 0; }
body.land .it { flex-basis: 90px; } body.land .it canvas { height: 36px; }
body.land #habcard { top: calc(58px + var(--sat)); left: auto; right: calc(10px + var(--sar)); width: 330px; }
body.land .sheet { left: auto; top: 0; right: 0; bottom: 0; width: min(380px, 52vw); max-height: none; border-radius: 18px 0 0 18px; border-top: 0; border-left: 1px solid var(--line); padding-top: calc(10px + var(--sat)); }
body.land .sheet .grab { display: none; }
body.land .toast { bottom: calc(150px + var(--sab)); left: 55%; }
body.land .legend { top: calc(64px + var(--sat)); left: calc(240px + var(--sal)); right: auto; }
body.land .banner { top: calc(70px + var(--sat)); }
body.land .shop { max-width: 820px; width: 100%; }
body.land .agrid { grid-template-columns: repeat(4, 1fr); }
body.land .ac canvas { height: 72px; }

/* ============================================================ desktop */
body.desk .money { top: 10px; left: 10px; min-width: 168px; }
body.desk .date { top: 10px; left: 188px; right: auto; display: flex; align-items: center; gap: 12px; padding: 7px 12px; }
body.desk .date .spd { margin-top: 0; } body.desk .date .spd button { font-size: 11px; padding: 3px 8px; }
body.desk .fame { top: 10px; left: 496px; right: auto; width: min(300px, calc(100vw - 890px)); padding: 6px 12px 8px; }
body.desk .fame .sub { display: none; }
body.desk .chips-top { display: flex; position: absolute; top: 10px; left: 806px; gap: 8px; }
@media (max-width: 1400px) { body.desk .chips-top { display: none; } }
body.desk .chip { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12px; font-weight: 900; white-space: nowrap; }
body.desk .chip b { font-size: 18px; font-style: italic; color: var(--accent2); }
body.desk .ovbtns { display: flex; position: absolute; top: 10px; right: 64px; gap: 4px; align-items: center; padding: 6px 8px; }
body.desk .ovbtns button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #ffffff0c; font-size: 15px; text-align: center; }
body.desk .ovbtns button.sel { background: var(--accent); }
body.desk .mbtn { top: 12px; right: 12px; }
body.desk .feed { display: none; }
body.desk .rumble { display: block; position: absolute; top: 74px; left: 10px; width: 280px; padding: 11px 12px; max-height: calc(100vh - 340px); overflow-y: auto; scrollbar-width: none; }
body.desk .rumble .lbl { font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .16em; margin-bottom: 8px; display: flex; justify-content: space-between; }
body.desk .rumble .lbl b { color: var(--accent); letter-spacing: .04em; }
body.desk .spark { display: block; width: 100%; height: 46px; margin-top: 6px; border-radius: 8px; background: #ffffff06; }
body.desk .mini { display: block; position: absolute; left: 10px; bottom: 12px; padding: 6px; }
body.desk .mini canvas { display: block; width: 230px; height: 140px; border-radius: 7px; cursor: pointer; }
body.desk .keys { display: flex; position: absolute; right: 10px; bottom: 12px; width: 300px; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
body.desk .keys div { background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 8px; padding: 3px 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
body.desk .keys b { color: var(--text); background: #ffffff14; border-radius: 4px; padding: 0 5px; margin-right: 4px; }
body.desk .tray { left: 50%; right: auto; bottom: 12px; transform: translateX(-50%); width: 700px; padding: 8px; background: rgba(8, 14, 11, .86); border: 1px solid #ffffff22; border-radius: 12px; box-shadow: 0 6px 20px #0008; }
body.desk .brush { margin: 0 0 6px; }
body.desk .items { padding: 6px 2px 6px; }
body.desk .it .k { display: block; }
body.desk .cats { grid-template-columns: repeat(8, 1fr); } body.desk .cat { font-size: 15px; padding: 5px 0 4px; }
body.desk .cat .kk { display: block; } body.desk .cat.sel .kk { color: #1a1400; }
body.desk .cat.desk-only { display: block; } body.desk .cat.phone-only { display: none; }
body.desk #btn-bull, body.desk #btn-turn { display: none; }
body.desk #habcard { top: 74px; left: auto; right: 10px; width: 340px; }
body.desk .sheet { left: auto; right: 10px; top: 74px; bottom: auto; width: 340px; max-height: calc(100vh - 90px); border-radius: 12px; border: 1px solid #ffffff22; background: rgba(12, 22, 17, .95); }
body.desk .sheet .grab { display: none; }
body.desk .toast { bottom: 190px; }
body.desk .legend { top: 74px; left: 300px; right: auto; }
body.desk .banner { top: 90px; }
body.desk.nopanels .rumble, body.desk.nopanels .mini, body.desk.nopanels .keys { display: none; }
body.desk .agrid { grid-template-columns: repeat(3, 1fr); }
body.desk .shop { width: 760px; }

/* ------------------------------------------------------------ playing together (js/net.js, js/nbnet.js) */
.mpmode { display: flex; flex-direction: column; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; margin-bottom: 6px; }
.mpmode b { font-size: 15px; } .mpmode span { font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.35; }
.lbtop { display: flex; align-items: center; gap: 9px; margin: 4px 0 10px; }
.lbtop .back { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 28px; font-weight: 900; text-align: center; line-height: 40px; }
.lbtop .ttl { flex: 1; min-width: 0; font-size: clamp(16px, 5.1vw, 30px); line-height: 1; white-space: nowrap; }
.lbtop .lbtab { flex: 0 0 auto; border-radius: 12px; }
.lbtop .lbtab button { padding: 7px 9px; font-size: 12px; }
.lbtop .lbtab button:disabled { opacity: .5; }
.mcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mcard { display: flex; flex-direction: column; gap: 3px; background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; text-align: left; }
.mcard b { font-size: 14.5px; line-height: 1.05; white-space: nowrap; } .mcard span { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.mcard.sel { border-color: var(--accent); background: #2a2a10; } .mcard.sel b { color: var(--accent); }
.mcard:disabled { cursor: default; } .mcard:disabled:not(.sel) { opacity: .6; }
.joinrow { display: flex; gap: 8px; }
.joinrow input { flex: 1; min-width: 0; background: #0b1410; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 20px; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; color: var(--text); }
.coderow { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.code { display: flex; gap: 6px; }
.code i { width: 50px; height: 54px; border: 2px solid var(--accent); border-radius: 12px; background: #0b100b; display: grid; place-items: center; font-style: italic; font-weight: 900; font-size: 34px; color: var(--accent); }
.share { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-align: right; }
.kp { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid #ffffff10; }
.kp:first-of-type { border-top: 0; }
.kp canvas { width: 42px; height: 42px; border-radius: 50%; background: #203a2c; flex: 0 0 42px; }
.kp .kn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kp .kn b { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp .kn b em { color: var(--accent); font-style: normal; } .kp .kn b small { color: var(--muted); font-size: 11px; }
.kp .kn span { font-size: 11.5px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp .rdy { font-size: 11px; font-weight: 900; color: var(--accent2); background: #3ee08f1a; border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.kp .dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid #ffffff10; }
.rule:first-of-type { border-top: 0; }
.rule > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.rule b { font-size: 13.5px; font-weight: 900; } .rule span { font-size: 11px; font-weight: 700; color: var(--muted); }
.tog { width: 50px; height: 28px; flex: 0 0 50px; border-radius: 999px; background: #ffffff1c; position: relative; transition: background .15s; }
.tog i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #d8e0dc; transition: left .15s; }
.tog.on { background: var(--accent2); } .tog.on i { left: 25px; background: #fff; }
.tog:disabled { opacity: .55; }
.zc { display: flex; gap: 10px; align-items: center; }
.zc img, .zc .ph { width: 110px; height: 72px; border-radius: 10px; flex: 0 0 110px; object-fit: cover; background: #2f6428; border: 1px solid #ffffff22; display: grid; place-items: center; font-size: 26px; }
.zc .nm { font-size: 20px; line-height: 1; } .zc .ds { font-size: 11.5px; font-weight: 800; color: var(--muted); margin-top: 3px; }
.zc .st { display: flex; gap: 8px; margin-top: 5px; font-size: 12px; font-weight: 900; flex-wrap: wrap; }
.zrow .cnt { font-size: 11px; font-weight: 900; color: var(--muted); align-self: center; margin-right: 4px; white-space: nowrap; }
/* in the zoo: the room chip and the keepers */
.coop { position: absolute; top: calc(132px + var(--sat)); right: calc(10px + var(--sar)); padding: 5px 8px 6px; pointer-events: auto; max-width: 60vw; }
.coop .rc { display: flex; align-items: center; gap: 6px; width: 100%; }
.coop .rl { font-size: 8.5px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.coop .rc b { font-size: 16px; color: var(--accent); letter-spacing: .06em; }
.coop .dots { display: flex; } .coop .dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #0b1410; margin-left: -4px; }
.coop .dots i:first-child { margin-left: 0; }
.coop .md { font-size: 8.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); margin-left: auto; white-space: nowrap; }
.coop .prs { margin-top: 3px; display: flex; flex-direction: column; gap: 1px; }
.coop .pr { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.coop .pr i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.coop .pr span { color: var(--muted); font-weight: 800; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
body.land .coop { top: calc(64px + var(--sat)); right: calc(10px + var(--sar)); max-width: 300px; }
body.desk .coop { top: 70px; right: 360px; min-width: 240px; }
body.port.habon .coop { visibility: hidden; }
#coop-cur { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#coop-cur .cur { position: absolute; left: 0; top: 0; will-change: transform; }
#coop-cur .cur svg { display: block; filter: drop-shadow(0 2px 3px #0008); }
#coop-cur .cur b { position: absolute; left: 20px; top: 22px; white-space: nowrap; color: #fff; font-size: 11.5px; font-weight: 900; padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 8px #0006; text-shadow: 0 1px 2px #0006; }
.askbox { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(240px + var(--sab)); width: min(520px, calc(100vw - 20px)); display: flex; align-items: center; gap: 10px; padding: 8px 10px; pointer-events: auto; animation: fin .2s; z-index: 3; }
.askbox .av { width: 34px; height: 34px; border-radius: 50%; border: 3px solid; background: #8fa89a; flex: 0 0 34px; }
.askbox > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .askbox b { font-size: 13px; } .askbox span { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.askbox em { font-size: 11px; font-weight: 900; color: var(--muted); font-style: normal; white-space: nowrap; }
.askbox button { width: 42px; height: 42px; border-radius: 50%; font-size: 18px; font-weight: 900; text-align: center; flex: 0 0 42px; color: #fff; }
.askbox .no { background: #e5484d; } .askbox .yes { background: #2fbf71; }
body.land .askbox { bottom: calc(12px + var(--sab)); } body.desk .askbox { bottom: 150px; }
.nbchip { position: absolute; top: calc(132px + var(--sat)); right: calc(10px + var(--sar)); padding: 6px 10px; display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 900; }
.nbchip b { color: var(--accent); letter-spacing: .06em; } .nbchip em { font-style: normal; color: var(--muted); } .nbchip i { font-style: normal; color: var(--accent2); }
body.land .nbchip { top: calc(64px + var(--sat)); } body.desk .nbchip { top: 70px; right: 360px; }
.posts2 { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.chip2 { font-size: 11.5px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); }
.league { display: flex; flex-direction: column; gap: 3px; }
.lg { display: grid; grid-template-columns: 18px 1fr auto 46px 24px; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 900; padding: 5px 6px; border-radius: 9px; background: #ffffff07; }
.lg.me { background: #ffd23f14; border: 1px solid #ffd23f44; }
.lg .n { color: var(--muted); } .lg .z { display: flex; flex-direction: column; min-width: 0; } .lg .z b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg .z small { color: var(--muted); font-weight: 800; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #ffffff10; }
.xl canvas { width: 46px; height: 36px; border-radius: 8px; background: #203a2c; flex: 0 0 46px; }
.xl > span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .xl b { font-size: 12.5px; } .xl small { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.xl .btn { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.nbsell { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; background: var(--panel2); border-radius: 12px; padding: 9px; }
.nbsell select { background: #0b1410; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-weight: 800; color: var(--text); width: 100%; }
.nbsell .go { font-size: 15px; padding: 10px 0; margin-top: 2px; }
.prog { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid #ffffff10; }
.prog .ic { font-size: 22px; flex: 0 0 28px; text-align: center; } .prog > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prog b { font-size: 12.5px; } .prog small { font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.prog .nb i { background: var(--accent2); } .prog.done b { color: var(--accent2); }
.prog .gv { display: flex; flex-direction: column; gap: 4px; } .prog .gv .btn { padding: 6px 9px; font-size: 11.5px; }
.sh-hd .ic2 { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 12px; background: #203a2c; display: grid; place-items: center; font-size: 28px; }
body.port.coopon .feed { right: calc(10px + 44vw); }
#lobby .card { padding: 8px 12px; margin-bottom: 7px; }
#lobby .go { margin-top: 4px; }
.card .lbl .lblbtn { color: var(--accent); font-weight: 900; letter-spacing: .1em; font-size: 10px; text-transform: uppercase; }
body.port.coopon .feed div { max-width: 100%; } body.port.coopon .feed div > span:last-child { min-width: 0; }

/* ------------------------------------------------------------ Zoopedia */
.zp { max-width: 980px; }
.zpbody { flex: 1; min-height: 0; display: flex; gap: 0; }
.zplist { flex: 1; padding-bottom: 12px; }
.zpd { flex: 1; min-height: 0; overflow-y: auto; padding: 0 14px 16px; scrollbar-width: thin; }
.zpd .sh-hd { margin-top: 2px; }
.zpd .zpp { width: 92px; height: 72px; border-radius: 10px; background: radial-gradient(120% 90% at 50% 100%, #2c4a33, #1a2e22); }
.zpd .row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; padding: 4px 0; border-top: 1px solid #ffffff0c; }
.zpd .row span { color: var(--muted); flex: 0 0 auto; } .zpd .row b { text-align: right; }
.zpparts { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 4px 0 6px; }
.zpparts .part { grid-template-columns: 110px 1fr 40px; font-size: 11.5px; }
.chipsl { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.chipsl span { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 800; }
.zc canvas { height: 92px; }
.zc .nm { font-size: 12.5px; }
.zc .nm .new { color: var(--accent2); font-style: normal; }
.zpback { display: none; margin: 2px 0 6px; background: none; color: var(--accent); font-weight: 900; font-size: 13px; padding: 6px 0; min-height: 36px; }
.zpempty { display: none; }
/* a phone held upright: the list, or one species full width */
body.port .zpbody.has .zplist { display: none; }
body.port .zpbody:not(.has) .zpd { display: none; }
body.port .zpback { display: inline-block; }
body.port .zp .agrid { grid-template-columns: 1fr 1fr; }
/* sideways and desktop: the list and the species side by side */
body.land .zplist, body.desk .zplist { flex: 0 0 52%; }
body.land .zpempty, body.desk .zpempty { display: block; padding-top: 10px; }
body.land .zp .agrid { grid-template-columns: 1fr 1fr; }
body.land .zplist { flex: 0 0 44%; }
body.land .zp .top { padding: 8px 14px 4px; } body.land .zp .top .t { font-size: 20px; }
body.desk .zp { width: 980px; }
body.desk .zp .agrid { grid-template-columns: 1fr 1fr 1fr; }
body.land .zc canvas { height: 64px; }

/* ------------------------------------------------------------ gamepad cursor and tool ring */
#padcur { position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #ffd23f; box-shadow: 0 0 0 2px #0b1410, 0 0 12px #ffd23f88; pointer-events: none; z-index: 60; }
#padcur::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ffd23f; }
#padcur.down { background: #ffd23f33; }
#padring { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 59; pointer-events: none; }
#padring .pr { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(8, 14, 11, .9); border: 2px solid #ffffff33; display: grid; place-items: center; font-size: 24px; line-height: 1; text-align: center; }
#padring .pr small { display: block; font-size: 9px; font-weight: 900; color: var(--muted); margin-top: -10px; }
#padring .pr.sel { border-color: var(--accent); background: #262a12; transform: scale(1.12); }
#padring .hub { position: absolute; width: 90px; margin-left: -45px; margin-top: -10px; text-align: center; font-size: 11px; font-weight: 900; color: var(--accent); text-shadow: 0 1px 3px #000; }

/* ------------------------------------------------------------ Neighbour Zoos: the race podium */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; align-items: end; margin: 6px 0 8px; }
.podium .pd { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.podium .pd b { font-size: 12px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pd small { font-size: 9.5px; color: var(--muted); font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pd .md { font-size: 24px; }
.podium .pd i { display: block; width: 100%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #2e5a3e, #1a3326); margin-top: 3px; }
.podium .p1 i { height: 54px; background: linear-gradient(180deg, #ffd23f, #b08a1e); } .podium .p2 i { height: 38px; background: linear-gradient(180deg, #d9e2e8, #8a969e); } .podium .p3 i { height: 26px; background: linear-gradient(180deg, #e0a26a, #8a5a32); }
.podium .pd.me b { color: var(--accent); } .podium .pd.empty { opacity: .45; }
.seg.wrap { flex-wrap: wrap; } .seg.wrap button { flex: 1 0 45%; }
.league .lg .nb { height: 5px; border-radius: 3px; background: #ffffff14; margin-top: 3px; position: relative; } .league .lg .nb i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent2); }
