/* The Plug v2 — styles */
:root {
  --ink: #0e0e0e; --ink-2: #161616; --ink-3: #202020; --ink-4: #2a2a2a; --line: #2c2c2c;
  --cream: #f4efe6; --muted: #9a948a; --red: #e5322d; --yellow: #f6c445; --green: #4cc38a; --blue: #3d7bff;
  --me: #e5322d; --accent: var(--me); --on-accent: #f4efe6; --accent-soft: rgba(229, 50, 45, .14);
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --pixel: "Press Start 2P", ui-monospace, "Courier New", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --pop: cubic-bezier(.34, 1.56, .64, 1); --fast: 160ms; --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--cream); font-family: var(--body); font-size: 15px; line-height: 1.5;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(229, 50, 45, .12), transparent 60%), var(--ink);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
body.busy { cursor: progress; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .95; margin: 0; }
.pixel { font-family: var(--pixel); font-size: 9px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
small { font-size: 12px; color: var(--muted); }
.mine { color: var(--me) !important; }
.gold { color: var(--yellow); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(12px, 3vw, 28px); background: rgba(14, 14, 14, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.home { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.home img { transition: transform 500ms var(--ease); }
.home:hover img { transform: rotate(180deg); }
.game-name { font-family: var(--pixel); font-size: 10px; color: var(--accent); text-transform: uppercase; }
.menu-btn { background: var(--cream); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px; transition: transform var(--fast) var(--ease), background var(--fast); }
.menu-btn:hover { background: var(--yellow); transform: translateY(-1px); }

.app { max-width: 1320px; margin: 0 auto; padding: 14px clamp(12px, 3vw, 28px) 90px; display: grid; gap: 14px; animation: fadeUp 400ms var(--ease) both; }

/* HUD */
.hud { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "who where stats" "bars bars bars"; gap: 12px 20px; align-items: center;
  background: var(--cream); color: var(--ink); border-radius: var(--r); padding: 14px 18px; box-shadow: 0 5px 0 var(--me); }
.hud small { color: #6b665e; display: block; }
.hud-who { grid-area: who; display: flex; align-items: center; gap: 12px; min-width: 0; }
.hud-who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.hud-where { grid-area: where; min-width: 0; }
.hud-where .pixel { color: var(--ink); opacity: .7; }
.hud-where h1 { font-size: clamp(34px, 4.6vw, 58px); margin: 2px 0; }
.hud-where .country { font-size: 13px; color: #5b5750; font-weight: 500; }
.hud-where.arrive h1 { animation: slam 450ms var(--pop); }
.hud-stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 8px; }
.stat { background: #fff9ef; border: 2px solid var(--ink); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.stat .pixel { display: block; color: #6b665e; font-size: 8px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.05; white-space: nowrap; }
.stat small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.debt b { color: var(--red); }
.stat.debt.warn { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.stat.debt.warn b, .stat.debt.warn .pixel, .stat.debt.warn small { color: var(--cream); }
.hud-bars { grid-area: bars; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .pixel { color: #6b665e; width: 54px; flex-shrink: 0; }
.meter > span:last-child { flex: 1; display: flex; align-items: center; gap: 8px; }
.meter b { font-family: var(--display); font-weight: 400; font-size: 17px; min-width: 3ch; white-space: nowrap; }
.bar { flex: 1; height: 14px; border: 2px solid currentColor; padding: 2px; display: block; min-width: 40px; }
.hud .bar { border-color: var(--ink); background: #fff9ef; }
.bar > span { display: block; height: 100%; transition: width 400ms var(--ease); background: repeating-linear-gradient(90deg, var(--f, currentColor) 0 6px, transparent 6px 8px); }
.bar.hp { --f: var(--green); } .bar.heat { --f: var(--red); } .bar.bag { --f: var(--ink); } .bar.gold { --f: var(--yellow); } .bar.me { --f: var(--me); } .bar.loy { --f: var(--yellow); }
.panel .bar, .modal .bar { border-color: #555; }
.panel .bar.bag { --f: var(--cream); }
.flash-up { animation: flashUp 600ms var(--ease); } .flash-down { animation: flashDown 600ms var(--ease); }
.mug { width: 56px; height: 56px; border-radius: 14px; background: var(--c, var(--me)); color: var(--ink); display: grid; place-items: center; flex-shrink: 0; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.mug span { font-family: var(--display); font-size: 26px; text-transform: uppercase; }
.mug.small { width: 44px; height: 44px; border-radius: 12px; background: var(--me); }
.mug.small span { font-size: 20px; }

/* nav */
.nav { display: flex; gap: 6px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px; position: sticky; top: 62px; z-index: 15; }
.nav button { flex: 1; border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 10px 8px; font-family: var(--pixel); font-size: 9px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: background var(--fast), color var(--fast), transform var(--fast) var(--ease); }
.nav button:hover { color: var(--cream); }
.nav button.on { background: var(--accent); color: var(--on-accent); }
.nav .ico { font-family: var(--body); font-size: 15px; }
.view { animation: fadeUp 260ms var(--ease) both; display: grid; gap: 14px; }

/* layout */
.layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: start; }
.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { font-size: 26px; }
.sec + .sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sec h3 { font-size: 22px; margin-bottom: 6px; }
.sub { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.note { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14px; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv span { color: var(--muted); }
.kv b small { display: inline; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.wide { width: 100%; margin-top: 8px; }
.mine-note { color: var(--yellow); font-weight: 700; margin: 6px 0; }

/* market */
.row { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; transition: background var(--fast); }
.row + .row { border-top: 1px solid var(--line); }
.row:not(.head):hover { background: var(--ink-3); }
.row.head { font-family: var(--pixel); font-size: 8px; text-transform: uppercase; color: var(--muted); padding-top: 0; }
.row.na { opacity: .4; }
.r-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r-name b { font-size: 15px; }
.r-price { font-family: var(--display); font-size: 21px; line-height: 1.1; }
.r-price small { display: block; font-family: var(--body); font-size: 11px; }
.r-own { font-weight: 700; } .r-own small { font-weight: 400; }
.r-act { display: flex; gap: 6px; }
.tag { font-family: var(--pixel); font-size: 7px; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; }
.tag.cheap { background: var(--green); color: var(--ink); } .tag.hot { background: var(--red); color: var(--cream); }

.mini { border: 2px solid var(--cream); background: transparent; color: var(--cream); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: transform var(--fast) var(--ease), background var(--fast), color var(--fast), box-shadow var(--fast); }
.mini:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 3px 0 currentColor; }
.mini:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.mini.buy { background: var(--cream); color: var(--ink); }
.mini.sell { border-color: var(--yellow); color: var(--yellow); }
.mini.sell:hover:not(:disabled) { background: var(--yellow); color: var(--ink); }
.mini:disabled { opacity: .3; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px 8px; flex-wrap: wrap; text-align: center; min-height: 46px; padding: 8px 18px; border-radius: 999px;
  border: 2px solid var(--cream); background: var(--cream); color: var(--ink); font-weight: 700; font-size: 14px;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast), background var(--fast), color var(--fast); }
.btn small { color: inherit; opacity: .7; font-weight: 500; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 0 var(--accent); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .35; }
.btn-red { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-red:hover:not(:disabled) { box-shadow: 0 4px 0 var(--cream); }
.btn-ghost { background: transparent; color: var(--cream); }

.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.item + .item { border-top: 1px dashed var(--line); }
.item b, .item small { display: block; }
.item.is-owned b { color: var(--muted); }
.owned { color: var(--green); }

/* news */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.news li { display: flex; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: 8px; font-size: 14px; }
.news li:first-child { background: var(--ink-3); animation: fadeUp 300ms var(--ease) both; }
.news li .pixel { color: var(--muted); min-width: 4ch; flex-shrink: 0; }
.news li.good { color: #bfeed6; } .news li.bad { color: #ffb3ad; } .news li.news { color: var(--yellow); }

/* NPCs */
.npc { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--ink-3); margin-top: 8px; transition: transform var(--fast) var(--ease); }
.npc:hover { transform: translateX(3px); }
.npc.is-hired { box-shadow: inset 0 0 0 2px var(--me); }
.npc.locked { opacity: .55; }
.npc-mug { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); border: 2px solid var(--yellow); color: var(--yellow); display: grid; place-items: center; font-family: var(--display); font-size: 18px; }
.npc-body { min-width: 0; }
.npc-body b { display: block; font-size: 14px; }
.npc-body small { display: block; }
.npc-fx { display: block; font-size: 12px; color: var(--yellow); margin-top: 2px; }
.loyal { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.loyal .pixel { font-size: 7px; color: var(--muted); }
.loyal .bar { max-width: 140px; height: 10px; }
.npc-act { text-align: right; }
.lvl-h { color: var(--muted); margin: 14px 0 0; }

/* org */
.org h2 { font-size: 34px; margin: 4px 0 10px; }
.ladder { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.ladder span { font-family: var(--pixel); font-size: 8px; text-transform: uppercase; padding: 6px 8px; border-radius: 6px; background: var(--ink-3); color: var(--muted); }
.ladder span.done { background: var(--ink-4); color: var(--cream); }
.ladder span.on { background: var(--me); color: var(--ink); }
.reqs { display: flex; flex-wrap: wrap; gap: 6px; }
.req { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ink-3); }
.req.ok { background: rgba(76, 195, 138, .2); color: var(--green); }

/* money */
.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mbox { background: var(--ink-3); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; margin-bottom: 8px; min-width: 0; }
.mbox .pixel { color: var(--muted); font-size: 8px; }
.mbox b { font-family: var(--display); font-size: 26px; font-weight: 400; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbox.clean { box-shadow: inset 0 0 0 2px var(--green); }
.mbox.warn { background: rgba(229, 50, 45, .2); box-shadow: inset 0 0 0 2px var(--red); }
.terr { display: grid; gap: 4px; padding: 8px 0; }
.terr + .terr { border-top: 1px dashed var(--line); }
.terr span { font-size: 13px; color: var(--muted); }

/* world */
.world { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.globe-wrap { position: relative; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); aspect-ratio: 1; max-height: calc(100vh - 150px); width: 100%; overflow: hidden; }
#globe { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#globe:active { cursor: grabbing; }
.globe-ui { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.globe-ui .mini { background: rgba(14, 14, 14, .8); min-width: 40px; }
.legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; background: rgba(14, 14, 14, .75); padding: 6px 10px; border-radius: 999px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg.you { background: var(--yellow); } .lg.mine { background: var(--me); } .lg.play { background: #6a6152; }
.globe-hint { position: absolute; left: 12px; top: 14px; color: var(--muted); }
.world-side { max-height: calc(100vh - 150px); overflow: auto; }
.country-pick { display: grid; gap: 8px; margin-bottom: 14px; }
.country-pick .pixel { color: var(--muted); display: block; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-btn { border: 1px solid var(--line); background: var(--ink-3); color: var(--cream); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; transition: background var(--fast), border-color var(--fast); }
.chip-btn:hover { border-color: var(--cream); }
.chip-btn.on { background: var(--cream); color: var(--ink); }
.chip-btn.mine { box-shadow: inset 0 0 0 2px var(--me); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 8px 0; }
.meters > div { display: flex; align-items: center; gap: 8px; }
.meters .pixel { width: 78px; flex-shrink: 0; color: var(--muted); font-size: 8px; }
.meters .bar { height: 10px; }
.city-row.here b { color: var(--yellow); }
.dot-me { width: 9px; height: 9px; border-radius: 50%; background: var(--me); display: inline-block; vertical-align: middle; }

/* you / dossier */
.dossier { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.dossier h2 { font-size: 30px; margin: 4px 0; }
.dossier.big .mug { width: 84px; height: 84px; border-radius: 18px; }
.dossier.big .mug span { font-size: 38px; }
.bio { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.stat-row + .stat-row { border-top: 1px dashed var(--line); }
.stat-row small { display: block; }
.pips { display: inline-flex; gap: 3px; flex-shrink: 0; }
.pips i { width: 12px; height: 16px; border-radius: 3px; background: var(--ink-4); display: block; }
.pips i.on { background: var(--me); }
.modal .pips i.on { background: var(--c, var(--me)); }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 12px 0; }
.statgrid > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.statgrid .pixel { color: var(--muted); font-size: 8px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 8, 8, .74);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 180ms var(--ease), visibility 0s linear 180ms; }
.modal.open { opacity: 1; visibility: visible; transition: opacity 180ms var(--ease); }
.modal-card { width: min(540px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--ink-2); border: 2px solid var(--cream); border-radius: 18px; padding: 24px;
  box-shadow: 8px 8px 0 var(--accent); transform: translateY(16px) scale(.97); transition: transform 240ms var(--pop); }
.modal.open .modal-card { transform: none; }
.modal-wide .modal-card { width: min(720px, 100%); }
.modal-card h2 { font-size: 36px; margin: 6px 0 12px; }
.modal-card p { margin: 0 0 12px; }
.lead { font-size: 16px; color: #d7d1c6; }
.kicker { color: var(--yellow); margin: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.choices .btn { flex: 1 1 auto; }
.choices.vertical { flex-direction: column; }
.hint { color: var(--muted); font-size: 13px; }
.up { color: var(--green); } .down { color: #ff8a82; }
.total { font-size: 15px; }
.total b { font-family: var(--display); font-size: 24px; font-weight: 400; }
.amount { display: grid; grid-template-columns: 1fr 130px; gap: 12px; align-items: center; margin: 8px 0 10px; }
.modal input[type=number], .modal input[type=text], .modal input:not([type]), .modal select {
  width: 100%; background: var(--ink); color: var(--cream); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 17px; font-weight: 600; }
.modal input:focus, .modal select:focus { border-color: var(--yellow); outline: none; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.modal-story .modal-card { border-color: var(--yellow); box-shadow: 8px 8px 0 var(--yellow); }
.modal-story .choices .btn small { display: block; width: 100%; }

/* wizard */
.wiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dots { display: flex; gap: 4px; }
.dots i { width: 14px; height: 6px; border-radius: 3px; background: var(--ink-4); transition: background 300ms, width 300ms var(--ease); }
.dots i.done { background: var(--cream); }
.dots i.on { background: var(--accent); width: 26px; }
.wiz h2 { font-size: clamp(30px, 5vw, 44px); animation: fadeUp 300ms var(--ease) both; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label, .custom { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.custom { margin-top: 12px; }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; background: var(--ink-3); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px;
  transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast); animation: fadeUp 300ms var(--ease) both; }
.opt:nth-child(2) { animation-delay: 30ms; } .opt:nth-child(3) { animation-delay: 60ms; } .opt:nth-child(4) { animation-delay: 90ms; } .opt:nth-child(5) { animation-delay: 120ms; }
.opt:hover { transform: translate(-2px, -2px); border-color: var(--cream); box-shadow: 4px 4px 0 var(--accent); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt b { font-size: 16px; }
.opt .fx { font-size: 12px; color: var(--yellow); }
.nicks { grid-template-columns: 1fr 1fr; }
.nicks .opt b { font-family: var(--display); font-size: 24px; font-weight: 400; text-transform: uppercase; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.swatch { border: 2px solid var(--line); background: var(--ink-3); border-radius: 12px; padding: 10px; display: grid; gap: 6px; justify-items: center; transition: transform var(--fast) var(--ease), border-color var(--fast); cursor: pointer; }
.swatch span { width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--c); }
.swatch:hover { transform: translateY(-3px); }
.swatch.on { border-color: var(--cream); }
.custom-col input { width: 46px; height: 46px; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.link-back { background: none; border: 0; color: var(--muted); margin-top: 14px; padding: 4px 0; font-size: 13px; }
.link-back:hover { color: var(--cream); }

/* title */
.modal-title .modal-card { background: var(--red); border-color: var(--ink); box-shadow: 10px 10px 0 var(--ink); text-align: center; }
.modal-title .kicker { color: var(--ink); }
.logo-type { font-size: clamp(64px, 16vw, 110px); line-height: .85; margin: 10px 0 8px; color: var(--cream); }
.logo-type span { color: var(--ink); }
.tag-line { font-family: var(--pixel); font-size: 10px; text-transform: uppercase; }
.modal-title .btn { border-color: var(--ink); }
.modal-title .btn-red { background: var(--ink); color: var(--cream); }
.modal-title .btn-ghost { color: var(--ink); }
.modal-title .btn:hover:not(:disabled) { box-shadow: 0 4px 0 var(--ink); }
.small-print { font-size: 11px; opacity: .8; margin-top: 18px !important; }
.rules { padding-left: 18px; margin: 0; display: grid; gap: 8px; }
.scores { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.scores li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: var(--ink-3); border-radius: 10px; padding: 10px 12px; }
.scores li:first-child { background: var(--yellow); color: var(--ink); }
.scores li:first-child small { color: #4a4640; }
.scores .who small { display: block; }
.scores .amt { font-family: var(--display); font-size: 20px; }

/* fight */
.modal-fight .modal-card { border-color: var(--red); animation: shake 380ms var(--ease); }
.foes { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 14px; padding-top: 12px; }
.foe { width: 22px; height: 30px; background: var(--red); border-radius: 11px 11px 4px 4px; position: relative; transition: transform 300ms var(--ease), opacity 300ms; }
.foe::before { content: ""; position: absolute; left: 5px; top: -12px; width: 12px; height: 12px; border-radius: 50%; background: inherit; }
.fight-police .foe { background: var(--blue); } .fight-enforcers .foe { background: var(--cream); } .fight-hitsquad .foe { background: #777; }
.foe.down { opacity: .25; transform: translateY(12px) scaleY(.3); }
.fight-stats { display: grid; grid-template-columns: 1.4fr 1fr .7fr; gap: 10px; margin-bottom: 12px; }
.fight-stats > div { background: var(--ink-3); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.fight-stats .pixel { color: var(--muted); }
.fight-stats b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.fight-log { list-style: none; margin: 0; padding: 10px 12px; background: var(--ink); border-radius: 10px; display: grid; gap: 4px; font-size: 14px; min-height: 60px; }
.fight-log li:last-child { animation: fadeUp 220ms var(--ease) both; font-weight: 700; }
.hurt { color: #ff8a82; }

/* over */
.over h2 { font-size: 56px; }
.over.dead h2 { color: var(--red); }
.cause { font-size: 16px; }
.final { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.final div { background: var(--ink-3); border-radius: 10px; padding: 10px; }
.final dt { font-family: var(--pixel); font-size: 8px; color: var(--muted); text-transform: uppercase; }
.final dd { margin: 4px 0 0; font-family: var(--display); font-size: 20px; }
.hs { color: var(--yellow); animation: pulse 1s ease-in-out infinite; }

.toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; translate: -50% calc(100% + 40px); max-width: min(560px, calc(100vw - 32px));
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 12px 16px; font-weight: 700; font-size: 14px;
  transition: translate 280ms var(--pop), visibility 0s linear 280ms; visibility: hidden; }
.toast.show { translate: -50% 0; visibility: visible; transition: translate 280ms var(--pop); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes slam { 0% { transform: translateY(-20px) scale(1.1); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pulse { 50% { opacity: .75; } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes flashUp { 0% { color: var(--green); } }
@keyframes flashDown { 0% { color: var(--red); } }

@media (max-width: 1080px) {
  .hud { grid-template-columns: auto 1fr; grid-template-areas: "who where" "stats stats" "bars bars"; }
  .layout, .world { grid-template-columns: 1fr; }
  .globe-wrap { max-height: 70vh; }
  .world-side { max-height: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .game-name { display: none; }
  .hud { grid-template-columns: 1fr; grid-template-areas: "where" "who" "stats" "bars"; padding: 12px; gap: 10px; }
  .hud-who b { max-width: 70vw; }
  .hud-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat { padding: 6px 8px; }
  .stat b { font-size: 19px; }
  .hud-bars { grid-template-columns: 1fr; gap: 6px; }
  .nav { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; z-index: 30; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
  .nav button { flex-direction: column; gap: 3px; font-size: 7px; padding: 8px 2px; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "name price" "own act"; gap: 4px 10px; }
  .row.head { display: none; }
  .r-name { grid-area: name; } .r-price { grid-area: price; text-align: right; }
  .r-own { grid-area: own; font-size: 13px; } .r-act { grid-area: act; justify-content: flex-end; }
  .money-grid { grid-template-columns: 1fr; }
  .meters { grid-template-columns: 1fr; }
  .two, .nicks, .statgrid { grid-template-columns: 1fr; }
  .modal-card { padding: 20px 16px; }
  .fight-stats { grid-template-columns: 1fr 1fr; }
  .fight-stats > div:first-child { grid-column: 1 / -1; }
  .final { grid-template-columns: repeat(2, 1fr); }
  .npc { grid-template-columns: 40px 1fr; }
  .npc-act { grid-column: 1 / -1; text-align: left; }
  .grid2 { grid-template-columns: 1fr; }
  .toast { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } }
.org { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

/* player colour accents */
.hud { box-shadow: 0 5px 0 var(--accent); }
.city.here, .chip-btn.on { box-shadow: inset 0 0 0 2px var(--accent); }
.tabs button.on { background: var(--accent); color: var(--on-accent); }
.kicker { color: var(--accent); }
.modal-story .modal-card { border-color: var(--accent); box-shadow: 8px 8px 0 var(--accent); }
.modal-story .kicker, .modal-wide .kicker { color: var(--accent); }
.npc-mug { border-color: var(--accent); color: var(--accent); }
.npc-fx { color: var(--accent); }
.news li.news { color: var(--accent); }
.ladder span.on { background: var(--accent); color: var(--on-accent); }
.mine-note { color: var(--accent); }
.btn-red:hover:not(:disabled) { box-shadow: 0 4px 0 var(--cream); }
.lg.mine { background: var(--accent); }
.logo-type span { color: var(--ink); }
body { background: radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 60%), var(--ink); transition: background 400ms; }

/* ---------- travel modes ---------- */
.modes { display: grid; gap: 8px; margin-top: 12px; }
.mode { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: left; background: var(--ink-3); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px;
  transition: transform var(--fast) var(--ease), border-color var(--fast), box-shadow var(--fast); animation: fadeUp 280ms var(--ease) both; }
.mode:nth-child(2) { animation-delay: 30ms; } .mode:nth-child(3) { animation-delay: 60ms; } .mode:nth-child(4) { animation-delay: 90ms; } .mode:nth-child(5) { animation-delay: 120ms; } .mode:nth-child(6) { animation-delay: 150ms; }
.mode:hover:not(:disabled) { transform: translate(-2px, -2px); border-color: var(--cream); box-shadow: 4px 4px 0 var(--accent); }
.mode.off { opacity: .4; }
.m-ico { font-size: 26px; text-align: center; }
.m-body b, .m-stats b { display: block; }
.m-body small, .m-stats small { display: block; }
.m-stats { text-align: right; }
.m-stats b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.risk { font-weight: 700; }
.risk.lo { color: var(--green); } .risk.mid { color: var(--yellow); } .risk.hi { color: #ff8a82; }

/* ---------- deal scene ---------- */
.modal-deal .modal-card { padding: 0; overflow: hidden; }
.deal-ui { padding: 18px 22px 22px; }
.deal-ui h2 { margin: 4px 0 10px; }
.scene { position: relative; height: 250px; overflow: hidden; perspective: 900px; background: #151517; border-bottom: 2px solid var(--line); }
.wall { position: absolute; inset: 0 0 46px 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 2px, transparent 2px 46px) 0 0 / 46px 44px,
    repeating-linear-gradient(90deg, rgba(0,0,0,.35) 0 2px, transparent 2px 46px) 23px 22px / 46px 44px,
    linear-gradient(#3b1f1a, #2a1714); }
.lamp { position: absolute; left: 50%; top: -40px; width: 380px; height: 330px; translate: -50% 0; background: radial-gradient(ellipse at 50% 12%, rgba(246, 196, 69, .38), rgba(246, 196, 69, .08) 45%, transparent 70%); pointer-events: none; animation: flicker 4s infinite; }
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: linear-gradient(#1c1c1f, #0c0c0d); border-top: 2px solid #2e2e33; }
.ground::after { content: ""; position: absolute; left: 10%; right: 10%; top: 16px; height: 3px; background: repeating-linear-gradient(90deg, #d8c46a 0 30px, transparent 30px 60px); opacity: .35; }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 1; } 48% { opacity: .6; } 50% { opacity: 1; } 76% { opacity: .85; } }

.stash { position: absolute; left: 7%; bottom: 30px; width: 230px; height: 160px; transform-style: preserve-3d; }
.st-body { position: absolute; inset: 0; transform-style: preserve-3d; }
.st-inside { position: absolute; inset: 14px 14px 18px; background: #120d0a; border-radius: 8px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 5px; padding: 8px;
  box-shadow: inset 0 6px 18px rgba(0,0,0,.8); }
.st-empty { color: #666; font-size: 12px; }
.lid { position: absolute; transition: transform 650ms cubic-bezier(.3, 1.3, .5, 1); z-index: 2; }
.pkc { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--cream); background: rgba(255,255,255,.06); border-radius: 6px; padding: 3px 5px; transition: transform 200ms var(--ease); }
.pkc b { font-size: 11px; }
.pkc.hl { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); transform: scale(1.1); }
.pk { display: inline-block; width: 18px; height: 13px; background: var(--pc); border-radius: 3px; box-shadow: inset 0 -3px rgba(0,0,0,.25); position: relative; flex-shrink: 0; }
.pk-brick::after { content: ""; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 44%, rgba(160,110,40,.8) 45% 55%, transparent 56%), linear-gradient(-45deg, transparent 44%, rgba(160,110,40,.8) 45% 55%, transparent 56%); border-radius: 3px; }
.pk-bag { border-radius: 3px 3px 7px 7px; }
.pk-bag::before { content: ""; position: absolute; left: 2px; right: 2px; top: 2px; height: 2px; background: rgba(0,0,0,.35); }
.pk-pill { width: 13px; height: 13px; border-radius: 50%; box-shadow: 8px 0 0 -1px var(--pc), inset 0 -3px rgba(0,0,0,.2); margin-right: 7px; }
.pk-tab { width: 14px; height: 14px; border-radius: 2px; background: repeating-linear-gradient(45deg, var(--pc) 0 3px, #ff79c6 3px 6px); }

/* coat */
.st-coat { width: 200px; height: 190px; bottom: 22px; }
.st-coat .st-body { background: #5a4130; border-radius: 40px 40px 10px 10px; clip-path: polygon(22% 0, 78% 0, 100% 18%, 94% 100%, 6% 100%, 0 18%); }
.st-coat .st-inside { inset: 34px 22px 16px; background: linear-gradient(var(--accent-soft), var(--accent-soft)), #2a1512; border-radius: 6px; }
.st-coat .lid { top: 20px; bottom: 0; width: 52%; background: linear-gradient(90deg, #6b4f3a, #5a4130); }
.st-coat .lid-l { left: 0; transform-origin: 0 50%; border-right: 2px solid #3a2a1f; }
.st-coat .lid-r { right: 0; transform-origin: 100% 50%; border-left: 2px solid #3a2a1f; }
.st-coat .collar { position: absolute; left: 28%; right: 28%; top: 0; height: 34px; background: #43301f; clip-path: polygon(0 0, 100% 0, 70% 100%, 50% 60%, 30% 100%); z-index: 2; }
.st-coat .btn-row { position: absolute; left: 50%; top: 60px; width: 8px; height: 90px; translate: -50% 0; background: radial-gradient(circle, #2a1d14 3px, transparent 4px) 0 0 / 8px 30px; z-index: 3; transition: opacity 200ms; }
.scene.open .st-coat .lid-l { transform: rotateY(-62deg); filter: brightness(.8); }
.scene.open .st-coat .lid-r { transform: rotateY(62deg); filter: brightness(.8); }
.scene.open .st-coat .btn-row { opacity: 0; }

/* duffel */
.st-duffel { width: 230px; height: 130px; }
.st-duffel .st-body { background: linear-gradient(#26262a, #141416); border-radius: 50px; border: 3px solid #0a0a0a; }
.st-duffel .st-body::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 26px; height: 6px; background: var(--accent); border-radius: 3px; opacity: .9; }
.st-duffel .st-inside { inset: 18px 30px 36px; border-radius: 30px 30px 12px 12px; }
.st-duffel .lid-top { left: 10px; right: 10px; top: 4px; height: 58%; background: linear-gradient(#34343a, #1d1d20); border-radius: 46px 46px 10px 10px; transform-origin: 50% 0; }
.st-duffel .zip { position: absolute; left: 30px; right: 30px; top: 60%; height: 4px; background: repeating-linear-gradient(90deg, #aaa 0 3px, transparent 3px 6px); opacity: .6; }
.st-duffel .handle { position: absolute; left: 35%; right: 35%; top: -22px; height: 30px; border: 5px solid #0a0a0a; border-bottom: 0; border-radius: 30px 30px 0 0; }
.scene.open .st-duffel .lid-top { transform: translateY(-40%) scaleY(.32); filter: brightness(.75); }

/* car boot */
.st-boot, .st-van, .st-lorry { width: 250px; height: 160px; }
.st-boot .st-body { background: linear-gradient(#a8a8b0, #6d6d75); border-radius: 60px 60px 12px 12px; border: 3px solid #1a1a1a; }
.st-boot .st-inside { inset: 30px 26px 44px; }
.st-boot .lid-top { left: 16px; right: 16px; top: 8px; height: 78px; background: linear-gradient(#b8b8c0, #8d8d95); border-radius: 50px 50px 6px 6px; transform-origin: 50% 0; border: 2px solid #333; }
.st-boot .glass { position: absolute; left: 22%; right: 22%; top: 8px; height: 26px; background: linear-gradient(#1f2a38, #3a4d66); border-radius: 26px 26px 4px 4px; }
.tl { position: absolute; bottom: 44px; width: 30px; height: 16px; background: linear-gradient(#ff5a4f, #b3170f); border-radius: 4px; box-shadow: 0 0 14px rgba(255, 60, 40, .7); }
.tl.l { left: 10px; } .tl.r { right: 10px; }
.plate { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; background: #f6c445; color: #111; font: 700 10px/1 var(--body); padding: 4px 8px; border-radius: 3px; letter-spacing: .08em; font-style: normal; white-space: nowrap; }
.bumper { position: absolute; left: -4px; right: -4px; bottom: -6px; height: 12px; background: #1a1a1a; border-radius: 6px; }
.scene.open .st-boot .lid-top { transform: translateY(-58%) scaleY(.42); filter: brightness(.8); }

/* van */
.st-van .st-body { background: #e7e3da; border-radius: 12px 12px 8px 8px; border: 3px solid #1a1a1a; }
.st-van .st-inside { inset: 12px 12px 40px; border-radius: 4px; }
.st-van .lid { top: 10px; bottom: 38px; width: calc(50% - 10px); background: linear-gradient(90deg, #f2efe8, #d7d2c6); border: 2px solid #444; }
.st-van .lid-l { left: 10px; transform-origin: 0 50%; }
.st-van .lid-r { right: 10px; transform-origin: 100% 50%; }
.st-van .lid::after { content: ""; position: absolute; left: 12%; right: 12%; top: 10px; height: 34px; background: linear-gradient(#1f2a38, #3a4d66); border-radius: 3px; }
.scene.open .st-van .lid-l { transform: rotateY(-72deg); filter: brightness(.85); }
.scene.open .st-van .lid-r { transform: rotateY(72deg); filter: brightness(.85); }

/* lorry */
.st-lorry { width: 260px; height: 175px; }
.st-lorry .st-body { background: #c9c4b8; border: 3px solid #1a1a1a; border-radius: 6px; }
.st-lorry .st-inside { inset: 10px 10px 40px; border-radius: 2px; }
.st-lorry .lid-roll { left: 10px; right: 10px; top: 10px; bottom: 40px; background: repeating-linear-gradient(#b3ada0 0 8px, #9a9486 8px 10px); transition: transform 700ms var(--ease); }
.scene.open .st-lorry .lid-roll { transform: translateY(-96%); }

/* briefcase */
.st-case { width: 220px; height: 120px; bottom: 34px; }
.st-case .st-body { background: linear-gradient(#232323, #0f0f0f); border-radius: 10px; border: 3px solid #000; }
.st-case .st-inside { inset: 10px; background: linear-gradient(var(--accent-soft), var(--accent-soft)), #1c1210; }
.st-case .lid-top { left: 0; right: 0; top: 0; height: 100%; background: linear-gradient(#2b2b2b, #111); border-radius: 10px; transform-origin: 50% 0; border: 3px solid #000; }
.st-case .clasp { position: absolute; top: 6px; width: 20px; height: 10px; background: #c9a24a; border-radius: 2px; }
.st-case .clasp.l { left: 30px; } .st-case .clasp.r { right: 30px; }
.st-case .handle { position: absolute; left: 38%; right: 38%; top: -18px; height: 22px; border: 5px solid #000; border-bottom: 0; border-radius: 12px 12px 0 0; }
.scene.open .st-case .lid-top { transform: translateY(-62%) scaleY(.34); filter: brightness(.75); }

/* person */
.person { position: absolute; right: 12%; bottom: 30px; width: 90px; height: 170px; transform-origin: 50% 100%; }
.p-head { position: absolute; left: 50%; top: 0; width: 46px; height: 52px; translate: -50% 0; border-radius: 50% 50% 44% 44%; background: #c49a7a;
  box-shadow: 0 -8px 0 6px var(--hood); }
.p-head .shades { position: absolute; left: 8px; right: 8px; top: 20px; height: 8px; background: #050505; border-radius: 4px; display: none; }
.dealer .p-head .shades { display: block; }
.p-body { position: absolute; left: 50%; top: 44px; bottom: 0; width: 88px; translate: -50% 0; background: var(--hood); border-radius: 36px 36px 8px 8px; box-shadow: inset 0 -30px 30px rgba(0,0,0,.35); }
.p-body::after { content: ""; position: absolute; left: 36%; right: 36%; top: 10px; height: 60px; background: rgba(0,0,0,.25); border-radius: 0 0 16px 16px; }
.person .bubble { position: absolute; right: 70%; top: -18px; width: max-content; max-width: 190px; background: var(--cream); color: var(--ink); font-size: 12px; font-weight: 700; padding: 7px 10px; border-radius: 12px 12px 2px 12px;
  opacity: 0; transform: translateY(8px) scale(.9); transition: opacity 250ms 450ms, transform 350ms 450ms var(--pop); }
.scene.open .person .bubble { opacity: 1; transform: none; }
.person { animation: idle 2.4s ease-in-out infinite; }
.person.nod { animation: nod 500ms ease-in-out 2; }
@keyframes idle { 50% { transform: scaleY(1.015); } }
@keyframes nod { 50% { transform: translateY(4px) rotate(-2deg); } }

.fly { position: absolute; z-index: 5; pointer-events: none; display: inline-flex; }
.fly .pk { width: 26px; height: 19px; }
.fly .pk-pill { width: 18px; height: 18px; }
.bill { display: inline-block; width: 34px; height: 17px; background: linear-gradient(90deg, #2f7d4f, #4cc38a 50%, #2f7d4f); border: 2px solid #1d4d31; border-radius: 3px; position: relative; }
.bill::after { content: "$"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 11px/1 var(--body); color: #0c2e1b; }
.stamp { position: absolute; right: 8%; top: 18px; z-index: 6; font-family: var(--display); font-size: 54px; line-height: .9; color: var(--accent); border: 5px solid var(--accent); border-radius: 8px; padding: 4px 12px 8px;
  text-align: center; transform: rotate(-12deg) scale(2.4); opacity: 0; pointer-events: none; background: rgba(14,14,14,.6); }
.stamp small { display: block; font-family: var(--body); font-size: 14px; font-weight: 700; color: var(--cream); }
.scene:has(.stamp.show) .bubble { opacity: 0; transition: opacity 150ms; }
.stamp.show { opacity: 1; transform: rotate(-12deg) scale(1); transition: transform 380ms var(--pop), opacity 150ms; }

@media (max-width: 640px) {
  .scene { height: 210px; }
  .stash { transform: scale(.72); transform-origin: 0 100%; left: 4%; }
  .person { scale: .8; right: 6%; }
  .person .bubble { max-width: 130px; right: 60%; }
  .deal-ui { padding: 14px 16px 18px; }
  .mode { grid-template-columns: 34px 1fr; }
  .m-stats { grid-column: 2; text-align: left; }
}

/* ---------- art slots ---------- */
/* Pictures live in /games/the-plug/art/<key>.webp|png. Empty slots are hidden in normal play,
   and shown as labelled placeholders in "art-slot" mode (Menu → Picture checklist). */
.art { position: relative; aspect-ratio: 2 / 1; border-radius: 12px; overflow: hidden; margin: 0 0 14px; background: center / cover no-repeat var(--ink-3); display: none; }
.art.has-img { display: block; }
.art-dev .art { display: block; }
.art-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 12px, transparent 12px 24px), linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--ink-3);
  border: 2px dashed #444; border-radius: inherit; }
.art-ico { font-size: 40px; line-height: 1; filter: grayscale(.2); }
.art-key { font-family: var(--pixel); font-size: 8px; color: var(--muted); letter-spacing: .04em; }
.art.has-img .art-ph { display: none; }
.art.has-img { animation: artIn 260ms var(--ease) both; }
@keyframes artIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.modal-card > .art:first-child, .fight > .art:first-child, .shop > .art:first-child, .over > .art:first-child, .title > .art:first-child { margin: -8px -8px 14px; }
.art.portrait { aspect-ratio: 1; width: 96px; flex-shrink: 0; margin: 0; border-radius: 14px; border: 2px solid var(--line); }
.art.portrait .art-ico { font-size: 30px; } .art.portrait .art-key { font-size: 6px; padding: 0 4px; word-break: break-all; }
.art.layer { display: block; position: absolute; inset: 0; margin: 0; aspect-ratio: auto; border-radius: 0; background-color: transparent; opacity: 0; transition: opacity 300ms; pointer-events: none; }
.art.layer.has-img { opacity: 1; animation: none; }
.with-portrait { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.with-portrait > div { min-width: 0; display: flex; flex-direction: column; }
.with-portrait.small .art.portrait { width: 56px; border-radius: 10px; }
.with-portrait.small h3 { margin: 0; }
.with-portrait:not(:has(.art.has-img)) .art.portrait { display: none; }
body.art-dev .with-portrait:not(:has(.art.has-img)) .art.portrait { display: block; }
.boss-card { background: var(--ink-3); border-radius: 12px; padding: 10px; }
.boss-card b { font-size: 17px; } .boss-card .kicker { margin: 0; }

/* npc mugshots */
.npc-mug { position: relative; overflow: hidden; }
.npc-mug .art.layer.has-img { background-color: var(--ink); }

/* rival box */
.rival-box { background: var(--ink-3); border-radius: 12px; padding: 10px 12px; margin: 8px 0 10px; border-left: 4px solid #555; }
.rival-box .with-portrait { margin-bottom: 4px; }
.rival-box .kv { padding: 5px 0; }
.rival-box .kv .bar { width: 50%; }
.rival-box .grid2 { margin-top: 8px; }
.rival-box.stage-war { border-left-color: var(--red); } .rival-box.stage-war .mood { color: var(--red); }
.rival-box.stage-warned { border-left-color: var(--yellow); } .rival-box.stage-warned .mood { color: var(--yellow); }
.rival-box.stage-truce, .rival-box.stage-vassal, .rival-box.stage-beaten { border-left-color: var(--me); } .rival-box.stage-vassal .mood, .rival-box.stage-beaten .mood { color: var(--me); }
.warn-note { background: rgba(229, 50, 45, .12); border-left: 3px solid var(--red); padding: 8px 10px; border-radius: 6px; font-size: 14px; }

/* flash card: a picture moment over everything */
.flash { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; pointer-events: none; opacity: 0; visibility: hidden; }
.flash.show { opacity: 1; visibility: visible; animation: flashLife var(--life, 1600ms) linear both; }
.flash-card { width: min(520px, 100%); background: var(--ink-2); border: 2px solid var(--cream); border-radius: 16px; padding: 10px; box-shadow: 8px 8px 0 var(--accent); animation: flashPop 320ms var(--pop) both; }
.flash-card .art { display: block; margin: 0; }
.flash-card p { margin: 10px 6px 4px; font-weight: 700; text-align: center; }
@keyframes flashPop { from { transform: scale(.85) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flashLife { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* deal scene picture layers (CSS drawing stays as the fallback) */
.scene .scene-bg { z-index: 0; }
.scene .scene-bg.has-img ~ .wall, .scene:has(.scene-bg.has-img) .wall, .scene:has(.scene-bg.has-img) .lamp, .scene:has(.scene-bg.has-img) .ground { opacity: 0; }
.st-art { position: absolute; inset: -10% -6%; z-index: 4; pointer-events: none; }
.st-art .art.layer { background-size: contain; background-position: center bottom; }
.st-art .open.has-img { opacity: 0; transform: scale(.96); transition: opacity 300ms 200ms, transform 400ms 200ms var(--pop); }
.scene.open .st-art .closed.has-img { opacity: 0; transition: opacity 250ms; }
.scene.open .st-art .open.has-img { opacity: 1; transform: none; }
.stash:has(.st-art .closed.has-img) .st-body { background: none; border: 0; clip-path: none; box-shadow: none; }
.stash:has(.st-art .closed.has-img) .st-body::after, .stash:has(.st-art .closed.has-img) .st-body > :not(.st-inside) { display: none; }
.stash:has(.st-art .closed.has-img) .st-inside { inset: auto 0 -26px; background: rgba(0,0,0,.6); border-radius: 8px; padding: 4px; z-index: 6; }
.person .p-art { z-index: 3; background-size: contain; background-position: center bottom; inset: -20% -40% 0; }
.person:has(.p-art.has-img) .p-head, .person:has(.p-art.has-img) .p-body { visibility: hidden; }
.pk-img { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.st-inside .pk-img { width: 20px; height: 20px; }
.bill-img { width: 40px; height: 26px; object-fit: contain; }

/* picture checklist */
.checklist code { font-size: 12px; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0 12px; cursor: pointer; }
.ck-list { list-style: none; padding: 0; margin: 0 0 14px; columns: 2 220px; column-gap: 16px; font-size: 12px; }
.ck-list li { display: flex; gap: 8px; align-items: center; padding: 3px 0; break-inside: avoid; color: var(--muted); }
.ck-list li i { width: 10px; height: 10px; border-radius: 50%; background: #444; flex-shrink: 0; }
.ck-list li.ok { color: var(--cream); } .ck-list li.ok i { background: var(--green); }
.ck-list li.miss i { background: var(--red); opacity: .6; }
@media (prefers-reduced-motion: reduce) { .flash-card, .art.has-img { animation: none; } }
.fight-stats .bar { flex: none; height: 12px; margin: 4px 0 2px; }
.pk-img { border-radius: 5px; box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.bill-img { border-radius: 4px; }
/* installable app */
.install-btn { display: none; }
.can-install .install-btn { display: inline-flex; }
.is-app .topbar .home { pointer-events: none; }
.is-app .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
@media (display-mode: standalone) { .topbar .home { pointer-events: none; } }

/* ---------- local jobs ---------- */
.job { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: var(--ink-3); margin-top: 8px; }
.job b { display: block; font-size: 14px; } .job small { display: block; }
.job-ico { font-size: 22px; text-align: center; }
.job.locked { opacity: .55; }
.job.active { box-shadow: inset 0 0 0 2px var(--yellow); grid-template-columns: 34px 1fr; }

/* ---------- achievement pop-up ---------- */
.ach-pop { position: fixed; top: 74px; right: 16px; z-index: 80; display: flex; gap: 12px; align-items: center; max-width: min(380px, calc(100vw - 32px));
  background: var(--ink-2); border: 2px solid var(--yellow); border-radius: 14px; padding: 12px 14px; box-shadow: 6px 6px 0 var(--yellow);
  transform: translateX(calc(100% + 40px)); visibility: hidden; transition: transform 380ms var(--pop), visibility 0s 380ms; pointer-events: none; }
.ach-pop.show { transform: none; visibility: visible; transition: transform 380ms var(--pop); }
.ach-pop .ach-ico { font-size: 34px; line-height: 1; }
.ach-pop span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ach-pop small { color: var(--yellow); font-size: 8px; } .ach-pop b { font-size: 16px; } .ach-pop em { font-style: normal; font-size: 12px; color: var(--muted); }
.ach-pop i { font-style: normal; font-size: 12px; color: var(--me); font-weight: 700; margin-top: 2px; }

/* ---------- achievements screen ---------- */
.ach-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 16px; }
.ach-sum div { background: var(--ink-3); border-radius: 12px; padding: 10px; text-align: center; }
.ach-sum b { display: block; font-family: var(--display); font-size: 26px; } .ach-sum small { font-size: 11px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 18px; }
.ach { background: var(--ink-3); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 3px; opacity: .45; filter: grayscale(1); }
.ach.got { opacity: 1; filter: none; box-shadow: inset 0 0 0 2px var(--yellow); }
.ach .ach-ico { font-size: 24px; } .ach b { font-size: 13px; } .ach small { font-size: 11px; line-height: 1.3; }
.achs h3 { margin: 6px 0 4px; }
.perk-grid, .perk-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.perk { background: var(--ink-3); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; opacity: .5; }
.perk.got { opacity: 1; box-shadow: inset 0 0 0 2px var(--me); }
.perk em { font-style: normal; font-size: 11px; color: var(--yellow); margin-top: 3px; } .perk small { font-size: 12px; }
.legacy { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.perk-opt { text-align: left; background: var(--ink-3); border: 2px solid transparent; color: var(--cream); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.perk-opt:hover { transform: translateY(-2px); } .perk-opt.on { border-color: var(--me); background: var(--accent-soft); }
.perk-opt small { font-size: 12px; }

/* ---------- the wall ---------- */
.bosswall .bar-wrap { margin: 4px 0 6px; display: flex; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.wanted { background: var(--ink-3); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; border: 2px solid transparent; }
.w-pic { position: relative; aspect-ratio: 1; background: #1b1b1b; overflow: hidden; }
.w-pic .art.layer { background-size: cover; filter: grayscale(.85) contrast(1.05); }
.wanted.st-war .w-pic .art.layer, .wanted.st-warned .w-pic .art.layer, .wanted.st-truce .w-pic .art.layer, .wanted.st-vassal .w-pic .art.layer { filter: none; }
.w-q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 64px; color: #333; }
.w-pic:has(.has-img) .w-q { display: none; }
.wanted.unknown .w-pic .art.layer { filter: brightness(0) opacity(.8); }
.wanted.unknown .w-pic:has(.has-img) .w-q { display: grid; color: rgba(255,255,255,.25); }
.w-x { position: absolute; inset: 8%; }
.w-x::before, .w-x::after { content: ""; position: absolute; left: 50%; top: -4%; width: 12px; height: 108%; background: var(--red); border-radius: 6px; transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.w-x::after { transform: translateX(-50%) rotate(-45deg); }
.w-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.w-body small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; } .w-body b { font-size: 13px; line-height: 1.2; }
.w-body span { font-size: 11px; color: var(--muted); } .w-body em { font-style: normal; font-size: 11px; font-weight: 700; margin-top: 3px; color: var(--muted); }
.wanted.st-war { border-color: var(--red); } .wanted.st-war em { color: var(--red); }
.wanted.st-warned em { color: var(--yellow); }
.wanted.st-beaten em, .wanted.st-vassal em, .wanted.st-truce em { color: var(--me); }
.wanted.st-beaten .w-pic .art.layer { filter: grayscale(1) brightness(.7); }
@media (max-width: 720px) {
  .nav { gap: 2px; }
  .ach-sum { grid-template-columns: repeat(2, 1fr); }
  .wall-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-pop { top: 12px; right: 12px; left: 12px; max-width: none; }
}

/* pack sizes + stash manager */
.r-name .pack { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.r-own small { display: block; }
.st-rows { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.st-row { display: grid; grid-template-columns: 1fr 70px 70px auto; gap: 10px; align-items: center; background: var(--ink-3); border-radius: 12px; padding: 8px 10px; }
.st-name b { display: block; } .st-name small { font-size: 11px; }
.st-q { text-align: center; } .st-q small { display: block; font-size: 10px; } .st-q b { font-size: 16px; }
.st-btns { display: flex; gap: 6px; }
@media (max-width: 520px) { .st-row { grid-template-columns: 1fr 52px 52px; } .st-btns { grid-column: 1 / -1; } .st-btns .mini { flex: 1; } }
