/* Layout: sticky header with tabs and coin balance; one view at a time in a 1120px column; listings in a wrapping card grid. */
:root {
  /* Colours. One dark look: black background, purple from the logo. */
  --bg: #000000; --surface: #0e0a15; --surface-2: #1a1326; --fg: #f2edf9; --muted: #a99dbb; --line: #2e2244;
  --accent: #9d2cff; --accent-fg: #ffffff; --accent-soft: #2a1247;
  --coin: #f2c14e; --coin-bg: #3a2e10;
  --ok: #62d49c; --ok-bg: #12301f; --warn: #f0b35a; --warn-bg: #3a2a10; --bad: #ff9088; --bad-bg: #3d1a17;
  --c-script: #41c2b7; --c-vehicle: #f08d5e; --c-map: #c79bff; --c-cloth: #f07fb6;
  --display: "Chakra Petch", "Trebuchet MS", sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 6px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.brand span { color: var(--accent); }
.balance { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.coin { display: inline-flex; align-items: center; gap: 6px; background: var(--coin-bg); color: var(--coin); font-weight: 600; padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coin::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
nav { width: 100%; display: flex; gap: 4px; overflow-x: auto; }
nav a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
nav a .n { font-size: .75rem; background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }

.notice { background: var(--warn-bg); color: var(--warn); font-size: .87rem; }
.notice div { max-width: 1120px; margin: 0 auto; padding: 6px 16px; }
main { max-width: 1120px; margin: 0 auto; padding-block: 24px 64px; padding-inline: 16px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-direction: column; gap: 4px; }
.head p { max-width: 65ch; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--r); cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: .87rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
input[type="search"], input[type="text"], input[type="number"], select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-width: 0; max-width: 100%; }
.filters input[type="search"] { flex: 1 1 180px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0; cursor: pointer; display: flex; flex-direction: column; overflow: hidden; }
.card:hover { border-color: var(--accent); }
.thumb { aspect-ratio: 16 / 7; max-width: 100%; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, transparent 10px 20px), var(--surface-2); font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: .04em; }
.thumb.k0 { color: var(--c-script); } .thumb.k1 { color: var(--c-map); } .thumb.k2 { color: var(--c-vehicle); } .thumb.k3 { color: var(--c-cloth); }
.card-b { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-b h3 { min-height: 2.4em; }
.meta { font-size: .85rem; color: var(--muted); }
.card-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.tag { font-size: .78rem; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); white-space: nowrap; }
.pill { font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .two { grid-template-columns: minmax(0, 1fr); } }
.list { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item > div { min-width: 0; }
.item .t { font-weight: 600; overflow-wrap: anywhere; }
.code { font-family: var(--mono); font-weight: 500; background: var(--surface-2); padding: 3px 8px; border-radius: 4px; user-select: all; overflow-wrap: anywhere; }
.codebox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: var(--r); }
.codebox .code { font-size: 1.1rem; background: none; padding: 0; }

.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.pack[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pack b { font-family: var(--display); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, legend { font-size: .85rem; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.err { color: var(--bad); font-size: .87rem; }
.num { font-variant-numeric: tabular-nums; }

dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(8, 14, 20, .6); }
.dlg { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dlg .thumb { border-radius: var(--r); }
.files { font-family: var(--mono); font-size: .85rem; background: var(--surface-2); border-radius: var(--r); padding: 10px; overflow-x: auto; white-space: pre; margin: 0; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: var(--r); max-width: calc(100vw - 32px); z-index: 20; }

/* Additions for the real site */
.spacer { margin-left: auto; }
.center { justify-content: center; margin-top: 10px; }
.strong { font-weight: 600; }
.narrow { width: 8em; }
.flagline { margin-top: 6px; }
.grow { flex: 1 1 200px; }
progress { width: 100%; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
body { margin: 0; }
a.btn { text-decoration: none; display: inline-block; color: var(--fg); }
.notice a { color: inherit; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.logo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.thumb { overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot { width: 160px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
