/* NightCore — Night City Services. Civic portal of a city in 2085: a midnight-indigo street,
   documents on warm paper, AP red for action, sodium amber for money. */
:root {
  --street: #171b2e;        /* page */
  --street-2: #1f2540;      /* raised surface */
  --street-3: #2a3152;      /* inputs, hover */
  --line: #353d63;
  --text: #e8eaf4;
  --muted: #a3aac6;
  --paper: #ede8dc;         /* documents */
  --paper-2: #e2dccd;
  --paper-ink: #1d2133;
  --paper-muted: #5d6175;
  --signal: #ff4a4a;        /* AP Gaming red: actions, alerts */
  --signal-ink: #fff;
  --sodium: #f2b23c;        /* money */
  --go: #52d49d;            /* online, delivered */
  --radius-doc: 6px;
  --radius-ui: 10px;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--street); color: var(--text);
  font: 16px/1.55 var(--body); font-feature-settings: "tnum" 1;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--sodium); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }
.muted { color: var(--muted); }
.money { color: var(--sodium); font-weight: 700; white-space: nowrap; }

/* --- header ---------------------------------------------------------------------------------- */
.top { border-bottom: 1px solid var(--line); background: #141828; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: auto; }
.brand b { font: 800 1.45rem/1 var(--display); letter-spacing: .02em; }
.brand span { display: block; font-size: .78rem; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--street-2); }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--signal); border-radius: 0; }

.citybar { background: var(--street-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.citybar .wrap { display: flex; gap: 22px; align-items: center; min-height: 38px; flex-wrap: wrap; color: var(--muted); }
.citybar strong { color: var(--text); font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--go); box-shadow: 0 0 0 3px rgba(82, 212, 157, .18); }
.dot.off { background: var(--signal); }

main { padding: 40px 0 72px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; padding: 26px 0 40px; }
.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; }

/* --- controls -------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: var(--radius-ui); border: 1px solid var(--line); background: var(--street-2);
  color: var(--text); font: 700 .98rem var(--body); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--street-3); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--street-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; min-height: 42px; max-width: 100%;
}
label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.notice { border-left: 4px solid var(--sodium); background: var(--street-2); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 24px; }
.notice.bad { border-color: var(--signal); }
.notice.good { border-color: var(--go); }

/* --- layout pieces --------------------------------------------------------------------------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: start; }
.panel { background: var(--street-2); border: 1px solid var(--line); border-radius: var(--radius-ui); padding: 22px; }
.section { margin-top: 48px; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num, .table th.num { text-align: right; }
.scroll { overflow-x: auto; }

/* --- the city board (home hero) -------------------------------------------------------------- */
.board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: end; padding: 12px 0 8px; }
.clock { font: 900 clamp(5.5rem, 17vw, 11.5rem)/.82 var(--display); letter-spacing: -.01em; color: var(--text); }
.clock small { font-size: .32em; color: var(--muted); font-weight: 700; margin-left: .2em; letter-spacing: .02em; }
.board .readout { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; font-size: 1.05rem; color: var(--muted); }
.board .readout strong { display: block; font: 800 1.9rem/1 var(--display); color: var(--text); }
.join ol { margin: 0 0 20px; padding-left: 1.3em; }
.join li { margin-bottom: 8px; }
.join li::marker { font-family: var(--display); font-weight: 800; color: var(--signal); }

/* --- documents: the NCID card is the signature piece ------------------------------------------ */
.doc { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius-doc); padding: 22px; }
.doc .muted, .doc small { color: var(--paper-muted); }
.doc .money { color: #8a5600; }
.doc h3 { color: var(--paper-ink); }
.doc .table th { color: var(--paper-muted); border-color: #cfc8b6; }
.doc .table td { border-color: #d8d1c0; }

.ncid {
  position: relative; overflow: hidden; width: min(100%, 520px); aspect-ratio: 1.586;
  background: linear-gradient(180deg, var(--paper) 0 72%, var(--paper-2) 72%);
  color: var(--paper-ink); border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px -18px rgba(0, 0, 0, .65);
  display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr auto; gap: 6px 18px;
}
.ncid::after { /* the holographic security strip */
  content: ""; position: absolute; top: 0; bottom: 0; right: 26px; width: 34px; opacity: .55; pointer-events: none;
  background: linear-gradient(160deg, #9ff1ff, #ffb3e6 30%, #fff1a8 55%, #a8ffcf 80%, #9ff1ff);
  mix-blend-mode: multiply;
}
.ncid .issuer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; font: 800 1.05rem/1 var(--display); letter-spacing: .04em; }
.ncid .issuer span { font: 600 .72rem var(--body); color: var(--paper-muted); letter-spacing: 0; }
.ncid .photo { grid-row: 2 / 4; border-radius: 8px; background: #c9c1ad; display: grid; place-items: center; font: 900 2.6rem var(--display); color: #8b8270; }
.ncid .name { font: 900 clamp(1.6rem, 4.6vw, 2.15rem)/.95 var(--display); }
.ncid dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0 0; font-size: .86rem; }
.ncid dt { color: var(--paper-muted); }
.ncid dd { margin: 0; font-weight: 700; }
.ncid .mrz { grid-column: 2; font: 600 .74rem/1.25 var(--body); letter-spacing: .14em; color: var(--paper-muted); overflow: hidden; white-space: nowrap; text-overflow: clip; }

/* --- market ------------------------------------------------------------------------------------ */
.store { margin-bottom: 40px; }
.store header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.store { margin-top: 36px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); column-gap: 48px; }
.ware { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ware label { flex: 1; margin: 0; font-weight: 600; }
.ware .money { min-width: 70px; text-align: right; }
.ware input[type=number] { width: 76px; }
.basket { position: sticky; bottom: 0; margin-top: 28px; background: var(--street-2); border: 1px solid var(--line); border-radius: var(--radius-ui);
  padding: 12px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.basket strong { font: 800 1.6rem/1 var(--display); color: var(--sodium); }
.cart { position: sticky; top: 16px; }
.receipt { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius-doc); padding: 18px 20px; }
.receipt .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.receipt .total { border-top: 1px dashed #b9b19c; margin-top: 8px; padding-top: 8px; font-weight: 800; }
.receipt .money { color: var(--paper-ink); }

/* --- staff ------------------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi { background: var(--street-2); border: 1px solid var(--line); border-radius: var(--radius-ui); padding: 14px 16px; }
.kpi strong { display: block; font: 800 1.8rem/1.05 var(--display); }
.kpi span { color: var(--muted); font-size: .88rem; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; }
.subnav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; background: var(--street-2); color: var(--muted); font-weight: 600; font-size: .92rem; }
.subnav a[aria-current="page"] { background: var(--street-3); color: var(--text); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--street-3); color: var(--muted); }
.tag.go { background: rgba(82, 212, 157, .16); color: var(--go); }
.tag.bad { background: rgba(255, 74, 74, .16); color: #ff8a8a; }
.tag.warn { background: rgba(242, 178, 60, .16); color: var(--sodium); }
pre.console { background: #0f1220; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 360px; overflow: auto; font-size: .82rem; white-space: pre-wrap; }

.menu-btn { display: none; }
@media (max-width: 760px) {
  .top .wrap { gap: 12px; }
  .menu-btn { display: inline-flex; margin-left: auto; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--street-2); color: var(--text); font: 700 .95rem var(--body); align-items: center; cursor: pointer; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--signal); }
  .shelf, .games { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; gap: 26px; }
  .ncid { grid-template-columns: 84px 1fr; padding: 16px; }
  .ncid .mrz { display: none; }
  .nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* wide pages (maps, boards) */
.wrap.wide { width: min(1320px, 100% - 32px); }
