/* Heritage site. The look follows the game's menus (Docs/FRONTEND.md, design doc of the login menu): dark smoked panels,
   a rust frame with cut corners, a sunset-orange accent, neon teal for "live" things. Fonts are the game's own
   (Oswald, Inter, JetBrains Mono; OFL, assets/fonts/OFL.txt). No scripts or styles from other sites. */

@font-face { font-family: "Oswald"; src: url("fonts/Oswald-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("fonts/Oswald-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #121010;
  --bg-2: #1b1816;
  --panel: rgba(28, 24, 21, 0.86);
  --panel-solid: #1f1b18;
  --line: #5a3a26;            /* rust frame */
  --line-soft: #3a2a20;
  --text: #ece3d6;
  --text-dim: #a89a89;
  --text-faint: #7a6e62;
  --accent: #f28c3b;          /* sunset orange, the game's main button */
  --accent-hi: #ffa45a;
  --accent-ink: #1a120b;
  --teal: #3fd1c2;            /* neon: online, live */
  --red: #e5534b;
  --yellow: #e8b84a;
  --cut: 12px;                /* the cut corner */
  --radius: 2px;
  --w: 1120px;
  font-size: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}
main { flex: 1; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Oswald", "Arial Narrow", sans-serif; font-weight: 700; letter-spacing: 0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); text-transform: uppercase; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.mono, code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.92em; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ------------------------------------------------------------------ header and footer */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 16, 16, 0.92);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
}
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.logo { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.6rem; letter-spacing: 0.18em; color: var(--text); text-transform: uppercase; }
.logo:hover { text-decoration: none; color: var(--accent-hi); }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { color: var(--text-dim); font-weight: 700; font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.nav .btn { padding: 6px 14px; border-bottom: 0; }

.foot { border-top: 1px solid var(--line-soft); margin-top: 64px; padding: 24px 0 32px; color: var(--text-faint); font-size: 0.88rem; }
.foot .wrap { display: flex; gap: 8px 32px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--text-dim); }

/* ------------------------------------------------------------------ panels with the cut corners */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.panel::before {   /* the cut corners get their own rust edge */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(135deg, var(--line) 0 calc(var(--cut) * 0.72), transparent 0) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(-45deg, var(--line) 0 calc(var(--cut) * 0.72), transparent 0) bottom right / var(--cut) var(--cut) no-repeat;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-title h2 { margin: 0; }

/* ------------------------------------------------------------------ buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem "Inter", sans-serif;
  padding: 11px 22px;
  border: 1px solid var(--line);
  background: rgba(30, 26, 23, 0.9);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.95rem; }
.field .hint { color: var(--text-faint); font-size: 0.85rem; }
input[type="text"], input[type="password"] {
  width: 100%;
  font: 400 1rem "Inter", sans-serif;
  color: var(--text);
  background: #14110f;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 11px 12px;
}
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--accent); outline: none; }
input[aria-invalid="true"] { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.field-error { color: var(--red); font-size: 0.88rem; min-height: 0; }

.notice { border-left: 3px solid var(--line); background: rgba(255, 255, 255, 0.03); padding: 12px 14px; font-size: 0.95rem; }
.notice.error { border-left-color: var(--red); background: rgba(229, 83, 75, 0.08); }
.notice.ok { border-left-color: var(--teal); background: rgba(63, 209, 194, 0.07); }
.notice.warn { border-left-color: var(--yellow); background: rgba(232, 184, 74, 0.07); }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ home */
.hero {
  position: relative;
  min-height: min(78vh, 720px);
  display: flex; align-items: center;
  background:
    linear-gradient(90deg, rgba(18, 16, 16, 0.96) 0%, rgba(18, 16, 16, 0.78) 42%, rgba(18, 16, 16, 0.15) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(18, 16, 16, 0) 30%),
    url("img/hero.jpg") right center / cover no-repeat;
}
.hero .wrap { padding-top: 56px; padding-bottom: 56px; }
.hero-text { max-width: 560px; }
.hero .kicker { font-family: "JetBrains Mono", monospace; color: var(--teal); letter-spacing: 0.08em; font-size: 0.85rem; text-transform: uppercase; margin-bottom: 12px; }
.hero h1 { font-size: clamp(3rem, 9vw, 5.4rem); letter-spacing: 0.12em; margin-bottom: 8px; }
.hero .lead { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }
.hero .sub { color: var(--text-dim); margin-bottom: 28px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.section { padding-top: 56px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature h3 { color: var(--accent-hi); }
.feature p { color: var(--text-dim); margin: 0; }
.shot { width: 100%; height: auto; display: block; border: 1px solid var(--line-soft); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); font: 700 1.3rem "Oswald", sans-serif; color: var(--accent-ink); background: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; }

/* ------------------------------------------------------------------ server status */
.servers { display: grid; gap: 12px; }
.server {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 14px 16px; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line-soft);
}
.server .name { font: 700 1.25rem "Oswald", sans-serif; letter-spacing: 0.03em; }
.server .type { color: var(--text-dim); font-size: 0.9rem; }
.server .about { grid-column: 1 / -1; color: var(--text-faint); font-size: 0.88rem; }
.server .count { text-align: right; font-family: "JetBrains Mono", monospace; }
.bar { grid-column: 1 / -1; height: 4px; background: #2a231e; }
.bar > span { display: block; height: 100%; background: var(--teal); width: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--text-faint); }
.dot.up { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.dot.full { background: var(--yellow); }
.dot.down { background: var(--red); }
.badge { display: inline-block; font: 700 0.72rem "Inter", sans-serif; letter-spacing: 0.04em; padding: 1px 6px; border: 1px solid var(--line); color: var(--text-dim); margin-left: 6px; vertical-align: 2px; }
.status-total { font-family: "JetBrains Mono", monospace; color: var(--teal); }

/* ------------------------------------------------------------------ auth pages */
.auth { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; padding-top: 48px; align-items: start; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } }
.rules { color: var(--text-dim); font-size: 0.95rem; }
.rules ul { padding-left: 1.1em; margin: 0 0 1em; }
.rules li { margin-bottom: 6px; }

/* ------------------------------------------------------------------ cabinet */
.cab-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 40px 0 24px; }
.cab-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); }
.cab { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .cab { grid-template-columns: 1fr; } }
.cab-main, .cab-side { display: grid; gap: 24px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.facts dt { color: var(--text-dim); }
.facts dd { margin: 0; }
.chars { display: grid; gap: 12px; }
.char { border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.025); padding: 14px 16px; }
.char-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.char-name { font: 700 1.3rem "Oswald", sans-serif; letter-spacing: 0.03em; }
.char .facts { grid-template-columns: max-content 1fr max-content 1fr; font-size: 0.93rem; }
@media (max-width: 560px) { .char .facts { grid-template-columns: max-content 1fr; } }
.char.deleting { border-color: rgba(229, 83, 75, 0.5); }
.server-group + .server-group { margin-top: 20px; }
.server-group h3 { color: var(--text-dim); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.activity li { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.93rem; }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--text-faint); font-family: "JetBrains Mono", monospace; font-size: 0.82rem; padding-top: 2px; }
.activity .where { color: var(--text-faint); font-size: 0.82rem; }
.activity .bad { color: var(--red); }
@media (max-width: 560px) { .activity li { grid-template-columns: 1fr; } }
.ban { border: 1px solid var(--red); background: rgba(229, 83, 75, 0.1); padding: 16px 18px; }
.ban h2 { color: var(--red); font-size: 1.3rem; }
.ingame { color: var(--teal); }
.empty { color: var(--text-dim); padding: 8px 0; }
.loading { color: var(--text-dim); padding: 48px 0; }

/* ------------------------------------------------------------------ plain pages (404, errors) */
.plain { padding-top: 72px; max-width: 640px; }

/* cabinet details */
#cab-login { text-transform: none; font-family: "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0; }
.cab-side .facts { grid-template-columns: 1fr; gap: 2px; }
.cab-side .facts dt { font-size: 0.85rem; color: var(--text-faint); }
.cab-side .facts dd { margin-bottom: 8px; }
.activity li { grid-template-columns: 150px 1fr; }
.activity time { white-space: nowrap; }
@media (max-width: 560px) { .activity li { grid-template-columns: 1fr; } }
