/* counter-strike.us — shared styles for the public site and the admin panel */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #f2f4f7;
  --surface: #ffffff;
  --ink: #18212e;
  --muted: #5a6575;
  --line: #d7dde6;
  --navy: #1c2b4a;
  --navy-2: #263a63;
  --red: #b22234;
  --red-ink: #9a1c2c;
  --sand: #c9a86a;
  --sand-soft: #f4ead6;
  --ct: #3b6fb6;          /* Counter-Terrorist blue */
  --ct-ink: #2a5a9e;      /* CT blue dark enough for text on white */
  --t: #e0a23a;           /* Terrorist gold */
  --t-deep: #a86b12;      /* T gold dark enough for large text on white */
  --t-on: #1a1206;        /* text on gold */
  --t-soft: #fbefd5;
  --ok: #1f7a4d;
  --ok-soft: #e1f2e9;
  --warn: #8a5a00;
  --warn-soft: #fbefd5;
  --bad: #a3202f;
  --bad-soft: #f9e1e4;
  --focus: #2f6fde;
  --radius-s: 4px;
  --radius-m: 8px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1626;
    --surface: #152036;
    --ink: #e7ebf2;
    --muted: #9aa6b8;
    --line: #2a3a58;
    --navy: #0a1220;
    --navy-2: #22355a;
    --red: #e04556;
    --red-ink: #ff7a88;
    --sand: #d8bb80;
    --sand-soft: #2c2716;
    --ct: #6f9be0;
    --ct-ink: #8fb4ea;
    --t: #e8b04a;
    --t-deep: #e8b04a;
    --t-on: #1a1206;
    --t-soft: #33270d;
    --ok: #4cc58a;
    --ok-soft: #12301f;
    --warn: #e6b450;
    --warn-soft: #33270d;
    --bad: #ff7a88;
    --bad-soft: #3a1519;
    --focus: #7aa8ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
}
img { max-width: 100%; height: auto; }
a { color: var(--ct-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.2rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- Header: the flag band is the site's one signature mark ---- */
.band {
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 28px, #fff 28px 40px);
}
.site-header { background: var(--navy); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.wordmark {
  font: 700 1.6rem/1 var(--display);
  color: #fff;
  text-decoration: none;
  letter-spacing: .01em;
  display: flex; align-items: baseline;
}
.wordmark .tld { color: var(--t); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a, .nav button {
  color: #dfe5ef; text-decoration: none; font: 600 1.05rem/1 var(--display); letter-spacing: .02em;
  padding: 10px 12px; border-radius: var(--radius-s); background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--t); border-radius: 0; }
.nav-account { display: flex; align-items: center; gap: 10px; }
.nav-account form { margin: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; }

/* ---- Buttons & forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1.05rem/1 var(--display); letter-spacing: .02em;
  padding: 11px 18px; border-radius: var(--radius-s);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--t); color: var(--t-on);
}
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: var(--surface); filter: none; }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: transparent; color: var(--bad); border-color: currentColor; }
.btn-small { padding: 7px 12px; font-size: .95rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number],
input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field { margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 18px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--ct); }
.field-error { color: var(--bad); font-size: .95rem; margin-top: 6px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.copy-code {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--t-soft); border: 1px dashed var(--t); border-radius: var(--radius-s);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem;
}

/* ---- Notices ---- */
.flash { padding: 12px 16px; border-radius: var(--radius-s); margin: 16px 0; border-left: 4px solid; }
.flash-success { background: var(--ok-soft); border-color: var(--ok); }
.flash-error { background: var(--bad-soft); border-color: var(--bad); }
.flash-info { background: var(--surface); border-color: var(--navy-2); }

.status {
  display: inline-block; font: 600 .9rem/1 var(--display); letter-spacing: .03em;
  padding: 5px 8px; border-radius: 3px; white-space: nowrap;
}
.status-approved, .status-online { background: var(--ok-soft); color: var(--ok); }
.status-pending_review, .status-unverified { background: var(--warn-soft); color: var(--warn); }
.status-rejected, .status-offline { background: var(--bad-soft); color: var(--bad); }
.status-inactive, .status-draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.status-published { background: var(--ok-soft); color: var(--ok); }

/* ---- Home: the live board leads ---- */
.board-intro { background: var(--navy); color: #fff; padding: 44px 0 0; }
.board-intro h1 { color: #fff; margin-bottom: .35em; font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.board-intro .intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 40px; flex-wrap: wrap; margin-bottom: 30px; }
.board-intro .intro-row p { color: #c9d2e1; max-width: 72ch; font-size: 1.15rem; margin: 0; flex: 1 1 420px; }
.live-count { font-variant-numeric: tabular-nums; color: var(--t); }
.board-intro .actions { flex: 0 0 auto; }
.board {
  background: var(--surface); color: var(--ink); border-radius: var(--radius-m) var(--radius-m) 0 0;
  border: 1px solid var(--line); border-bottom: 0; overflow: hidden;
}

/* Server rows share one grid on the home board and the full list */
.srv-table { width: 100%; border-collapse: collapse; }
.srv-table th {
  text-align: left; font: 600 .95rem/1 var(--display); letter-spacing: .03em; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.srv-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.srv-table tr:last-child td { border-bottom: 0; }
.srv-table tbody tr:hover { background: color-mix(in srgb, var(--t-soft) 50%, transparent); }
.srv-name a { color: var(--ink); font-weight: 600; text-decoration: none; }
.srv-name a:hover { text-decoration: underline; }
.srv-sub { display: block; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.players { font: 600 1.15rem/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.players .of { color: var(--muted); font-weight: 500; font-size: .95rem; }
.fill { display: block; height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; width: 70px; overflow: hidden; }
.fill > span { display: block; height: 100%; background: var(--ct); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); }
.lock { color: var(--muted); font-size: .9rem; }
.board-empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.board-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .95rem; }

/* ---- Home sections ---- */
.home-grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); padding: 48px 0 64px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.section-head h2 { margin: 0 0 6px; }
.section-head a { font-weight: 600; }

.story { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.story:first-of-type { padding-top: 0; }
.story img { width: 180px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-s); background: var(--line); }
.story-noimg { grid-template-columns: 1fr; }
.story h3 { margin: 0 0 6px; font-size: 1.35rem; }
.story h3 a { color: var(--ink); text-decoration: none; }
.story h3 a:hover { text-decoration: underline; }
.story p { margin: 0; color: var(--muted); }
.story time { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.lead-story { grid-template-columns: 1fr; }
.lead-story img { width: 100%; aspect-ratio: 21 / 9; }
.lead-story h3 { font-size: 1.9rem; }

.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.topic-list a { color: var(--ink); font-weight: 500; text-decoration: none; }
.topic-list a:hover { text-decoration: underline; }
.topic-list small { display: block; color: var(--muted); }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; margin-bottom: 28px; }
.side-box h3 { margin-bottom: 8px; }

/* ---- Pages ---- */
.page-head { padding: 40px 0 24px; }
.page-head p { color: var(--muted); max-width: 64ch; }
.page-body { padding-bottom: 64px; }

.filters {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 16px; margin-bottom: 20px;
}
.filters label { font-size: .92rem; }
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow-x: auto; }

/* Article */
.article-head { padding: 44px 0 20px; }
.article-head .meta { color: var(--muted); }
.cover { width: 100%; border-radius: var(--radius-m); margin: 8px 0 28px; aspect-ratio: 2 / 1; object-fit: cover; }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose img { border-radius: var(--radius-s); margin: .5em 0; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--t); color: var(--muted); }
.prose pre { background: var(--navy); color: #e7ebf2; padding: 14px 16px; border-radius: var(--radius-s); overflow-x: auto; font-size: .92rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--display); font-weight: 600; color: var(--muted); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-s); margin: .5em 0; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose li[data-list="bullet"] { list-style-type: disc; }
.prose ol:has(> li[data-list="bullet"]) { list-style-type: disc; }

.pager { display: flex; gap: 10px; justify-content: center; margin: 32px 0; }

/* Server detail */
.srv-hero { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; padding-bottom: 64px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.connect-box { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ct); border-radius: var(--radius-m); padding: 20px; }
.connect-box .copy-code { width: 100%; justify-content: space-between; margin: 8px 0 14px; }

/* Member area */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 24px; }
.steps li { position: relative; padding: 0 0 18px 44px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 700 1.05rem/1 var(--display);
  background: var(--navy); color: #fff;
}
.steps li.done::before { content: "✓"; background: var(--ok); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; margin-bottom: 24px; }
.card h2 { font-size: 1.45rem; }

/* Footer */
.site-footer { background: var(--navy); color: #b9c3d3; padding: 28px 0; font-size: .95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.site-footer .staff-link { color: #b9c3d3; }
.site-footer p { margin: 0; max-width: 70ch; }

/* ---- Admin panel ---- */
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--navy) 220px, transparent 220px); }
.admin-side { background: var(--navy); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .wordmark { font-size: 1.35rem; padding: 0 8px 18px; }
.admin-side nav a {
  display: flex; justify-content: space-between; align-items: center;
  color: #d6dde9; text-decoration: none; padding: 9px 10px; border-radius: var(--radius-s); font-weight: 500;
}
.admin-side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-side nav a[aria-current="page"] { background: var(--navy-2); color: #fff; }
.admin-side .count { background: var(--red); color: #fff; font: 600 .82rem/1 var(--body); padding: 3px 7px; border-radius: 10px; }
.admin-side .who { border-top: 1px solid rgba(255,255,255,.15); margin-top: 18px; padding: 14px 10px 0; font-size: .92rem; color: #b9c3d3; }
.admin-side .who form { margin-top: 8px; }
.admin-main { padding: 28px 32px 64px; min-width: 0; }
.admin-main h1 { font-size: 2.1rem; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-top h1 { margin: 0; }
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.stat strong { display: block; font: 700 2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); }
.stat.attention { border-color: var(--red); }

.data { width: 100%; border-collapse: collapse; background: var(--surface); }
.data th, .data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data th { font-weight: 600; color: var(--muted); font-size: .92rem; }
.data tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--t); }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 22px; flex: none; font-weight: 700; text-align: center; }
.checks .pass .mark { color: var(--ok); }
.checks .fail .mark { color: var(--bad); }
.checks .unknown .mark { color: var(--warn); }

.editor-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
#editor { background: var(--surface); min-height: 420px; font-size: 1.05rem; }
.ql-editor { font-family: var(--body); font-size: 1.05rem; line-height: 1.65; }
.ql-editor h2, .ql-editor h3 { font-family: var(--display); margin: .8em 0 .3em; }
.ql-editor p { margin-bottom: .6em; }
.ql-toolbar.ql-snow { background: var(--surface); border-color: var(--line) !important; border-radius: var(--radius-s) var(--radius-s) 0 0; position: sticky; top: 0; z-index: 2; }
.ql-container.ql-snow { border-color: var(--line) !important; border-radius: 0 0 var(--radius-s) var(--radius-s); }
.ql-snow .ql-stroke { stroke: var(--ink); }
.ql-snow .ql-fill { fill: var(--ink); }
.ql-snow .ql-picker { color: var(--ink); }
.ql-editor.ql-blank::before { color: var(--muted); }
.cover-preview { width: 100%; border-radius: var(--radius-s); margin: 8px 0; aspect-ratio: 2 / 1; object-fit: cover; background: var(--line); }

.auth-box { width: min(420px, 100% - 32px); margin: 10vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px; }
.auth-box h1 { font-size: 1.9rem; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius-s); width: max-content; margin: 12px 0; }
.qr svg, .qr img { display: block; width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 28px; font: 1.1rem ui-monospace, Menlo, Consolas, monospace; padding: 16px; background: var(--t-soft); border-radius: var(--radius-s); }

/* ---- Small screens ---- */
@media (max-width: 900px) {
  .home-grid, .srv-hero, .editor-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .filter-q { grid-column: 1 / -1; }
  .admin-shell { grid-template-columns: 1fr; background: none; }
  .admin-side { position: static; height: auto; }
  .admin-main { padding: 20px 16px 48px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .wrap { gap: 8px; padding: 10px 0; }
  .nav { order: 3; flex: 1 1 100%; margin: 0 -8px; }
  .wordmark { flex: 1; }
  .nav a { padding: 8px 8px; }
  .story { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .story img { width: 96px; }
  .lead-story, .story-noimg { grid-template-columns: 1fr; }
  .lead-story img { width: 100%; }
  .srv-table .hide-sm { display: none; }
  .srv-sub { max-width: 26ch; }
  .filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
