/*
 * Shared components (docs/design/design-system.html): pages put these together rather than
 * styling things themselves. Built on tokens.css.
 */
/* Buttons: primary (one per area), go (Connect), secondary, ghost (quiet actions: outlined), danger (outlined in red);
   sm / default / lg. Quiet actions chosen from docs/design/quiet-action-options.html (A) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-ctl);
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: -.01em; line-height: 1;
  text-transform: lowercase; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s;
}
.btn i { font-size: 1.15em; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn--primary { background: var(--brand); color: var(--white); box-shadow: inset 0 0 0 1px var(--edge); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--go { background: var(--go); color: var(--go-ink); }
.btn--go:hover { background: var(--go-hover); }
.btn--secondary { background: var(--surface-3); border-color: var(--line-2); color: var(--ink); }
.btn--secondary:hover { border-color: var(--ink-3); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--ink-3); color: var(--ink); }
.btn--danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn--discord { background: var(--discord); color: var(--white); }
.btn--block { width: 100%; }
/* The favorite star (favorites/_star): filled and warm once starred; just the icon in lists */
.fav i { color: var(--ink-3); }
.fav--on i { color: var(--warn); }
.fav--icon { width: 28px; padding: 0; }
.fav--busy { cursor: progress; }
.fav--busy i { animation: fav-spin .7s linear infinite; }
@keyframes fav-spin { to { transform: rotate(1turn); } }

/* A form saving itself (data-autosave): saving, then saved for a moment, or what went wrong */
.autosave { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-3); }
.autosave--saving i { animation: fav-spin .7s linear infinite; }
.autosave--saved { color: var(--live); }
.autosave--error { color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .fav--busy i, .autosave--saving i { animation: none; } }
/* button_to wraps its button in a form */
form.button_to { display: inline-flex; margin: 0; }
form.button_to:has(.btn--block) { display: flex; }

/* Links in text */
.lnk { color: var(--link); font-weight: 600; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
/* An action that reads as part of a sentence: a button_to with class lnk, its form inline-form */
button.lnk { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; }
.inline-form { display: inline; }

/* Pills label things; they're never buttons */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-ctl);
  font-family: var(--mono); font-size: 12px; font-weight: 500; text-transform: lowercase; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2); font-style: normal;
}
.pill--live { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); }
.pill--brand { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--link); }
.pill--danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.pill--mode { background: color-mix(in srgb, var(--mode) 16%, transparent); color: var(--mode); }
.pill--warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pill--sm { height: 18px; padding: 0 6px; font-size: 11px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Cards */
.card { padding: 20px; border: 1px solid var(--line); border-left: 2px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-2); }
.card__title { margin: 0 0 6px; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); }
.card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Quiet actions on the left, the main one pushed right (.card__end); an opened <details> (.card__more) takes the row */
.card__actions--split { justify-content: flex-start; align-items: center; }
.card__actions--split .card__end { margin-left: auto; }
.card__actions--split .card__more[open] { flex-basis: 100%; }

/* Section labels: the console's comment voice */
.label { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.label::before { content: "// "; }

/* Form fields */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 12px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input:not([type=checkbox]):not([type=radio]), .field textarea, .field select {
  width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface-0); color: var(--ink); font: inherit; font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); outline: none; }
/* A file picker: the browser's button drawn as a quiet button (.btn--ghost), the chosen file's name beside it */
.file { font-size: 13px; color: var(--ink-3); max-width: 100%; }
.file::file-selector-button {
  height: 28px; margin-right: 10px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: lowercase; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s;
}
.file:hover::file-selector-button { background: var(--surface-3); border-color: var(--ink-3); color: var(--ink); }
.file:focus-visible { outline: none; }
.file:focus-visible::file-selector-button { outline: 2px solid var(--brand); outline-offset: 2px; }
.field__hint { font-size: 12px; color: var(--ink-3); }
.field__error { font-size: 12px; color: var(--danger); }
.field--error input, .field--error textarea { border-color: var(--danger); }

/* Tabs: each tab is a link to its own URL */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  display: inline-flex; align-items: center; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: lowercase; color: var(--ink-3); text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab--on { color: var(--ink); border-color: var(--brand); }
.tab--on::before { content: "> "; color: var(--brand); white-space: pre; }
.tab .pill { margin-left: 8px; }

/* Segmented choice (chart ranges): links styled as a row of ghost buttons */
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-0); }
.seg a { padding: 4px 10px; border-radius: 3px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-decoration: none; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current] { background: var(--surface-3); color: var(--ink); }

/* Confirmations and errors under the header */
/* "This page is in Russian": offered when the browser prefers another language the page has, closed for good with × */
.langbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: var(--text-sm); }

.flash {
  margin: 0; padding: 10px 24px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--live) 25%, transparent);
  background: color-mix(in srgb, var(--live) 10%, var(--bg)); color: var(--live); font-family: var(--mono); font-size: 13px;
}
.flash::before { content: "✓"; }
.flash--error { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--bg)); color: var(--danger); }
.flash--error::before { content: "!"; }

/* Header: the logo, the sections as console tabs on the bottom edge, then owners and the account apart at the right */
.site-header.site-header--tabs { padding-bottom: 0; }
.site-header__bar { display: flex; align-items: stretch; gap: var(--s6); }
.site-header__brand, .site-header__end { display: flex; align-items: center; gap: var(--s4); padding-bottom: var(--s4); }
.site-header__end { margin-left: auto; }
/* Each tab is as tall as the bar, with the same bottom padding as the logo, so its text lines up with the logo;
   the current one is underlined just below its words */
.site-tabs { display: flex; align-items: stretch; gap: var(--s1); }
.site-tab { position: relative; display: flex; align-items: center; padding: 0 var(--s3) var(--s4); color: var(--ink-2); font-family: var(--mono); font-size: var(--text-ui);
  text-transform: lowercase; text-decoration: none; white-space: nowrap; }
.site-tab:hover { color: var(--ink); }
.site-tab[aria-current] { color: var(--ink); }
.site-tab[aria-current]::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); bottom: 11px; height: 2px; border-radius: 1px; background: var(--brand); }
.site-tab[aria-current]::before { content: ">"; margin-right: 1ch; color: var(--brand); }
.site-tab--phone { display: none; }
.site-header__owners { color: var(--link); font-size: var(--text-ui); font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-header__owners:hover, .site-header__owners[aria-current] { color: var(--ink); }
.site-header__owners.btn { color: var(--ink); }
/* Phones: the logo and account on one row, the tabs (owners among them) below, scrolling sideways if they must */
@media (max-width: 760px) {
  .site-header__bar { flex-wrap: wrap; gap: 0 var(--s4); }
  .site-header__brand, .site-header__end { padding-bottom: var(--s3); }
  .site-tabs { order: 1; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-tab { padding: var(--s2) var(--s2) var(--s3); }
  .site-tab[aria-current]::after { left: var(--s1); right: var(--s1); bottom: 7px; }
  .site-tab--phone { display: flex; }
  .site-header__owners { display: none; }
}
.acct { position: relative; }
.acct > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 4px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--surface-3); color: var(--ink); font-size: 14px; }
.acct > summary::-webkit-details-marker { display: none; }
.acct > summary img { width: 24px; height: 24px; border-radius: 3px; }
/* The tight left edge is for the avatar; a name on its own (accounts without a picture) needs room */
.acct > summary:not(:has(img)) { padding-left: var(--s3); }
.acct > summary i { color: var(--ink-3); }
.acct[open] > summary { border-color: var(--ink-3); }
.acct__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 220px; padding: 6px;
  border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-2); box-shadow: var(--shadow-pop);
}
.acct__menu a, .acct__menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 3px; background: none;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.acct__menu a:hover, .acct__menu button:hover { background: var(--surface-3); }
.acct__menu i { color: var(--ink-3); font-size: 16px; }
.acct__menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.acct__menu .acct__quiet { color: var(--ink-2); }
.acct__menu form.button_to { display: block; }
.acct__count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* Every account page (account/_shell, chosen Nov 2, 2026 from docs/design/account-options.html, B): the sidebar with
   all of them, grouped by what you're doing; on phones it becomes a row of tabs */
.acct-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.acct-side { position: sticky; top: var(--s5); display: grid; gap: 2px; }
.acct-side__label { padding: var(--s3) 10px 2px; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-3); }
.acct-side__label:first-child { padding-top: 0; }
.acct-side a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-ctl); color: var(--ink-2); font-size: var(--text-ui); text-decoration: none; }
.acct-side a:hover { background: var(--surface-3); color: var(--ink); }
.acct-side a[aria-current] { background: var(--surface-3); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand); }
.acct-side i { color: var(--ink-3); font-size: 16px; }
@media (max-width: 760px) {
  .acct-shell { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .acct-side { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
  .acct-side::-webkit-scrollbar { display: none; }
  .acct-side__label { display: none; }
  .acct-side a { white-space: nowrap; }
}

/* A one-time code being typed: big, spaced digits */
.field input.input--code { font-family: var(--mono); font-size: var(--text-lg); letter-spacing: .2em; }

/* Two-factor setup: the QR code (dark modules need a light ground in either theme) and the backup codes */
.qr-box { justify-self: start; padding: var(--s3); border-radius: var(--r-card); background: var(--ink); }
.qr { display: block; width: 184px; height: 184px; }
.backup-codes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s5);
  font-family: var(--mono); font-size: var(--text-lg); color: var(--ink); }

/* The Console tab (account_servers/_console): the server's own reply, and kick/ban forms that open in a row */
.console-reply pre { margin: var(--s3) 0 0; max-height: 320px; overflow: auto; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-action > summary { list-style: none; }
.inline-action > summary::-webkit-details-marker { display: none; }
.inline-action[open] > summary { border-color: var(--ink-3); }
.inline-action { position: relative; }
/* A table whose rows open pop-overs lets them show past its edge */
.data-table--menus { overflow: visible; }
.inline-action__form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; gap: var(--s2); padding: var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-2); box-shadow: var(--shadow-pop); }
.inline-action__form .input { width: 220px; min-height: 32px; }
.inline-action__form .select { height: 32px; }

/* The Console's live feed (account_servers/_log_event): newest at the bottom, scrolls on its own; the filters hide
   kinds of lines through data-hide-* on .feed */
.feed__list { margin: 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; display: grid; gap: 2px; font-size: var(--text-ui); }
.feed__line { display: flex; gap: var(--s3); align-items: baseline; padding: 3px var(--s2); border-radius: var(--r-ctl); }
.feed__line:hover { background: var(--surface-3); }
.feed__time { flex: none; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-3); }
.feed__text { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.feed__name { color: var(--ink); font-weight: 600; }
/* Which server a line is from: on the Live dashboard (.feed--all) only */
.feed__server { display: none; flex: none; font-family: var(--mono); font-size: var(--text-xs); color: var(--link); }
.feed--all .feed__server { display: inline; }
.feed__line[data-kind="join"] .feed__text, .feed__line[data-kind="leave"] .feed__text, .feed__line[data-kind="map"] .feed__text { color: var(--ink-3); }
.feed[data-hide-chat] .feed__line:is([data-kind="chat"], [data-kind="team_chat"]),
.feed[data-hide-joins] .feed__line:is([data-kind="join"], [data-kind="leave"]),
.feed[data-hide-kills] .feed__line[data-kind="kill"],
.feed[data-hide-map] .feed__line[data-kind="map"] { display: none; }

/* The Live dashboard (live_dashboard/show): a card per server, then the feed of all of them, taller */
.live-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s3); }
.live-server { display: grid; gap: 6px; padding: 14px 16px; color: var(--ink-2); text-decoration: none; }
.live-server:hover { border-color: var(--line-2); }
.live-server__top { display: flex; align-items: center; gap: var(--s2); color: var(--ink); }
.live-server__top .mono:last-child { margin-left: auto; color: var(--ink-2); }
.live-server__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-ui); }
.feed__list--tall { max-height: 640px; }

/* A form page inside the account shell keeps a form's width */
.acct-form { max-width: 480px; }

/* A row of .stat boxes: a page's numbers at a glance */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s3); }

/* A setting's state as an icon and a word: alerts on, RCON works */
.state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap; }
.state i { font-size: 14px; color: var(--ink-3); }
.state--ok i { color: var(--live); }
.state--warn i { color: var(--warn); }
.state--bad i { color: var(--danger); }

/* The pager (legacy class name, used on every list) */
.pagination-button { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface-3); color: var(--ink-2); font-family: var(--mono); font-size: 12px; text-decoration: none; }
.pagination-button:hover { color: var(--ink); border-color: var(--ink-3); }
.pagination-button.active { background: var(--brand); border-color: var(--brand); color: var(--white); }

/* A <summary> styled as a button (+ Add filter, Change webhook) */
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* Tables of data (the server list): scrolls sideways on narrow screens */
.data-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); }
.data-table table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); }
.data-table th { padding: var(--s4); text-align: left; font-family: var(--mono); font-size: var(--text-xs); font-weight: 500; text-transform: lowercase; color: var(--ink-3); white-space: nowrap; }
.data-table :where(td) { padding: var(--s4); border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.data-table tbody tr { background: var(--bg); }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--surface-3); }
.data-table__end { text-align: right; white-space: nowrap; }
.data-table__end .cluster { flex-wrap: nowrap; }
.data-table__game .cluster { flex-wrap: nowrap; }
@media (max-width: 1200px) { .data-table :where(td, th) { padding: var(--s3); } }
.data-table__server { min-width: 16rem; max-width: 24rem; }
.data-table__server > a { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; text-decoration: none; }
.data-table__server > a:hover { color: var(--link); }
.data-table__sub { margin-top: var(--s1); font-size: var(--text-xs); color: var(--ink-3); }
.data-table__map { min-width: 11rem; max-width: 16rem; overflow-wrap: anywhere; }
.data-table__map a { color: inherit; text-decoration: none; flex-wrap: nowrap; }
.data-table__map a:hover { color: var(--link); }
.data-table__place { min-width: 9rem; max-width: 13rem; }
.data-table__empty { padding: var(--s7) var(--s5); text-align: center; color: var(--ink-2); }

/* The server list on phones: each row becomes a card, players at the left and the rest stacked beside them
   (server, game, map, then place and Copy IP). Connect is left out: a phone can't start the game */
@media (max-width: 760px) {
  .data-table--servers thead { display: none; }
  .data-table--servers table, .data-table--servers tbody { display: block; }
  .data-table--servers tbody tr { display: grid; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: center;
    padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
  .data-table--servers tbody tr:first-child { border-top: 0; }
  .data-table--servers :where(td) { padding: 0; border: 0; min-width: 0; max-width: none; font-size: var(--text-sm); }
  .data-table--servers .players { grid-column: 1; grid-row: 1 / span 4; align-self: start; font-size: var(--text-ui); }
  .data-table--servers .data-table__server { grid-column: 2 / -1; font-size: var(--text-ui); }
  .data-table--servers .data-table__game, .data-table--servers .data-table__map { grid-column: 2 / -1; color: var(--ink-2); }
  .data-table--servers .data-table__game .game-thumb { display: none; }
  .data-table--servers .data-table__map span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .data-table--servers .data-table__place { grid-column: 2; }
  .data-table--servers .data-table__end { grid-column: 3; justify-self: end; }
  .data-table--servers .data-table__end .btn--go { display: none; }
  .data-table--servers .data-table__empty { grid-column: 1 / -1; }
}

/* Player counts: empty, full, or with room */
.players { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.players small { display: block; color: var(--ink-3); font-family: var(--sans); font-size: var(--text-xs); }
.players--empty { color: var(--ink-3); }
.players--full { color: var(--danger); }
.players--open { color: var(--live); }

/* A row of small status icons: VAC, dedicated, password, bots */
.icons { display: inline-flex; gap: var(--s1); font-size: var(--text-ui); }
.icons__vac { color: var(--live); }
.icons__dedicated { color: var(--info); }
.icons__password { color: var(--warn); }
.icons__bots { color: var(--brand); }
.server-nonsteam { color: var(--warn); }
.server-plugins { color: var(--link); }
.server-tags { color: var(--ink-2); }

/* A game's header art as a small thumbnail */
.game-thumb { width: 38px; height: 18px; flex: none; object-fit: cover; border-radius: 2px; }

/* The site footer */
.site-footer { margin-top: var(--s7); padding: var(--s6) 0; border-top: 1px solid var(--line); background: var(--bg); }
.site-footer__title { margin: 0; font-family: var(--mono); font-size: var(--text-md); font-weight: 500; }
/* The languages row: every language of this page, the current one lit, and on a translated page a link to suggest
   better wording */
.site-footer__langs { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--ink-3); }
.site-footer__langs nav { align-items: center; }
.site-footer__lang { padding: 2px var(--s2); border-radius: var(--r-ctl); color: var(--ink-2); text-decoration: none; }
.site-footer__lang:hover { color: var(--ink); }
.site-footer__lang[aria-current] { background: var(--surface-3); color: var(--ink); }
.site-footer__suggest { margin: 0; }
.site-footer__links { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.site-footer__links a { color: var(--ink-2); text-decoration: none; }
.site-footer__links a:hover { color: var(--ink); }
.site-footer__base { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--text-sm); }
.site-footer__base p { margin: 0; }
.site-footer__base a { color: var(--ink-2); }
.site-footer__base .site-footer__links { display: flex; }

/* Map pictures (TopHelper#map_tile): a screenshot, a radar overview on its mode's colour, or generated art */
.map-tile { position: relative; display: block; flex: none; overflow: hidden; background: var(--surface-0); }
.map-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-tile--radar { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--mode) 32%, var(--surface-0)), var(--surface-0) 75%); }
.map-tile--radar img { object-fit: contain; padding: 10%; }
/* Our own top-down drawings (MapRender::Goldsrc) sit like radars, on the mode's glow */
.map-tile--render { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--mode) 22%, var(--surface-0)), var(--surface-0) 75%); }
.map-tile--render img { object-fit: contain; padding: 6%; }
.map-tile--thumb { width: 64px; height: 40px; border-radius: 5px; }
.map-tile--mini { width: 40px; height: 25px; border-radius: 4px; }
/* Generated art's hairlines vanish this small, so small tiles carry their mode's colour too */
.map-tile--mini.map-tile--generated, .map-tile--thumb.map-tile--generated { background: color-mix(in srgb, var(--mode) 38%, var(--surface-0)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mode) 55%, transparent); }
.map-tile--mini.map-tile--generated img, .map-tile--thumb.map-tile--generated img { mix-blend-mode: screen; opacity: .9; }

/* A <select> drawn without the browser's arrow (the home page's sort) */

/* Page header: a back link, the heading, then a row of facts about the page */
.page-head { display: grid; gap: var(--s2); }
.page-head h1 { margin: 0; font-size: var(--text-2xl); line-height: 1.1; overflow-wrap: anywhere; }
/* The styles gallery's heading sample: looks like a page's h1 (base.css) without being one (a page has one h1) */
.page-head__sample { margin: 0; font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; font-size: var(--text-2xl); line-height: 1.1; overflow-wrap: anywhere; }
.page-head__lede { margin: 0; max-width: 64ch; color: var(--ink-2); }
.back { color: var(--ink-2); font-size: var(--text-ui); text-decoration: none; }
.back:hover { color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); color: var(--ink-2); font-size: var(--text-ui); }
.meta a { color: var(--link); text-decoration: none; }
.meta a:hover { text-decoration: underline; }
.section-title { margin: 0; font-family: var(--mono); font-size: var(--text-lg); font-weight: 500; }

/* Text roles */
.muted { color: var(--ink-2); }
.hint { margin: 0; color: var(--ink-3); font-size: var(--text-sm); }
.danger-text { color: var(--danger-soft); }

/* Stat tiles: a big number over a caption */
.stat { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); }
.stat b { display: block; font-family: var(--mono); font-size: var(--text-xl); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat small { color: var(--ink-3); font-size: var(--text-xs); }

/* Cards: variants */
.card--danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); border-left-color: var(--danger); }
.card--done { opacity: .6; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* A clickable row standing for one thing (a server on the account page) */
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s2) var(--s3); align-items: center; padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.item:hover { border-color: var(--line-2); }
.item__main { min-width: 0; display: grid; }
.item__main b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item__main small { color: var(--ink-3); font-size: var(--text-sm); }
.item__end { font-family: var(--mono); color: var(--live); font-variant-numeric: tabular-nums; }
.item__foot { grid-column: 2 / -1; }

/* A status dot on its own */
.status-dot { width: 10px; height: 10px; border-radius: var(--r-round); background: var(--ink-3); }
.status-dot--on { background: var(--live); }

/* A list of events, each with a time on the right (Recent alerts) */
.log { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s3); font-size: var(--text-ui); }
.log li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); }
.log li > :where(span, b, a) { min-width: 0; overflow-wrap: anywhere; }
.log time { margin-left: auto; color: var(--ink-3); font-size: var(--text-xs); white-space: nowrap; }

/* A checklist that ticks itself off */
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.checklist li::before { content: "○ "; color: var(--ink-3); }
.checklist li.is-done::before { content: "✓ "; color: var(--live); }
.checklist a { color: var(--link); }
.checklist li.is-done a { color: var(--ink-3); text-decoration: line-through; }

/* A bulleted list of problems (why a server is flagged) */
.problems { margin: 0; padding-left: var(--s5); list-style: disc; color: var(--danger-soft); }

/* Numbered steps (claiming) */
.steps { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s5); list-style: decimal; }
.steps > li::marker { font-family: var(--mono); color: var(--brand); }
.steps > li > b { display: block; margin-bottom: var(--s2); }

/* Something to copy into a console: a claim code */
.code { display: inline-block; padding: var(--s2) var(--s4); border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--surface-0);
  font-family: var(--mono); font-size: var(--text-lg); letter-spacing: .08em; user-select: all; }
.inline-code { font-family: var(--mono); color: var(--link); overflow-wrap: anywhere; }

/* A secret shown masked, with an action beside it (a saved webhook) */
.secret { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--surface-0); }
.secret i { color: var(--discord); font-size: 18px; }
.secret span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--mono); font-size: var(--text-sm); color: var(--ink-2); }

/* What an app connected over OAuth can and can't do (the consent page), and how to connect one */
.consent-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); font-size: var(--text-ui); color: var(--ink-2); }
.consent-list li { display: flex; gap: var(--s2); align-items: baseline; }
.consent-list i { color: var(--live); }
.consent-list--no i { color: var(--ink-3); }
.consent-list + .card__title { margin-top: var(--s2); }
.consent-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.setup-list { margin: 0; padding-left: var(--s4); display: grid; gap: var(--s2); font-size: var(--text-ui); color: var(--ink-2); }
.setup-list code { overflow-wrap: anywhere; }

/* A message box inside a page (a form's error) */
.notice { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-ctl); font-size: var(--text-ui); }
.notice--error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger-soft); }
.notice--warn { background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn); }

/* A field and its button on one line */
.field-row { display: flex; gap: var(--s3); }
.field-row input:not([type=submit]) { flex: 1; min-width: 0; }
@media (max-width: 760px) { .field-row { flex-direction: column; } }

/* Avatars */
.avatar { width: 64px; height: 64px; border-radius: var(--r-card); }

/* The site header and logo */
.site-header { padding: var(--s4) 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.logo { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; }
.logo__mark { width: 36px; height: 36px; flex: none; }
.logo__word { margin: 0; font-family: var(--pixel); font-size: var(--text-lg); letter-spacing: .05em; color: var(--ink); }
.logo__word span { background: linear-gradient(90deg, var(--brand), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 640px) { .logo__word { font-size: var(--text-md); } }

/* A text input on its own (search boxes) */
.input { width: 100%; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface-0); color: var(--ink); font: inherit; font-size: var(--text-md); }
.input:focus { border-color: var(--brand); outline: none; }
.field-row--narrow { max-width: 672px; }

/* The search bar: magnifier, field and its button in one frame, lit while you type. --lg on the home page */
.searchbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); width: 100%; margin: 0; padding: var(--s1) var(--s1) var(--s1) var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--surface-0); }
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.searchbar > i { color: var(--ink-3); font-size: var(--text-md); }
.searchbar input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: var(--text-ui); }
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar input:focus-visible { outline: none; }
.searchbar--lg { padding-left: var(--s4); }
.searchbar--lg > i { font-size: var(--text-lg); }
.searchbar--lg input { height: 44px; font-size: var(--text-md); }

/* Long-form text: about, privacy, terms */
.prose { display: grid; gap: var(--s4); color: var(--ink-2); line-height: 1.65; }
.prose p { margin: 0; }
.code-block { padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--surface-3); font-family: var(--mono); font-size: var(--text-ui); overflow-wrap: anywhere; color: var(--ink); }

/* A numbered list of names with a value each (the players list) */
.ranked-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s7); font-size: var(--text-ui); }
.ranked-list li { display: flex; justify-content: space-between; gap: var(--s4); }
.ranked-list__name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ranked-list__name a { color: var(--ink); text-decoration: none; }
.ranked-list__name a:hover { color: var(--link); }
.ranked-list__n { display: inline-block; width: var(--s6); color: var(--ink-3); font-family: var(--mono); }
@media (max-width: 760px) { .ranked-list { grid-template-columns: 1fr; } }

/* A table inside a card: no frame or stripes of its own */
.data-table--plain { border: 0; background: transparent; }
.data-table--plain th { padding: 0 var(--s4) var(--s2) 0; }
.data-table--plain td { padding: var(--s2) var(--s4) var(--s2) 0; }
.data-table--plain tbody tr, .data-table--plain tbody tr:nth-child(even) { background: transparent; }

/* Charts wider than a phone scroll sideways */
.scroll-x { overflow-x: auto; }

/* A week by hour (owner insights): a row per day, a cell per hour, brighter the busier; the view sets --share */
.heatmap { display: grid; grid-template-columns: 2.5rem repeat(24, minmax(12px, 1fr)); gap: 3px; min-width: 520px;
  font-family: var(--mono); font-size: var(--text-xs); color: var(--ink-3); }
.heatmap__day { align-self: center; }
.heatmap__hour { line-height: 1.6; }
.heatmap__cell { aspect-ratio: 1; border-radius: 2px; background: color-mix(in srgb, var(--brand) var(--share), var(--surface-0)); }
.heatmap__cell--none { background: none; box-shadow: inset 0 0 0 1px var(--line); }

/* A choice with a checkbox: a bold name over a line saying what it does (which alerts to send) */
.option { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; }
.option:hover { border-color: var(--line-2); }
.option:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.option:has(input:disabled) { cursor: default; color: var(--ink-3); border-style: dashed; }
.option:has(input:disabled):hover { border-color: var(--line); }
.option input:where([type=checkbox], [type=radio]) { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); }
.option > span { display: grid; gap: var(--s1); min-width: 0; }
.option b { font-size: var(--text-ui); font-weight: 600; }
.option small { color: var(--ink-3); font-size: var(--text-sm); }
/* Tiles of options to tick (servers): as many columns as fit, each name on one line */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s2); }
.picks .option { padding: var(--s2) var(--s3); }
.picks .option b { font-family: var(--mono); }
.picks .option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* .seg as radio buttons in a form ("all my servers" / "only these"): the circles hidden, the chosen one lit */
.seg label { padding: 4px 10px; border-radius: 3px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); cursor: pointer; }
.seg label:hover { color: var(--ink); }
.seg label:has(input:checked) { background: var(--surface-3); color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
/* A server choice: the tiles only when "only these" is chosen */
.targets > .seg { align-self: start; justify-self: start; }
.targets:has(input[value=all]:checked) .picks { display: none; }

/* A line with words in the middle ("or continue with") */
.or-line { display: flex; align-items: center; gap: var(--s3); margin: 0; color: var(--ink-3); font-size: var(--text-sm); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Sign-in services as a row of logo tiles, each its own color (docs/design/signin-options.html, A) */
.provider-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s2); }
.provider-tiles form.button_to { display: block; }
.provider-tile { display: grid; place-items: center; width: 100%; height: 48px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  background: var(--surface-3); cursor: pointer; }
.provider-tile:hover { border-color: var(--ink-3); }
.provider-tile img { width: 22px; height: 22px; }
/* A service's logo beside its name (the account page's ways to sign in) */
.provider-logo { width: 20px; height: 20px; }

/* A small number field inside a sentence ("tell me when it reaches [10] players") */
.input--num { width: 5.5rem; min-height: 32px; padding: 0 var(--s2); font-family: var(--mono); }
.chart { min-width: 480px; max-width: 56rem; }

/* Pagination: page links and a gap marker */
.pager { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pager__gap { padding: var(--s1) var(--s2); color: var(--ink-3); }

/* A card's heading with something beside it (a chart's range control) */
.card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s4); }
.card__head .card__title { margin: 0; }

/* Nothing to show yet, inside a card */
.empty { margin: 0; padding: var(--s7) 0; text-align: center; color: var(--ink-2); }

/* Wide charts (the hourly players chart) */
.chart--wide { min-width: 640px; max-width: none; }

/* A colour key in a sentence (chart legends) */
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: middle; }
.swatch--brand { background: var(--brand); }
.swatch--live { background: var(--live); }

/* Shares of a whole, each with a bar (maps played); the template sets --share */
.shares { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s3); font-size: var(--text-ui); }
.shares li { display: flex; align-items: center; gap: var(--s3); }
.shares__main { flex: 1; min-width: 0; display: grid; gap: var(--s1); }
.shares__main a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.shares__main a:hover { color: var(--link); }
.bar { height: 6px; border-radius: var(--r-round); background: var(--surface-0); }
.bar__fill { width: var(--share); height: 100%; border-radius: var(--r-round); background: var(--brand); }

/* One-column ranked list (top players on a server page) */
.ranked-list--one { grid-template-columns: 1fr; }

/* A banner image previewed at its own size, never wider than its card */
.banner-preview { max-width: 100%; height: auto; }

/* Long values in a table cell wrap anywhere */
.data-table__wrap { overflow-wrap: anywhere; color: var(--ink); }

/* A card that opens (server settings) */
.disclosure > summary { cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "▸ "; color: var(--ink-3); }
.disclosure[open] > summary::before { content: "▾ "; }
.disclosure[open] > summary { margin-bottom: var(--s4); }
.pager--end { justify-content: flex-end; padding-top: var(--s4); }

/* A dropdown drawn without the browser's arrow, with our own (sort) */
.select { max-width: 100%; height: 34px; padding: 0 var(--s6) 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-ctl); appearance: none;
  background: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) right 14px center / 5px 5px no-repeat,
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%) right 9px center / 5px 5px no-repeat, var(--surface-3);
  color: var(--ink); font: inherit; font-size: var(--text-ui); cursor: pointer; }
.hm-chip-value { font-weight: 600; }

/* Charts (ServersHelper): drawn as SVG, coloured here */
.chart__svg { display: block; width: 100%; height: auto; }
.chart__grid { stroke: var(--line-2); }
.chart__label { fill: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.chart__max { stroke: var(--ink-3); stroke-dasharray: 4 4; }
.chart__line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.chart__area { fill: var(--brand); fill-opacity: .2; }
.chart__dot { fill: var(--brand); }
.chart__hit { fill: transparent; }
.chart__miss { fill: var(--danger); }
.chart__bar { fill: var(--brand); }
.chart__bar--new { fill: var(--live); }
