/* VILLE: cozy pixel village at night, cream ink, gold money, red death */
@font-face { font-family: 'Silkscreen'; src: url('/fonts/Silkscreen.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/SpaceGrotesk.ttf') format('truetype'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/JetBrainsMono.ttf') format('truetype'); font-display: swap; }

:root {
  --bg: #0f1424; --bg2: #151c33; --panel: #1b2340; --panel2: #232d52; --line: #33406e; --line2: #46548a;
  --ink: #fff6e0; --dim: #b8b2c9; --faint: #7d7896;
  --gold: #ffd166; --gold2: #f2a93b; --green: #6ee07a; --green2: #2fa84f; --red: #ff6b6b; --red2: #c23b4a; --blue: #6cb4ff; --purple: #b48ed8;
  --grass: #5aa83c;
  --px: 4px;
  --display: 'Silkscreen', 'Courier New', monospace;
  --body: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img, canvas { image-rendering: pixelated; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: #1f1a2e; }

/* pixel frame: chunky stepped border without images */
.px { position: relative; background: var(--panel); box-shadow:
  0 calc(-1 * var(--px)) 0 0 var(--line), 0 var(--px) 0 0 var(--line), calc(-1 * var(--px)) 0 0 0 var(--line), var(--px) 0 0 0 var(--line),
  0 calc(2 * var(--px)) 0 0 rgba(0,0,0,.35); margin: var(--px); }
.px.gold { box-shadow: 0 -4px 0 0 var(--gold2), 0 4px 0 0 var(--gold2), -4px 0 0 0 var(--gold2), 4px 0 0 0 var(--gold2), 0 8px 0 0 rgba(0,0,0,.35); }
.px.red { box-shadow: 0 -4px 0 0 var(--red2), 0 4px 0 0 var(--red2), -4px 0 0 0 var(--red2), 4px 0 0 0 var(--red2), 0 8px 0 0 rgba(0,0,0,.35); }

/* header */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: rgba(15,20,36,.92); backdrop-filter: blur(6px); border-bottom: 4px solid #0a0e1a; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 26px; color: var(--ink); letter-spacing: 2px; }
.logo:hover { text-decoration: none; }
.logo canvas { width: 36px; height: 36px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { font-family: var(--display); font-size: 13px; color: var(--dim); padding: 6px 10px; border-radius: 0; }
.nav a:hover, .nav a.on { color: var(--ink); background: var(--panel2); text-decoration: none; }
.top .grow { flex: 1; }
.search { position: relative; }
.search input { width: 220px; background: #0d1222; border: 0; box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); padding: 8px 10px; font-family: var(--mono); font-size: 13px; outline: none; }
.search input:focus { box-shadow: inset 0 0 0 2px var(--gold); }
.q-res { display: none; position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-height: 60vh; overflow: auto; background: var(--panel); box-shadow: 0 0 0 3px #0a0e1a, 0 10px 30px rgba(0,0,0,.5); z-index: 40; padding: 6px; }
.q-res.on { display: block; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px; }
.q-row:hover { background: var(--panel2); }
.q-row .who { min-width: 0; font-size: 14px; }
.q-row .who span { overflow: hidden; text-overflow: ellipsis; }
.q-empty { padding: 10px; font-size: 13px; }
@media (min-width: 861px) and (max-width: 1640px) { .nav a.xlink span { display: none; } .search input { width: 190px; } }
@media (min-width: 861px) and (max-width: 1360px) { .top { gap: 10px; } .nav { gap: 0; } .nav a { padding: 6px 6px; font-size: 12px; } .search input { width: 150px; } }
.nav a.xlink { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); border: 2px solid var(--panel2); }
.nav a.xlink svg { width: 13px; height: 13px; fill: currentColor; }
.nav a.xlink:hover { background: var(--panel2); }
.me { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.me img { width: 26px; height: 26px; border-radius: 0; image-rendering: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 0; padding: 10px 16px; font-family: var(--display); font-size: 14px; letter-spacing: .5px;
  background: var(--gold); color: #1f1a2e; box-shadow: inset -4px -4px 0 0 var(--gold2), inset 4px 4px 0 0 #fff0b8, 0 4px 0 0 #0a0e1a; transition: transform .06s; text-decoration: none !important; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: inset -4px -4px 0 0 var(--gold2), inset 4px 4px 0 0 #fff0b8; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--panel2); color: var(--ink); box-shadow: inset -4px -4px 0 0 #18203d, inset 4px 4px 0 0 var(--line2), 0 4px 0 0 #0a0e1a; }
.btn.red { background: var(--red); color: #1f1a2e; box-shadow: inset -4px -4px 0 0 var(--red2), inset 4px 4px 0 0 #ffb0b0, 0 4px 0 0 #0a0e1a; }
.btn.green { background: var(--green); color: #10241a; box-shadow: inset -4px -4px 0 0 var(--green2), inset 4px 4px 0 0 #c8ffc8, 0 4px 0 0 #0a0e1a; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.big { padding: 14px 22px; font-size: 18px; }

/* type */
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0 0 10px; letter-spacing: 1px; line-height: 1.15; }
h1 { font-size: 40px; } h2 { font-size: 24px; } h3 { font-size: 16px; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.up { color: var(--green); } .down { color: var(--red); } .gold-t { color: var(--gold); }
.big-num { font-family: var(--display); font-size: 34px; line-height: 1; }

/* layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; padding: 4px 8px; background: var(--panel2); color: var(--dim); }
.pill b { color: var(--ink); font-weight: 600; }
.tag { font-family: var(--mono); font-size: 11px; padding: 2px 6px; background: #2a345e; color: var(--dim); text-transform: lowercase; }
.tag.gold { background: #4a3a14; color: var(--gold); } .tag.red { background: #4a1a24; color: var(--red); } .tag.green { background: #163a24; color: var(--green); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); padding: 6px 8px; border-bottom: 2px solid var(--line); }
table.t td { padding: 7px 8px; border-bottom: 1px solid #252e52; vertical-align: middle; }
table.t tr:hover td { background: rgba(255,255,255,.02); }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.who canvas { width: 32px; height: 32px; flex: none; }
.who:hover { text-decoration: none; color: var(--gold); }
.empty { padding: 26px; text-align: center; color: var(--faint); font-family: var(--mono); font-size: 13px; }

/* toast + modal */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel2); padding: 10px 14px; font-family: var(--mono); font-size: 13px; box-shadow: 0 0 0 4px #0a0e1a; animation: pop .18s ease-out; max-width: 92vw; }
.toast.bad { background: #4a1a24; } .toast.good { background: #163a24; }
@keyframes pop { from { transform: translateY(8px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; background: rgba(5,8,18,.72); z-index: 70; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.on { display: flex; }
.modal { width: min(460px, 100%); padding: 22px; max-height: 92vh; overflow: auto; }
.modal .x { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--dim); font-family: var(--display); font-size: 18px; cursor: pointer; }
input.in { width: 100%; background: #0d1222; border: 0; box-shadow: inset 0 0 0 3px var(--line); color: var(--ink); padding: 11px 12px; font-family: var(--mono); font-size: 15px; outline: none; }
input.in:focus { box-shadow: inset 0 0 0 3px var(--gold2); }

/* bars */
.bar { height: 10px; background: #0d1222; box-shadow: inset 0 0 0 2px #2a345e; position: relative; }
.bar i { position: absolute; left: 2px; top: 2px; bottom: 2px; background: var(--gold); }

@media (max-width: 860px) {
  .g2, .g3 { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .nav a { font-size: 11px; padding: 5px 6px; }
  .search { order: 5; width: 100%; }
  .search input { width: 100%; }
  .q-res { left: 0; right: 0; width: auto; }
  .top { gap: 10px; flex-wrap: wrap; padding: 8px 12px; }
  .logo { font-size: 20px; }
}

.catches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.catch { display: flex; gap: 10px; align-items: center; padding: 6px 8px; background: rgba(255,255,255,0.03); border: 2px solid #1b2340; }
