@font-face {
  font-family: "Reactor7";
  src: url("/fonts/Reactor7.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/fonts/VT323-latin.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-display: "Reactor7", ui-monospace, "Courier New", monospace;
  --font-body:    "VT323", ui-monospace, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }

html { background: #000; }
body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  font-family: var(--font-body);
  color: #f5f0e5;
  position: relative;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  image-rendering: pixelated;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #0a1e5c 0%, #060d2e 55%, #000 100%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.14) 0 2px, transparent 2px 4px);
  pointer-events: none;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  position: relative;
  z-index: 2;
}

/* --- Header --- */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: rgba(6,13,46,.72); color: #f5f0e5;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.18),
              inset -2px -2px 0 0 rgba(0,0,0,.6),
              3px 3px 0 0 #000;
  margin-bottom: 32px;
  backdrop-filter: blur(2px);
}
.word {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 2px;
  color: #f5f0e5; text-decoration: none;
}
.word .dot { color: #f2c14e; }
.nav { display: flex; gap: 14px; }
.nav a {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 1px;
  color: #c8d4ea; text-decoration: none;
  padding: 4px 8px; border: 2px solid transparent;
}
.nav a:hover { color: #f2c14e; }

/* --- Hero --- */
.hero { margin-bottom: 28px; }
h1.big {
  font-family: var(--font-display); font-size: 64px; letter-spacing: 5px;
  margin: 0 0 8px; color: #f5f0e5;
  text-shadow: 4px 4px 0 #000; line-height: 1;
}
h1.big .dot { color: #f2c14e; }
.sub { font-family: var(--font-body); font-size: 22px; color: #c8d4ea; margin: 0; line-height: 1.3; }
.sub a { color: #f2c14e; }

/* --- Container --- */
.container {
  position: relative;
  background: rgba(6,13,46,.72); color: #f5f0e5;
  border: 2px solid #000; padding: 28px 24px 22px; margin-bottom: 28px;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.15),
              inset -2px -2px 0 0 rgba(0,0,0,.6),
              4px 4px 0 0 #000;
  backdrop-filter: blur(2px);
}
.container.deep { background: rgba(0,0,0,.72); }
.container > .ctitle {
  position: absolute; top: -13px; left: 16px;
  padding: 2px 8px; font-family: var(--font-display); font-size: 16px; letter-spacing: 1px;
  background: #0a1e5c; color: #f2c14e; border: 2px solid #000;
}
.container p { margin: 0 0 10px; font-size: 22px; line-height: 1.3; color: #e8e2d0; }
.container p:last-child { margin: 0; }
.container .count {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: #6c8fc8;
  margin: 0 0 18px;
  text-transform: uppercase;
}
.container ol { padding-left: 24px; margin: 8px 0 0; }
.container ol li { font-size: 20px; line-height: 1.4; color: #e8e2d0; margin-bottom: 6px; }

a { color: #f2c14e; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color 80ms linear; }
a:hover { color: #ffd870; }
a:focus-visible { outline: 2px dashed #3b74e0; outline-offset: 2px; }

code {
  font-family: var(--font-body);
  background: #000;
  color: #c8d4ea;
  padding: 0 6px;
  border: 2px solid #0a0a12;
  font-size: 18px;
}

.empty {
  font-size: 20px;
  color: #c8d4ea;
  margin: 16px 0 0;
}

/* --- NPC grid --- */
.npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.npc-card {
  position: relative;
  background: rgba(6,13,46,.72);
  border: 2px solid #000;
  padding: 14px 14px 12px;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.15),
              inset -2px -2px 0 0 rgba(0,0,0,.6),
              4px 4px 0 0 #000;
  text-decoration: none;
  color: #f5f0e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(2px);
  transition: transform 80ms linear, box-shadow 80ms linear;
}
.npc-card:hover {
  transform: translate(-1px, -1px);
  color: #f5f0e5;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.2),
              inset -2px -2px 0 0 rgba(0,0,0,.6),
              5px 5px 0 0 #000;
}
.npc-sprite {
  width: 96px;
  height: 128px;
  background: #060d2e;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.15),
              inset -2px -2px 0 0 rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}
.npc-sprite img {
  image-rendering: pixelated;
  width: 96px;
  height: 128px;
  object-fit: contain;
}
.npc-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.npc-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  color: #f5f0e5;
}
.npc-handle {
  font-family: var(--font-body);
  font-size: 16px;
  color: #6c8fc8;
  word-break: break-all;
}
.npc-open {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: #f2c14e;
  margin-top: 4px;
}

/* --- Forms / admin --- */
.banner {
  border: 2px solid #000;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 18px;
  font-family: var(--font-body);
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.15),
              inset -2px -2px 0 0 rgba(0,0,0,.6),
              4px 4px 0 0 #000;
}
.banner.error   { background: #e04e4e; color: #fff; }
.banner.success { background: #6ac674; color: #0a0a12; }

.form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.form .field { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 480px; }
.lbl {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  color: #f2c14e;
  text-transform: uppercase;
}
.inp {
  font-family: var(--font-body);
  font-size: 20px;
  padding: 8px 10px;
  background: #060d2e;
  color: #f5f0e5;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 0 rgba(0,0,0,.6),
              inset -2px -2px 0 0 rgba(255,255,255,.15);
  width: 100%;
  max-width: 480px;
}
.inp:focus-visible { outline: 2px dashed #3b74e0; outline-offset: 2px; }
.inline { display: flex; align-items: center; gap: 8px; }
.suffix { font-family: var(--font-body); font-size: 18px; color: #6c8fc8; }

.btn {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
  padding: 12px 18px;
  background: #0a1e5c;
  color: #f5f0e5;
  border: 2px solid #000;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.2),
              inset -2px -2px 0 0 rgba(0,0,0,.55),
              2px 2px 0 0 #000;
  transition: transform 80ms linear, background 80ms linear;
}
.btn:hover { background: #12297a; color: #ffd870; }
.btn:active { transform: translate(2px,2px); box-shadow: inset -2px -2px 0 0 rgba(255,255,255,.3), inset 2px 2px 0 0 rgba(0,0,0,.5); }
.btn.primary { background: #1a3a8a; color: #f5f0e5; }
.btn.primary:hover { background: #2756c4; color: #fff; }
.btn.danger { background: #e04e4e; color: #fff; }
.btn.danger:hover { background: #c83a3a; }
.btn.sm { padding: 4px 10px; font-size: 16px; box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.2), inset -2px -2px 0 0 rgba(0,0,0,.55); }

.nav a.on { background: #1a3a8a; color: #f5f0e5; border-color: #000; box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.25), inset -2px -2px 0 0 rgba(0,0,0,.5); }

/* --- Admin table --- */
.npc-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.npc-table th, .npc-table td { text-align: left; padding: 8px 10px; font-size: 18px; vertical-align: middle; }
.npc-table th { font-family: var(--font-display); font-size: 16px; letter-spacing: 1px; color: #f2c14e; border-bottom: 2px dashed #3b74e0; text-transform: uppercase; }
.npc-table td { border-bottom: 1px dashed rgba(108,143,200,.35); }
.npc-table td.did { font-family: var(--font-body); color: #c8d4ea; }
.npc-table td .muted { color: #6c8fc8; }
.status {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 0 rgba(255,255,255,.2), inset -2px -2px 0 0 rgba(0,0,0,.55);
}
.status.ok      { background: #6ac674; color: #0a0a12; }
.status.pending { background: #f2c14e; color: #0a0a12; }
.empty { color: #6c8fc8; text-align: center; padding: 24px 0; }

/* --- Footer --- */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 2px dashed #3b74e0;
  color: #6c8fc8;
  font-size: 18px;
  margin-top: 8px;
}
footer a { color: #f2c14e; }

/* --- Mobile --- */
@media (max-width: 640px) {
  .page { padding: 20px 14px 60px; }
  h1.big { font-size: 44px; letter-spacing: 3px; text-shadow: 3px 3px 0 #000; }
  .sub { font-size: 20px; }
  .hdr { padding: 10px 12px; }
  .word { font-size: 20px; letter-spacing: 1px; }
  .nav { gap: 8px; }
  .nav a { font-size: 16px; padding: 4px 6px; }
  .npc-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
