@font-face {
  font-family: "Monocle";
  src: url("assets/fonts/monoclefixed.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #e9e6df;
  --dim: #8e8a82;
  --line: #ffffff26;
  --hev: #ff9a1f;          /* Half-Life HUD amber */
  --hev-dim: #ff9a1f55;
  --hev-glow: 0 0 10px #ff9a1f88;
  --ok: #9fe870;
  --bad: #ff5a48;
  --panel: #0c0c0cdd;
  --titlebar: #d8d5cf;     /* White Knuckle OS window chrome */
  --red: #f1857d;
  --blue: #88bcf0;
  --mono: "Monocle", "Lucida Console", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent; /* html paints --bg; the fixed backdrop sits between */
  color: var(--ink);
  font: 15px/1.5 var(--mono);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--hev); outline-offset: 3px; }

/* ---------- backdrop: dithered WK art, amber wash, CRT scanlines ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg {
  position: absolute; inset: -3%;
  background: center / cover no-repeat;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 1.6s ease;
  animation: drift 40s ease-in-out infinite alternate;
}
.bg.show { opacity: .9; }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.08) translate(-1.5%, 1%); } }
.tint {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #050505f2 0%, #050505b3 34%, #05050533 64%, #05050566 100%),
    radial-gradient(ellipse at 70% 40%, #ff9a1f22, transparent 60%);
  mix-blend-mode: normal;
}
.tint::after { content: ""; position: absolute; inset: 0; background: #ff8a0026; mix-blend-mode: color; }
.scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, #0000 0 2px, #00000059 2px 3px);
  box-shadow: inset 0 0 180px #000;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
}
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stat { color: var(--ink); font-size: clamp(13px, 1.4vw, 16px); white-space: nowrap; letter-spacing: .025em; text-shadow: 1px 1px 0 #000; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: #0008; cursor: pointer;
}
.icon-btn[aria-pressed="true"] { color: var(--dim); text-decoration: line-through; }

.retro-signin {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 14px 18px 6px; border: 1px solid #8ba5a366; border-radius: 8px;
  background: linear-gradient(#4b4d4b, #151817 52%, #292e2b);
  box-shadow: inset 0 1px 1px #ffffff66, 0 4px 8px #0005;
  color: #f3f4ee; font-family: Arial, sans-serif; text-decoration: none; cursor: pointer;
  transition: filter .2s, transform .2s;
}
.retro-signin:hover, .retro-signin:focus-visible { transform: translateY(-2px); filter: brightness(1.15); }
.steam-brand { position: relative; display: flex; flex-direction: column; }
/* "Sign in with..." sits over the STEAM text so the icon stays vertically centered, as on cod.city. */
.steam-brand small { position: absolute; left: 0; bottom: 100%; margin-bottom: -4px; padding-left: 40%; white-space: nowrap; font-size: 11px; opacity: .8; }
.steam-brand img { display: block; width: 132px; height: 40px; }
.retro-signin.big { display: flex; width: 100%; min-height: 88px; padding: 12px 24px; border-radius: 10px; }
.retro-signin.big .steam-brand small { font-size: 12px; }
.retro-signin.big .steam-brand img { width: 198px; height: 60px; }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user img { width: 34px; height: 34px; border: 1px solid var(--hev-dim); image-rendering: pixelated; }
.user-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: none; color: var(--dim); cursor: pointer; text-decoration: underline; font-size: 12px; padding: 0; }

/* ---------- main layout ---------- */
.layout {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: clamp(24px, 4vw, 64px);
  align-items: start;
  padding: clamp(12px, 3vw, 40px) clamp(16px, 4vw, 48px) 32px;
  max-width: 1320px; width: 100%; margin: 0 auto;
}

.logo {
  margin: 0;
  font-size: clamp(44px, 7vw, 92px); line-height: 1; letter-spacing: 0; font-weight: 400;
  text-shadow: 3px 3px 0 #000, 0 0 24px #ffffff22;
}
.logo .g { margin-right: .04em; color: var(--hev); text-shadow: 3px 3px 0 #000, var(--hev-glow); }
.tagline {
  margin: 14px 0 34px; font-size: clamp(18px, 2.2vw, 26px); color: var(--hev); letter-spacing: .06em;
  text-shadow: var(--hev-glow);
}
.tagline::after { content: "_"; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.menu { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 34px; }
.menu-item {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 2px 0; border: 0; background: none; cursor: pointer; text-decoration: none;
  font-size: clamp(26px, 3.2vw, 38px); letter-spacing: .08em;
  color: #d9d5cc; text-shadow: 2px 2px 0 #000;
  transition: color .12s, transform .12s;
}
.menu-item .caret { color: var(--hev); opacity: 0; transform: translateX(-6px); transition: opacity .12s, transform .12s; }
.menu-item:hover, .menu-item:focus-visible, .menu-item[aria-current="page"] { color: #fff; transform: translateX(8px); }
.menu-item:hover .caret, .menu-item:focus-visible .caret, .menu-item[aria-current="page"] .caret { opacity: 1; transform: none; }
.menu-item[aria-current="page"] { color: var(--hev); text-shadow: 2px 2px 0 #000, var(--hev-glow); }

/* HL2-style HUD readouts */
.hud { display: flex; flex-wrap: wrap; gap: 10px; }
.hud-box {
  display: flex; flex-direction: column; justify-content: center; min-width: 138px; padding: 10px 16px 8px;
  border-radius: 8px; background: #00000099; color: var(--hev); text-shadow: var(--hev-glow);
}
.hud-label { color: inherit; font-size: 12px; letter-spacing: .12em; opacity: .9; text-decoration: none; }
a.hud-label:hover, a.hud-label:focus-visible { color: #fff; opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.hud-value { font-size: 30px; line-height: 1.1; }
.hud-box.good { color: var(--hev); }
.hud-box.bad { color: var(--bad); text-shadow: 0 0 10px #ff5a4888; }
.hud-box.flash { animation: hudflash .5s ease-out 2; }
@keyframes hudflash { 50% { background: #ff9a1f44; } }

/* ---------- WK OS-style window ---------- */
.window {
  --drag-x: 0px; --drag-y: 0px;
  position: relative; transform: translate3d(var(--drag-x), var(--drag-y), 0);
  border: 2px solid var(--titlebar); background: var(--panel); box-shadow: 8px 8px 0 #000a; backdrop-filter: blur(2px);
  will-change: transform;
}
.titlebar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 3px 6px 3px 10px; background: var(--titlebar); color: #111; font-size: 13px;
  cursor: grab; user-select: none; touch-action: none;
}
.window.dragging .titlebar { cursor: grabbing; }
.titlebar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-body { padding: 22px; min-height: 360px; }
.window-body h2 { margin: 0 0 6px; font-size: 22px; font-weight: 400; letter-spacing: .06em; color: #fff; }
.window-body p { margin: 0 0 14px; color: #c9c4ba; font-size: 14px; }
.muted { color: var(--dim) !important; font-size: 12px !important; }

.notice { border-left: 3px solid var(--hev); padding: 10px 12px; margin: 0 0 16px; background: #ff9a1f12; font-size: 13px; }
.notice.bad { border-color: var(--bad); background: #ff5a4814; }
.notice.ok { border-color: var(--ok); background: #9fe87012; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 18px; border: 2px solid var(--hev); background: #ff9a1f1a; color: var(--hev);
  cursor: pointer; text-decoration: none; letter-spacing: .1em; text-transform: uppercase; font-size: 14px;
  text-shadow: var(--hev-glow);
}
.btn:hover:not(:disabled) { background: var(--hev); color: #111; text-shadow: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.big { width: 100%; padding: 16px; font-size: 18px; }
.btn.ghost { border-color: var(--line); color: var(--ink); background: none; text-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: #ffffff14; color: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

.field { margin: 0 0 16px; border: 0; padding: 0; }
.field legend, .field-label { display: block; margin-bottom: 8px; color: var(--dim); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.pill input:checked + span { border-color: var(--hev); color: var(--hev); background: #ff9a1f14; }
.pill input:focus-visible + span { outline: 2px solid var(--hev); outline-offset: 2px; }
select {
  font: inherit; color: var(--ink); background: #111; border: 1px solid var(--line); padding: 7px 10px;
}

.searching { text-align: center; padding: 18px 0; }
.spinner {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--hev-dim); border-top-color: var(--hev); animation: spin 1s linear infinite;
  box-shadow: var(--hev-glow);
}
@keyframes spin { to { transform: rotate(360deg); } }
.timer { font-size: 32px; color: var(--hev); text-shadow: var(--hev-glow); }

.server-browser-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.server-browser-head h2 { margin: 0; }
.server-refresh {
  border: 0; padding: 2px 5px; background: transparent; color: var(--hev); cursor: pointer;
  font: 24px/1 var(--mono); text-shadow: var(--hev-glow);
}
.server-refresh:hover, .server-refresh:focus-visible { color: #fff; }
.server-list { display: grid; gap: 10px; }
.server-entry {
  position: relative; overflow: hidden; padding: 14px 16px 13px;
  border: 1px solid #ffffff26; background: linear-gradient(105deg, #080807e8, #17140fe0);
  box-shadow: inset 3px 0 0 var(--hev-dim), 4px 4px 0 #0007;
}
.server-entry::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .11;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #fff 3px 4px);
}
.server-entry.offline { opacity: .65; filter: grayscale(.35); }
.server-main { position: relative; z-index: 1; display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.server-main h3 { margin: 0 0 3px; color: #fff; font-size: 20px; font-weight: 400; letter-spacing: .08em; }
.server-main code { color: var(--hev); font: 13px/1.4 var(--mono); text-shadow: var(--hev-glow); }
.server-map { position: relative; z-index: 1; margin: 11px 0 10px !important; color: #aaa49a !important; }
.server-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #c7c1b5; font-size: 12px; letter-spacing: .055em; }
.server-mark { font-weight: 700; letter-spacing: .08em; text-transform: none; }
.server-mark.ill { color: #62d878; text-shadow: 0 0 9px #2ecf5377; }
.server-mark.host { color: #f0c85a; text-shadow: 0 0 9px #d5a52077; }
.server-mark.unofficial { color: #aaa49a; text-shadow: 1px 1px 0 #000; }
.server-join, .server-state {
  flex: none; color: var(--hev); font-size: 13px; letter-spacing: .1em; text-decoration: none;
  text-shadow: var(--hev-glow);
}
.server-join:hover, .server-join:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.server-state { color: var(--dim); text-shadow: none; }
.empty { padding: 26px 0; text-align: center; color: var(--dim); }

.steps { list-style: none; margin: 0 0 8px; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 18px 44px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; display: grid; place-items: center;
  width: 30px; height: 30px; border: 2px solid var(--line); color: var(--dim);
}
.steps li.done::before { content: "✓"; border-color: var(--ok); color: var(--ok); }
.steps li.todo::before { border-color: var(--hev); color: var(--hev); }
.steps strong { display: block; font-weight: 400; color: #fff; }
.steps p { margin: 4px 0 8px; font-size: 13px; }

.check { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; margin-bottom: 16px; }
.check .mark { font-size: 18px; }
.check .yes { color: var(--ok); }
.check .no { color: var(--bad); }
.check .unk { color: var(--dim); }

/* ---------- footer: same as illicit.page / cod.city ---------- */
.corporation-footer {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px) 18px; background: #070707e6; border-top: 1px solid #ffffff15;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: #f2f0eb;
}
.corporation-footer a { color: inherit; text-decoration: none; }
.footer-lockup { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.corporation-brand { display: inline-flex; align-items: center; white-space: nowrap; }
.corporation-copy { display: flex; flex-direction: column; font-size: 16px; font-weight: 850; letter-spacing: .12em; line-height: 1.1; text-transform: uppercase; }
.corporation-copy small { margin-top: 4px; color: #aab2bc; font-size: 9px; font-weight: 600; letter-spacing: .27em; }
.brand-cross { color: #8f969e; font-size: 23px; line-height: 1; }
.gmod-wordmark {
  color: #f5f5f5 !important; font: 900 24px/1 Arial, Helvetica, sans-serif;
  letter-spacing: -.075em; text-transform: lowercase; white-space: nowrap;
}
.corporation-footer nav { display: flex; flex-wrap: wrap; justify-content: start; gap: 12px 20px; font-size: 11px; }
.corporation-footer nav a { color: #c7cdd3; }
.corporation-footer a:hover, .corporation-footer a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .window { transform: none; }
  .titlebar { cursor: default; touch-action: auto; }
  .menu { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
  .menu-item:hover, .menu-item[aria-current="page"] { transform: none; }
  .stat { display: none; }
}
@media (max-width: 520px) {
  .window-body { padding: 16px; }
  .hud-box { min-width: 0; flex: 1; }
  .user-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bg, .tagline::after, .spinner { animation: none; }
  .menu-item, .menu-item .caret, .retro-signin { transition: none; }
}
.row.center { justify-content: center; }
.window-body .section-gap { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
