/* aped.city — mainnet game UI. Chunky outlined cartoon HUD over a low-poly jungle map. */
:root {
  --ink: #3b1f0e;
  --ink2: #7a4d2b;
  --cream: #fff7e2;
  --paper: #fffdf7;
  --sand: #f4e9cf;
  --banana: #ffd21e;
  --banana2: #ffe36e;
  --leaf: #2f9e44;
  --leaf2: #e3f8e6;
  --sky: #3fd2c3;
  --red: #e03131;
  --display: 'Lilita One', 'Arial Black', system-ui, sans-serif;
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --out: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 4px 0 var(--ink);
  --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);
  --g: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0; color: var(--ink); font: 700 14px/1.4 var(--ui); background: #2d8f4e;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button, input { font: inherit; color: inherit; }
a, button, input, label { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: default; }
#game.cmd { cursor: crosshair; }
#game.pan { cursor: grabbing; }

.compat { display: none; position: fixed; z-index: 200; top: 0; left: 0; right: 0; padding: 10px 16px; padding-top: calc(10px + var(--sat)); background: var(--ink); color: var(--cream); font: 800 13px/1.4 var(--ui); text-align: center; }
.compat b { color: var(--banana); margin-right: 6px; }
.compat .c-st { display: none; }
.old .compat, .stuck .compat { display: block; }
.stuck .compat .c-st { display: inline; }

/* ---------- loading ---------- */
.loading { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: #2d8f4e radial-gradient(120% 80% at 40% 20%, #9ff3dd 0%, #3fd2c3 45%, #1d9a6c 100%); transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }
.ld-in { display: grid; gap: 14px; justify-items: center; }
.ld-in .logo { font-size: 48px; }
.ld-bar { width: 220px; height: 16px; border-radius: 99px; background: var(--cream); border: 3px solid var(--ink); overflow: hidden; box-shadow: 0 4px 0 var(--ink); }
.ld-bar i { display: block; height: 100%; width: 5%; background: var(--banana); transition: width .25s; }
#ldTxt { font: 800 13px var(--ui); color: var(--cream); text-shadow: 0 2px 0 var(--ink); }

/* ---------- top HUD ---------- */
.hud-top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 16px 0; padding-top: calc(12px + var(--sat)); padding-left: calc(16px + var(--sal)); padding-right: calc(16px + var(--sar)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hl { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 0 1 auto; }
.hr { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.logo { font: 30px/1 var(--display); letter-spacing: .01em; color: var(--banana); text-decoration: none; text-shadow: var(--out); white-space: nowrap; }
.logo span { color: var(--cream); }
.bank { display: flex; align-items: center; gap: 4px; pointer-events: none; }
.bn-ic { width: 46px; height: 46px; filter: drop-shadow(0 3px 0 rgba(59,31,14,.35)); flex: none; }
.bn-ic.sm { width: 20px; height: 20px; filter: none; }
.bank-t { display: grid; line-height: 1; min-width: 0; }
.bank b { font: 34px/1 var(--display); color: var(--banana); text-shadow: var(--out); letter-spacing: .02em; }
.bank span { font: 900 12px/1.3 var(--ui); color: var(--cream); text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 2px 0 var(--ink); margin-top: 3px; }
.bank.bump b { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-4deg); } }

.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--cream); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 800 13px/1 var(--ui); white-space: nowrap; text-decoration: none; }
button.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.chip b { font: 16px/1 var(--display); letter-spacing: .02em; }
.chip.icon { width: 36px; padding: 0; }
.chip.icon svg { width: 19px; height: 19px; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: #37d25a; box-shadow: 0 0 0 2px var(--ink); animation: pulse 1.6s ease-in-out infinite; }
.chip.pay { background: var(--ink); color: var(--banana); }
.chip.pay.soon b { color: #ff9f43; }
.chip.wallet { background: var(--banana); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.chip.wallet.on { background: var(--cream); }
.chip.menu { display: none; }
@keyframes pulse { 50% { transform: scale(.7); opacity: .6; } }

.banner { position: fixed; z-index: 19; left: 50%; transform: translateX(-50%); top: calc(62px + var(--sat)); padding: 6px 14px; border-radius: 99px; background: var(--ink); color: var(--banana); font: 900 12px/1.3 var(--ui); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.banner.act { pointer-events: auto; cursor: pointer; background: var(--banana); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.feed { position: fixed; z-index: 18; left: 50%; transform: translateX(-50%); top: calc(96px + var(--sat)); display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(92vw, 520px); }
.fi { padding: 7px 14px; border-radius: 14px; background: var(--cream); border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 800 13px/1.3 var(--ui); text-align: center; animation: fin .35s cubic-bezier(.3,1.5,.5,1); transition: opacity .5s, transform .5s; }
.fi b { font-weight: 900; }
.fi i { font-style: normal; display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--ink); margin-right: 5px; vertical-align: -1px; }
.fi.gold { background: var(--banana); }
.fi.out { opacity: 0; transform: translateY(-8px); }
@keyframes fin { 0% { transform: scale(.6); opacity: 0; } }

/* ---------- minimap ---------- */
.minimap { position: fixed; z-index: 16; left: calc(var(--g) + var(--sal)); bottom: calc(var(--g) + var(--sab)); width: 172px; height: 172px; border-radius: 16px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); overflow: hidden; background: #2d8f4e; }
.minimap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

/* ---------- dock (army) ---------- */
.dock { position: fixed; z-index: 17; left: 50%; transform: translateX(-50%); bottom: calc(var(--g) + var(--sab)); display: grid; gap: 8px; justify-items: center; pointer-events: none; max-width: calc(100vw - 2 * var(--g) - 380px); }
.dock > * { pointer-events: auto; max-width: 100%; }
.army { display: flex; gap: 6px; padding: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 18px; background: rgba(255,247,226,.94); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ab { position: relative; flex: none; display: flex; align-items: center; gap: 6px; height: 48px; min-width: 48px; padding: 0 10px 0 4px; border-radius: 13px; border: 2.5px solid var(--ink); background: var(--paper); box-shadow: 0 3px 0 var(--ink); font: 16px/1 var(--display); }
.ab:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ab img { width: 36px; height: 36px; border-radius: 9px; border: 2px solid var(--ink); object-fit: cover; }
.ab.all { padding: 0 12px; background: var(--banana); }
.ab.all b { font: 15px/1 var(--display); }
.ab.on { background: #c5f6d0; box-shadow: 0 3px 0 var(--ink), inset 0 0 0 2px #2f9e44; }
.ab.all.on { background: #8ce99a; }
.ab.zero { opacity: .45; }
.ab.tool { padding: 0; justify-content: center; width: 48px; }
.ab.tool svg { width: 22px; height: 22px; }
.ab.tool.on { background: var(--ink); color: var(--banana); }
.selinfo { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 14px; border-radius: 99px; background: var(--ink); color: var(--cream); font: 800 13px/1 var(--ui); white-space: nowrap; max-width: 100%; }
.selinfo #selN { color: var(--banana); font-weight: 900; }
.selinfo .hint { opacity: .8; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.selinfo .mini { flex: none; }
.mini { height: 30px; min-width: 34px; padding: 0 11px; border-radius: 99px; border: 2px solid var(--cream); background: transparent; color: var(--cream); font: 900 12px/1 var(--ui); text-transform: uppercase; letter-spacing: .04em; }
.resp { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 99px; background: rgba(59,31,14,.86); color: var(--cream); font: 800 12px/1 var(--ui); }
.resp svg { width: 15px; height: 15px; }
.resp b { color: #ffa8a8; font: 14px/1 var(--display); }

/* ---------- buy ---------- */
.buy { position: fixed; z-index: 17; right: calc(var(--g) + var(--sar)); bottom: calc(var(--g) + var(--sab)); display: inline-flex; align-items: center; gap: 8px; height: 58px; padding: 0 22px 0 18px; border-radius: 20px; border: 3px solid var(--ink); background: var(--banana); box-shadow: 0 5px 0 var(--ink); font: 22px/1 var(--display); letter-spacing: .02em; }
.buy .bn-ic.sm { width: 28px; height: 28px; }
.buy:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.buy.pulse { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-4deg) scale(1.05); } 90% { transform: rotate(4deg) scale(1.05); } 95% { transform: rotate(-2deg); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 16px; border: 3px solid var(--ink); background: var(--banana); box-shadow: 0 4px 0 var(--ink); font: 19px/1 var(--display); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.btn.big { height: 58px; font-size: 22px; padding: 0 26px; }
.btn.ghost { background: var(--cream); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy span::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 10px; border: 3px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kicker { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--ink); color: var(--banana); font: 900 11.5px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; }
.kicker i { width: 8px; height: 8px; border-radius: 50%; background: #37d25a; animation: pulse 1.6s infinite; }
.fine { margin: 10px 0 0; font: 800 12px/1.45 var(--ui); color: var(--ink2); }
.fine a { color: var(--ink); }
.msg { min-height: 1.4em; margin: 8px 0 0; font: 800 13px/1.4 var(--ui); color: var(--leaf); }
.msg.err { color: var(--red); }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; padding-top: calc(16px + var(--sat)); padding-bottom: calc(16px + var(--sab)); background: radial-gradient(90% 70% at 50% 40%, rgba(20,60,30,.25), rgba(20,40,20,.62)); overflow: auto; }
.gate-in { width: min(640px, 100%); padding: 26px 26px 22px; border-radius: 26px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 7px 0 var(--ink), 0 24px 60px rgba(0,0,0,.35); text-align: center; animation: pop .45s cubic-bezier(.3,1.5,.5,1); }
.gate h1 { margin: 14px 0 8px; font: 44px/1.02 var(--display); letter-spacing: .01em; }
.lead { margin: 0 auto; max-width: 480px; font: 700 16px/1.45 var(--ui); color: var(--ink2); }
.lead b { color: var(--ink); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.tri { border-radius: 16px; border: 2.5px solid var(--ink); overflow: hidden; background: var(--cream); box-shadow: 0 3px 0 var(--ink); }
.tri img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 2.5px solid var(--ink); }
.tri b { display: block; margin: 7px 6px 0; font: 15px/1.1 var(--display); }
.tri span { display: block; margin: 2px 6px 8px; font: 900 12px/1.2 var(--ui); color: var(--ink2); }
.gate-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; padding-top: calc(16px + var(--sat)); padding-bottom: calc(16px + var(--sab)); background: rgba(25,15,5,.5); overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet { position: relative; width: min(480px, 100%); min-width: 0; max-width: 100%; padding: 24px 22px 20px; border-radius: 24px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 7px 0 var(--ink); animation: pop .35s cubic-bezier(.3,1.5,.5,1); -webkit-user-select: text; user-select: text; }
.sheet.wide { width: min(940px, 100%); }
.sheet h2 { margin: 10px 0 6px; font: 32px/1.05 var(--display); letter-spacing: .01em; }
.sheet .sub { margin: 0 0 14px; font: 700 14px/1.45 var(--ui); color: var(--ink2); }
.sheet .sub b { color: var(--ink); }
.x { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--cream); box-shadow: 0 3px 0 var(--ink); font: 900 16px/1 var(--ui); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { min-width: 0; display: grid; grid-template-rows: auto 1fr; border-radius: 18px; border: 3px solid var(--ink); background: var(--cream); box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.card .ph { position: relative; }
.card .ph img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 3px solid var(--ink); }
.card .tag { position: absolute; left: 8px; top: 8px; padding: 4px 9px; border-radius: 99px; background: var(--ink); color: var(--banana); font: 900 10.5px/1 var(--ui); letter-spacing: .07em; text-transform: uppercase; }
.card .so { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(59,31,14,.55); color: var(--banana); font: 30px var(--display); text-shadow: var(--out); }
.card .bd { display: grid; gap: 8px; padding: 10px 12px 12px; align-content: start; }
.card h3 { margin: 0; font: 21px/1.05 var(--display); }
.card p { margin: 0; font: 700 12.5px/1.35 var(--ui); color: var(--ink2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.st { border-radius: 10px; background: var(--paper); border: 2px solid var(--ink); padding: 5px 2px 4px; text-align: center; }
.st b { display: block; font: 16px/1 var(--display); }
.st span { display: block; margin-top: 2px; font: 900 9px/1 var(--ui); letter-spacing: .05em; color: var(--ink2); text-transform: uppercase; }
.st.y b { color: #c98a00; }
.supply { display: grid; gap: 4px; font: 800 11.5px/1 var(--ui); color: var(--ink2); }
.supply .sb { height: 10px; border-radius: 99px; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.supply .sb i { display: block; height: 100%; background: var(--leaf); }
.buyrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font: 20px/1 var(--display); }
.price small { font: 900 11px var(--ui); color: var(--ink2); }
.step { display: inline-flex; align-items: center; border: 2.5px solid var(--ink); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 0 var(--ink); overflow: hidden; }
.step button { width: 38px; height: 40px; border: 0; background: transparent; font: 22px/1 var(--display); }
.step button:active { background: var(--sand); }
.step input { width: 46px; height: 40px; border: 0; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); background: #fff; text-align: center; font: 18px/1 var(--display); -moz-appearance: textfield; appearance: textfield; -webkit-user-select: text; user-select: text; }
.step input::-webkit-inner-spin-button, .step input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.card.picked { background: #fff3bf; }
.cart { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 12px 12px 12px 18px; border-radius: 18px; background: var(--ink); color: var(--cream); flex-wrap: wrap; }
.cart-t { display: grid; gap: 3px; }
.cart-t span { font: 800 13px/1.3 var(--ui); opacity: .85; }
.cart-t b { font: 26px/1 var(--display); color: var(--banana); }

.lbl { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: r; }
.lbl li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 13px; background: var(--cream); border: 2px solid var(--ink); counter-increment: r; font: 800 14px/1.2 var(--ui); }
.lbl li::before { content: counter(r); font: 18px var(--display); text-align: center; }
.lbl li.me { background: #fff3bf; }
.lbl li.empty { display: block; text-align: center; color: var(--ink2); }
.lbl li.empty::before { content: none; }
.lbl .on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #37d25a; margin-left: 6px; vertical-align: 1px; }
.lbl .b { font: 17px var(--display); color: #c98a00; }
.lbl .b small { color: var(--ink2); font: 800 11px var(--ui); margin-left: 5px; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.zr { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); font: 800 12px/1.2 var(--ui); min-width: 0; }
.zr i { flex: none; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); background: #ddd; }
.zr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zr b { display: block; font: 900 13px var(--ui); }

.rules { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 8px; font: 700 14px/1.45 var(--ui); color: var(--ink2); }
.rules b { color: var(--ink); }
.ctrls { display: grid; gap: 8px; margin-top: 14px; }
.ctrls > div { padding: 10px 12px; border-radius: 13px; background: var(--cream); border: 2px solid var(--ink); font: 700 12.5px/1.45 var(--ui); }
.ctrls b { display: block; font: 15px var(--display); margin-bottom: 2px; }
.touch .c-desk { order: 2; }

/* zone card (tap a zone) */
.zcard { position: fixed; z-index: 30; padding: 10px 14px; border-radius: 16px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font: 800 13px/1.35 var(--ui); transform: translate(-50%, calc(-100% - 14px)); pointer-events: none; min-width: 180px; text-align: center; }
.zcard h4 { margin: 0 0 3px; font: 19px/1.1 var(--display); }
.zcard .own { display: inline-flex; align-items: center; gap: 6px; }
.zcard .own i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--ink); }
.zcard .bty { color: #c98a00; font: 16px var(--display); }

/* toast + box select + flyers */
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(150px + var(--sab)); transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--cream); font: 800 14px/1.35 var(--ui); max-width: min(92vw, 460px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.boxsel { position: fixed; z-index: 10; border: 2px solid #fff; background: rgba(255,255,255,.14); border-radius: 4px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.flyer { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.flyer .fb { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; will-change: transform; }
.flyer .pl { position: absolute; transform: translate(-50%, -50%); font: 26px/1 var(--display); color: var(--banana); text-shadow: var(--out); white-space: nowrap; animation: rise 1.6s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

/* ---------- wallet sheet (wallet.js) ---------- */
.wmodal { position: fixed; inset: 0; z-index: 130; display: none; place-items: center; padding: 16px; background: rgba(25,15,5,.5); }
.wmodal.open { display: grid; }
.wsheet { width: min(380px, 100%); max-height: calc(100% - 20px); overflow: auto; padding: 18px; border-radius: 22px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); animation: pop .3s cubic-bezier(.3,1.5,.5,1); }
.wtitle { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font: 22px var(--display); }
.wtitle .mute { font: 800 13px var(--ui); color: var(--ink2); }
.wrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 7px; padding: 8px 12px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--cream); box-shadow: 0 3px 0 var(--ink); font: 800 14px/1.3 var(--ui); text-align: left; text-decoration: none; }
.wrow:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.wicon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--paper); border: 2px solid var(--ink); font: 900 14px var(--ui); overflow: hidden; flex: none; }
.wicon img { width: 100%; height: 100%; }
.warr { margin-left: auto; font: 900 16px var(--ui); }
.wnote { margin: 4px 0; font: 700 13px/1.45 var(--ui); color: var(--ink2); }
.wname { display: flex; gap: 6px; margin-top: 8px; }
.wname input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; font: 800 16px var(--ui); -webkit-user-select: text; user-select: text; }
.wname button { height: 44px; padding: 0 14px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--banana); font: 16px var(--display); }

/* ---------- responsive ---------- */
.s-show { display: none; }
@media (max-width: 1100px) {
  .dock { max-width: calc(100vw - 2 * var(--g) - 200px); }
  .selinfo .hint { display: none; }
}
@media (max-width: 900px), (max-height: 560px) {
  :root { --g: 10px; }
  .logo { font-size: 24px; }
  .bn-ic { width: 38px; height: 38px; }
  .bank b { font-size: 27px; }
  .minimap { width: 118px; height: 118px; border-radius: 13px; }
  .buy { height: 50px; font-size: 18px; padding: 0 16px 0 12px; border-radius: 17px; }
  .buy .bn-ic.sm { width: 22px; height: 22px; }
  .ab { height: 44px; min-width: 44px; }
  .ab img { width: 32px; height: 32px; }
  .ab.tool { width: 44px; }
  .dock { max-width: calc(100vw - 2 * var(--g) - 270px); }
}
/* phones (portrait): stacked bottom bar, logo hidden, tighter chips */
@media (max-width: 760px) and (orientation: portrait), (max-width: 560px) {
  .hud-top { padding-top: calc(8px + var(--sat)); padding-left: calc(10px + var(--sal)); padding-right: calc(10px + var(--sar)); }
  .logo { display: none; }
  .hr { gap: 5px; flex-wrap: nowrap; }
  #onChip, #lbBtn, #helpBtn { display: none; }
  .chip.menu { display: inline-flex; }
  .chip { height: 32px; padding: 0 9px; font-size: 12px; }
  .chip.icon { width: 32px; }
  .chip b { font-size: 14px; }
  .chip.wallet { max-width: 128px; }
  .s-hide { display: none; }
  .s-show { display: inline; }
  .bank-t span { font-size: 11px; }
  .dock { left: var(--g); right: var(--g); transform: none; max-width: none; bottom: calc(68px + var(--sab)); justify-items: stretch; }
  .army { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  .army::-webkit-scrollbar { display: none; }
  .ab { flex: none; }
  .selinfo { justify-self: center; }
  .selinfo .hint { display: none; }
  .resp { justify-self: center; }
  .minimap { left: auto; right: calc(var(--g) + var(--sar)); bottom: auto; top: calc(52px + var(--sat)); width: 96px; height: 96px; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  .buy { left: var(--g); right: var(--g); bottom: calc(var(--g) + var(--sab)); justify-content: center; height: 50px; }
  .banner { top: calc(60px + var(--sat)); font-size: 10.5px; max-width: calc(100vw - 130px); overflow: hidden; text-overflow: ellipsis; left: calc(var(--g) + var(--sal)); transform: none; }
  .feed { top: calc(156px + var(--sat)); }
  .gate h1 { font-size: 34px; }
  .gate-in { padding: 20px 16px 16px; }
  .lead { font-size: 14.5px; }
  .trio { gap: 7px; margin: 14px 0; }
  .tri b { font-size: 13px; }
  .tri span { font-size: 11px; }
  .cards { grid-template-columns: 1fr; }
  .card { grid-template-rows: none; grid-template-columns: 112px 1fr; }
  .card .ph img { height: 100%; aspect-ratio: auto; border-bottom: 0; border-right: 3px solid var(--ink); }
  .card .bd { padding: 9px 10px 10px; gap: 6px; }
  .card h3 { font-size: 18px; }
  .card p { display: none; }
  .st b { font-size: 14px; }
  .sheet { padding: 20px 14px 16px; }
  .sheet h2 { font-size: 27px; }
  .cart { padding: 10px 10px 10px 14px; }
  .cart .btn { width: 100%; }
  .zones { grid-template-columns: 1fr; }
  .toast { bottom: calc(180px + var(--sab)); }
}
@media (max-width: 380px) {
  .modal { padding-left: 8px; padding-right: 8px; }
  .sheet { padding-left: 10px; padding-right: 10px; }
  .card .bd { padding: 8px; }
  .step button { width: 34px; }
  .step input { width: 40px; }
  .price { font-size: 18px; }
  .chip.pay { padding: 0 8px; }
  .chip.pay .bn-ic.sm { display: none; }
  .chip.wallet { max-width: 98px; }
  .hr { gap: 4px; }
  .chip.live .dot { display: none; }
  .bank b { font-size: 21px; }
  .bank-t span { font-size: 10px; }
  .bn-ic { width: 30px; height: 30px; }
  .ab { height: 42px; min-width: 42px; padding: 0 8px 0 3px; font-size: 14px; gap: 4px; }
  .ab img { width: 28px; height: 28px; }
  .ab.tool { width: 42px; }
  .ab.all { padding: 0 9px; }
  .card { grid-template-columns: 78px 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gate h1 { font-size: 29px; }
}
/* landscape phones */
@media (max-height: 500px) and (min-width: 561px) {
  .hud-top { padding-top: calc(6px + var(--sat)); }
  .logo { display: none; }
  .chip { height: 30px; padding: 0 9px; }
  .chip.icon { width: 30px; }
  .bn-ic { width: 30px; height: 30px; }
  .bank b { font-size: 22px; }
  .minimap { width: 92px; height: 92px; }
  .ab { height: 40px; min-width: 40px; }
  .ab img { width: 28px; height: 28px; }
  .ab.tool { width: 40px; }
  .buy { height: 44px; font-size: 16px; }
  .dock { max-width: calc(100vw - 2 * var(--g) - 300px); gap: 5px; }
  .gate { align-items: start; }
  .gate h1 { font-size: 28px; margin: 8px 0 4px; }
  .trio { grid-template-columns: repeat(3, 110px); justify-content: center; margin: 10px 0; }
  .banner { top: calc(48px + var(--sat)); }
  .feed { top: calc(80px + var(--sat)); width: min(60vw, 460px); }
  .fi { padding: 5px 12px; font-size: 12px; }
  .selinfo { padding: 3px 4px 3px 12px; }
  .mini { height: 30px; }
  .resp { height: 26px; }
  .hr .chip.wallet { max-width: 140px; }
  .minimap { top: auto; }
}
