/* ===========================================================================
   MODERN BLOCK — "Sodium Noir"
   A city street at 2am: warm asphalt near-blacks, sodium-streetlight amber,
   film grain and a lamplight vignette. Sharp rectangles only — no curves.
   Display: Bebas Neue · Body: Inter · Numbers: IBM Plex Mono
   =========================================================================== */

:root {
  /* handoff palette — gold-leaf on near-black (design_handoff_modern_block_website) */
  --bg:      #100d08;
  --bg2:     #0c0a06;
  --panel:   #171209;
  --panel2:  #1e1810;
  --border:  #2b2417;
  --border2: #6b5327;
  --text:    #e8ddc3;
  --muted:   #b3a488;
  /* gold accents */
  --accent:  #e3c26b;
  --accent2: #e8d9a0;
  --accent-dim: rgba(227, 194, 107, .14);
  --gold-hi: #f0d88c;
  --gold-lo: #c9a24a;
  /* functional status colors, muted to sit under the amber */
  --green:   #79d494;
  --red:     #ee8378;
  --blue:    #97bce8;
  --purple:  #c6adf0;
  --ink:     #14100b;   /* text on gold */
  --ease:    cubic-bezier(.25, .6, .35, 1);
  --ui-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: 'Cinzel', Georgia, serif;
  --mono-font: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --panel-soft: #1b160f;
  --panel-lift: #241d13;
  --hit: 42px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -8%, #262019 0%, rgba(38, 32, 25, 0) 60%),
    linear-gradient(180deg, #14100b 0%, #100d08 75%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain — CSS-generated SVG noise, no image files */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .03;
}
/* lamplight vignette — frames the block, kept gentle for AA contrast */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1999;
  background: radial-gradient(ellipse 120% 90% at 50% 30%, transparent 60%, rgba(9, 6, 3, .16) 100%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mono { font-family: var(--mono-font); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.amber { color: var(--accent); }
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.purple { color: var(--purple); }
.sp { flex: 1; }

/* comfortable reading measure for prose */
.box-b p, .lead, .doc-wrap p, .locked-msg p, .bio p { max-width: 65ch; }

/* ===== Brand ===== */
.brand {
  font-family: 'Cinzel', serif; font-weight: 400; letter-spacing: 3px;
  color: var(--text); text-shadow: 0 0 22px rgba(217, 181, 89, .18);
}
.brand span { color: var(--accent); text-shadow: 0 0 16px rgba(217, 181, 89, .45); }
.brand.big { font-size: 44px; }

/* ===== Buttons — rectangles with streetlight glow ===== */
.btn {
  display: inline-block; padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel2), #131007);
  border: 1px solid var(--border2); color: var(--text);
  font-family: 'Cinzel', serif;
  font-weight: 700; font-size: 13px; letter-spacing: .12em; cursor: pointer;
  border-radius: 3px; text-align: center; position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 6px rgba(0, 0, 0, .35);
  transition: border-color .18s var(--ease), color .18s var(--ease),
              box-shadow .2s var(--ease), transform .15s var(--ease), background .18s var(--ease);
}
.btn:hover {
  border-color: var(--accent); color: var(--accent2); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px var(--accent-dim),
              0 6px 18px rgba(217, 181, 89, .13), 0 4px 10px rgba(0, 0, 0, .4);
}
.btn:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:disabled:hover {
  border-color: var(--border2); color: var(--text); transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 6px rgba(0, 0, 0, .35);
}
.btn.primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  color: var(--ink); border-color: var(--gold-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 10px rgba(217, 181, 89, .22);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #f8e6a8, #d9b559); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 22px rgba(217, 181, 89, .3), 0 5px 14px rgba(0, 0, 0, .35);
}
.btn.danger { color: var(--red); border-color: #764d46; }
.btn.danger:hover {
  background: var(--red); color: #fff5f2; border-color: var(--red);
  box-shadow: 0 0 18px rgba(224, 106, 96, .25), 0 4px 10px rgba(0, 0, 0, .4);
}
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.actform { display: contents; }
.row { display: flex; gap: 7px; flex-wrap: wrap; }

/* ===== Inputs ===== */
input, textarea, select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; font-size: 15px; border-radius: 0; width: 100%;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3), 0 0 0 1px var(--accent-dim), 0 0 14px rgba(217, 181, 89, .1);
}
input::placeholder, textarea::placeholder { color: #7a7060; }
textarea { resize: vertical; }

/* ===== Auth ===== */
.auth-body {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0; padding: 24px;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 50% 8%, #262019 0%, rgba(38, 32, 25, 0) 62%),
    linear-gradient(180deg, #14100b, #100d08 80%);
  background-attachment: fixed;
}
.auth-split {
  display: flex; gap: 40px; align-items: stretch; max-width: 980px; width: 100%;
}
.auth-hero { flex: 1.2; padding: 40px 8px; min-width: 0; }
.auth-hero .tagline { margin-bottom: 18px; }
.auth-pitch { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 46ch; margin: 0 0 26px; }
.af-row {
  border-left: 2px solid var(--accent); padding: 10px 14px; margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(217, 181, 89, .05), transparent 70%);
}
.af-t { font-family: 'Cinzel', serif; font-size: 19px; letter-spacing: .08em; color: var(--accent2); }
.af-d { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.auth-counts { display: flex; gap: 26px; margin-top: 26px; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.auth-counts b { color: var(--text); }
.auth-counts .online i {
  display: inline-block; width: 7px; height: 7px; background: #3ce97e;
  box-shadow: 0 0 8px #3ce97e; margin-right: 7px;
}
.auth-card-h {
  font-family: 'Cinzel', serif; font-size: 27px; letter-spacing: .08em;
  color: var(--accent2); margin-bottom: 16px;
}
.auth-form { text-align: left; }
.auth-form .fld { text-align: left; }
.field-help {
  margin: -8px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.45;
  letter-spacing: 0;
}
.agree {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  font-size: 12.5px; color: var(--muted); line-height: 1.5; cursor: pointer;
}
.agree input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.auth-switch { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-footer {
  display: flex; gap: 18px; align-items: center; max-width: 980px; width: 100%;
  margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); letter-spacing: .06em;
}
@media (max-width: 860px) {
  .auth-split { flex-direction: column; gap: 8px; }
  .auth-hero { padding: 10px 4px; }
  .auth-card { width: 100%; }
}
.auth-card {
  width: 400px; max-width: 100%; padding: 40px 34px; text-align: center;
  background: linear-gradient(180deg, var(--panel), #37322d);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 24px 60px rgba(0, 0, 0, .5), 0 0 90px rgba(217, 181, 89, .05);
}
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.tagline { color: var(--muted); letter-spacing: 3px; font-size: 12px; margin: 8px 0 26px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tabs .tab {
  flex: 1; padding: 11px; background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: 1px;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.auth-tabs .tab:hover { border-color: var(--border2); color: var(--text); }
.auth-tabs .tab.on { background: linear-gradient(180deg, var(--accent2), var(--accent)); color: var(--ink); border-color: var(--accent); }

/* ===== Standalone document pages (rules, policies) ===== */
.doc-body {
  min-height: 100vh; padding: 48px 24px 72px;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 50% 0%, #453c30 0%, rgba(43, 34, 22, 0) 60%),
    linear-gradient(180deg, #342f2c, #2c2923 80%);
  background-attachment: fixed;
}
.doc-wrap { max-width: 780px; margin: 0 auto; }
.doc-wrap > .brand { font-size: 34px; }
.doc-wrap > .tagline { margin: 4px 0 28px; }
.doc-back { margin-top: 24px; }
.doc-list { margin: 10px 0; padding-left: 22px; max-width: 62ch; }
.doc-list li { margin-bottom: 8px; line-height: 1.65; }
.hint { color: var(--muted); font-size: 13px; margin-top: 18px; line-height: 1.6; }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; gap: 20px; height: 58px; padding: 0 18px;
  background: linear-gradient(180deg, #3e3831, var(--panel));
  border-bottom: 1px solid var(--border2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  position: sticky; top: 0; z-index: 40;
}
.topbar .brand { font-size: 27px; }
.top-stats { display: flex; gap: 7px; flex: 1; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--bg2); border: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.chip .lbl { color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.chip.resp { color: var(--purple); border-color: #4a3d63; font-weight: 700; letter-spacing: 1px; }
.chip.danger { color: var(--red); border-color: #764d46; font-weight: 700; letter-spacing: 1px; }
.top-right { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; }

.toptabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.toptab {
  padding: 9px 15px; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; position: relative;
  transition: color .18s var(--ease), border-color .18s var(--ease), text-shadow .18s var(--ease);
}
.toptab:hover { color: var(--text); }
.toptab.on { color: var(--accent); border-bottom-color: var(--accent); text-shadow: 0 0 14px rgba(217, 181, 89, .4); }
.toptab.new { color: var(--accent); }
.tab-badge { background: var(--red); color: #fff5f2; font-size: 10px; font-weight: 700; padding: 0 5px; margin-left: 5px; }
.online { display: inline-flex; align-items: center; gap: 7px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.online i { width: 8px; height: 8px; background: var(--green); display: inline-block; box-shadow: 0 0 8px rgba(99, 196, 127, .7); }
.online-link {
  padding: 7px 9px; border: 1px solid transparent; color: var(--muted);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.online-link:hover {
  color: var(--green); border-color: rgba(99, 196, 127, .35);
  background: rgba(99, 196, 127, .08);
}
.logout-link {
  padding: 8px 11px; border: 1px solid var(--border);
  background: rgba(16, 13, 8, .6); color: var(--muted);
  font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; letter-spacing: .08em;
}
.logout-link:hover {
  color: var(--accent); border-color: var(--accent);
  background: rgba(227, 194, 107, .08);
}

/* ===== Player status bar (second header) ===== */
.statbar {
  background: linear-gradient(180deg, var(--panel), #36312c);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .35);
  position: sticky; top: 58px; z-index: 39;
}
.statbar-inner { max-width: 1280px; margin: 0 auto; padding: 5px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sb-group { display: flex; align-items: center; gap: 15px; }
.sb-id { gap: 10px; }
.sb-name { font-family: 'Cinzel', serif; font-size: 21px; letter-spacing: 1.5px; color: var(--accent); text-shadow: 0 0 14px rgba(217, 181, 89, .3); }
.sb-lvl { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; }
.sb-div { width: 1px; align-self: stretch; min-height: 32px; background: linear-gradient(180deg, transparent, var(--border2), transparent); }
.sb-stat { display: flex; flex-direction: column; gap: 1px; }
.sb-stat .k { font-size: 10px; color: var(--muted); letter-spacing: .8px; }
.sb-stat .v { font-size: 14px; font-weight: 600; }
/* ===== Neon stacked attribute bars (HP/NRG/NRV/STM/TRN/XP) ===== */
.sb-bars { display: flex; gap: 18px; align-items: center; }
.vstack { display: flex; flex-direction: column; gap: 5px; min-width: 212px; }
.nbar { display: flex; align-items: center; gap: 8px; }
.nbar .nl { width: 32px; font-size: 10px; letter-spacing: 1.2px; font-weight: 700; text-align: right; flex: 0 0 32px; }
.nbar .nt {
  flex: 1; height: 8px; background: #272421; border: 1px solid var(--border);
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .65);
}
.nbar .nt i { display: block; height: 100%; transition: width .45s var(--ease); }
.nbar .nv { font-size: 10.5px; color: var(--muted); flex: 0 0 auto; min-width: 72px; white-space: nowrap; }
/* neon fills — bright core + colored halo */
.nbar-hp  .nt i { background: linear-gradient(90deg, #c22e3e, #ff5866); box-shadow: 0 0 6px #ff5866, 0 0 16px rgba(255, 88, 102, .55); }
.nbar-hp  .nl   { color: #ff8d97; text-shadow: 0 0 8px rgba(255, 88, 102, .5); }
.nbar-nrg .nt i { background: linear-gradient(90deg, #23a45a, #3ce97e); box-shadow: 0 0 6px #3ce97e, 0 0 16px rgba(60, 233, 126, .55); }
.nbar-nrg .nl   { color: #7deca4; text-shadow: 0 0 8px rgba(60, 233, 126, .5); }
.nbar-nrv .nt i { background: linear-gradient(90deg, #8b4fd8, #c084fc); box-shadow: 0 0 6px #c084fc, 0 0 16px rgba(192, 132, 252, .55); }
.nbar-nrv .nl   { color: #d4b2fd; text-shadow: 0 0 8px rgba(192, 132, 252, .5); }
.nbar-stm .nt i { background: linear-gradient(90deg, #14a3b8, #2fd8e8); box-shadow: 0 0 6px #2fd8e8, 0 0 16px rgba(47, 216, 232, .55); }
.nbar-stm .nl   { color: #7ce4ee; text-shadow: 0 0 8px rgba(47, 216, 232, .5); }
.nbar-xp  .nt i { background: linear-gradient(90deg, #d18f1e, #ffc95e); box-shadow: 0 0 7px #f5a623, 0 0 18px rgba(217, 181, 89, .6); }
.nbar-xp  .nl   { color: var(--accent2); text-shadow: 0 0 8px rgba(217, 181, 89, .55); }

/* ===== Market: category tabs + item card grid ===== */
.mtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mtab {
  padding: 8px 15px; background: var(--bg2); border: 1px solid var(--border);
  color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .8px;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.mtab:hover { border-color: var(--border2); color: var(--text); }
.mtab.on {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: var(--ink); border-color: var(--accent);
  box-shadow: 0 0 14px rgba(217, 181, 89, .2);
}
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.mgrid .mcard { display: flex; flex-direction: column; }
.mgrid .mcard-b { flex: 1; align-items: flex-start; }
.mgrid .mcard-tile { flex-basis: 56px; width: 56px; height: 56px; font-size: 20px; }
.mgrid .mcard-f { flex-wrap: wrap; }
.mcard {
  background: linear-gradient(180deg, var(--bg2), #322e2a);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 3px 10px rgba(0, 0, 0, .3);
  transition: border-color .18s var(--ease), box-shadow .2s var(--ease);
}
.mcard:hover { border-color: var(--border2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 20px rgba(0, 0, 0, .4); }
.mcard.locked { opacity: .45; }
.mcard-h {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: linear-gradient(180deg, #403a33, #37322d); border-bottom: 1px solid var(--border);
  font-family: 'Cinzel', serif; font-size: 19px; letter-spacing: 1.8px;
}
.mcard-b { display: flex; align-items: center; gap: 14px; padding: 12px 14px 6px; }
.mcard-info { flex: 1; min-width: 0; }
.mcard-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ibadge {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; padding: 2px 8px;
  background: #2e2a26; border: 1px solid #6f6039; color: var(--muted); letter-spacing: .4px;
}
.ibadge b { color: var(--accent2); font-weight: 600; }
.mcard-flavor { margin: 0; color: var(--muted); font-size: 14px; font-style: italic; max-width: 58ch; }
.mcard-tile {
  flex: 0 0 64px; width: 64px; height: 64px; display: grid; place-items: center;
  background: linear-gradient(160deg, #3e3831, #312d2a); border: 1px solid var(--border2);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .5);
  font-family: 'Cinzel', serif; font-size: 24px; letter-spacing: 2px; color: var(--accent);
  text-shadow: 0 0 12px rgba(217, 181, 89, .35);
}
.mcard-f { display: flex; align-items: center; gap: 10px; padding: 6px 14px 12px; }
.mcard-price { color: var(--green); font-size: 19px; font-weight: 600; }
.mcard-buy { display: flex; gap: 8px; align-items: center; }
.mcard-buy input { width: 64px; padding: 8px; text-align: center; }

/* ===== Inventory: stash cards + bookbag ===== */
.inv-summary {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px;
  margin-bottom: 10px;
}
.inv-summary div {
  min-width: 0; padding: 8px 9px; background: #0f0d09;
  border: 1px solid #3a301d; border-left: 3px solid rgba(227, 194, 107, .45);
  border-radius: 4px;
}
.inv-summary span {
  display: block; color: var(--muted); font-family: var(--ui-font);
  font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase;
}
.inv-summary b {
  display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-family: var(--mono-font); font-size: 12px;
}
.inv-tabs { margin-bottom: 10px; }
.inv-tabs .mtab { display: inline-flex; align-items: center; gap: 7px; }
.tab-count {
  color: inherit; opacity: .72; font-size: 11px;
  padding-left: 7px; border-left: 1px solid rgba(227, 194, 107, .22);
}
.inv-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 190px));
  justify-content: start; align-items: start; gap: 9px;
}
.inv-card {
  position: relative;
  aspect-ratio: 1 / 1; min-height: 0; display: flex; flex-direction: column; gap: 6px;
  padding: 9px; background: linear-gradient(180deg, #211a10, #18130c);
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 4px 14px rgba(0, 0, 0, .22);
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.inv-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: rgba(227, 194, 107, .28);
}
.inv-card.type-lootbag::before { background: linear-gradient(90deg, #f5a623, #c084fc); }
.inv-card.type-consumable::before { background: var(--green); opacity: .7; }
.inv-card.type-drug::before { background: var(--purple); opacity: .75; }
.inv-card.type-weapon::before { background: var(--red); opacity: .75; }
.inv-card.type-armor::before { background: var(--blue); opacity: .75; }
.inv-card.type-valuable::before { background: var(--accent); opacity: .75; }
.inv-card.special {
  border-color: rgba(227, 194, 107, .42);
}
.inv-info {
  position: absolute; top: 7px; left: 7px; z-index: 7;
  width: 22px; height: 22px; padding: 0; display: grid; place-items: center;
  border: 1px solid rgba(227, 194, 107, .36); border-radius: 50%;
  background: rgba(12, 10, 6, .84); color: var(--accent2);
  font-family: var(--mono-font); font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.inv-info:hover {
  border-color: var(--accent); background: var(--accent); color: var(--ink);
}
.inv-card:hover {
  border-color: var(--border2);
  background: linear-gradient(180deg, #272015, #1b150d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 18px rgba(0, 0, 0, .28);
}
.inv-card.equipped {
  border-color: rgba(198, 173, 240, .72);
  background: linear-gradient(180deg, #251d15, #19120d);
  box-shadow:
    inset 0 0 0 1px rgba(198, 173, 240, .18),
    inset 3px 0 0 rgba(198, 173, 240, .85),
    0 0 18px rgba(198, 173, 240, .12),
    0 4px 14px rgba(0, 0, 0, .24);
}
.inv-card.equipped::after {
  content: ''; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px;
  background: var(--purple); border: 1px solid rgba(232, 221, 195, .75); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(198, 173, 240, .14), 0 0 12px rgba(198, 173, 240, .7);
}
.inv-card.equipped .inv-art {
  border-color: rgba(198, 173, 240, .78);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .48), 0 0 16px rgba(198, 173, 240, .18);
}
.inv-card.equipped .inv-title { color: var(--accent2); }
.inv-art {
  width: 58px; height: 58px; display: grid; place-items: center; align-self: center; flex: 0 0 58px;
  background: linear-gradient(160deg, #3e3831, #28231d);
  border: 1px solid var(--border2); border-radius: 4px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .48);
  overflow: hidden;
}
.inv-art img.item-img { width: 48px; height: 48px; display: block; object-fit: contain; }
.inv-art .tile-txt { font-family: 'Cinzel', serif; font-size: 16px; letter-spacing: 1.5px; color: var(--accent); }
.inv-art.sm { width: 44px; height: 44px; }
.inv-art.sm .item-ico { width: 32px; height: 32px; object-fit: contain; }
.inv-main {
  min-width: 0; min-height: 0; flex: 1 1 auto; overflow: hidden;
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.inv-head { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; max-width: 100%; }
.inv-title {
  font-family: 'Cinzel', serif; font-size: 13px; color: var(--text);
  letter-spacing: .04em; line-height: 1.12; overflow-wrap: anywhere;
}
.inv-meta {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
}
.inv-meta .mono {
  color: var(--accent2); background: rgba(227, 194, 107, .08);
  border: 1px solid rgba(227, 194, 107, .22); border-radius: 4px; padding: 1px 7px;
}
.inv-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); gap: 4px;
  align-items: center; margin-top: auto; width: 100%; min-width: 0; max-width: none;
}
.inv-actions .actform { display: block; }
.inv-actions .btn.sm {
  width: 100%; min-width: 0; padding: 3px 2px;
  font-size: 10px; line-height: 1.15; letter-spacing: .06em;
}
.inv-actions .icon-btn {
  display: grid; place-items: center; min-height: 24px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1;
}
.inv-actions .icon-btn.primary { font-size: 12px; }
.inv-detail {
  position: absolute; inset: 6px; z-index: 5;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 6px;
  padding: 9px; text-align: center; pointer-events: none; overflow-y: auto;
  background: linear-gradient(180deg, rgba(30, 24, 16, .98), rgba(12, 10, 6, .97));
  border: 1px solid rgba(227, 194, 107, .32); border-radius: 4px;
  opacity: 0; transform: translateY(5px) scale(.98);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.inv-card:hover .inv-detail {
  opacity: 1; transform: none;
}
.inv-card:has(.inv-actions:hover) .inv-detail,
.inv-card:has(.inv-actions:focus-within) .inv-detail {
  opacity: 0; transform: translateY(5px) scale(.98);
}
.inv-detail-title {
  font-family: 'Cinzel', serif; font-size: 14px; line-height: 1.1;
  color: var(--text); letter-spacing: .05em; overflow-wrap: anywhere;
}
.inv-detail-badges {
  justify-content: center; margin: 0; max-height: none; overflow: visible;
}
.inv-detail-badges .ibadge { font-size: 9.5px; padding: 1px 5px; }
.inv-detail p {
  margin: 0; color: var(--muted); font-size: 11px; line-height: 1.22;
}
.inv-detail .inv-flavor {
  color: var(--accent2); font-style: italic;
}
.item-dialog {
  width: min(360px, calc(100vw - 28px)); padding: 0;
  color: var(--text); background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border2); border-radius: 6px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.item-dialog::backdrop { background: rgba(7, 5, 3, .74); backdrop-filter: blur(2px); }
.item-dialog-form { display: grid; gap: 11px; padding: 16px; }
.item-dialog h3 {
  margin: -4px 0 2px; font-family: 'Cinzel', serif; font-size: 18px;
  line-height: 1.15; letter-spacing: .04em;
}
.dialog-kicker {
  color: var(--accent); font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.item-dialog label {
  display: grid; gap: 5px; color: var(--muted); font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase;
}
.item-dialog input { width: 100%; }
.dialog-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.confirm-dialog { width: min(390px, calc(100vw - 28px)); }
.confirm-dialog h3 { color: var(--red); }
.confirm-dialog .dialog-note {
  color: var(--text); font-size: 14px; line-height: 1.5;
  padding: 10px 12px; background: rgba(238, 131, 120, .08);
  border: 1px solid rgba(238, 131, 120, .28); border-left-width: 3px;
}
.inv-bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.inv-bag-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
}
@media (max-width: 720px) {
  .inv-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .inv-summary div { padding: 7px; }
  .inv-summary b { font-size: 11px; }
  .inv-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .inv-tabs::-webkit-scrollbar { display: none; }
  .inv-tabs .mtab { flex: 0 0 auto; padding: 7px 10px; }
  .inv-list { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
  .inv-card { padding: 8px; gap: 5px; }
  .inv-info { width: 24px; height: 24px; top: 6px; left: 6px; }
  .inv-art { width: 48px; height: 48px; flex-basis: 48px; }
  .inv-art img.item-img { width: 40px; height: 40px; object-fit: contain; }
  .inv-title { font-size: 12px; }
  .inv-meta { font-size: 9.5px; }
  .inv-actions { gap: 4px; }
  .inv-actions .btn.sm { padding: 3px 5px; font-size: 9.5px; }
  .inv-actions .icon-btn { min-height: 24px; font-size: 12px; }
  .inv-detail { inset: 5px; padding: 7px; gap: 5px; }
  .inv-card:hover .inv-detail { opacity: 0; transform: translateY(5px) scale(.98); }
  .inv-detail-title { font-size: 12.5px; }
  .inv-detail p { font-size: 10.5px; }
}

/* gym: energy amount above the train button */
.gym-form { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.gym-form label { letter-spacing: .5px; }

/* dashboard variant: roomier */
.home-bars { min-width: 0; max-width: 560px; gap: 7px; }
.home-bars .nbar .nl { width: 36px; flex-basis: 36px; font-size: 11px; }
.home-bars .nbar .nt { height: 10px; }
.home-bars .nbar .nv { font-size: 12px; min-width: 120px; }

/* ===== Layout: content | right menu ===== */
.layout { display: grid; grid-template-columns: 1fr 224px; gap: 14px; max-width: 1280px; margin: 0 auto; padding: 12px 14px 40px; align-items: start; }
.col-right { display: flex; flex-direction: column; gap: 12px; }

/* ===== Right menu (collapsible) ===== */
.menu-wrap { display: flex; flex-direction: column; gap: 8px; }
.menu-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 10px 13px; background: linear-gradient(180deg, var(--panel2), #3e3831);
  border: 1px solid var(--border2); color: var(--text);
  font-family: 'Cinzel', serif; letter-spacing: 3px; font-size: 16px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }
.menu-body { display: flex; flex-direction: column; gap: 8px; }
.menu-wrap.collapsed .menu-body { display: none; }
.menu-sec-wrap { display: flex; flex-direction: column; }
.menu-sec {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 8px 6px; background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; letter-spacing: 2px; font-weight: 700; cursor: pointer;
  transition: color .18s var(--ease);
}
.menu-sec:hover { color: var(--accent2); }
.menu-links { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.menu-sec-wrap.collapsed .menu-links { display: none; }
.menu-link {
  display: flex; align-items: center; padding: 9px 13px;
  background: var(--panel); border: 1px solid var(--border); border-left: 2px solid transparent;
  font-size: 14px; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .15s var(--ease);
}
.menu-link:hover { background: var(--panel2); border-left-color: var(--border2); transform: translateX(2px); }
.menu-link.on { background: var(--panel2); border-left-color: var(--accent); color: var(--accent); box-shadow: inset 3px 0 12px -6px rgba(217, 181, 89, .5); }
.menu-link.new { color: var(--accent); border-left-color: var(--accent); }
.menu-badge { margin-left: auto; background: var(--red); color: #fff5f2; font-size: 11px; font-weight: 700; padding: 0 6px; }
.new-dot { width: 7px; height: 7px; background: var(--accent); display: inline-block; box-shadow: 0 0 8px rgba(217, 181, 89, .8); }
.menu-link .new-dot { margin-left: auto; }
.toptab .new-dot { margin-left: 6px; vertical-align: middle; }
.mobile-dock { display: none; }
.caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; transition: transform .2s var(--ease); flex: 0 0 auto;
}
.menu-sec-wrap.collapsed .caret, .menu-wrap.collapsed .menu-toggle .caret { transform: rotate(-90deg); }

/* ===== Boxes / panels — layered cards over the grain ===== */
.box {
  background: linear-gradient(180deg, var(--panel), #120e08);
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 28px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.box-h {
  background: linear-gradient(180deg, #1e1810, var(--bg2));
  border-bottom: 1px solid var(--border); padding: 10px 16px;
  font-family: 'Cinzel', serif; letter-spacing: 2.5px; font-size: 18px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
.box-sub { color: var(--muted); font-size: 12px; letter-spacing: 1px; margin: 12px 0 6px; padding: 0 16px; }
.box > .box-sub { padding: 10px 16px 0; margin: 0; }
.box-b { padding: 12px 14px; }
.lead { margin: 0 0 16px; color: var(--text); }

/* panel entrance — subtle rise, staggered */
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.col-mid > section.box { animation: panel-in .32s var(--ease) both; }
.col-mid > section.box:nth-of-type(2) { animation-delay: .06s; }
.col-mid > section.box:nth-of-type(3) { animation-delay: .12s; }
.col-mid > section.box:nth-of-type(4) { animation-delay: .18s; }
.col-mid > section.box:nth-of-type(5) { animation-delay: .24s; }
.col-mid > section.box:nth-of-type(n+6) { animation-delay: .3s; }

/* ===== Cards ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 11px; }
.card {
  background: linear-gradient(180deg, var(--bg2), #322e2a);
  border: 1px solid var(--border); padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 2px 8px rgba(0, 0, 0, .3);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .2s var(--ease);
}
.card.link:hover, .card:hover {
  border-color: var(--border2); transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 20px rgba(0, 0, 0, .4);
}
.card.link:hover { border-color: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 0 0 1px var(--accent-dim), 0 8px 22px rgba(217, 181, 89, .1); }
.card.locked { opacity: .45; }
.card.locked:hover { transform: none; }
.card-t { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-s { color: var(--muted); font-size: 13px; }
.card-m { color: var(--muted); font-size: 13px; line-height: 1.6; }
.tag { font-size: 10px; padding: 2px 7px; background: var(--panel2); border: 1px solid var(--border); color: var(--muted); letter-spacing: .5px; white-space: nowrap; }
.challenge-rewards { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.challenge-item {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px;
  padding: 2px 7px 2px 3px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .18); color: var(--text); font-size: 12px;
}
.challenge-item img.item-img { width: 22px; height: 22px; object-fit: contain; display: block; }
.quest-reqs { display: flex; flex-direction: column; gap: 7px; }
.quest-req {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center;
  padding: 7px; border: 1px solid var(--border); background: rgba(0, 0, 0, .16);
}
.quest-req.done { border-color: rgba(99, 196, 127, .45); background: rgba(99, 196, 127, .08); }
.quest-req-art {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border); background: rgba(0, 0, 0, .22);
}
.quest-req-art img.item-img { width: 28px; height: 28px; object-fit: contain; display: block; }
.quest-req-symbol { font: 700 10px/1 var(--mono); color: var(--accent); letter-spacing: .04em; }
.quest-req-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.quest-req-main .bar { height: 5px; }

/* ===== Lists ===== */
.list { display: flex; flex-direction: column; gap: 8px; }
.lrow {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg2), #332f2a);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.lrow:hover { border-color: var(--border2); }
.lrow.col { flex-direction: column; align-items: flex-start; gap: 3px; }
.lrow .name { font-weight: 700; }
.lrow .rank { width: 36px; }
a.name.link:hover { color: var(--accent); }
.link { transition: color .15s var(--ease); }
.link:hover { color: var(--accent); }

/* ===== Badges ===== */
.badge { font-size: 10px; padding: 1px 6px; letter-spacing: .6px; border: 1px solid; }
.badge.npc { color: var(--blue); border-color: #3a4a63; }
.badge.eq, .badge.resp { color: var(--purple); border-color: #4a3d63; }
.badge.online { color: var(--green); border-color: #4f7359; }
.badge.off { color: var(--muted); border-color: var(--border); }
.badge.jail { color: var(--accent); border-color: #6b531c; }
.badge.hospital { color: var(--blue); border-color: #3a4a63; }
.badge.vip {
  color: #aff3fb; border-color: #3f7c86; background: linear-gradient(180deg, rgba(47, 216, 232, .16), rgba(47, 216, 232, .04));
  text-shadow: 0 0 8px rgba(47, 216, 232, .6); box-shadow: 0 0 10px rgba(47, 216, 232, .18); font-weight: 700;
}
.gem { color: #7ce4ee; }

/* ===== Bars / stats ===== */
.bar-block { margin-bottom: 11px; }
.bar-block:last-child { margin-bottom: 0; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; letter-spacing: .5px; }
.bar { height: 7px; background: #2a2723; border: 1px solid var(--border); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.bar i { display: block; height: 100%; transition: width .45s var(--ease); }
.bar.energy i { background: linear-gradient(90deg, #4da368, var(--green)); box-shadow: 0 0 8px rgba(99, 196, 127, .4); }
.bar.nerve i { background: linear-gradient(90deg, #bf574e, var(--red)); box-shadow: 0 0 8px rgba(224, 106, 96, .4); }
.bar.health i { background: linear-gradient(90deg, #6790c2, var(--blue)); box-shadow: 0 0 8px rgba(127, 168, 217, .4); }
.bar.turns i { background: linear-gradient(90deg, #6790c2, var(--blue)); box-shadow: 0 0 8px rgba(127, 168, 217, .4); }
.bar.xp i { background: linear-gradient(90deg, #d18f1e, var(--accent)); box-shadow: 0 0 10px rgba(217, 181, 89, .5); }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.statgrid.wide { grid-template-columns: repeat(3, 1fr); margin: 10px 0; }
.stat {
  background: linear-gradient(180deg, var(--bg2), #322e2a); border: 1px solid var(--border);
  padding: 9px 11px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}
.stat .k { color: var(--muted); font-size: 10px; letter-spacing: .8px; }
.stat .v { font-size: 17px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }

/* ===== Live chat ===== */
.chat { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; margin-bottom: 10px; scroll-behavior: smooth; }
.chat-line { font-size: 14px; line-height: 1.5; word-break: break-word; animation: panel-in .25s var(--ease) both; }
.chat-line b { color: var(--accent); }
.chat-time { color: #7a7060; font-size: 11px; letter-spacing: .3px; }

/* shoutbox message cards — each shout in its own box, newest on top */
.shout-card {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px;
  background: linear-gradient(180deg, var(--bg2), #332f2a);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  animation: panel-in .25s var(--ease) both;
}
.shout-card.system {
  background: linear-gradient(180deg, #2f2a1d, #241f17);
  border-color: #8c7438;
  box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.shout-card.system .shout-tile {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  border-color: var(--accent2);
  color: var(--ink);
  text-shadow: none;
}
.shout-card.system .shout-head b { color: var(--accent2); }
.shout-tile {
  flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(160deg, #3e3831, #312d2a); border: 1px solid var(--border2);
  font-family: 'Cinzel', serif; font-size: 16px; letter-spacing: 1px; color: var(--accent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
.shout-main { flex: 1; min-width: 0; }
.shout-head { font-size: 13.5px; }
.shout-head b { color: var(--accent); }
.shout-text { font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.chat.chat-page { gap: 8px; }

/* VIP highlight swatches */
.cswatch-row { display: flex; align-items: center; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.cswatch {
  width: 22px; height: 22px; cursor: pointer; padding: 0;
  background: var(--sw); border: 1px solid var(--border2);
  box-shadow: 0 0 8px var(--sw), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s var(--ease), box-shadow .18s var(--ease);
}
.cswatch:hover { transform: translateY(-2px) scale(1.08); }
.cswatch.on { outline: 2px solid var(--text); outline-offset: 2px; }
.cswatch-none { background: var(--bg); box-shadow: inset 0 2px 5px rgba(0,0,0,.5); position: relative; }
.cswatch-none::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.chat-form { display: flex; gap: 7px; }
.chat-form input { padding: 8px 10px; }
.chat-page { max-height: 460px; min-height: 320px; }

/* ===== Forms ===== */
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 0 1 auto; }
.player-filters {
  display: grid; grid-template-columns: minmax(220px, 1fr) 170px auto auto;
  gap: 8px; align-items: center; margin: 0 0 12px;
}
.player-filters input, .player-filters select { width: 100%; }
.bounty-form {
  display: grid; grid-template-columns: minmax(160px, 1fr) 130px minmax(180px, 1fr) auto;
  gap: 8px; align-items: end;
}
.bounty-form label {
  display: grid; gap: 5px; color: var(--muted);
  font-family: var(--ui-font); font-size: 11px; font-weight: 800; letter-spacing: .07em;
}
.bounty-row .avatar { flex: 0 0 auto; }
.job-collect {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; margin-bottom: 12px; background: rgba(12, 10, 6, .58);
  border: 1px solid var(--border);
}
.job-collect .prof-name { margin-top: 2px; }
.inline-list { display: inline-flex; gap: 4px; }
.mail-compose-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  align-items: stretch; margin-top: 10px;
}
.mail-compose-body textarea { min-height: 96px; resize: vertical; }
.mail-compose-body .btn { align-self: end; }
.mail-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; background: linear-gradient(180deg, var(--bg2), #332f2a);
  border: 1px solid var(--border);
}
.mail-main { min-width: 0; }
.mail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-head .muted { margin-left: auto; }
.mail-subject { font-weight: 700; margin-top: 3px; }
.mail-preview {
  color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.thread-msg.out { grid-template-columns: minmax(0, 1fr) 34px; }
.thread-msg.out .avatar { grid-column: 2; grid-row: 1; }
.thread-msg.out .thread-bubble { grid-column: 1; grid-row: 1; }
.thread-bubble {
  padding: 10px 12px; background: linear-gradient(180deg, var(--bg2), #332f2a);
  border: 1px solid var(--border);
}
.thread-msg.out .thread-bubble {
  background: linear-gradient(180deg, #252015, #1b160e);
  border-color: rgba(227, 194, 107, .28);
}
.thread-body { margin-top: 6px; color: var(--text); line-height: 1.45; white-space: pre-wrap; }
@media (max-width: 640px) {
  .mail-compose-body { grid-template-columns: 1fr; }
  .mail-compose-body .btn { width: 100%; }
  .mail-row { grid-template-columns: 34px minmax(0, 1fr); }
  .mail-row .btn { grid-column: 1 / -1; width: 100%; }
  .mail-head .muted { margin-left: 0; }
}
.mini-in { width: 84px; padding: 6px 8px; font-size: 12.5px; }
.fld { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; letter-spacing: .5px; }
.fld input, .fld textarea { margin-top: 6px; }
.fld.password-field { position: relative; }
.fld.password-field input { padding-right: 64px; }
.password-toggle {
  position: absolute; right: 7px; bottom: 7px; height: 30px; min-width: 48px;
  padding: 0 8px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 3px;
  background: rgba(12, 10, 6, .82); color: var(--accent2);
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible {
  border-color: var(--accent); background: var(--accent); color: var(--ink);
}

/* ===== Flash / banners ===== */
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash {
  padding: 12px 16px; margin-bottom: 14px; border: 1px solid; border-left-width: 3px;
  font-size: 14px; animation: flash-in .25s var(--ease) both;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.flash.ok { background: #303e34; border-color: var(--green); color: #c3e8cd; }
.flash.err { background: #44322f; border-color: var(--red); color: #f2c4be; }
.banner {
  display: flex; align-items: center; gap: 16px; padding: 15px 18px; margin-bottom: 14px; border: 1px solid;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 22px rgba(0, 0, 0, .35);
}
.banner.jail { background: linear-gradient(180deg, #433a2d, #3e3629); border-color: var(--accent); }
.banner.hospital { background: linear-gradient(180deg, #313a45, #2d353f); border-color: var(--blue); }
.banner-t { font-family: 'Cinzel', serif; font-size: 26px; letter-spacing: 2.5px; }
.banner-r { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.banner .timer { font-size: 23px; font-weight: 700; }

/* ===== Misc ===== */
.locked-msg { text-align: center; padding: 28px 12px; }
.locked-msg p { margin-left: auto; margin-right: auto; }
.lock-big { font-family: 'Cinzel', serif; font-size: 52px; letter-spacing: 8px; color: var(--accent); margin-bottom: 12px; text-shadow: 0 0 30px rgba(217, 181, 89, .3); }
.prof-head { display: flex; align-items: center; gap: 15px; margin-bottom: 8px; }
.prof-name { font-family: 'Cinzel', serif; font-size: 32px; letter-spacing: 2px; }
.bio p { margin: 4px 0 0; }
.home-head { display: flex; align-items: center; gap: 15px; }
.dot { width: 9px; height: 9px; flex: 0 0 9px; display: inline-block; }
.dot.red { background: var(--red); box-shadow: 0 0 7px rgba(224, 106, 96, .6); }
.dot.green { background: var(--green); box-shadow: 0 0 7px rgba(99, 196, 127, .6); }
.dot.amber { background: var(--accent); box-shadow: 0 0 7px rgba(217, 181, 89, .6); }
.dot.blue { background: var(--blue); box-shadow: 0 0 7px rgba(127, 168, 217, .6); }
.dot.purple { background: var(--purple); box-shadow: 0 0 7px rgba(183, 154, 232, .6); }
.unreadrow { border-left: 2px solid var(--accent); }
.run-form label { display: block; margin-bottom: 6px; letter-spacing: .5px; }
.run-row { display: flex; gap: 8px; }
.run-row input { width: 140px; }
.run-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.run-summary.result { margin-bottom: 16px; }
.explore-brief {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: center;
  margin-bottom: 14px;
}
.explore-brief .lock-big {
  font-size: 28px; letter-spacing: 4px; margin-bottom: 6px;
}
.explore-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-runs { display: flex; flex-wrap: wrap; gap: 6px; }
.result-layout { display: grid; grid-template-columns: minmax(220px, .85fr) minmax(0, 1.4fr); gap: 14px; }
.result-layout.crime-result { grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); }
.result-actions {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.result-actions .explore-actions { flex: 1 1 340px; }
.loot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
.loot-grid.empty { grid-template-columns: 1fr; }
.loot-card {
  aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px; background: linear-gradient(180deg, #211a10, #18130c);
  border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.loot-art {
  width: 54px; height: 54px; display: grid; place-items: center;
  background: linear-gradient(160deg, #3e3831, #28231d); border: 1px solid var(--border2);
}
button.loot-art {
  padding: 0; cursor: pointer; color: inherit; border-radius: 4px;
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
button.loot-art:hover, button.loot-art:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(227, 194, 107, .14), inset 0 2px 10px rgba(0, 0, 0, .5);
}
.loot-art img.item-img { width: 46px; height: 46px; display: block; object-fit: contain; }
.loot-name {
  font-family: 'Cinzel', serif; font-size: 12px; line-height: 1.12; text-align: center;
  overflow-wrap: anywhere; max-width: 100%;
}
.loot-qty { color: var(--accent2); font-size: 12px; }
.loot-empty {
  min-height: 104px; display: grid; place-items: center; text-align: center;
  color: var(--muted); background: var(--bg2); border: 1px dashed var(--border);
}
.loot-empty span { font-size: 13px; color: var(--accent2); }
.crime-outcome {
  min-height: 210px; display: flex; flex-direction: column; justify-content: center;
  padding: 18px; background: linear-gradient(180deg, #211a10, #18130c);
  border: 1px solid var(--border); text-align: center;
}
.crime-outcome .lock-big { font-size: 34px; letter-spacing: 5px; margin-bottom: 8px; }
.crime-outcome.ok { border-color: rgba(99, 196, 127, .35); }
.crime-outcome.bad { border-color: rgba(224, 106, 96, .38); }
.crime-outcome.ok .lock-big { color: var(--green); }
.crime-outcome.bad .lock-big { color: var(--red); }

/* ===== Explore log — the story feed ===== */
.explog {
  display: flex; flex-direction: column; gap: 5px; max-height: 360px; overflow-y: auto;
  background: linear-gradient(180deg, #312d2a, #2e2a26); border: 1px solid var(--border); padding: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4);
  scroll-behavior: smooth; cursor: pointer;
}
.exline {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; padding: 6px 10px; border-left: 2px solid var(--border);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.exdot {
  width: 8px; height: 8px; flex: 0 0 8px; background: var(--border2);
  box-shadow: 0 0 8px rgba(217, 181, 89, .12);
}
.exloot {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  background: rgba(227, 194, 107, .08); border: 1px solid rgba(227, 194, 107, .25);
}
button.exloot {
  padding: 0; cursor: pointer; color: inherit;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
button.exloot:hover, button.exloot:focus-visible {
  background: rgba(227, 194, 107, .16);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.exloot .item-ico { width: 24px; height: 24px; }
.exline-hidden { opacity: 0; transform: translateX(-6px); }
.exline.cash { border-left-color: var(--green); color: #c3e8cd; }
.exline.loot { border-left-color: var(--accent); color: var(--accent2); }
.exline.xp { border-left-color: var(--blue); }
.exline.hurt, .exline.bad, .exline.ko { border-left-color: var(--red); color: #f2c4be; }
.exline.heal { border-left-color: var(--green); color: #c3e8cd; }
.exline.jackpot { border-left-color: var(--purple); color: var(--purple); font-weight: 700; text-shadow: 0 0 12px rgba(183, 154, 232, .4); }
.exline.quiet { color: var(--muted); }
@media (max-width: 860px) {
  .explore-brief, .result-layout { grid-template-columns: 1fr; }
  .result-actions { align-items: stretch; }
}

/* ===== Crews / casino ===== */
.crew-tag { color: var(--blue); font-weight: 700; }
.reel-key { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.reel-key span { background: var(--bg2); border: 1px solid var(--border); padding: 4px 9px; }
.war-vs { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px 0; }
.war-side { text-align: center; min-width: 130px; }
.war-name { font-family: 'Cinzel', serif; font-size: 20px; letter-spacing: 1.5px; }
.war-score { font-family: 'IBM Plex Mono', monospace; font-size: 36px; font-weight: 700; color: var(--accent); text-shadow: 0 0 20px rgba(217, 181, 89, .35); }
.war-mid { text-align: center; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }
.war-mid .timer { display: block; font-size: 17px; color: var(--text); margin-top: 4px; }

/* ===== Scrollbars — thin amber-tinted ===== */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border2); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #6b5a42; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html, .chat, .explog { scroll-behavior: auto; }
  .exline-hidden { opacity: 1; transform: none; }
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  body { font-size: 15px; }
  .layout { grid-template-columns: 1fr; padding: 14px 12px 40px; }
  .statbar { position: static; }
  .col-right { order: -1; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .statbar-inner { gap: 11px; }
  .sb-bars { width: 100%; flex-wrap: wrap; }
  .vstack { flex: 1 1 220px; min-width: 200px; }
  .war-vs { gap: 14px; }
  .brand.big { font-size: 36px; }
}

/* ---- guided tour ----------------------------------------------------------- */
.tour-dim { position: fixed; inset: 0; background: rgba(10, 8, 5, .74); z-index: 2100; }
.tour-ring {
  position: fixed; z-index: 2101; pointer-events: none;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 179, 71, .16), 0 0 26px rgba(255, 179, 71, .32);
  transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease;
}
.tour-tip {
  position: fixed; z-index: 2102;
  background: var(--panel2); border: 1px solid var(--accent);
  padding: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
.tour-tip.centered {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 32px));
}
.tour-step { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.tour-title {
  font-family: 'Cinzel', serif; font-size: 26px;
  letter-spacing: .04em; color: var(--accent); margin: 2px 0 6px;
}
.tour-tip p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--text); }
.tour-btns { display: flex; align-items: center; gap: 8px; }
.tour-skip {
  background: none; border: none; padding: 0;
  color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline;
}
.tour-skip:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }

/* ---- The District: property grid ------------------------------------------ */
.dgrid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-top: 14px;
}
.dtile {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 8px; text-align: center;
  background: var(--bg2); border: 1px solid var(--border);
  text-decoration: none; color: var(--text); position: relative;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
a.dtile:hover { border-color: var(--accent); transform: translateY(-1px); }
.dtile .dt-tag {
  position: absolute; top: 6px; left: 6px; font-size: 9px; letter-spacing: .1em;
  color: var(--muted); font-family: 'IBM Plex Mono', monospace;
}
.dtile .dt-big {
  font-family: 'Cinzel', serif; font-size: 30px; line-height: 1;
  color: var(--accent2); letter-spacing: .04em;
}
.dtile .dt-sub { font-size: 10px; letter-spacing: .06em; }
.dtile.empty { border-style: dashed; }
.dtile.empty .dt-big { color: var(--muted); font-size: 26px; }
.dtile.sale { border-style: dashed; border-color: #647454; }
.dtile.sale .dt-tag { color: #9dbb7a; }
.dtile.locked { opacity: .4; }
.dtile.constr { border-color: #645a4a; }
.dtile.constr .dt-big { color: var(--muted); }
.dtile.constr::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(217, 181, 89, .05) 10px 20px);
}
.dtile.ready {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(217, 181, 89, .22), inset 0 0 14px rgba(217, 181, 89, .06);
}
.dtile.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 720px) { .dgrid { grid-template-columns: repeat(3, 1fr); } }

/* ---- email verification ----------------------------------------------------- */
.verify-note { color: var(--muted); font-size: 14px; line-height: 1.6; text-align: left; margin: 0 0 16px; }
.verify-note b { color: var(--text); }
.code-in {
  font-size: 30px; letter-spacing: .45em; text-align: center; padding: 12px 8px 12px 20px;
}
.hint { margin-top: 14px; }

/* unverified-account banner */
.banner.verifybar { border-color: #6a5320; background: linear-gradient(90deg, rgba(217, 181, 89, .10), rgba(217, 181, 89, .02)); }
.banner.verifybar .banner-t { color: var(--accent2); }

/* ---- gym stat analysis chart ------------------------------------------------ */
.schart { display: flex; flex-direction: column; gap: 10px; }
.srow { display: grid; grid-template-columns: 44px 1fr 130px; gap: 12px; align-items: center; }
.slabel { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-align: right; }
.strack {
  position: relative; height: 16px; background: #272421;
  border: 1px solid var(--border); overflow: visible;
}
.sfill { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.savg {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--text); opacity: .8;
}
.sval { font-size: 12.5px; text-align: right; }
.schart-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.savg-key { display: inline-block; width: 2px; height: 14px; background: var(--text); opacity: .8; }
@media (max-width: 560px) { .srow { grid-template-columns: 38px 1fr 90px; } }

/* ---- The District: isometric 3D board -------------------------------------- */
/* The plane tilts with rotateX+rotateZ; buildings are CSS cuboids (roof + two
   camera-facing walls) whose --h grows with tier and upgrade level. Billboards
   counter-rotate the plane transform so labels always face the camera. */
.dboard {
  --ts: clamp(56px, 12vw, 92px);
  position: relative; margin-top: 16px;
  height: calc(var(--ts) * 5 * 0.9 + 150px);
  perspective: 1600px; overflow: hidden;
}
.dplane {
  position: absolute; left: 50%; top: 55%;
  width: calc(var(--ts) * 5); height: calc(var(--ts) * 5);
  display: grid; grid-template-columns: repeat(5, var(--ts)); grid-auto-rows: var(--ts);
  transform: translate(-50%, -50%) rotateX(56deg) rotateZ(45deg);
  transform-style: preserve-3d;
}
.dtile3d {
  position: relative; transform-style: preserve-3d;
  background:
    linear-gradient(135deg, #4a4238 0%, #3d372e 100%);
  border: 1px solid #5d5343; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18);
  text-decoration: none; color: var(--text);
  transition: background .18s ease;
}
a.dtile3d:hover { background: linear-gradient(135deg, #57503f, #474034); }
.dtile3d.empty { background: repeating-linear-gradient(45deg, #433c32 0 12px, #3d372e 12px 24px); border-style: dashed; }
.dtile3d.sale { border: 2px dashed #7a8a5a; background: linear-gradient(135deg, #474334, #3d3a2c); }
.dtile3d.locked { opacity: .38; }
.dtile3d.sel { outline: 3px solid var(--accent); outline-offset: -3px; }

/* building models — each .b3 is one cuboid part of the structure */
.bldg { position: absolute; inset: 8%; transform-style: preserve-3d; pointer-events: none; }
.b3 {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--d);
  transform: translateZ(var(--z, 0px)); transform-style: preserve-3d;
}
.b3 .face { position: absolute; }
.b3 .roof {
  inset: 0; background: var(--bc);
  transform: translateZ(var(--h));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
}
.b3 .wa {             /* wall along the part's bottom edge, standing up toward camera */
  left: 0; right: 0; top: 100%; height: var(--h);
  transform-origin: top; transform: rotateX(90deg);
  background: var(--bc); filter: brightness(.68);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.b3 .wb {             /* wall along the part's right edge, standing up toward camera */
  top: 0; bottom: 0; left: 100%; width: var(--h);
  transform-origin: left; transform: rotateY(-90deg);
  background: var(--bc); filter: brightness(.5);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
/* lit windows, only on parts flagged as the main structure */
.b3.win .wa::after, .b3.win .wb::after {
  content: ''; position: absolute; inset: 18% 12%;
  background: repeating-linear-gradient(0deg, rgba(255, 205, 112, .3) 0 3px, transparent 3px 9px);
}
/* neon signage parts */
.b3.glow .roof, .b3.glow .wa, .b3.glow .wb {
  filter: none; box-shadow: 0 0 14px rgba(255, 201, 94, .55), inset 0 0 0 1px rgba(0, 0, 0, .2);
}
.dtile3d.constr .b3 .roof {
  background: repeating-linear-gradient(-45deg, #6a5a3a 0 10px, #4d4230 10px 20px);
}
.dtile3d.constr .b3 .wa, .dtile3d.constr .b3 .wb { filter: brightness(.45) grayscale(.4); }
.dtile3d.constr .b3.glow .roof, .dtile3d.constr .b3.glow .wa, .dtile3d.constr .b3.glow .wb { box-shadow: none; filter: brightness(.45) grayscale(.4); }
.dtile3d.ready .b3.win .roof {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 26px rgba(217, 181, 89, .5);
}
a.dtile3d:hover .b3.win .roof { box-shadow: inset 0 0 0 2px var(--accent2), 0 0 20px rgba(217, 181, 89, .4); }

/* billboard labels — inverse of the plane rotation, hovering above the roof */
.bill {
  position: absolute; left: 50%; top: 50%; width: max-content; max-width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 2px 6px; text-align: center;
  background: rgba(26, 22, 16, .72); border: 1px solid var(--border);
  transform: translate(-50%, -50%) translateZ(calc(var(--h, 0px) + 26px)) rotateZ(-45deg) rotateX(-56deg);
  font-size: 10px; line-height: 1.2; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
}
/* only actionable labels stay up by default: timers, ready tills, board affordances */
.dtile3d.constr .bill, .dtile3d.ready .bill,
.dtile3d.empty .bill, .dtile3d.sale .bill { opacity: .92; }
.dtile3d:hover .bill, .dtile3d.sel .bill { opacity: 1; background: rgba(26, 22, 16, .92); }
.dboard.flat .bill { opacity: 1; }
.bill b { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: .08em; color: var(--accent2); }
.bill small { font-size: 9px; letter-spacing: .1em; color: var(--muted); }
.bill .btn { pointer-events: auto; }
.bill form { pointer-events: auto; }
.bill.low { transform: translate(-50%, -50%) translateZ(30px) rotateZ(-45deg) rotateX(-56deg); }
.bill.faint { opacity: .75; background: rgba(26, 22, 16, .6); }
.dtile3d.sale .bill { pointer-events: auto; }

/* view toggle */
[data-dview].on { background: linear-gradient(180deg, var(--accent2), var(--accent)); color: var(--ink); border-color: var(--accent); }

/* FLAT mode — the old top-down board */
.dboard.flat { perspective: none; height: auto; overflow: visible; }
.dboard.flat .dplane {
  position: static; transform: none; width: 100%; height: auto;
  grid-template-columns: repeat(5, 1fr); grid-auto-rows: auto; gap: 10px;
}
.dboard.flat .dtile3d { aspect-ratio: 1; transform: none; }
.dboard.flat .bldg { display: none; }
.dboard.flat .bill {
  position: static; transform: none; width: auto; max-width: none;
  height: 100%; justify-content: center; background: none; border: none;
}
@media (prefers-reduced-motion: reduce) { .dtile3d, .bldg .roof { transition: none; } }

/* ---- district drag-to-build palette ----------------------------------------- */
.dpalette {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 14px; padding: 10px; background: var(--bg2); border: 1px solid var(--border);
}
.dpalette-h { flex-basis: 100%; letter-spacing: .1em; }
.dchip {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px;
  background: var(--panel2); border: 1px solid var(--border2);
  cursor: grab; user-select: none; font-size: 12px;
}
.dchip:active { cursor: grabbing; }
.dchip b { font-family: 'Cinzel', serif; font-size: 15px; color: var(--accent2); letter-spacing: .06em; }
.dchip-p { color: var(--green); font-size: 11px; }
.dchip.disabled { opacity: .4; cursor: not-allowed; }
.dchip[draggable="true"]:hover { border-color: var(--accent); }
/* valid targets pulse while dragging; hovered target lights up */
.dboard.dragging .dtile3d.empty {
  border-color: var(--accent); border-style: dashed;
  box-shadow: inset 0 0 22px rgba(217, 181, 89, .18);
}
.dtile3d.dragover {
  background: linear-gradient(135deg, #5d5138, #4a4230) !important;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 30px rgba(217, 181, 89, .3);
}

/* ---- item art ---------------------------------------------------------------- */
.mcard-tile img.item-img { width: 52px; height: 52px; display: block; object-fit: contain; }
.item-ico { width: 24px; height: 24px; flex: 0 0 24px; vertical-align: middle; object-fit: contain; }

/* ---- brand assets ------------------------------------------------------------ */
.brand-ico {
  width: 30px; height: 30px; margin-right: 10px;
  vertical-align: -8px; border-radius: 7px;
}
.brand-wordmark { width: 300px; max-width: 88%; display: block; margin: 0 0 6px; }
.auth-card .brand-wordmark.sm { width: 210px; margin: 0 auto 10px; }

/* ===========================================================================
   Marketing landing page — tokens verbatim from the design handoff
   =========================================================================== */
.mb-land {
  margin: 0; background: #100d08; color: #e8ddc3;
  font-family: var(--ui-font); font-size: 18px;
  background-image: none;
}
.mb-land::before, .mb-land::after { display: none; }   /* no grain/vignette here */
.mb-land a { text-decoration: none; }

.mb-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 56px; border-bottom: 1px solid #2b2417;
}
.mb-nav-brand { display: flex; align-items: center; gap: 14px; }
.mb-nav-brand img { border-radius: 8px; }
.mb-nav-brand span {
  font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 19px;
  letter-spacing: .08em; color: #e3c26b;
}
.mb-nav-links { display: flex; align-items: center; gap: 36px; }
.mb-nav-links a, .mb-login {
  font-family: Cinzel, serif; font-size: 14px; letter-spacing: .16em;
  color: #b3a488; transition: color .15s ease;
}
.mb-nav-links a:hover { color: #e8d9a0; }
.mb-cta {
  font-family: Cinzel, serif; font-weight: 700; color: #14100b !important;
  background: linear-gradient(180deg, #f0d88c, #c9a24a);
  border-radius: 3px; transition: background .15s ease, box-shadow .15s ease;
}
.mb-cta:hover { background: linear-gradient(180deg, #f8e6a8, #d9b559); }
.mb-cta.sm { font-size: 14px; letter-spacing: .18em; padding: 10px 24px; }
.mb-cta.lg {
  display: inline-block; margin-top: 40px; font-size: 17px; letter-spacing: .2em;
  padding: 18px 52px; box-shadow: 0 6px 24px rgba(217, 181, 89, .25);
}
.mb-cta.lg:hover { box-shadow: 0 6px 32px rgba(217, 181, 89, .4); }

.mb-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 96px 32px 72px;
  background: radial-gradient(ellipse 70% 55% at 50% 32%, #262019 0%, #100d08 75%);
}
.mb-wordmark { width: 560px; max-width: 90%; }
.mb-tagline {
  font-style: italic; font-size: 26px; color: #b3a488;
  margin: 34px 0 0; max-width: 560px; line-height: 1.4;
}
.mb-sub { font-size: 16px; color: #6f6350; margin: 16px 0 0; }

.mb-gemrule {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 0 56px;
}
.mb-gemrule .l { width: 220px; height: 1px; background: linear-gradient(90deg, transparent, #a98a3f); }
.mb-gemrule .r { width: 220px; height: 1px; background: linear-gradient(270deg, transparent, #a98a3f); }
.mb-gemrule .gem {
  width: 10px; height: 10px; transform: rotate(45deg);
  background: linear-gradient(135deg, #f3e3a5, #b98c2f 60%, #7a5a1a);
}

.mb-h2 {
  font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 34px;
  text-align: center; color: #e3c26b; letter-spacing: .04em; margin: 0;
}
.mb-h3 {
  font-family: 'Cinzel Decorative', serif; font-weight: 700; font-size: 30px;
  color: #e3c26b; line-height: 1.2; margin: 0;
}
.mb-features { max-width: 1080px; margin: 0 auto; padding: 0 32px 80px; }
.mb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; }
.mb-card {
  background: #171209; border: 1px solid #2b2417; border-radius: 6px;
  padding: 34px 28px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 14px; transition: border-color .15s ease;
}
.mb-card:hover { border-color: #6b5327; }
.mb-card-art {
  width: 96px; height: 96px; display: grid; place-items: center;
}
.mb-card-art .item-img {
  width: 96px; height: 96px; object-fit: contain;
}
.mb-card-t { font-family: Cinzel, serif; font-weight: 700; font-size: 19px; letter-spacing: .12em; color: #e8d9a0; }
.mb-card-b { font-size: 18px; line-height: 1.5; color: #b3a488; }

.mb-market {
  padding: 64px 0; background: #0c0a06;
  border-top: 1px solid #2b2417; border-bottom: 1px solid #2b2417; overflow: hidden;
}
.mb-market-sub { font-style: italic; font-size: 20px; color: #8f8168; text-align: center; margin: 12px 0 0; }
.mb-ticker-clip { margin-top: 44px; width: 100%; overflow: hidden; }
.mb-ticker { display: flex; gap: 20px; width: max-content; animation: mbTicker 40s linear infinite; }
.mb-ticker:hover { animation-play-state: paused; }
.mb-ticker-tile {
  width: 110px; height: 110px; display: grid; place-items: center;
  border: 1px solid #2b2417; border-radius: 6px;
  background: radial-gradient(circle at 50% 38%, #2a241b, #141007 72%);
}
.mb-ticker-tile .item-img {
  width: 88px; height: 88px; object-fit: contain;
}
@keyframes mbTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mb-ticker { animation: none; } }
.mb-currencies { display: flex; justify-content: center; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.mb-currencies div { display: flex; align-items: center; gap: 10px; }
.mb-currency-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid #6b5327; border-radius: 50%;
  background: #171209; color: #e3c26b;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 800;
}
.mb-currencies span { font-family: Cinzel, serif; font-size: 15px; letter-spacing: .12em; color: #b3a488; }

.mb-shot {
  max-width: 1080px; margin: 0 auto; padding: 80px 32px;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: center;
}
.mb-shot-copy { display: flex; flex-direction: column; gap: 18px; }
.mb-shot-copy p { font-size: 19px; line-height: 1.55; color: #b3a488; margin: 0; }
.mb-runlink {
  font-family: Cinzel, serif; font-weight: 700; font-size: 14px; letter-spacing: .18em;
  color: #e8d9a0; margin-top: 6px; transition: color .15s ease;
}
.mb-runlink:hover { color: #f8e6a8; }
.mb-shot-frame {
  aspect-ratio: 16/10; border: 1px solid #2b2417; border-radius: 6px;
  background: repeating-linear-gradient(45deg, #171209, #171209 14px, #131007 14px, #131007 28px);
  display: flex; align-items: center; justify-content: center;
}
.mb-shot-frame span { font-family: monospace; font-size: 14px; color: #6f6350; letter-spacing: .08em; }
.mb-shot-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.mb-foot {
  border-top: 1px solid #2b2417; padding: 40px 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.mb-foot-brand { display: flex; align-items: center; gap: 12px; }
.mb-foot-brand img { border-radius: 6px; }
.mb-foot span, .mb-foot a {
  font-family: Cinzel, serif; font-size: 13px; letter-spacing: .14em; color: #6f6350;
}
.mb-foot-links { display: flex; gap: 28px; }
.mb-foot a { transition: color .15s ease; }
.mb-foot a:hover { color: #b3a488; }

@media (max-width: 900px) {
  .mb-nav { padding: 18px 22px; }
  .mb-nav-links { gap: 18px; }
  .mb-nav-links a[href="#features"], .mb-nav-links a[href="#market"] { display: none; }
  .mb-cards { grid-template-columns: 1fr; }
  .mb-shot { grid-template-columns: 1fr; padding: 56px 24px; }
  .mb-foot { flex-direction: column; gap: 16px; }
}


/* ---- reskin: display headers use Cinzel Decorative ---------------------------- */
.brand, .prof-name, .auth-card-h, .tour-title, .lock-big, .banner-t, .mb-h2 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
}
.brand { color: #e3c26b; font-size: 19px; letter-spacing: .08em; }
.brand span { color: var(--text); }
.sb-name { font-size: 17px; }
.card, .mcard, .lrow, input, textarea, select, .shout-card, .dtile3d, .dchip { border-radius: 4px; }

/* ---- legibility pass: calmer text, stronger hierarchy, easier targets -------- */
button, input, textarea, select { font-family: var(--ui-font); }
p, li, .lead, .card-m, .card-s, .mcard-flavor, .thread-body, .shout-text, .exline {
  font-size: 15px;
  line-height: 1.58;
}
.muted { color: #c2b498; }
.small { font-size: 12.5px; }
.brand, .box-h, .card-t, .mcard-h, .inv-title, .inv-detail-title, .loot-name,
.prof-name, .banner-t, .lock-big, .af-t, .auth-card-h, .menu-toggle, .tr-stat,
.war-name, .bill b {
  font-family: var(--display-font);
}
.box-h, .mcard-h, .banner-t, .lock-big, .prof-name {
  letter-spacing: .055em;
}
.box-h {
  display: flex; align-items: center; min-height: 40px;
  padding: 9px 14px; font-size: 15px; font-weight: 700;
  background: linear-gradient(180deg, #211b12, #120f0a);
}
.box-b { padding: 14px; }
.box-sub {
  color: #caba9c; font-family: var(--ui-font); font-size: 11px;
  font-weight: 800; letter-spacing: .075em;
}
.btn, .toptab, .menu-link, .mtab, .auth-tabs .tab {
  font-family: var(--ui-font);
  font-weight: 800;
}
.btn {
  min-height: var(--hit); display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; font-size: 12px; letter-spacing: .07em;
}
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 11.5px; }
input, textarea, select {
  min-height: var(--hit); font-size: 15px; line-height: 1.35;
  background: #0d0b07; border-color: #413620;
}
textarea { line-height: 1.5; }
.topbar {
  background: linear-gradient(180deg, #211c15, #11100c);
}
.toptabs { gap: 5px; }
.toptab {
  min-height: 36px; display: inline-flex; align-items: center;
  padding: 8px 11px; font-size: 12px; letter-spacing: .035em;
  border: 1px solid transparent; border-bottom-color: transparent;
}
.toptab.on {
  background: rgba(227, 194, 107, .1); border-color: rgba(227, 194, 107, .35);
  text-shadow: none;
}
.statbar {
  background: linear-gradient(180deg, #17130d, #211b12);
}
.sb-name { font-family: var(--display-font); letter-spacing: .045em; }
.sb-stat {
  min-width: 76px; padding: 4px 7px;
  background: rgba(12, 10, 6, .52); border: 1px solid rgba(107, 83, 39, .38);
}
.sb-stat .k, .stat .k, .chip .lbl, .bar-top {
  font-family: var(--ui-font); font-weight: 800; letter-spacing: .06em;
}
.sb-stat .v, .stat .v, .chip, .online, .nbar .nv, .nbar .nl, .ibadge {
  font-family: var(--mono-font);
}
.nbar .nl { letter-spacing: .06em; }
.layout { gap: 12px; }
.box, .card, .mcard, .lrow, .mail-row, .thread-bubble, .shout-card, .stat, .explog {
  background: linear-gradient(180deg, var(--panel-soft), #120f0a);
  border-color: #3a301d;
}
.box, .card, .mcard, .lrow, .mail-row, .thread-bubble, .shout-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 6px 18px rgba(0, 0, 0, .24);
}
.card { padding: 13px; gap: 8px; }
.card-t {
  font-size: 15px; line-height: 1.25; letter-spacing: .025em;
}
.card-s, .card-m { color: #c2b498; }
.tag, .badge {
  font-family: var(--ui-font); font-weight: 800; letter-spacing: .045em;
}
.lrow { padding: 10px 12px; }
.menu-toggle {
  min-height: var(--hit); font-size: 13px; letter-spacing: .1em;
}
.menu-sec {
  font-family: var(--ui-font); font-size: 11px; font-weight: 900; letter-spacing: .08em;
}
.menu-link {
  min-height: 38px; padding: 8px 11px; font-size: 13px; letter-spacing: .01em;
}
.mtabs { gap: 7px; }
.mtab {
  min-height: 36px; display: inline-flex; align-items: center;
  padding: 7px 12px; font-size: 12px; letter-spacing: .035em;
}
.mcard-h { font-size: 16px; letter-spacing: .045em; }
.mcard-flavor { color: #c2b498; font-style: normal; }
.inv-card {
  background: linear-gradient(180deg, #201910, #13100b);
  border-color: #3b311d;
}
.inv-title {
  font-family: var(--ui-font); font-weight: 800; font-size: 12.5px; letter-spacing: 0;
}
.inv-meta {
  font-family: var(--ui-font); font-weight: 800; letter-spacing: .045em;
}
.inv-detail-title { font-size: 13px; letter-spacing: .025em; }
.inv-detail p { color: #d0c0a0; line-height: 1.35; }
.loot-name {
  font-family: var(--ui-font); font-weight: 800; font-size: 12px; letter-spacing: 0;
}
.explog {
  background: #0f0d09; padding: 10px; cursor: default;
}
.exline {
  background: rgba(255, 255, 255, .018); border: 1px solid rgba(107, 83, 39, .24);
  border-left-width: 3px; padding: 7px 9px; color: #ddcfb4;
}
.shout-head { font-size: 12.5px; }
.shout-text { color: #e2d4ba; }
.flash, .banner {
  border-radius: 4px;
}
.auth-card, .doc-wrap { font-family: var(--ui-font); }
.auth-card-h { letter-spacing: .055em; }
.auth-pitch, .af-d, .verify-note, .hint, .doc-list li {
  line-height: 1.65;
}

/* ---- player avatars ----------------------------------------------------------- */
.avatar { border-radius: 8px; flex: 0 0 auto; }
.avatar.lg { width: 84px; height: 84px; margin-right: 16px; }
.avatar.md { width: 54px; height: 54px; margin-right: 14px; }
.avatar.sm { width: 28px; height: 28px; }
.prof-head, .home-head { display: flex; align-items: center; }

/* avatar upload (settings) */
.avatar-row { display: flex; align-items: center; gap: 18px; }
.avatar-forms { display: flex; flex-direction: column; gap: 10px; }
.avatar-forms input[type="file"] { font-size: 13px; max-width: 240px; }
.avatar-note { margin-top: 12px; }
.avatar { object-fit: cover; background: #120e08; }


/* ===== arcade-loop layouts: the click cycle stays above the fold ============= */
.split2 { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .split2 { grid-template-columns: 1fr; } }
.box { margin-bottom: 10px; }
.box-h { padding: 7px 14px; font-size: 15px; }
.box-h .tag { float: right; font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.btn { padding: 8px 13px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.lrow { padding: 6px 8px; }
.explog { max-height: 52vh; overflow-y: auto; }
.run-form .run-row input { width: 90px; }

/* gym: one row per stat — value, energy input, TRAIN */
.train-rows { display: flex; flex-direction: column; gap: 8px; }
.train-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
}
.tr-stat { font-family: 'Cinzel', serif; font-weight: 700; font-size: 13px; letter-spacing: .12em; width: 42px; color: var(--accent2); }
.tr-val { min-width: 64px; font-size: 15px; }
.train-form { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.train-form input { width: 64px; padding: 5px 8px; }

/* battle results */
.battle-log { max-height: 44vh; }
.exline.good { color: var(--green); }
.exline.bad { color: var(--red); }
.exline.ko { color: var(--accent2); font-weight: 700; }
.exline.info { color: var(--muted); font-style: italic; }
.war-side .avatar { margin: 0 auto 8px; display: block; }

/* ===== mobile game shell ===================================================== */
@media (max-width: 720px) {
  html { scroll-padding-top: 8px; }
  body { font-size: 14px; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  .topbar {
    position: sticky; top: 0; display: grid; grid-template-columns: 1fr auto;
    gap: 6px 10px; padding: 8px 10px; z-index: 55;
  }
  .topbar .brand {
    font-size: 16px; min-width: 0; display: flex; align-items: center;
    gap: 6px; letter-spacing: .06em; white-space: nowrap;
  }
  .brand-ico { width: 24px; height: 24px; }
  .top-right { justify-content: flex-end; gap: 8px; font-size: 11px; }
  #clock { display: none; }
  .online { font-size: 10px; }
  .online-link { padding: 6px 7px; }
  .logout-link { padding: 7px 8px; font-size: 10px; }
  .toptabs { display: none; }
  .toptabs::-webkit-scrollbar { display: none; }
  .toptab {
    flex: 0 0 auto; padding: 7px 10px; background: rgba(12, 10, 6, .7);
    border: 1px solid var(--border); font-size: 12px; border-bottom-width: 1px;
  }
  .toptab.on { border-color: var(--accent); background: rgba(227, 194, 107, .09); }

  .statbar { position: static; }
  .statbar-inner { padding: 8px 10px; gap: 8px; display: grid; grid-template-columns: 1fr; }
  .sb-group { gap: 8px; flex-wrap: wrap; min-width: 0; }
  .sb-id { justify-content: space-between; }
  .sb-name {
    font-size: 15px; min-width: 0; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sb-lvl, .badge { flex: 0 0 auto; }
  .sb-div { display: none; }
  .sb-stat {
    flex: 1 1 30%; min-width: 86px; padding: 5px 7px;
    background: rgba(12, 10, 6, .55); border: 1px solid var(--border);
  }
  .sb-stat .k { font-size: 9px; }
  .sb-stat .v { font-size: 12px; overflow-wrap: anywhere; }
  .sb-bars { width: 100%; display: grid; grid-template-columns: 1fr; gap: 5px; }
  .vstack { min-width: 0; width: 100%; gap: 4px; }
  .nbar { gap: 6px; }
  .nbar .nl { width: 30px; flex-basis: 30px; font-size: 9px; }
  .nbar .nv { min-width: 58px; font-size: 9px; }

  .layout { padding: 8px 8px 18px; gap: 8px; }
  .col-mid { min-width: 0; }
  .col-right {
    display: none; position: fixed; left: 8px; right: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 70; margin: 0;
  }
  body.menu-open .col-right { display: block; }
  .menu-wrap { gap: 6px; }
  .menu-toggle {
    padding: 10px 12px; font-size: 13px; letter-spacing: .16em;
    background: linear-gradient(180deg, #342d24, #171209);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
  }
  .menu-body {
    max-height: min(58vh, 460px); overflow-y: auto; padding: 8px;
    background: rgba(16, 13, 8, .98); border: 1px solid var(--border2); border-top: 0;
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .52);
    backdrop-filter: blur(8px);
  }
  .menu-sec { padding: 8px 4px; font-size: 10px; }
  .menu-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .menu-link {
    min-height: 34px; justify-content: center; text-align: center;
    padding: 7px 5px; font-size: 11.5px; border-left-width: 1px;
  }
  .menu-link:hover { transform: none; }

  .mobile-dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px; padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(30, 24, 16, .96), rgba(12, 10, 6, .98));
    border-top: 1px solid var(--border2);
    box-shadow: 0 -8px 22px rgba(0, 0, 0, .48);
  }
  .dock-link {
    position: relative; min-width: 0; min-height: 46px; display: grid; place-items: center;
    padding: 6px 2px; background: rgba(16, 13, 8, .74);
    border: 1px solid var(--border); color: var(--muted);
    font-family: 'Cinzel', serif; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
    text-align: center; border-radius: 4px;
  }
  .dock-link.on, .dock-link:active, body.menu-open .dock-more {
    color: var(--ink); border-color: var(--gold-lo);
    background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  }
  .dock-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .dock-more { cursor: pointer; }
  .dock-badge {
    position: absolute; top: -5px; right: 4px; min-width: 17px; height: 17px; padding: 0 5px;
    display: grid; place-items: center; background: var(--red); color: #fff5f2;
    font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700;
    border: 1px solid rgba(255, 245, 242, .28);
  }

  .box { margin-bottom: 8px; border-radius: 4px; }
  .box-h { padding: 7px 10px; font-size: 13px; letter-spacing: .12em; line-height: 1.25; }
  .box-b { padding: 9px; }
  .box-sub { padding: 0 10px; font-size: 10px; }
  .box > .box-sub { padding: 8px 10px 0; }
  .lead, p { line-height: 1.45; }

  .grid, .mgrid { grid-template-columns: 1fr; gap: 8px; }
  .card { padding: 10px; gap: 7px; }
  .card-t { font-size: 13px; align-items: flex-start; }
  .card-m, .card-s, .mcard-flavor { font-size: 12.5px; line-height: 1.45; }
  .mcard-h { padding: 7px 10px; font-size: 15px; letter-spacing: .08em; }
  .mcard-b { padding: 9px 10px 5px; gap: 9px; }
  .mcard-tile { flex-basis: 48px; width: 48px; height: 48px; }
  .mgrid .mcard-tile { flex-basis: 48px; width: 48px; height: 48px; }
  .mcard-f { padding: 6px 10px 10px; gap: 7px; flex-wrap: wrap; }
  .mcard-price { font-size: 15px; }
  .mcard-buy { width: 100%; }
  .mcard-buy input { width: 70px; }

  .statgrid, .statgrid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat { padding: 7px 8px; }
  .stat .num { font-size: 17px; }
  .kv { display: grid; grid-template-columns: 1fr; gap: 2px; }
  .lrow { align-items: flex-start; flex-wrap: wrap; gap: 7px; }
  .lrow .sp { display: none; }
  .row, .inline-form, .run-row, .chat-form { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .row .btn, .inline-form .btn, .run-row .btn, .chat-form .btn { width: 100%; }
  .player-filters { grid-template-columns: 1fr; gap: 7px; }
  .player-filters .btn { width: 100%; }
  .bounty-form { grid-template-columns: 1fr; gap: 7px; }
  .bounty-form .btn { width: 100%; }
  .job-collect { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .job-collect .btn { width: 100%; }
  .run-row input, .run-form .run-row input, .mini-in { width: 100%; }

  .banner { align-items: flex-start; flex-direction: column; gap: 10px; padding: 11px; }
  .banner-t { font-size: 20px; }
  .banner-r { margin-left: 0; align-items: stretch; width: 100%; text-align: left; }
  .banner-r .btn { width: 100%; }

  .home-head, .prof-head, .avatar-row { align-items: flex-start; flex-direction: column; }
  .avatar.lg, .avatar.md { margin-right: 0; }
  .prof-name { font-size: 24px; }
  .avatar-forms, .avatar-forms input[type="file"] { width: 100%; max-width: none; }

  .train-row { align-items: stretch; flex-wrap: wrap; gap: 6px; }
  .train-form { width: 100%; margin-left: 0; }
  .train-form input { flex: 1; width: auto; }
  .train-form .btn { flex: 1; }

  .explore-brief { gap: 9px; margin-bottom: 9px; }
  .explore-actions, .quick-runs, .result-actions { display: grid; grid-template-columns: 1fr; gap: 7px; }
  .quick-runs .actform, .explore-actions .actform { display: block; }
  .quick-runs .btn, .explore-actions .btn, .result-actions .btn { width: 100%; }
  .loot-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 7px; }
  .loot-art { width: 46px; height: 46px; }
  .loot-art img.item-img { width: 38px; height: 38px; object-fit: contain; }
  .challenge-rewards { gap: 5px; }
  .challenge-item { min-height: 24px; padding: 2px 6px 2px 3px; font-size: 11px; }
  .challenge-item img.item-img { width: 20px; height: 20px; object-fit: contain; }
  .quest-req-art img.item-img { width: 26px; height: 26px; object-fit: contain; }
  .explog { max-height: 42vh; padding: 8px; }
  .exline { padding: 6px 7px; font-size: 12.5px; gap: 7px; }

  .mail-compose-body, .mail-row, .thread-msg, .thread-msg.out {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .thread-msg.out .avatar { grid-column: 1; }
  .thread-msg.out .thread-bubble { grid-column: 2; }
  .mail-row .btn { grid-column: 1 / -1; width: 100%; }

  .dboard { --ts: clamp(44px, 16vw, 62px); height: calc(var(--ts) * 5 * 0.9 + 110px); }
  .dgrid { gap: 6px; }
  .dtile { padding: 6px; }
  .dtile .dt-big { font-size: 22px; }
}

@media (max-width: 390px) {
  .inv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-actions .btn.sm { font-size: 9px; padding: 3px 4px; }
  .statgrid, .statgrid.wide { grid-template-columns: 1fr; }
  .menu-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- mobile legibility/touch pass ------------------------------------------ */
@media (max-width: 720px) {
  body {
    font-size: 15px;
    line-height: 1.55;
  }
  .topbar {
    padding: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .topbar .brand {
    font-size: 15px;
    letter-spacing: .045em;
  }
  .statbar-inner {
    padding: 8px;
    gap: 7px;
  }
  .sb-id {
    gap: 7px;
  }
  .sb-name {
    font-size: 14px;
  }
  .sb-stat {
    min-width: 0;
    flex: 1 1 calc(33.333% - 6px);
    padding: 5px 6px;
  }
  .sb-stat .k {
    font-size: 9.5px;
  }
  .sb-stat .v {
    font-size: 12.5px;
  }
  .nbar .nl {
    font-size: 9.5px;
  }
  .nbar .nv {
    font-size: 9.5px;
    min-width: 64px;
  }
  .box-h {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13.5px;
    letter-spacing: .045em;
  }
  .box-b {
    padding: 10px;
  }
  .card, .mcard, .lrow, .mail-row, .thread-bubble {
    padding: 10px;
  }
  .card-t {
    font-size: 14px;
  }
  .card-m, .card-s, .mcard-flavor, .thread-body, .shout-text, .exline {
    font-size: 14px;
    line-height: 1.5;
  }
  .btn {
    min-height: 44px;
    font-size: 12px;
    letter-spacing: .045em;
  }
  .btn.sm {
    min-height: 36px;
    font-size: 11px;
  }
  .dock-link {
    font-family: var(--ui-font);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0;
  }
  .menu-link {
    min-height: 38px;
    font-size: 12px;
  }
  .menu-sec {
    font-size: 10.5px;
  }
  .inv-list {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }
  .inv-title {
    font-size: 12.5px;
  }
  .inv-actions .btn.sm {
    min-height: 30px;
    font-size: 10px;
    padding: 4px;
  }
  .loot-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
  .explog {
    max-height: 46vh;
  }
}

@media (max-width: 390px) {
  .inv-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inv-actions .btn.sm {
    font-size: 9.5px;
  }
  .dock-link {
    font-size: 10px;
  }
}
