/* Dark theme: dark background, red accent, large uppercase headings, "blocky" buttons with a shadow below.
   All rules start with :root[data-theme="dark"]: under other themes the file changes nothing and the Rubik font is not loaded. */

:root[data-theme="dark"] {
  --font-display: "Rubik", "Segoe UI", system-ui, sans-serif;
  --font-body: "Rubik", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;

  /* Red: slightly darker under white text so that the contrast is not below 4.5:1 */
  --red-1: #ff0033; --red-2: #e0002c; --red-3: #ec0a38; --red-edge: #b30024; --red-light: #ff4d6a;
  --red-grad: linear-gradient(135deg, var(--red-2) 0%, var(--red-3) 50%, var(--red-2) 100%);
  --ease-expo: cubic-bezier(.16, 1, .3, 1); --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --live: #22c55e;

  --bg: #050507; --surface: #0d0d14; --surface-2: #17171f; --ink: #ffffff; --muted: #8a8a96; --link: var(--red-light);
  --line: rgb(255 255 255 / .07); --field-edge: rgb(255 255 255 / .18);
  --accent: var(--red-2); --accent-hover: var(--red-3); --accent-ink: #ffffff; --accent-soft: rgb(255 0 51 / .1); --accent-text: var(--red-light);
  --btn: rgb(255 255 255 / .04); --btn-edge: rgb(255 255 255 / .12); --btn-ink: #ffffff; --btn-hover: rgb(255 0 51 / .08);
  --hint: rgb(255 0 51 / .08); --hint-ink: var(--red-light);

  --gold: linear-gradient(135deg, #ffe7a3, #f5b400); --badge-ink: #2a1a00;
  --newbie: rgb(34 197 94 / .14); --newbie-ink: #4ade80;
  --red: rgb(255 0 51 / .12); --on-red: #ff8099;
  --done: rgb(34 197 94 / .16); --done-ink: #4ade80;
  --good: var(--live); --good-soft: rgb(34 197 94 / .2); --bad: var(--red-1); --bad-soft: rgb(255 0 51 / .2); --idle-soft: rgb(255 255 255 / .08);
  --warn-bg: rgb(255 214 0 / .08); --warn-ink: #ffd600;

  --xp-track: rgb(255 255 255 / .07); --xp-value: var(--red-1);
  --mark: rgb(255 0 51 / .28); --mark-ink: #ffffff;
  --tip-bg: #0f0f16; --tip-ink: #f5f5f7; --tip-muted: #b8b8c0;
  --pop-bg: #15151c; --pop-ink: #f5f5f7; --pop-muted: #8a8a96; --pop-hover: rgb(255 0 51 / .1);
  --focus: var(--red-light);

  --top-bg: rgb(5 5 7 / .86); --top-edge: rgb(255 0 51 / .15); --brand-ink: #ffffff;
  --menu-ink: #b8b8c0; --menu-on: #ffffff; --menu-on-bg: transparent; --menu-hover: transparent;
  --foot-bg: linear-gradient(rgb(255 255 255 / .012), rgb(255 255 255 / .03));

  --chart-bar: var(--red-1); --chart-sel: #ffffff; --chart-down: #4a4a58; --chart-grid: rgb(255 255 255 / .07); --chart-bg: transparent;

  --radius: 18px; --radius-md: 12px; --radius-sm: 8px; --radius-xs: 6px; --radius-icon: 13px;
  --panel-edge: rgb(255 255 255 / .07);
  --panel-shadow: 0 18px 36px -18px rgb(0 0 0 / .9);
  --pop-shadow: 0 28px 60px -16px rgb(0 0 0 / .9);
  --field-shadow: none;
  --hero-edge: rgb(255 255 255 / .09); --hero-on: #ffffff;
  --hero-shadow: none; --hero-shadow-hover: none;
  --hero-ring: 0 0 0 3px rgb(255 0 51 / .16);
  --hero-title: #ffffff; --hero-title-glow: none;
  --focus-style: solid;
  --tracking: -.02em;

  scrollbar-color: var(--red-1) #111118;
  /* A custom cursor: a red arrow with a white outline */
  cursor: url("../img/dark/cursor.svg") 5 3, auto;
}
:root[data-theme="dark"] ::selection { background: rgb(255 0 51 / .45); color: #ffffff; }

/* Theme animations */
@keyframes dark-pulse { 0% { opacity: .75; transform: scale(1); } 70%, to { opacity: 0; transform: scale(2.8); } }
@keyframes dark-glow { 0%, to { opacity: .55; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.12); } }
@keyframes dark-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes dark-rise { from { opacity: 0; transform: translateY(28px) scale(.98); } }

/* Page background: a thin red grid and a soft glow in the center. Both layers stay still on scroll */
:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); line-height: 1.6; }
:root[data-theme="dark"] body::before,
:root[data-theme="dark"] body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
:root[data-theme="dark"] body::before {
  z-index: -2;
  background-image: linear-gradient(rgb(255 0 51 / .03) 1px, transparent 1px), linear-gradient(90deg, rgb(255 0 51 / .03) 1px, transparent 1px);
  background-size: 50px 50px;
}
:root[data-theme="dark"] body::after { z-index: -2; opacity: .45; background: radial-gradient(ellipse at center, rgb(255 0 51 / .3) 0%, transparent 70%); }
:root[data-theme="dark"] a { transition: color .2s ease; }
:root[data-theme="dark"] :focus-visible { outline-width: 2px; }

/* Headings: uppercase, bold, tight */
:root[data-theme="dark"] :is(h1, h2) { font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; text-wrap: balance; line-height: 1.1; }
:root[data-theme="dark"] h3 { font-weight: 800; letter-spacing: -.005em; }

/* The header repeats the reference design. At the top of the page it is transparent and lies on the glow. On scroll the script sets the class scrolled:
   on a phone the header becomes a dark strip, on desktop the header row turns into a floating panel with blur */
@keyframes dark-drawer { from { transform: translateX(100%); } }
@keyframes dark-fade { from { opacity: 0; } }
@keyframes dark-slide { from { opacity: 0; transform: translateX(18px); } }
@keyframes dark-drop { from { opacity: 0; transform: translateY(8px); } }
:root[data-theme="dark"] header.top {
  position: sticky; top: 0; z-index: 24;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease-expo), border-color .4s ease, box-shadow .4s ease, padding .4s var(--ease-expo);
}
/* With the script the header is fixed over the page, as in the reference design. On scroll it becomes shorter, and if it were in the flow (sticky),
   the page would shift by that difference, the scroll would fall back below the threshold and the header would jitter, switching back and forth.
   The space under the header is held by the body padding, equal to its height at the top of the page. Without the script the menu on a phone is the second header row, so it stays in the flow */
@media (scripting: enabled) {
  :root[data-theme="dark"] { scroll-padding-top: 96px; }
  :root[data-theme="dark"] header.top { position: fixed; left: 0; right: 0; }
  :root[data-theme="dark"] body { padding-top: 93px; }
}
:root[data-theme="dark"] .top-row { gap: 8px; min-height: 0; padding-block: 0; transition: background-color .4s var(--ease-expo), border-color .4s ease, box-shadow .4s ease; }
@media (max-width: 860px) {
  :root[data-theme="dark"] header.top { padding-block: 24px; }
  :root[data-theme="dark"] header.top.scrolled { padding-block: 16px; background: rgb(5 5 7 / .98); border-bottom-color: rgb(255 0 51 / .15); box-shadow: 0 4px 30px rgb(0 0 0 / .1); }
}
@media (min-width: 861px) {
  :root[data-theme="dark"] header.top { padding-block: 16px; }
  :root[data-theme="dark"] header.top.scrolled { padding-block: 9.6px; }
  /* The row edges match the home page panel and the content of the pages below it */
  :root[data-theme="dark"] .top-row {
    width: calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))); max-width: 1448px;
    padding: 6.4px 7.2px 6.4px 12px; border: 1px solid transparent; border-radius: 20px;
  }
  :root[data-theme="dark"] header.top.scrolled .top-row {
    background: rgb(12 12 18 / .8); border-color: rgb(255 255 255 / .08);
    box-shadow: 0 18px 44px -20px rgb(0 0 0 / .9), inset 0 1px rgb(255 255 255 / .05);
    -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px);
  }
}

/* The name: CRAFT in white, NOW in a red gradient, so the capital letters read as two words.
   On a phone there are three 44 px buttons on the right, a 40 px icon on the left, margins and gaps: 236 px in total, the rest goes to the name, which is 5.62em wide */
:root[data-theme="dark"] .brand {
  gap: 8px; white-space: nowrap;
  font-size: clamp(16px, calc((100vw - 236px) * .172), 28px); font-weight: 900; text-transform: uppercase; letter-spacing: -.03em;
  color: #ffffff;
  transition: font-size .4s var(--ease-expo);
}
:root[data-theme="dark"] .brand-now { background: linear-gradient(135deg, var(--red-1) 0%, #ff3355 50%, var(--red-1) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* The icon without a tile: the picture stands directly on the header */
:root[data-theme="dark"] .logo {
  width: 40px; height: 40px;
  transition: transform .3s var(--ease-back), width .3s var(--ease-back), height .3s var(--ease-back);
}
@media (min-width: 861px) {
  :root[data-theme="dark"] .brand { margin-right: 15px; font-size: 28px; }
  :root[data-theme="dark"] header.top.scrolled .brand { font-size: 24px; }
  :root[data-theme="dark"] header.top.scrolled .logo { width: 36px; height: 36px; }
}
/* With a mouse the row height is set by the buttons (40 px), as in the reference design; on a touch screen the name keeps 44 px */
@media (min-width: 861px) and (pointer: fine) { :root[data-theme="dark"] .brand { min-height: 0; } }
@media (hover: hover) {
  :root[data-theme="dark"] .brand:hover .logo { transform: translateY(-2px) rotate(-5deg); }
}
@media (max-width: 359px) {
  :root[data-theme="dark"] .top-row { gap: 6px; }
  :root[data-theme="dark"] .logo { width: 34px; height: 34px; }
}

/* Sections on desktop: normal case, hover highlights their tile, the active section has a red border */
@media (min-width: 861px) {
  :root[data-theme="dark"] .menu { gap: 2px; margin-inline: auto; }
  :root[data-theme="dark"] .menu a {
    min-height: 0; padding: 8px clamp(5.6px, .55vw, 8px); border-radius: 11px;
    font-size: 14px; font-weight: 600; line-height: 1.6; white-space: nowrap;
    color: #b8b8c0; background: none; transition: color .2s ease, background-color .2s ease;
  }
  :root[data-theme="dark"] .menu a.on { color: #ffffff; background: rgb(255 0 51 / .12); box-shadow: inset 0 0 0 1px rgb(255 0 51 / .28); }
}
@media (min-width: 861px) and (hover: hover) { :root[data-theme="dark"] .menu a:not(.on):hover { color: #ffffff; background: rgb(255 255 255 / .06); } }

/* Sections on a phone without scripts: a line under the header, gray capital letters, the active one and on hover get a red line below */
@media (max-width: 860px) {
  :root[data-theme="dark"] .menu:not(.open) { gap: 2px; }
  :root[data-theme="dark"] .menu:not(.open) a {
    position: relative; padding: 0 16px; border-radius: var(--radius-md);
    font-size: 14.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
    color: var(--menu-ink); background: none; transition: color .3s var(--ease-expo);
  }
  :root[data-theme="dark"] .menu:not(.open) a::before {
    content: ""; position: absolute; left: 50%; bottom: 2px; width: 0; height: 3px; border-radius: 2px;
    background: var(--red-1); box-shadow: 0 0 12px rgb(255 0 51 / .6); transform: translateX(-50%); transition: width .3s var(--ease-expo);
  }
  :root[data-theme="dark"] .menu:not(.open) a.on { color: #ffffff; }
  :root[data-theme="dark"] .menu:not(.open) a.on::before { width: calc(100% - 32px); }
}
@media (max-width: 860px) and (hover: hover) {
  :root[data-theme="dark"] .menu:not(.open) a:hover { color: #ffffff; }
  :root[data-theme="dark"] .menu:not(.open) a:hover::before { width: calc(100% - 32px); }
}

/* The open phone menu is a full-height panel on the right over a dimmed backdrop, as in the reference design. The header row serves as its heading:
   the header shrinks to 72 px, the buttons (and on a narrow screen the name) rise above the panel.
   The section icons are masks, their color is set by the background. The arrow on the right is the background of the link itself */
@media (max-width: 860px) {
  :root[data-theme="dark"]:has(.menu.open) { overflow: hidden; }
  :root[data-theme="dark"] header.top:has(.menu.open),
  :root[data-theme="dark"] header.top.scrolled:has(.menu.open) { z-index: 40; padding-block: 14px; }
  :root[data-theme="dark"] header.top:has(.menu.open)::before {
    content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / .6);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: dark-fade .3s ease;
  }
  :root[data-theme="dark"] :is(.top-actions, .menu-toggle, #theme-toggle) { position: relative; z-index: 2; }
  :root[data-theme="dark"] .menu.open {
    position: fixed; z-index: 1; top: 0; right: 0; bottom: 0; width: min(100%, 420px);
    flex-direction: column; flex-wrap: nowrap; gap: 2px;
    padding: 90px clamp(16px, 4vw, 24px) max(20px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto; overscroll-behavior: contain;
    background:
      linear-gradient(rgb(255 255 255 / .06), rgb(255 255 255 / .06)) 0 72.8px / 100% 1px no-repeat,
      radial-gradient(120% 50% at 100% 0%, rgb(255 0 51 / .14), transparent 65%),
      #0a0a0f;
    border-left: 1px solid rgb(255 255 255 / .06); box-shadow: -24px 0 60px rgb(0 0 0 / .5);
    animation: dark-drawer .45s var(--ease-expo);
  }
  :root[data-theme="dark"] .menu.open a {
    --nav-icon: url("../img/dark/icons/nav-servers.svg");
    position: relative; flex: none; min-height: 58px; padding: 8px 42px 8px 62.4px; border: 1px solid transparent; border-radius: 14px;
    font-size: 15.2px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #f5f5f7;
    background: url("../img/dark/icons/chevron-gray.svg") right 12px center / 18px no-repeat;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    animation: dark-slide .5s var(--ease-expo) .11s backwards;
  }
  :root[data-theme="dark"] .menu.open a:nth-child(2) { --nav-icon: url("../img/dark/icons/nav-help.svg"); animation-delay: .14s; }
  :root[data-theme="dark"] .menu.open a::before {
    content: ""; position: absolute; left: 8px; top: 50%; width: 40px; height: 40px; margin-top: -20px;
    background: #18181f; border: 1px solid rgb(255 255 255 / .07); border-radius: 12px;
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
  }
  :root[data-theme="dark"] .menu.open a::after {
    content: ""; position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
    background: #b8b8c0; transition: background-color .25s ease;
    -webkit-mask: var(--nav-icon) center / contain no-repeat; mask: var(--nav-icon) center / contain no-repeat;
  }
  :root[data-theme="dark"] .menu.open a.on { color: #ffffff; background-color: rgb(255 0 51 / .08); background-image: url("../img/dark/icons/chevron-white.svg"); border-color: rgb(255 0 51 / .22); }
  :root[data-theme="dark"] .menu.open a.on::before { background: linear-gradient(135deg, var(--red-1) 0%, #ff3355 50%, var(--red-1) 100%); border-color: transparent; box-shadow: 0 3px 0 #cc0029, 0 6px 18px rgb(255 0 51 / .35); }
  :root[data-theme="dark"] .menu.open a.on::after { background: #ffffff; }
}
@media (max-width: 420px) { :root[data-theme="dark"] header.top:has(.menu.open) .brand { position: relative; z-index: 2; } }
@media (max-width: 860px) and (hover: hover) {
  :root[data-theme="dark"] .menu.open a:not(.on):hover { background-color: rgb(255 255 255 / .04); background-image: url("../img/dark/icons/chevron-white.svg"); }
  :root[data-theme="dark"] .menu.open a:not(.on):hover::before { border-color: rgb(255 0 51 / .4); }
  :root[data-theme="dark"] .menu.open a:hover::after { background: #ffffff; }
}

/* Header buttons: squares with a thin border, the menu is three bars, the middle one is shorter and pushed to the right.
   On a phone the menu button comes last, as in the reference design: the open menu is closed by a cross in the panel corner */
:root[data-theme="dark"] { --icon-edge: 0px; }
:root[data-theme="dark"] .iconbtn { color: var(--menu-ink); transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
:root[data-theme="dark"] :is(.menu-toggle, #theme-toggle) { color: #ffffff; background-color: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: 12px; }
:root[data-theme="dark"] .menu-toggle { order: 1; }
:root[data-theme="dark"] #theme-toggle svg { width: 22px; height: 22px; }
:root[data-theme="dark"] .menu-toggle svg { stroke-width: 2; }
:root[data-theme="dark"] .menu-toggle[aria-expanded="false"] { background-image: url("../img/dark/icons/menu-bars.svg"); background-position: center; background-size: 18px 16px; background-repeat: no-repeat; }
:root[data-theme="dark"] .menu-toggle[aria-expanded="false"] svg { visibility: hidden; }
:root[data-theme="dark"] .menu-toggle[aria-expanded="true"] { background-color: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .1); }
:root[data-theme="dark"] .menu-toggle[aria-expanded="true"] svg { width: 20px; height: 20px; }
@media (hover: hover) {
  :root[data-theme="dark"] .iconbtn:hover { background-color: rgb(255 255 255 / .06); color: #ffffff; }
  :root[data-theme="dark"] :is(.menu-toggle, #theme-toggle):hover { background-color: rgb(255 0 51 / .08); border-color: rgb(255 0 51 / .5); }
}
/* On desktop the theme button is like the sign-in button in the reference design: a light icon that turns red on hover */
@media (min-width: 861px) { :root[data-theme="dark"] #theme-toggle { width: 40px; height: 40px; color: #f5f5f7; } }
@media (min-width: 861px) and (hover: hover) {
  :root[data-theme="dark"] #theme-toggle:hover { background-color: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .24); color: #ff3355; }
}

/* Avatar and profile menu: in the main theme these rules are written only for modern, here are our own.
   On a phone the avatar is the same square as the neighboring buttons, with no arrow: otherwise the name does not fit */
:root[data-theme="dark"] .top-actions { display: flex; align-items: center; gap: 8px; }
@media (min-width: 861px) { :root[data-theme="dark"] .top-actions { order: 1; } }
:root[data-theme="dark"] .top-profile { position: relative; }
:root[data-theme="dark"] .top-avatar {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; width: 44px; height: 44px; padding: 0; vertical-align: top;
  color: #f5f5f7; list-style: none; cursor: pointer;
  background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: 12px;
  transition: background-color .2s ease, border-color .2s ease;
}
:root[data-theme="dark"] .top-avatar::-webkit-details-marker { display: none; }
@media (hover: hover) { :root[data-theme="dark"] .top-avatar:hover { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .24); } }
@media (min-width: 861px) { :root[data-theme="dark"] .top-avatar { width: auto; height: 40px; padding: 0 4px 0 3px; } }
:root[data-theme="dark"] .top-avatar svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .top-avatar-face { display: grid; place-items: center; width: 32px; height: 32px; }
:root[data-theme="dark"] .top-avatar-face svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .top-avatar-arrow { width: 20px; height: 20px; color: #8a8a96; transition: transform .3s var(--ease-back), color .2s ease; }
@media (max-width: 860px) { :root[data-theme="dark"] .top-avatar-arrow { display: none; } }
:root[data-theme="dark"] .top-avatar:hover .top-avatar-arrow { color: #ff3355; }
:root[data-theme="dark"] .top-profile[open] .top-avatar-arrow { transform: rotate(180deg); }
@media (min-width: 861px) and (pointer: coarse) {
  :root[data-theme="dark"] .menu a { min-height: 44px; }
  :root[data-theme="dark"] #theme-toggle { width: 44px; height: 44px; }
  :root[data-theme="dark"] .top-avatar { height: 44px; }
}
/* The dropdown menu as in the reference design: a dark blurred card, the items have tiles with icons, on hover the tile turns red */
:root[data-theme="dark"] .top-profile-menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 21;
  width: max-content; min-width: 260px; max-width: calc(100vw - 32px); padding: 8.8px;
  background: rgb(14 14 20 / .97); color: #e8e8ec; border: 1px solid rgb(255 255 255 / .08); border-radius: 18px;
  box-shadow: 0 30px 60px -24px rgb(0 0 0 / .9), 0 0 0 1px rgb(255 0 51 / .05);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  animation: dark-drop .3s var(--ease-expo);
}
/* On a phone the avatar is not the rightmost: the menu is aligned to the right edge of the row and does not hang to the left of the avatar */
@media (scripting: enabled) and (max-width: 860px) {
  :root[data-theme="dark"] .top-profile-menu { right: -52px; }
  :root[data-theme="dark"] .top-row:has(#theme-toggle) .top-profile-menu { right: -104px; }
}
:root[data-theme="dark"] .top-profile-menu form { margin: 0; }
:root[data-theme="dark"] .top-profile-menu :is(a, button) {
  --menu-icon: url("../img/dark/icons/user.svg");
  position: relative; display: flex; align-items: center; gap: 11.2px; width: 100%; min-height: 44px; padding: 7.2px 9.6px;
  font: 600 13.76px/1.6 var(--font-body); color: #e8e8ec; text-align: left; text-decoration: none;
  background: none; border: 0; border-radius: 12px; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
:root[data-theme="dark"] .top-profile-menu :is(a, button)::before {
  content: ""; flex: none; width: 32px; height: 32px;
  background: #18181f; border: 1px solid rgb(255 255 255 / .07); border-radius: 10px;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
:root[data-theme="dark"] .top-profile-menu :is(a, button)::after {
  content: ""; position: absolute; left: 17.6px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: #b8b8c0; transition: background-color .25s ease;
  -webkit-mask: var(--menu-icon) center / contain no-repeat; mask: var(--menu-icon) center / contain no-repeat;
}
:root[data-theme="dark"] .top-profile-menu a[href="/login"] { --menu-icon: url("../img/dark/icons/log-in.svg"); }
:root[data-theme="dark"] .top-profile-menu a[href="/register"] { --menu-icon: url("../img/dark/icons/user-plus.svg"); }
:root[data-theme="dark"] .top-profile-menu a[href="/admin"] { --menu-icon: url("../img/dark/icons/shield-check.svg"); }
:root[data-theme="dark"] .top-profile-menu button { --menu-icon: url("../img/dark/icons/log-out.svg"); }
@media (hover: hover) {
  :root[data-theme="dark"] .top-profile-menu :is(a, button):hover { color: #ffffff; background: rgb(255 255 255 / .045); }
  :root[data-theme="dark"] .top-profile-menu :is(a, button):hover::before {
    background: linear-gradient(135deg, var(--red-1) 0%, #ff3355 50%, var(--red-1) 100%); border-color: transparent;
    box-shadow: 0 2px 0 #cc0029, 0 6px 14px rgb(255 0 51 / .35);
  }
  :root[data-theme="dark"] .top-profile-menu :is(a, button):hover::after { background: #ffffff; }
}

:root[data-theme="dark"] .stale { background: rgb(255 214 0 / .08); color: #ffd600; border-bottom: 1px solid rgb(255 214 0 / .2); }

/* The top of the page: a red glow at the top and a grid that fades towards the edges. The scene with clouds and ground is not drawn in this theme.
   The glow goes under the transparent header */
:root[data-theme="dark"] .scene { background: radial-gradient(at 50% 0, rgb(255 0 51 / .2) 0%, transparent 60%); }
:root[data-theme="dark"] .hero { position: static; }
/* The home page glow starts from the top of the page, not from the search block: the header lies on it, and there is no black strip above the search even when a banner is between them */
:root[data-theme="dark"] .hero .scene { inset: 0 0 auto; height: 640px; }
:root[data-theme="dark"] .scene::before {
  inset: 0; width: auto; height: auto; animation: none; will-change: auto;
  background: linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(70% 65% at 50% 0, #000, transparent 78%); mask-image: radial-gradient(70% 65% at 50% 0, #000, transparent 78%);
}
:root[data-theme="dark"] .scene::after {
  inset: -120px auto auto 50%; width: min(900px, 120vw); height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 0 51 / .22), transparent);
  animation: dark-glow 6s ease-in-out infinite;
}
:root[data-theme="dark"] .scene-low { inset: 0 0 auto; height: 380px; }
:root[data-theme="dark"] .wrap { max-width: 1480px; }

/* The home page header is a panel: a glow from the top right corner, a grid in the same corner and a large block, rotated and glowing.
   The panel itself clips nothing, otherwise the search hints under it would be cut off: the grid and the block are clipped at the panel edge by their .hero-deco layer.
   z-index raises the panel together with the hints above the catalog that follows below */
:root[data-theme="dark"] .hero { --hero-floor: 20px; }
:root[data-theme="dark"] .hero .wrap {
  position: relative; z-index: 15;
  width: calc(100% - 2 * max(16px, env(safe-area-inset-left, 0px))); max-width: 1448px;
  margin: 12px auto var(--hero-floor); gap: 16px; justify-items: start; text-align: left;
  padding: clamp(20px, 3vw, 36px) clamp(18px, 3vw, 36px);
  background:
    radial-gradient(110% 140% at 100% 0%, rgb(255 0 51 / .3), transparent 58%),
    radial-gradient(80% 120% at 0% 110%, rgb(255 0 51 / .1), transparent 60%),
    linear-gradient(180deg, rgb(255 255 255 / .035), rgb(255 255 255 / .012));
  border: 1px solid rgb(255 255 255 / .07); border-radius: 24px;
  animation: dark-rise .7s var(--ease-expo) backwards;
}
:root[data-theme="dark"] .hero-deco { display: block; position: absolute; z-index: -1; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
:root[data-theme="dark"] .hero-deco::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(70% 100% at 100% 0, #000, transparent 75%); mask-image: radial-gradient(70% 100% at 100% 0, #000, transparent 75%);
}
:root[data-theme="dark"] .hero-deco::after {
  content: ""; position: absolute;
  top: 50%; right: clamp(-40px, 2vw, 32px); width: clamp(150px, 18vw, 250px); aspect-ratio: 1;
  background: url("../img/dark/hero-art.svg") center / contain no-repeat;
  opacity: .16; filter: drop-shadow(0 0 30px var(--red-1));
  transform: translateY(-50%) rotate(-10deg);
  animation: dark-float 6s ease-in-out infinite;
}
@keyframes dark-float { 0%, to { transform: translateY(-50%) rotate(-10deg); } 50% { transform: translateY(calc(-50% - 14px)) rotate(-7deg); } }
@media (max-width: 600px) {
  :root[data-theme="dark"] .hero .wrap { border-radius: 20px; }
  :root[data-theme="dark"] .hero-deco::after { top: 30%; right: -40px; }
}
:root[data-theme="dark"] .hero-big { font-size: clamp(32px, 4.6vw, 58px); font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; color: #ffffff; }
:root[data-theme="dark"] .hero-big::before { content: none; }
:root[data-theme="dark"] .hero-title > span { color: var(--red-1); text-shadow: 0 0 30px rgb(255 0 51 / .6); }
:root[data-theme="dark"] .examples { justify-content: flex-start; }

/* Search */
:root[data-theme="dark"] .searchbox input[type="search"] {
  height: 56px; font-weight: 400; color: #ffffff;
  background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .09); border-radius: 14px; box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] .search-ico { top: 16px; color: #8a8a96; transition: color .15s ease; }
:root[data-theme="dark"] .searchbox:focus-within .search-ico { color: #ffffff; }
@media (hover: hover) { :root[data-theme="dark"] .searchbox input[type="search"]:hover { border-color: rgb(255 255 255 / .2); box-shadow: none; } }
:root[data-theme="dark"] .searchbox input[type="search"]:focus { background: rgb(255 255 255 / .07); border-color: rgb(255 0 51 / .55); box-shadow: 0 0 0 3px rgb(255 0 51 / .16); }
:root[data-theme="dark"] .searchbox input[type="search"]::placeholder { color: #6f6f7c; }
:root[data-theme="dark"] .suggest {
  top: calc(100% + 8px); padding: 6px; background: rgb(15 15 22 / .98); border: 1px solid rgb(255 255 255 / .1); border-radius: 16px;
  box-shadow: var(--pop-shadow); animation: dark-pop .18s var(--ease-expo);
}
:root[data-theme="dark"] .suggest button { border-radius: 10px; }
:root[data-theme="dark"] .suggest button.sel { background: rgb(255 0 51 / .12); }
@media (hover: hover) { :root[data-theme="dark"] .suggest button:hover { background: rgb(255 255 255 / .06); } }
:root[data-theme="dark"] .suggest .tagico { width: 32px; height: 32px; background: rgb(255 0 51 / .1); color: var(--red-light); border: 1px solid rgb(255 0 51 / .28); border-radius: 10px; }

/* Pills: search examples, the «Версия» ("Version") filter, sorting, tabs, chart ranges */
:root[data-theme="dark"] :is(.examples a, .pill, .sort .btn, .ranges .btn, .tabs .btn) {
  min-height: 40px; padding: 6px 15px; border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-pill);
  background: rgb(255 255 255 / .025); color: #b8b8c0; box-shadow: none;
  font: 700 13.5px/1.2 var(--font-body); text-transform: none; letter-spacing: 0; white-space: nowrap;
  transition: transform .25s var(--ease-expo), border-color .2s ease, background-color .2s ease, color .2s ease;
}
:root[data-theme="dark"] .examples a { color: #e8e8ec; }
:root[data-theme="dark"] .pill { min-height: 34px; padding-inline: 12px; }
@media (hover: hover) {
  :root[data-theme="dark"] :is(.examples a, .pill:not(.on), .sort .btn:not(.on), .ranges .btn:not(.on), .tabs .btn:not(.on)):hover {
    color: #ffffff; background: rgb(255 0 51 / .08); border-color: rgb(255 0 51 / .38); transform: translateY(-1px); box-shadow: none;
  }
}
:root[data-theme="dark"] .examples a:focus-visible { outline: 2px solid var(--red-light); outline-offset: 2px; box-shadow: none; }
:root[data-theme="dark"] :is(.pill.on, .sort .btn.on, .ranges .btn.on, .tabs .btn.on, .btn.on) {
  color: #ffffff; background: var(--red-grad); border-color: transparent; box-shadow: 0 3px 0 0 var(--red-edge), 0 6px 18px rgb(255 0 51 / .35);
}
:root[data-theme="dark"] .pill.zero { color: #6f6f7c; }

/* Buttons: the usual one is dark with a thin border, on hover it turns red and rises */
:root[data-theme="dark"] .btn {
  position: relative; overflow: hidden; gap: 8px; min-height: 44px; padding: 10px 20px;
  font: 700 14px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .05em;
  color: #ffffff; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-md);
  box-shadow: 0 3px 0 rgb(255 255 255 / .06);
  transition: transform .2s var(--ease-back), box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
@media (hover: hover) {
  :root[data-theme="dark"] .btn:not(.primary, .on, .done):hover { color: #ffffff; background: rgb(255 0 51 / .08); border-color: rgb(255 0 51 / .55); transform: translateY(-2px); box-shadow: 0 5px 0 rgb(255 0 51 / .25), 0 12px 28px -12px rgb(255 0 51 / .45); }
}
:root[data-theme="dark"] .btn:not(.primary):active { transform: translateY(1px); box-shadow: 0 1px 0 rgb(255 0 51 / .25); }
/* The main button: a red block with a base shadow, a glint runs across it on hover */
:root[data-theme="dark"] .btn.primary {
  color: #ffffff; background: var(--red-grad); border-color: transparent; text-shadow: 0 1px 1px rgb(0 0 0 / .18);
  box-shadow: 0 4px 0 0 var(--red-edge), 0 10px 28px -8px rgb(255 0 51 / .55);
}
:root[data-theme="dark"] .btn.primary::before {
  content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .2), transparent); transition: left .5s ease;
}
@media (hover: hover) {
  :root[data-theme="dark"] .btn.primary:hover { background: var(--red-grad); border-color: transparent; transform: translateY(-2px); box-shadow: 0 6px 0 0 var(--red-edge), 0 14px 34px -8px rgb(255 0 51 / .65); }
  :root[data-theme="dark"] .btn.primary:hover::before { left: 100%; }
}
:root[data-theme="dark"] .btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 0 var(--red-edge), 0 6px 18px -6px rgb(255 0 51 / .5); }
:root[data-theme="dark"] .btn.done { color: var(--done-ink); background: var(--done); border-color: rgb(34 197 94 / .4); box-shadow: 0 3px 0 rgb(34 197 94 / .2); }
:root[data-theme="dark"] .more .btn { min-height: 52px; padding-inline: 32px; }

/* Panels */
:root[data-theme="dark"] .panel {
  background: linear-gradient(rgb(255 255 255 / .043), rgb(255 255 255 / .012) 55%), var(--surface);
  border: 1px solid var(--panel-edge); border-radius: var(--radius); box-shadow: var(--panel-shadow);
}

/* Filters: a side panel with a red glow in the corner, the groups labeled with small capitals */
:root[data-theme="dark"] .filters {
  padding: 6px 10px 12px;
  background: radial-gradient(140% 60% at 0 0, rgb(255 0 51 / .1), transparent 60%), linear-gradient(rgb(22 22 31 / .94), rgb(11 11 17 / .96));
  border: 1px solid rgb(255 255 255 / .075); border-radius: 22px;
  box-shadow: inset 0 1px rgb(255 255 255 / .05), 0 24px 50px -30px rgb(0 0 0 / .9);
  scrollbar-color: rgb(255 255 255 / .14) transparent;
  /* There is always room for the scrollbar: when the filters fit entirely and the scrollbar disappears, the labels and counters do not shift */
  scrollbar-gutter: stable;
}
/* The filters have no «?»: on a computer with a mouse the explanation of the mode pops up to the right of the row on hover or when it is reached from the keyboard.
   The hint is anchored to the row (anchor positioning) and stands outside the panel's scroll, so the scroll does not clip it; near the bottom edge of the screen it rises above the row.
   On touch screens, narrow windows and in browsers without anchoring the explanation is not visible, the link still points to it for reading with a screen reader */
@media (hover: hover) and (min-width: 861px) {
  @supports (position-area: right) {
    /* The sticky panel is its own layer, and the cards on the right are drawn over it together with the hint. While the hint is visible the panel is above them.
       The slid-out server page panel (.open) is already above everything, with layer 3 it would go under the dimmed backdrop */
    :root[data-theme="dark"] .filters:not(.open):has(.opt-hint):is(:has(.opt:hover), :has(.opt:focus-visible)) { z-index: 3; }
    :root[data-theme="dark"] .optrow:is(:has(.opt:hover), :has(.opt:focus-visible)) { anchor-name: --opt-hint; }
    :root[data-theme="dark"] .optrow:is(:has(.opt:hover), :has(.opt:focus-visible)) .opt-hint {
      display: block; position: fixed; inset: auto; z-index: 25; width: 280px; margin: -4px 0 0 25px; pointer-events: none;
      position-anchor: --opt-hint; position-area: right span-bottom; position-try-fallbacks: flip-block;
      font-size: 14.5px; line-height: 1.5;
      animation: dark-pop .18s var(--ease-expo) .25s backwards;
    }
  }
}
:root[data-theme="dark"] .fgroup { padding: 4px 0 6px; border-top: 0; }
:root[data-theme="dark"] .fgroup h2 { margin: 14px 10px 6px; padding: 0; font: 800 11px/1.3 var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
:root[data-theme="dark"] .optrow { min-height: 42px; border-radius: var(--radius-md); color: #b8b8c0; transition: background-color .15s ease, color .15s ease; }
:root[data-theme="dark"] .opt { gap: 9px; padding: 6px; font-size: 14.5px; font-weight: 600; }
:root[data-theme="dark"] .opt .label { min-width: 0; }
:root[data-theme="dark"] .opt.on .label { font-weight: 600; }
:root[data-theme="dark"] .opt .box {
  position: relative; width: 30px; height: 30px; border-radius: 9px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 24%, transparent);
  transition: transform .2s var(--ease-back), background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
:root[data-theme="dark"] .opt .box svg { display: none; }
:root[data-theme="dark"] .opt .box::before {
  content: ""; width: 17px; height: 17px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
/* Selected item: the tile is filled with the mode's color, a white check mark in the corner */
:root[data-theme="dark"] .opt.on .box { color: #ffffff; background: var(--tone); border-color: transparent; box-shadow: 0 0 16px -2px color-mix(in srgb, var(--tone) 75%, transparent); }
:root[data-theme="dark"] .opt.on .box::after {
  content: ""; position: absolute; right: -5px; bottom: -5px; width: 15px; height: 15px; border-radius: 50%;
  background: #ffffff url("../img/dark/icons/check-badge.svg") center / 11px no-repeat; box-shadow: 0 0 0 2px #121219;
}
:root[data-theme="dark"] .optrow .n { font: 700 12px var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .optrow:has(.opt.on) { color: #ffffff; background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 24%, transparent), rgb(255 255 255 / .02)); }
:root[data-theme="dark"] .optrow:has(.opt.on)::before {
  content: ""; position: absolute; top: 9px; bottom: 9px; left: -10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--tone); box-shadow: 0 0 12px var(--tone);
}
:root[data-theme="dark"] .optrow:has(.opt.on) .n { color: #b8b8c0; }
:root[data-theme="dark"] .opt.zero { color: #6f6f7c; }
:root[data-theme="dark"] .opt.zero .box { opacity: .55; }
:root[data-theme="dark"] .pills { padding-inline: 8px; }
@media (hover: hover) {
  :root[data-theme="dark"] .optrow:has(.opt:hover) { color: #ffffff; background: rgb(255 255 255 / .05); }
  :root[data-theme="dark"] .optrow:has(.opt.on):has(.opt:hover) { background: linear-gradient(90deg, color-mix(in srgb, var(--tone) 32%, transparent), rgb(255 255 255 / .03)); }
  :root[data-theme="dark"] .optrow:has(.opt:hover) .box { transform: scale(1.08) rotate(-4deg); }
  :root[data-theme="dark"] .optrow:has(.opt:not(.on):hover) .box { background: color-mix(in srgb, var(--tone) 22%, transparent); border-color: color-mix(in srgb, var(--tone) 40%, transparent); }
  :root[data-theme="dark"] .optrow:has(.opt:hover) .n { color: #b8b8c0; }
}
@media (min-width: 861px) {
  /* The header sticks to the top, the panel sits under it */
  /* A thin scrollbar, as in the reference design, but gray, with no red. In the main layout it is hidden, here the labels fit next to it too */
  :root[data-theme="dark"] .filters { top: 88px; max-height: calc(100vh - 104px); scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .16) transparent; }
  :root[data-theme="dark"] .filters:hover { scrollbar-color: rgb(255 255 255 / .32) transparent; }
  /* The column is wider than in the main theme (248 px, as in the reference design): the scrollbar takes up room, and «Гриферский» ("Griefer") must stay on one line.
     The padding on the right is smaller: the gap is given by the scrollbar itself */
  :root[data-theme="dark"] .layout { grid-template-columns: 248px minmax(0, 1fr); gap: 28px; }
  :root[data-theme="dark"] .filters { padding-right: 4px; }
  :root[data-theme="dark"] .fgroup, :root[data-theme="dark"] .fgroup h2 { padding-inline: 0; }
  :root[data-theme="dark"] .opt { padding-inline: 6px; }
  :root[data-theme="dark"] .pills { padding-inline: 6px; }
}
/* Chrome and Edge draw arrows on the scrollbar, and at the rounded corners of the panel they stuck out past the edge. Where possible the scrollbar is custom: no arrows, the track steps back from the corners,
   the width is the same (10 px) as the thin one. The standard properties are reset, otherwise the browser takes them and ::-webkit-scrollbar is ignored. Firefox has no arrows, so the standard properties remain there.
   Only with a mouse: on a phone such a scrollbar would stop floating on top and would take up space */
@media (hover: hover) {
  @supports selector(::-webkit-scrollbar) {
    :root[data-theme="dark"] .filters, :root[data-theme="dark"] .filters:hover { scrollbar-width: auto; scrollbar-color: auto; }
    :root[data-theme="dark"] .filters::-webkit-scrollbar { width: 10px; }
    :root[data-theme="dark"] .filters::-webkit-scrollbar-track { margin-block: 16px; background: transparent; }
    :root[data-theme="dark"] .filters::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .16) padding-box; border: 2px solid transparent; border-radius: 999px; }
    :root[data-theme="dark"] .filters:hover::-webkit-scrollbar-thumb { background-color: rgb(255 255 255 / .32); }
  }
}
@media (scripting: enabled) and (max-width: 860px) {
  :root[data-theme="dark"] .filters.open { padding: 8px 12px env(safe-area-inset-bottom, 0px); background: #0b0b11; border: 0; border-radius: 0; box-shadow: none; }
  :root[data-theme="dark"] .filters.open .filters-done { background: rgb(11 11 17 / .94); border-top-color: rgb(255 255 255 / .08); }
}

/* Above the results */
:root[data-theme="dark"] .restitle { font-size: clamp(24px, 3.4vw, 34px); }
:root[data-theme="dark"] .reslead { color: #b8b8c0; }
:root[data-theme="dark"] .reshead h2 { font-weight: 800; text-transform: none; letter-spacing: -.01em; }
:root[data-theme="dark"] .reshead h2 span { color: var(--muted); font-weight: 600; }
:root[data-theme="dark"] .sort-select select { color: #ffffff; background-color: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-pill); }
:root[data-theme="dark"] .view-toggle { background: rgb(255 255 255 / .025); border-color: rgb(255 255 255 / .12); }
:root[data-theme="dark"] .view-toggle .iconbtn { color: #8a8a96; }
:root[data-theme="dark"] .view-toggle [aria-pressed="true"] { background: var(--red-grad); color: #ffffff; box-shadow: 0 2px 0 var(--red-edge); }
@media (hover: hover) {
  :root[data-theme="dark"] .view-toggle .iconbtn:hover { background: rgb(255 0 51 / .1); color: #ffffff; }
  :root[data-theme="dark"] .view-toggle [aria-pressed="true"]:hover { background: var(--red-grad); }
}
:root[data-theme="dark"] .chip { background: rgb(255 0 51 / .08); border: 1px solid rgb(255 0 51 / .38); color: #ffffff; }
@media (hover: hover) { :root[data-theme="dark"] .chip a:hover { background: rgb(255 0 51 / .25); } }
:root[data-theme="dark"] .reset { color: var(--red-light); }

/* Server cards: on hover they rise, the border lights up with a red gradient */
:root[data-theme="dark"] .card {
  --tone: var(--red-1);
  border-color: rgb(255 255 255 / .07);
  transition: transform .3s var(--ease-expo), border-color .25s ease, box-shadow .3s ease;
}
/* The hover border is the same on a similar server's card on the server page */
:root[data-theme="dark"] :is(.card, .sd-card)::after {
  content: ""; position: absolute; inset: 0; z-index: 1; padding: 1px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(140deg, var(--tone), transparent 40%, transparent 62%, color-mix(in srgb, var(--tone) 65%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity .25s ease;
}
:root[data-theme="dark"] .card.down { --card-bg: #0a0a0f; background: var(--card-bg); }
:root[data-theme="dark"] .card-art { transition: filter .3s ease, object-view-box .6s var(--ease-expo); object-view-box: inset(0); }
:root[data-theme="dark"] .card h3 a { transition: color .2s ease; }
/* Inside the card on hover only the picture moves: the icon and the number stay in place */
@media (hover: hover) {
  :root[data-theme="dark"] .card:hover { border-color: color-mix(in srgb, var(--tone) 40%, transparent); box-shadow: 0 18px 36px -18px rgb(0 0 0 / .9), 0 0 30px -12px color-mix(in srgb, var(--tone) 75%, transparent); }
  :root[data-theme="dark"] :is(.card:hover, .sd-grid > li:hover > .sd-card)::after { opacity: 1; }
  :root[data-theme="dark"] .card:not(.down):hover .card-art { filter: saturate(1.15) brightness(1.08); object-view-box: inset(3.5%); }
}
/* The lift is only on a wide screen: on a narrow one the hint is position: fixed, and shifting the card would shift the hint with it.
   The card's stretched link is lowered by the lift height and the border: otherwise, after the lift, the cursor at the bottom edge ends up below the card,
   the hover is lost, the card goes back down, and so on in a loop: the card jitters */
@media (hover: hover) and (min-width: 861px) {
  :root[data-theme="dark"] .card:hover { transform: translateY(-4px); }
  :root[data-theme="dark"] .card:hover h3 a::after { bottom: -5px; }
}
/* Cards and panels slide up from below when they are shown on scroll. The animation is tied to scroll and acts only until they appear,
   so it does not interfere with the lift on hover. No opacity: a card that is only partly visible would look blackened.
   Browsers without animation-timeline show everything at once */
@keyframes dark-scroll-rise { from { transform: translateY(24px) scale(.98); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :root[data-theme="dark"] :where(.card, .srv-head, .srv-section, .srv-status, .about-body, .empty, .form-panel, .contacts-panel, .comment-list li) {
      animation: dark-scroll-rise linear backwards; animation-timeline: view(); animation-range: entry 0% entry 50%;
    }
  }
}
@media (hover: hover) { :root[data-theme="dark"] .card h3 a:hover { color: color-mix(in srgb, var(--tone) 55%, #ffffff); } }

/* Rank in the results: «#1», «#2»… in the corner of the card, the first three are gold, silver and bronze.
   «Показать ещё» ("Show more") appends cards to the same list, so the count continues. The number is not read by a screen reader */
:root[data-theme="dark"] .list { counter-reset: dark-rank; }
:root[data-theme="dark"] .list > .card { counter-increment: dark-rank; }
:root[data-theme="dark"] .list > .card::before {
  content: "#" counter(dark-rank); content: "#" counter(dark-rank) / "";
  position: absolute; z-index: 3; top: -9px; left: -7px; min-width: 32px; padding: 2px 8px; text-align: center; pointer-events: none;
  font: 900 12px/1.4 var(--font-body); color: #ffffff; font-variant-numeric: tabular-nums;
  background: rgb(8 8 12 / .86); border: 1px solid rgb(255 255 255 / .16); border-radius: 9px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
:root[data-theme="dark"] .list > .card:nth-child(1)::before { color: #2a1a00; background: linear-gradient(135deg, #ffe7a3, #f5b400); border-color: transparent; box-shadow: 0 2px 0 #a87600, 0 6px 16px rgb(245 180 0 / .45); }
:root[data-theme="dark"] .list > .card:nth-child(2)::before { color: #1b2230; background: linear-gradient(135deg, #f8fafc, #b8c2cf); border-color: transparent; box-shadow: 0 2px 0 #7d8796, 0 6px 16px rgb(184 194 207 / .35); }
:root[data-theme="dark"] .list > .card:nth-child(3)::before { color: #2b1300; background: linear-gradient(135deg, #f9c49b, #c8742f); border-color: transparent; box-shadow: 0 2px 0 #8a4a17, 0 6px 16px rgb(200 116 47 / .4); }
/* In the «Сетка» ("Grid") and «Список» ("List") views the number is in the top right corner, inside the card, as in the tiles: there is only a picture there, and on the left the icon and the name. On a phone (up to 640 px) it stays in the top left corner */
@media (min-width: 640px) {
  :root[data-theme="dark"]:is([data-view="grid"], [data-view="list"]) .list > .card::before { top: 8px; right: 8px; left: auto; }
  /* In «Сетка» the name reaches the right edge, so there is room on its right for the number (up to «#100») */
  :root[data-theme="dark"][data-view="grid"] .list > .card h3 { padding-right: 48px; }
}
:root[data-theme="dark"] .slogan { color: #b8b8c0; }

/* Icons and tags: small capitals on a colored backing with a border of the same color */
:root[data-theme="dark"] :is(.badge, .tag) {
  padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
  font: 800 11.5px/1.5 var(--font-body); text-transform: uppercase; letter-spacing: .07em;
}
:root[data-theme="dark"] .badge { color: var(--badge-ink); background: var(--gold); box-shadow: 0 2px 0 #a87600, 0 6px 16px rgb(245 180 0 / .3); }
:root[data-theme="dark"] .badge.newbie { color: #4ade80; background: rgb(34 197 94 / .12); border-color: rgb(34 197 94 / .38); box-shadow: none; }
:root[data-theme="dark"] .badge.offb { color: #ff8099; background: rgb(255 0 51 / .12); border-color: rgb(255 0 51 / .38); box-shadow: none; }
:root[data-theme="dark"] .like-icon {
  fill: none; background: var(--live);
  -webkit-mask: url("../img/dark/icons/thumbs-up.svg") center / contain no-repeat; mask: url("../img/dark/icons/thumbs-up.svg") center / contain no-repeat;
}
:root[data-theme="dark"] .btn.primary .like-icon { background: currentColor; }
:root[data-theme="dark"] .badge.likes {
  gap: 5px; padding: 3px 2px; border: 0; background: none; box-shadow: none;
  font: 700 12.5px/1.5 var(--font-body); text-transform: none; letter-spacing: 0; color: #b8b8c0; font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .badge.likes .like-icon { width: 13px; height: 13px; }
:root[data-theme="dark"] .like-btn .like-num { color: #8a8a96; font-weight: 700; }
:root[data-theme="dark"] .like-count { font-weight: 700; color: #b8b8c0; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .tag {
  color: color-mix(in srgb, var(--tone) 70%, #ffffff); background: color-mix(in srgb, var(--tone) 14%, transparent); border-color: color-mix(in srgb, var(--tone) 38%, transparent);
  transition: transform .25s var(--ease-expo), background-color .2s ease, border-color .2s ease, color .2s ease;
}
:root[data-theme="dark"] .tag.hit { color: #ffffff; background: color-mix(in srgb, var(--tone) 34%, transparent); border-color: color-mix(in srgb, var(--tone) 70%, transparent); box-shadow: 0 0 14px -4px var(--tone); }
:root[data-theme="dark"] .card.down .tag { --tone: #9ca3af; }
/* The tag row in the card is clipped by height to hide the extra tags. Without a margin it would cut off the border of a tag raised by hover,
   and the bottom of the border (the tag is slightly taller than the row here). The row height is counted without the margin, so the next row of tags is still hidden */
:root[data-theme="dark"] .card .tags { box-sizing: content-box; padding-block: 4px; margin-block: -4px; }
:root[data-theme="dark"] .tag .tip summary:not(.tip-text) { color: #ffffff; background: color-mix(in srgb, var(--tone) 30%, transparent); box-shadow: none; }
@media (hover: hover) {
  :root[data-theme="dark"] .tag:has(> a:hover) { color: #ffffff; background: color-mix(in srgb, var(--tone) 26%, transparent); border-color: color-mix(in srgb, var(--tone) 60%, transparent); transform: translateY(-1px); }
  :root[data-theme="dark"] a.badge:hover { filter: brightness(1.15); }
}
:root[data-theme="dark"] .meta { color: var(--muted); }
:root[data-theme="dark"] mark { border-radius: 4px; }

/* Hints */
:root[data-theme="dark"] .tip summary:not(.tip-text) {
  font: 700 13px var(--font-body); color: var(--red-light);
  background: rgb(255 0 51 / .08); box-shadow: inset 0 0 0 1px rgb(255 0 51 / .3); transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
:root[data-theme="dark"] .tip[open] summary:not(.tip-text) { color: #ffffff; background: var(--red-1); box-shadow: 0 0 0 3px rgb(255 0 51 / .14), 0 6px 16px rgb(255 0 51 / .35); }
@media (hover: hover) { :root[data-theme="dark"] .tip:not([open]) summary:not(.tip-text):hover { background: rgb(255 0 51 / .16); box-shadow: inset 0 0 0 1px rgb(255 0 51 / .5); } }
:root[data-theme="dark"] .tip-text { text-decoration-color: rgb(255 255 255 / .25); }
:root[data-theme="dark"] .tip-body {
  background: rgb(15 15 22 / .98); color: #e8e8ec; border: 1px solid rgb(255 255 255 / .1); border-radius: 16px;
  box-shadow: var(--pop-shadow); animation: dark-pop .18s var(--ease-expo);
}
/* A hint inside a tag does not inherit its small capitals */
:root[data-theme="dark"] .tag .tip-body { font: 400 16px/1.6 var(--font-body); text-transform: none; letter-spacing: normal; }
@media (pointer: coarse) {
  :root[data-theme="dark"] .tip summary:not(.tip-text) { background: radial-gradient(circle, rgb(255 0 51 / .14) 12px, transparent 12.5px); box-shadow: none; }
  /* The open «?» is a red circle of the same size, not a red square over the whole press area on top of the tag text */
  :root[data-theme="dark"] .tip[open] summary:not(.tip-text) { color: #ffffff; background: radial-gradient(circle, var(--red-1) 12px, transparent 12.5px); box-shadow: none; }
}

/* Online: the green dot pulses, the fill strip is red with a glow */
:root[data-theme="dark"] .dot { position: relative; width: 7px; height: 7px; background: #6a6a78; box-shadow: none; }
:root[data-theme="dark"] :is(.online, .srv-status, .sd-live, .sd-stat)[data-state="online"] .dot { background: var(--live); box-shadow: 0 0 8px rgb(34 197 94 / .75); }
:root[data-theme="dark"] :is(.online, .srv-status, .sd-live, .sd-stat)[data-state="online"] .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--live); animation: dark-pulse 2.2s ease-out infinite;
}
:root[data-theme="dark"] :is(.online, .srv-status, .sd-live)[data-state="offline"] .dot { background: var(--red-1); box-shadow: 0 0 8px rgb(255 0 51 / .6); }
/* The player count is a dark badge with blur: a green pulsing dot, a bold number, the word in gray.
   The badge is drawn by ::before in the same grid cells as the dot and the number: there is no wrapper in the markup. It is first in the grid and is drawn under them,
   z-index is not needed: with a negative one it would go under the panel background. An empty element with align-items: center would shrink to zero, hence stretch */
:root[data-theme="dark"] .online { grid-template-columns: auto auto minmax(0, 1fr); gap: 8px 0; }
:root[data-theme="dark"] .online::before {
  content: ""; grid-area: 1 / 1 / 2 / 3; align-self: stretch; border-radius: var(--radius-pill);
  background: rgb(6 6 10 / .78); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 6px 16px -8px rgb(0 0 0 / .9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* The badge occupied the cells explicitly, so the dot and the number are placed explicitly too: otherwise auto-placement would skip the occupied cells */
:root[data-theme="dark"] .online .dot { grid-area: 1 / 1; margin: 0 7px 0 9px; }
:root[data-theme="dark"] .online > span:not(.dot) { grid-area: 1 / 2; }
:root[data-theme="dark"] .online > span:not(.dot), :root[data-theme="dark"] .card .online > span:not(.dot) { position: relative; padding: 4px 11px 4px 0; font-size: 12px; font-weight: 600; line-height: 1.35; color: #8a8a96; }
:root[data-theme="dark"] .online b, :root[data-theme="dark"] .card .online b { font: 800 13px/1.35 var(--font-body); letter-spacing: 0; color: #ffffff; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .online > span.state-text { color: #ffffff; font-weight: 700; }
/* The server's fill strip does not exist in this theme: the player count is shown only by the badge */
:root[data-theme="dark"] .xp { display: none; }

/* Address field */
:root[data-theme="dark"] .ip { background: rgb(255 255 255 / .04); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); border-radius: 10px; transition: background-color .2s ease, box-shadow .2s ease; }
:root[data-theme="dark"] .ip code { color: #e8e8ec; }
:root[data-theme="dark"] .card.down .ip { background: rgb(255 255 255 / .025); }
:root[data-theme="dark"] .ip .copy-icon { color: #8a8a96; }
@media (hover: hover) and (scripting: enabled) {
  :root[data-theme="dark"] .ip[data-copy-area]:hover { background: rgb(255 0 51 / .08); box-shadow: inset 0 0 0 1px rgb(255 0 51 / .45); }
  :root[data-theme="dark"] .ip[data-copy-area]:hover .copy-icon { color: var(--red-light); background: none; }
}
:root[data-theme="dark"] .ip[data-copy-area]:has(.done) { background: var(--done); box-shadow: inset 0 0 0 1px rgb(34 197 94 / .5); }
:root[data-theme="dark"] .plat-head { color: var(--muted); }
:root[data-theme="dark"] .plat-head.only { color: var(--badge-ink); background: var(--gold); font-weight: 700; }
:root[data-theme="dark"] .plat + .plat { border-color: rgb(255 255 255 / .07); }
:root[data-theme="dark"] .plat-down { color: #ff8099; }

/* The hint «Адрес скопирован» ("Address copied"), the empty result */
:root[data-theme="dark"] .joinhelp { background: #15151c; border: 1px solid rgb(255 0 51 / .25); box-shadow: 0 28px 60px -16px rgb(0 0 0 / .9), 0 0 30px rgb(255 0 51 / .12); }
:root[data-theme="dark"] .joinhelp h2 { font-size: 22px; }
:root[data-theme="dark"] .joinhelp-close { color: #8a8a96; transition: background-color .2s ease, color .2s ease, transform .3s var(--ease-back); }
@media (hover: hover) { :root[data-theme="dark"] .joinhelp-close:hover { background: rgb(255 0 51 / .12); color: #ffffff; transform: rotate(90deg); } }
:root[data-theme="dark"] .empty h1, :root[data-theme="dark"] .empty h3 { font-size: 22px; font-weight: 800; }

/* Steps: red tiles with a digit */
:root[data-theme="dark"] .steps li::before { font: 800 14px var(--font-body); color: #ffffff; background: var(--red-grad); border-radius: 9px; box-shadow: 0 3px 0 var(--red-edge), 0 8px 18px -10px var(--red-1); }

/* The footer as in the reference design (bloxg.com/games/best): a red glow at the top; the call to action is a dark block with red spots and a grid,
   a green badge above the heading; a panel with 28 px rounding, the groups have an icon on a red tile; the «Смотри также» ("See also") strip
   is slightly lighter, with gray tiles; at the bottom a badge with the player count, the copyright, documents as pills and a huge name that fades downwards */
:root[data-theme="dark"] .foot { position: relative; isolation: isolate; background: none; border-top: 0; color: var(--muted); }
:root[data-theme="dark"] .foot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 40% at 50% 0, rgb(255 0 51 / .12), transparent 70%); }
:root[data-theme="dark"] .foot .wrap { padding-block: clamp(48px, 7vw, 80px) calc(clamp(24px, 4vw, 40px) + env(safe-area-inset-bottom, 0px)); }
:root[data-theme="dark"] .foot a { color: #8a8a96; text-decoration: none; transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease; }

:root[data-theme="dark"] .foot-cta {
  position: relative; overflow: hidden; margin-bottom: clamp(16px, 2vw, 20px); padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 36px); gap: clamp(16px, 3vw, 40px);
  background: radial-gradient(120% 160% at 0 0, rgb(255 0 51 / .28), transparent 55%), radial-gradient(90% 140% at 100% 100%, rgb(255 0 51 / .14), transparent 60%), linear-gradient(rgb(24 24 32 / .96), rgb(14 14 20 / .96));
  border: 1px solid rgb(255 0 51 / .28); border-radius: 24px; box-shadow: 0 28px 60px -36px rgb(255 0 51 / .55);
}
:root[data-theme="dark"] .foot-cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px); background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(60% 120% at 100% 0, #000, transparent 70%); mask-image: radial-gradient(60% 120% at 100% 0, #000, transparent 70%);
}
:root[data-theme="dark"] :is(.foot-cta-copy, .foot-cta-actions) { position: relative; z-index: 1; }
:root[data-theme="dark"] .foot-cta-copy { gap: 0; }
:root[data-theme="dark"] .foot-cta-eyebrow { margin-bottom: 10px; padding: 4.5px 11px; font-size: 11.2px; font-weight: 800; letter-spacing: .08em; color: #4ade80; background: rgb(34 197 94 / .1); border: 1px solid rgb(34 197 94 / .3); }
:root[data-theme="dark"] .foot-cta-check { display: block; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("../img/dark/icons/shield-check.svg") center / contain no-repeat; mask: url("../img/dark/icons/shield-check.svg") center / contain no-repeat; }
:root[data-theme="dark"] .foot .foot-cta-title { margin-bottom: 6px; font-size: clamp(21.6px, 2.8vw, 32px); font-weight: 900; line-height: 1.05; letter-spacing: -.015em; text-transform: uppercase; color: #ffffff; }
:root[data-theme="dark"] .foot-cta-title span { color: var(--red-1); text-shadow: 0 0 30px rgb(255 0 51 / .45); }
:root[data-theme="dark"] .foot-cta-text { font-size: 15.2px; color: #c8c8d0; }
:root[data-theme="dark"] .foot .foot-cta-actions .btn { min-height: 48px; padding: 0 20.8px; font-size: 13.6px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; border-radius: 14px; }
:root[data-theme="dark"] .foot .foot-cta-actions .btn:not(.primary) { color: #ffffff; background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .14); box-shadow: none; }
:root[data-theme="dark"] .foot-arrow { display: block; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("../img/dark/icons/arrow-right.svg") center / contain no-repeat; mask: url("../img/dark/icons/arrow-right.svg") center / contain no-repeat; transition: transform .2s ease; }

:root[data-theme="dark"] .foot-panel {
  position: relative; overflow: hidden; padding: clamp(24px, 3.5vw, 44px) clamp(20px, 3.5vw, 44px) 0;
  background: radial-gradient(70% 50% at 0 0, rgb(255 0 51 / .08), transparent 60%), linear-gradient(rgb(20 20 28 / .96), rgb(10 10 15 / .98));
  border: 1px solid rgb(255 255 255 / .07); border-radius: 28px; box-shadow: inset 0 1px rgb(255 255 255 / .05);
}
:root[data-theme="dark"] .foot .foot-logo { gap: 10px; font-size: 24px; font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; color: #ffffff; }
:root[data-theme="dark"] .foot-brand { gap: 16px; }
:root[data-theme="dark"] .foot-about { font-size: 13.8px; color: #8a8a96; }
:root[data-theme="dark"] .foot-about strong { color: #ffffff; }
:root[data-theme="dark"] .foot .foot-about a { color: #e8e8ec; text-decoration: underline rgb(255 0 51 / .5); text-underline-offset: 3px; }
:root[data-theme="dark"] .foot .foot-mail { color: #e8e8ec; background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .1); border-radius: 12px; }
:root[data-theme="dark"] :is(.foot-contact p, .foot-note) { font-size: 12.8px; }

:root[data-theme="dark"] .foot-group, :root[data-theme="dark"] .foot-main > .foot-group:first-of-type { border-color: rgb(255 255 255 / .07); }
:root[data-theme="dark"] .foot-title { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; color: #ffffff; }
:root[data-theme="dark"] .foot-title label::after { border-color: #6b6b78; }
:root[data-theme="dark"] .foot-title-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; background: rgb(255 0 51 / .12); border: 1px solid rgb(255 0 51 / .28); border-radius: 8px; }
:root[data-theme="dark"] .foot-title-icon::before { content: ""; width: 15px; height: 15px; background: var(--red-light); -webkit-mask: var(--foot-icon) center / contain no-repeat; mask: var(--foot-icon) center / contain no-repeat; }
:root[data-theme="dark"] .foot-group[data-group="catalog"] { --foot-icon: url("../img/dark/icons/nav-servers.svg"); }
:root[data-theme="dark"] .foot-group[data-group="players"] { --foot-icon: url("../img/dark/icons/nav-help.svg"); }
:root[data-theme="dark"] .foot-group[data-group="owners"] { --foot-icon: url("../img/dark/icons/user.svg"); }
:root[data-theme="dark"] .foot-group[data-group="site"] { --foot-icon: url("../img/dark/icons/info.svg"); }
:root[data-theme="dark"] .foot-group[data-group="modes"] { --foot-icon: url("../img/dark/icons/minigames.svg"); }
:root[data-theme="dark"] .foot-links a { font-size: 14px; line-height: 1.4; }
:root[data-theme="dark"] .foot .foot-more a { color: var(--red-light); font-weight: 700; }

/* «Смотри также»: a strip across the full panel width, gray tiles, smaller links */
:root[data-theme="dark"] .foot-explore-label { font-size: 10.9px; font-weight: 800; letter-spacing: .16em; color: #8a8a96; }
:root[data-theme="dark"] .foot-explore .foot-title-icon { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .1); }
:root[data-theme="dark"] .foot-explore .foot-title-icon::before { background: #c8c8d0; }
:root[data-theme="dark"] .foot-explore .foot-links a { font-size: 13.1px; }

:root[data-theme="dark"] .foot-bottom { border-color: rgb(255 255 255 / .06); }
:root[data-theme="dark"] .foot-live { padding: 7.2px 14.4px; font-size: 13.1px; color: #c8c8d0; background: rgb(34 197 94 / .06); border-color: rgb(34 197 94 / .22); }
:root[data-theme="dark"] .foot-live b { color: #ffffff; }
:root[data-theme="dark"] .foot-live-dot { position: relative; width: 7px; height: 7px; background: var(--live); box-shadow: 0 0 8px rgb(34 197 94 / .75); }
:root[data-theme="dark"] .foot-live-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--live); animation: dark-pulse 2.2s ease-out infinite; }
:root[data-theme="dark"] .foot-copy { font-size: 12.8px; }
:root[data-theme="dark"] .foot .foot-legal a { font-size: 12.5px; border-color: rgb(255 255 255 / .08); }
/* CRAFTNOW is 5.5em wide here: it takes about 99% of the panel width at 360 px and 92% at 1280 px, the strip height cuts it at the same share of its height */
:root[data-theme="dark"] .foot-wordmark {
  display: block; height: clamp(32px, 10.65vw, 154px); margin: 8px calc(-1 * clamp(20px, 3.5vw, 44px)) 0; overflow: hidden;
  font: 900 clamp(49px, 16.2vw, 239px)/.78 var(--font-display); letter-spacing: -.045em; text-align: center; text-transform: uppercase; white-space: nowrap;
  color: transparent; background: linear-gradient(rgb(255 255 255 / .09), rgb(255 0 51 / .06) 55%, transparent 85%); -webkit-background-clip: text; background-clip: text;
  user-select: none; pointer-events: none;
}

/* Phone: the call-to-action buttons are full width one under another, the open list under the heading text, the bottom centered */
@media (max-width: 699px) {
  :root[data-theme="dark"] .foot-cta-actions { flex-direction: column; }
  :root[data-theme="dark"] .foot .foot-cta-actions .btn { width: 100%; }
  :root[data-theme="dark"] .foot-panel { border-radius: 22px; }
  :root[data-theme="dark"] .foot-links { padding-left: 36px; }
  :root[data-theme="dark"] .foot-explore { padding-top: 16px; }
}
@media (min-width: 700px) {
  :root[data-theme="dark"] .foot-title { margin-bottom: 14px; }
  :root[data-theme="dark"] .foot-links { gap: 2px; }
  :root[data-theme="dark"] .foot-explore {
    margin: 0 calc(-1 * clamp(20px, 3.5vw, 44px)); padding: clamp(24px, 3vw, 36px) clamp(20px, 3.5vw, 44px);
    background: rgb(255 255 255 / .02); border-top: 1px solid rgb(255 255 255 / .06); border-bottom: 1px solid rgb(255 255 255 / .06);
  }
  :root[data-theme="dark"] .foot-explore-label { margin-bottom: 17.6px; }
  :root[data-theme="dark"] .foot-main { padding-bottom: clamp(24px, 3vw, 36px); }
  :root[data-theme="dark"] .foot-bottom { margin-top: 0; padding-block: 20px; border-top: 0; }
}
@media (hover: hover) {
  :root[data-theme="dark"] .foot a:hover { color: #ffffff; text-decoration: none; }
  :root[data-theme="dark"] .foot .foot-about a:hover { color: #ffffff; text-decoration-color: var(--red-1); }
  :root[data-theme="dark"] .foot-logo:hover .logo { transform: translateY(-2px) rotate(-5deg); box-shadow: 0 6px 0 #cc0029, 0 0 60px rgb(255 0 51 / .6), 0 0 120px rgb(255 0 51 / .3); }
  :root[data-theme="dark"] .foot-links a:hover { transform: translateX(3px); }
  :root[data-theme="dark"] .foot .foot-more a:hover { color: #ff6b80; }
  :root[data-theme="dark"] .foot .foot-cta-actions .btn:not(.primary):hover { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .24); transform: translateY(-2px); box-shadow: none; }
  :root[data-theme="dark"] .foot .foot-cta-actions .btn.primary:hover .foot-arrow { transform: translateX(3px); }
  :root[data-theme="dark"] .foot .foot-mail:hover { background: rgb(255 0 51 / .12); border-color: rgb(255 0 51 / .55); transform: translateY(-2px); }
  :root[data-theme="dark"] .foot .foot-legal a:hover { border-color: rgb(255 255 255 / .2); }
}
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="dark"] .foot a:hover, :root[data-theme="dark"] .foot .foot-cta-actions .btn:hover .foot-arrow { transform: none; }
  :root[data-theme="dark"] .foot-live-dot::after { animation: none; }
}

/* The server page */
:root[data-theme="dark"] .crumbs a { color: var(--muted); font-weight: 500; }
@media (hover: hover) { :root[data-theme="dark"] .crumbs a:hover { color: var(--red-light); } }
:root[data-theme="dark"] .srv-head h1 { font-size: clamp(28px, 6vw, 44px); }
:root[data-theme="dark"] .srv-head h1 .badge { font-size: 12px; }
:root[data-theme="dark"] :is(.srv-section, .srv-status) h2 { font-size: 22px; }
/* «● Работает» ("● Working") as a badge, like the player count row in the reference design; the large number stays under it */
:root[data-theme="dark"] .bigstate { grid-template-columns: auto auto minmax(0, 1fr); gap: 12px 0; justify-items: start; }
:root[data-theme="dark"] .bigstate::before {
  content: ""; grid-area: 1 / 1 / 2 / 3; align-self: stretch; justify-self: stretch; border-radius: var(--radius-pill);
  background: rgb(255 255 255 / .045); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08);
}
:root[data-theme="dark"] .bigstate .dot { grid-area: 1 / 1; margin: 0 8px 0 13px; }
:root[data-theme="dark"] .bs-text > span:first-child { position: relative; grid-area: 1 / 2; padding: 6px 14px 6px 0; font-size: 13px; font-weight: 700; color: #ffffff; }
:root[data-theme="dark"] .bs-count { grid-column: 1 / -1; color: #8a8a96; font-weight: 600; }
:root[data-theme="dark"] .bs-count b { font-weight: 800; color: #ffffff; text-shadow: 0 0 30px rgb(255 0 51 / .35); }
:root[data-theme="dark"] .address code { background: rgb(255 255 255 / .04); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
:root[data-theme="dark"] .warn { background: rgb(255 214 0 / .08); color: #ffd600; box-shadow: inset 0 0 0 1px rgb(255 214 0 / .25); }
:root[data-theme="dark"] .report-ok { box-shadow: inset 0 0 0 1px rgb(34 197 94 / .4); }
:root[data-theme="dark"] .srv-about p { color: #b8b8c0; }
:root[data-theme="dark"] .bar { filter: drop-shadow(0 0 4px rgb(255 0 51 / .35)); }
:root[data-theme="dark"] .bar.down, :root[data-theme="dark"] .bar.sel { filter: none; }
:root[data-theme="dark"] .comment-list li { background: rgb(255 255 255 / .03); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .07); border-radius: 14px; }
:root[data-theme="dark"] .comment-list .comment-report { border-left: 3px solid var(--red-1); }

/* Expandable blocks as questions and answers: the red strip on the left grows on hover and when expanded */
:root[data-theme="dark"] :is(.form-details, .report) {
  position: relative; overflow: hidden; border: 1px solid rgb(255 255 255 / .07); border-radius: 16px;
  background: linear-gradient(rgb(28 28 38 / .9), rgb(18 18 26 / .9));
  transition: border-color .35s var(--ease-expo), box-shadow .35s var(--ease-expo);
}
:root[data-theme="dark"] :is(.form-details, .report)::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; transform: scaleY(0); transform-origin: top;
  background: linear-gradient(var(--red-1), rgb(255 0 51 / .3)); transition: transform .4s var(--ease-expo);
}
:root[data-theme="dark"] :is(.form-details, .report):hover { border-color: rgb(255 0 51 / .3); }
:root[data-theme="dark"] :is(.form-details, .report):hover::before { transform: scaleY(.5); }
:root[data-theme="dark"] :is(.form-details, .report)[open] { border-color: rgb(255 0 51 / .45); box-shadow: 0 14px 40px rgb(0 0 0 / .35), 0 0 30px rgb(255 0 51 / .1); }
:root[data-theme="dark"] :is(.form-details, .report)[open]::before { transform: scaleY(1); }
:root[data-theme="dark"] .report summary { padding: 0 16px; }
/* Under the heading a guest gets a form, and a signed-in user gets the reasons straight away (the form is around details): the padding of both is the same */
:root[data-theme="dark"] .report > :not(summary) { margin-top: 8px; padding: 0 16px 16px; }
/* A guest's report block is no wider than the signed-in user's comment form */
:root[data-theme="dark"] .comments > .report { max-width: 640px; }
:root[data-theme="dark"] .report summary::after, :root[data-theme="dark"] .report[open] summary::after { color: var(--red-light); }

/* Input fields on all pages */
:root[data-theme="dark"] :is(.comment-form textarea, :is(.form-panel, .mod-edit) input:not([type="radio"], [type="checkbox"], [type="hidden"]), :is(.form-panel, .mod-edit) textarea) {
  color: #ffffff; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-md);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] :is(.comment-form textarea, :is(.form-panel, .mod-edit) input, :is(.form-panel, .mod-edit) textarea):focus { outline: none; background: rgb(255 255 255 / .06); border-color: rgb(255 0 51 / .55); box-shadow: 0 0 0 3px rgb(255 0 51 / .16); }
:root[data-theme="dark"] .form-panel code { background: rgb(255 255 255 / .06); }
:root[data-theme="dark"] .form-panel h1 { font-size: clamp(28px, 6vw, 40px); }
:root[data-theme="dark"] .form-endpoint { border-color: rgb(255 255 255 / .1); border-radius: 16px; }
:root[data-theme="dark"] .form-errors { box-shadow: inset 0 0 0 1px rgb(255 0 51 / .4); }
:root[data-theme="dark"] .form-ok { box-shadow: inset 0 0 0 1px rgb(34 197 94 / .4); }

/* Help and the text about the catalog */
:root[data-theme="dark"] .help-page h1 { font-size: clamp(32px, 7vw, 56px); }
:root[data-theme="dark"] .glossary dd, :root[data-theme="dark"] .about-body p { color: #b8b8c0; }
:root[data-theme="dark"] .about-body h3 { font-weight: 800; }

/* Contacts: dark cards, like the community buttons on the server page, the service tile glows in its color, the email tile is red.
   On hover the border, shadow and highlight in the service color (red for email), the card rises slightly, the tile tilts.
   The «Скоро» ("Soon") placeholder is transparent, with a dashed border and no glow */
:root[data-theme="dark"] .contacts-panel h1 { font-size: clamp(28px, 6vw, 40px); }
:root[data-theme="dark"] .contact[data-link="mail"] { --link-tone: var(--red-1); --link-tile: var(--red-grad); }
:root[data-theme="dark"] .contact {
  min-height: 76px; padding: 14px 18px 14px 14px; background: rgb(8 8 12 / .55); border-color: rgb(255 255 255 / .1); border-radius: 16px;
  transition: transform .2s var(--ease-back), box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
:root[data-theme="dark"] .contact-ico { width: 46px; height: 46px; border-radius: 13px; background-size: 27px, auto; box-shadow: 0 0 18px -4px var(--link-tone); transition: transform .2s var(--ease-back); }
:root[data-theme="dark"] .contact-name { font-weight: 800; color: #ffffff; }
:root[data-theme="dark"] .contact-value { color: #9a9aa6; transition: color .2s ease; }
:root[data-theme="dark"] .contact.soon { cursor: inherit; background: transparent; border-color: rgb(255 255 255 / .1); }
:root[data-theme="dark"] .contact.soon .contact-ico { box-shadow: none; }
:root[data-theme="dark"] .contact.soon .contact-name { color: #a0a0ac; }
:root[data-theme="dark"] .contact.soon .contact-value { color: var(--muted); }
:root[data-theme="dark"] a.contact:focus-visible { border-color: color-mix(in srgb, var(--link-tone) 60%, transparent); }
@media (hover: hover) {
  :root[data-theme="dark"] a.contact:hover {
    background: color-mix(in srgb, var(--link-tone) 12%, rgb(8 8 12 / .55)); border-color: color-mix(in srgb, var(--link-tone) 60%, transparent); transform: translateY(-2px);
    box-shadow: 0 5px 0 color-mix(in srgb, var(--link-tone) 28%, transparent), 0 12px 28px -12px color-mix(in srgb, var(--link-tone) 60%, transparent);
  }
  :root[data-theme="dark"] a.contact:hover .contact-ico { transform: scale(1.08) rotate(-4deg); }
  :root[data-theme="dark"] a.contact:hover .contact-value { color: #c8c8d0; }
}
:root[data-theme="dark"] a.contact:active { transform: translateY(1px); box-shadow: 0 1px 0 color-mix(in srgb, var(--link-tone) 28%, transparent); }
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="dark"] a.contact:is(:hover, :active), :root[data-theme="dark"] a.contact:hover .contact-ico { transform: none; }
}

/* The color and icon of each mode, platform and mark: the filter row, the tag on a card and the similar server card take them */
:root[data-theme="dark"] :is(.optrow, .tag) { --tone: var(--red-1); }
:root[data-theme="dark"] .tag { --tone: #9ca3af; }
:root[data-theme="dark"] .optrow:has(> [data-key="Platform-java"]) { --tone: #fb923c; --icon: url("../img/dark/icons/java.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Platform-bedrock"]) { --tone: #34d399; --icon: url("../img/dark/icons/bedrock.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-anarchy"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="anarchy"] { --tone: #ff3355; --icon: url("../img/dark/icons/anarchy.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-survival"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="survival"] { --tone: #10b981; --icon: url("../img/dark/icons/survival.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-bedwars"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="bedwars"] { --tone: #f472b6; --icon: url("../img/dark/icons/bedwars.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-skywars"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="skywars"] { --tone: #22d3ee; --icon: url("../img/dark/icons/skywars.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-skyblock"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="skyblock"] { --tone: #818cf8; --icon: url("../img/dark/icons/skyblock.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-pvp"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="pvp"] { --tone: #f97316; --icon: url("../img/dark/icons/pvp.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-grief"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="grief"] { --tone: #a855f7; --icon: url("../img/dark/icons/grief.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-vanilla"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="vanilla"] { --tone: #cbd5e1; --icon: url("../img/dark/icons/vanilla.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-minigames"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="minigames"] { --tone: #facc15; --icon: url("../img/dark/icons/minigames.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-clans"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="clans"] { --tone: #3b82f6; --icon: url("../img/dark/icons/clans.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Mode-economy"]), :root[data-theme="dark"] :is(.tag, .sd-card)[data-mode="economy"] { --tone: #a3e635; --icon: url("../img/dark/icons/economy.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Access-license"]) { --tone: #60a5fa; --icon: url("../img/dark/icons/license.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Access-pirate"]) { --tone: #94a3b8; --icon: url("../img/dark/icons/pirate.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Flag-newbie"]) { --tone: #22c55e; --icon: url("../img/dark/icons/newbie.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Flag-unchecked"]) { --tone: #f59e0b; --icon: url("../img/dark/icons/unchecked.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Flag-reported"]) { --tone: #fb7185; --icon: url("../img/dark/icons/reported.svg"); }
:root[data-theme="dark"] .optrow:has(> [data-key="Flag-hidden"]) { --tone: #a1a1aa; --icon: url("../img/dark/icons/hidden.svg"); }

/* A card takes the color of its first mode: its border and shadow glow with it on hover. A switched-off server stays red by default */
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="anarchy"]) { --tone: #ff3355; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="survival"]) { --tone: #10b981; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="bedwars"]) { --tone: #f472b6; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="skywars"]) { --tone: #22d3ee; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="skyblock"]) { --tone: #818cf8; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="pvp"]) { --tone: #f97316; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="grief"]) { --tone: #a855f7; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="vanilla"]) { --tone: #cbd5e1; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="minigames"]) { --tone: #facc15; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="clans"]) { --tone: #3b82f6; }
:root[data-theme="dark"] .card:not(.down):has(.tags > span.tag:first-of-type[data-mode="economy"]) { --tone: #a3e635; }

/* Tiles: the rank in the results lies inside the picture, the player count badge is drawn by ::before, as in the other views */
@media (min-width: 640px) {
  :root[data-theme="dark"][data-view="tiles"] .list > .card::before { top: 8px; left: 8px; }
  :root[data-theme="dark"][data-view="tiles"] .card .online { margin: 0 0 10px -4px; padding: 0; background: none; box-shadow: none; gap: 0; }
  :root[data-theme="dark"][data-view="tiles"] .card h3 { font-size: 15px; }
  :root[data-theme="dark"][data-view="tiles"] .card .slogan { color: #8a8a96; font-size: 13.5px; }
  :root[data-theme="dark"][data-view="tiles"] .card .card-art { border-bottom: 1px solid rgb(255 255 255 / .06); }
}

/* ===== The server page (Pages/Shared/_ServerDark.cshtml) =====
   Repeats the game page of the reference design: the catalog filter column on the left, on the right a header with a blurred picture, tiles with numbers,
   a description next to the chart, steps as cards, a row of similar servers, questions and comments.
   The layout inside depends on the width of the column itself (container), not the window: next to the filters it is narrower */
:root[data-theme="dark"] .sd { container-type: inline-size; min-width: 0; }
:root[data-theme="dark"] .sd .hl { color: var(--red-1); text-shadow: 0 0 30px rgb(255 0 51 / .6); }

/* In the markup the filter column comes after the page (from the keyboard first the address and the buttons), on screen it is on the left */
@media (min-width: 861px) {
  :root[data-theme="dark"] .sd-layout > .filters { grid-area: 1 / 1; }
  :root[data-theme="dark"] .sd-layout > .sd { grid-area: 1 / 2; }
}

/* The search above the filters: it sends to the catalog. "/" puts the cursor in it, and so does a press anywhere in the field */
:root[data-theme="dark"] .sd-side-top { display: flex; align-items: center; gap: 8px; margin: 8px 6px 4px 0; }
:root[data-theme="dark"] .sd-search-form { flex: 1; min-width: 0; margin: 0; }
:root[data-theme="dark"] .sd-search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 12px; cursor: text;
  color: var(--muted); background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .09); border-radius: 13px;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
:root[data-theme="dark"] .sd-search:focus-within { color: #ffffff; background: rgb(255 255 255 / .07); border-color: rgb(255 0 51 / .55); box-shadow: 0 0 0 3px rgb(255 0 51 / .16); }
:root[data-theme="dark"] .sd-search-ico { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
:root[data-theme="dark"] .sd-search input { flex: 1; min-width: 0; height: 100%; padding: 0; color: #ffffff; font: 400 16px var(--font-body); background: none; border: 0; outline: none; }
:root[data-theme="dark"] .sd-search input::placeholder { color: var(--muted); }
:root[data-theme="dark"] .sd-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
:root[data-theme="dark"] .sd-search kbd {
  padding: 2px 7px; color: var(--muted); font: 700 11.2px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid rgb(255 255 255 / .14); border-bottom-width: 2px; border-radius: 6px;
}
:root[data-theme="dark"] .sd-search:focus-within kbd { visibility: hidden; }
@media (hover: none) { :root[data-theme="dark"] .sd-search kbd { display: none; } }
:root[data-theme="dark"] .filters-close { display: none; }

/* Up to 1099 px, as in the reference design, there is no filter column: it is opened by «Фильтры» ("Filters") in the search strip that sticks under the header.
   The open column is a panel on the left over a dimmed backdrop; it is closed by the cross, a press outside and Escape (Scripts/panels.ts).
   Without the script the column stays in place: on a phone under the page, on wider screens on the left */
@keyframes sd-drawer { from { transform: translateX(-104%); } }
:root[data-theme="dark"] .sd-bar { display: none; }
@media (scripting: enabled) and (max-width: 1099px) {
  :root[data-theme="dark"]:has(.sd-bar) { scroll-padding-top: 152px; }
  :root[data-theme="dark"] .sd-layout { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme="dark"] .sd-layout > .sd { grid-area: auto; }
  :root[data-theme="dark"] .sd-layout > .filters { display: none; }
  :root[data-theme="dark"] .sd-layout > .filters.open {
    display: block; position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(320px, 86vw); max-height: none;
    overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px env(safe-area-inset-bottom, 0px);
    background: radial-gradient(140% 60% at 0 0, rgb(255 0 51 / .1), transparent 60%), linear-gradient(rgb(22 22 31 / .98), rgb(11 11 17 / .99));
    border: 1px solid rgb(255 255 255 / .075); border-left: 0; border-radius: 0 22px 22px 0; box-shadow: 24px 0 60px rgb(0 0 0 / .5);
    animation: sd-drawer .3s var(--ease-expo);
  }
  :root[data-theme="dark"] .sd-layout:has(> .filters.open)::before {
    content: ""; position: fixed; z-index: 29; inset: 0; background: rgb(0 0 0 / .62);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: dark-fade .25s ease;
  }
  :root[data-theme="dark"] .sd-layout > .filters.open .sd-side-top { margin: 6px 0 4px; }
  :root[data-theme="dark"] .sd-layout > .filters.open .filters-close {
    display: grid; place-items: center; flex: none; width: 42px; height: 42px; color: #ffffff;
    background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .1); border-radius: 12px;
  }
  :root[data-theme="dark"] .filters-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  :root[data-theme="dark"] .sd-layout > .filters.open .filters-done { display: block; position: sticky; z-index: 2; bottom: 0; padding: 12px 0; background: rgb(11 11 17 / .94); border-top: 1px solid rgb(255 255 255 / .08); }
  :root[data-theme="dark"] .sd-layout > .filters.open .filters-done .btn { width: 100%; min-height: 52px; }

  :root[data-theme="dark"] .sd-bar {
    position: sticky; top: 76px; z-index: 20; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 7px;
    background: rgb(12 12 18 / .86); border: 1px solid rgb(255 255 255 / .08); border-radius: 16px; box-shadow: 0 14px 30px -20px rgb(0 0 0 / .9);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  :root[data-theme="dark"] .sd-bar #mobfilters { display: inline-flex; }
  :root[data-theme="dark"] .sd-bar .btn { flex: none; min-height: 42px; height: 42px; padding: 0 14px; gap: 7px; border-radius: 12px; font-size: 13px; font-weight: 800; letter-spacing: .04em; box-shadow: 0 3px 0 0 var(--red-edge); }
  :root[data-theme="dark"] .sd-bar .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
}
@media (pointer: coarse) { :root[data-theme="dark"] .sd-bar .btn { height: 44px; min-height: 44px; } }

/* The header: a panel with the blurred server picture behind it and a grid; on the left a 16:9 picture, on the right the name, online, tags and buttons.
   The panel itself clips nothing so that the «?» hint on a tag goes past its edge; the blurred picture is clipped by its .sd-hero-glow frame.
   Without its own picture (.no-art) there is neither it nor the blurred background: the panel with the grid and full-width text remain */
:root[data-theme="dark"] .sd-hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 48px);
  padding: clamp(20px, 2.6vw, 32px); background: #0b0b11; border: 1px solid rgb(255 255 255 / .08); border-radius: 24px;
}
:root[data-theme="dark"] .sd-hero.no-art { grid-template-columns: minmax(0, 1fr); }
/* Below the site header and the search strip, but above the blocks under it */
:root[data-theme="dark"] .sd-hero:has(.tip[open]) { z-index: 19; }
:root[data-theme="dark"] .sd-hero-bg {
  position: absolute; z-index: -2; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); max-width: none;
  object-fit: cover; filter: blur(48px) saturate(1.5); opacity: .42; pointer-events: none;
}
:root[data-theme="dark"] .sd-hero-glow { position: absolute; z-index: -2; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
:root[data-theme="dark"] .sd-hero::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(90deg, rgb(8 8 12 / .25), rgb(8 8 12 / .8)),
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px;
}
:root[data-theme="dark"] .sd-hero-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgb(255 255 255 / .12); border-radius: clamp(14px, 2vw, 20px);
  background: linear-gradient(135deg, rgb(255 0 51 / .14), rgb(14 14 20 / .96));
  box-shadow: 0 30px 60px -32px rgb(255 0 51 / .45), 0 22px 44px -22px rgb(0 0 0 / .85);
}
:root[data-theme="dark"] .sd-hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="dark"] .sd-hero.down .sd-hero-media img { filter: grayscale(1); opacity: .45; }
:root[data-theme="dark"] .sd-hero.down .sd-hero-bg { filter: blur(48px) grayscale(1); opacity: .25; }
:root[data-theme="dark"] .sd-hero-info { min-width: 0; }

:root[data-theme="dark"] .sd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 13px; font-weight: 500; }
:root[data-theme="dark"] .sd-crumbs a { color: #9a9aa6; text-decoration: none; }
@media (hover: hover) { :root[data-theme="dark"] .sd-crumbs a:hover { color: var(--red-light); } }
:root[data-theme="dark"] .sd-crumbs > span[aria-hidden] { color: #4a4a58; }
/* The name is not clipped: a long one goes to its own line and wraps */
:root[data-theme="dark"] .sd-crumbs > [aria-current] { min-width: 0; color: #e8e8ec; overflow-wrap: anywhere; }

:root[data-theme="dark"] .sd-title { display: flex; align-items: center; gap: clamp(12px, 2vw, 16px); }
:root[data-theme="dark"] .sd-icon {
  flex: none; width: clamp(52px, 7vw, 68px); height: clamp(52px, 7vw, 68px); overflow: hidden;
  background: #18181f; border: 1px solid rgb(255 255 255 / .12); border-radius: clamp(13px, 1.8vw, 17px); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .9);
}
:root[data-theme="dark"] .sd-icon :is(img, svg) { display: block; width: 100%; height: 100%; border-radius: 0; image-rendering: pixelated; shape-rendering: crispEdges; }
/* The name size is computed from the page column width (cqi) and the length of the longest word (data-len, 8–18 letters):
   the word fits entirely on the line next to the icon. The shortest words are up to 54 px, as in the reference design */
:root[data-theme="dark"] .sd-hero h1 { margin: 0; font-size: clamp(26px, 5.1cqi, 54px); font-weight: 900; line-height: 1.02; overflow-wrap: anywhere; }
:root[data-theme="dark"] .sd-hero h1[data-len="9"] { font-size: clamp(22px, 4.56cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="10"] { font-size: clamp(22px, 4.1cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="11"] { font-size: clamp(22px, 3.73cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="12"] { font-size: clamp(22px, 3.42cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="13"] { font-size: clamp(22px, 3.15cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="14"] { font-size: clamp(22px, 2.93cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="15"] { font-size: clamp(22px, 2.73cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="16"] { font-size: clamp(22px, 2.56cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="17"] { font-size: clamp(22px, 2.41cqi, 54px); }
:root[data-theme="dark"] .sd-hero h1[data-len="18"] { font-size: clamp(22px, 2.28cqi, 54px); }
:root[data-theme="dark"] .sd-by { margin: 12px 0 0; color: #b8b8c0; font-size: 16px; }

/* «● 1 082 игрока сейчас» ("● 1,082 players now") large, next to it in gray when it was checked. The dot is shared with the online badge */
:root[data-theme="dark"] .sd-live { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 16px 0 0; color: #e8e8ec; font-size: clamp(16px, 2vw, 19px); }
:root[data-theme="dark"] .sd-live b { color: #ffffff; font-weight: 900; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .sd-live .dot { width: 10px; height: 10px; }
:root[data-theme="dark"] .sd-updated { color: var(--muted); font-size: 13px; }

:root[data-theme="dark"] .sd-chips { margin-top: 16px; }
:root[data-theme="dark"] .sd-hero .tabs { margin-top: 16px; }
:root[data-theme="dark"] .sd-address { display: grid; gap: 6px; margin-top: 18px; max-width: 480px; }
:root[data-theme="dark"] .sd-address-label { justify-self: start; font: 800 11px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: #9a9aa6; }
:root[data-theme="dark"] .sd-address-label.only { padding: 2px 10px; color: var(--badge-ink); background: var(--gold); border-radius: var(--radius-pill); letter-spacing: .04em; }
:root[data-theme="dark"] .sd-address .ip { margin: 0; background: rgb(8 8 12 / .55); }
:root[data-theme="dark"] .sd-address .ip code { padding: 12px 14px; font-size: 16px; }
:root[data-theme="dark"] .sd-hero .warn { margin-top: 10px; max-width: 480px; }
:root[data-theme="dark"] .sd-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 3vw, 26px); }
:root[data-theme="dark"] .sd-actions .btn { min-height: 54px; padding: 16px 32px; font-size: 15px; }
:root[data-theme="dark"] .sd-meta { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 480px) {
  :root[data-theme="dark"] .sd-actions { flex-direction: column; align-items: stretch; }
  :root[data-theme="dark"] .sd-actions .btn { padding-inline: 18px; font-size: 14px; }
}
/* The server community: a label like the address's, dark buttons with a service color tile, like the filter rows.
   On hover the border, shadow and highlight are in the service color, not red. Buttons two per row of equal width, as wide as the address field */
:root[data-theme="dark"] .sd-hero .srv-links { gap: 8px; margin-top: clamp(18px, 2.6vw, 24px); }
:root[data-theme="dark"] .srv-links-label { font: 800 11px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: #9a9aa6; }
:root[data-theme="dark"] .srv-links ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 480px; }
:root[data-theme="dark"] .srv-links li { display: grid; min-width: 0; }
:root[data-theme="dark"] .srv-link { min-height: 48px; padding: 7px 14px 7px 7px; font-size: 13px; background: rgb(8 8 12 / .55); }
@media (max-width: 359px) { :root[data-theme="dark"] .srv-links ul { grid-template-columns: minmax(0, 1fr); } }
:root[data-theme="dark"] .srv-link-ico { width: 32px; height: 32px; border-radius: 10px; background-size: 21px, auto; box-shadow: 0 0 16px -4px var(--link-tone); transition: transform .2s var(--ease-back); }
@media (hover: hover) {
  :root[data-theme="dark"] .srv-links .srv-link:hover {
    background: color-mix(in srgb, var(--link-tone) 12%, rgb(8 8 12 / .55)); border-color: color-mix(in srgb, var(--link-tone) 60%, transparent);
    box-shadow: 0 5px 0 color-mix(in srgb, var(--link-tone) 28%, transparent), 0 12px 28px -12px color-mix(in srgb, var(--link-tone) 60%, transparent);
  }
  :root[data-theme="dark"] .srv-link:hover .srv-link-ico { transform: scale(1.08) rotate(-4deg); }
}
:root[data-theme="dark"] .srv-links .srv-link:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--link-tone) 28%, transparent); }

/* Number tiles: four per row, «Играют сейчас» ("Playing now") has a green tint. A thin colored line along the top edge */
:root[data-theme="dark"] .sd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(9px, 1.5vw, 14px); margin: clamp(14px, 1.6vw, 18px) 0 0; }
:root[data-theme="dark"] .sd-stat {
  position: relative; overflow: hidden; min-width: 0; padding: clamp(14px, 2.4vw, 18px) clamp(14px, 2.4vw, 19px);
  background: linear-gradient(180deg, rgb(255 0 51 / .06), rgb(255 255 255 / .012) 55%), #0a0a0f;
  border: 1px solid rgb(255 255 255 / .07); border-radius: 16px;
}
:root[data-theme="dark"] .sd-stat::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 1px; background: linear-gradient(90deg, transparent, rgb(255 0 51 / .75), transparent); }
:root[data-theme="dark"] .sd-stat.live { background: linear-gradient(180deg, rgb(34 197 94 / .08), rgb(255 255 255 / .012) 55%), #0a0a0f; border-color: rgb(34 197 94 / .28); }
:root[data-theme="dark"] .sd-stat.live::before { background: linear-gradient(90deg, transparent, rgb(34 197 94 / .8), transparent); }
:root[data-theme="dark"] .sd-stat dt { font: 800 11px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
:root[data-theme="dark"] .sd-stat dd { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 0; }
:root[data-theme="dark"] .sd-value {
  display: inline-flex; align-items: center; gap: 8px; color: #ffffff; overflow-wrap: anywhere;
  font: 900 clamp(21px, 3vw, 30px)/1.1 var(--font-body); letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .sd-value.small { font-size: clamp(17px, 2.2vw, 21px); letter-spacing: -.01em; }
:root[data-theme="dark"] .sd-value .dot { width: 7px; height: 7px; flex: none; }
:root[data-theme="dark"] .sd-note { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* The description and the chart side by side, of the same height. Panels as in the reference design: almost black, the border slightly lighter than the background */
:root[data-theme="dark"] .sd-about { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(14px, 2.5vw, 24px); margin-top: clamp(28px, 4vw, 40px); }
:root[data-theme="dark"] :is(.sd-panel, .sd .srv-section) {
  min-width: 0; padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, rgb(255 255 255 / .035), rgb(255 255 255 / .012) 60%), #0a0a0f;
  border: 1px solid rgb(255 255 255 / .07); border-radius: 18px; box-shadow: none;
}
:root[data-theme="dark"] .sd-panel h2 { margin: 0 0 16px; font-size: clamp(22px, 3vw, 30px); overflow-wrap: anywhere; }
:root[data-theme="dark"] .sd .srv-section h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); overflow-wrap: anywhere; }
:root[data-theme="dark"] .sd-panel p { margin: 0 0 14px; color: #b8b8c0; font-size: clamp(15.5px, 1.3vw, 16.8px); line-height: 1.7; }
:root[data-theme="dark"] .sd-panel .desc-list { margin: 0 0 14px; padding-left: 20px; gap: 6px; color: #b8b8c0; font-size: clamp(15.5px, 1.3vw, 16.8px); line-height: 1.7; }
:root[data-theme="dark"] .sd-desc .sd-panel > :last-child { margin-bottom: 0; }
:root[data-theme="dark"] .sd-quote { margin: 20px 0 0; padding: 15px 18px; background: rgb(255 255 255 / .024); border-left: 3px solid var(--red-1); border-radius: 0 14px 14px 0; }
:root[data-theme="dark"] .sd-quote .about-modes { padding-left: 18px; color: #b8b8c0; font-size: 15.2px; line-height: 1.65; }
:root[data-theme="dark"] .sd-quote cite { display: block; margin-top: 9px; font: 800 11px/1.4 var(--font-body); font-style: normal; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
:root[data-theme="dark"] .sd-addresses { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / .07); }
:root[data-theme="dark"] .sd-addresses p { margin: 0; font-size: 14.5px; line-height: 1.6; }
:root[data-theme="dark"] :is(.sd-addresses, .sd-faq) code { padding: 1px 6px; font: 500 14px var(--font-mono); color: #ffffff; background: rgb(255 255 255 / .06); border-radius: 6px; overflow-wrap: anywhere; }
:root[data-theme="dark"] .sd .chart { --chart-h: 220px; }
:root[data-theme="dark"] .sd .chart h2 { font-size: clamp(20px, 2.4vw, 24px); }
:root[data-theme="dark"] .sd .chart .ranges .btn { min-height: 34px; padding: 4px 12px; font-size: 12.8px; }

/* Sections below the header: a large heading on the left, questions and comments have a column no wider than 880 px */
:root[data-theme="dark"] .sd-band { padding-top: clamp(28px, 3.5vw, 42px); }
:root[data-theme="dark"] .sd-narrow { max-width: 880px; }
:root[data-theme="dark"] .sd-head h2 { margin: 0 0 16px; font-size: clamp(25px, 4.4vw, 42px); }
:root[data-theme="dark"] .sd-head p { max-width: 640px; margin: 0 0 clamp(20px, 3vw, 32px); color: var(--muted); font-size: clamp(16px, 1.6vw, 18.4px); }

/* The «Как зайти» ("How to join") steps are cards: a tile with a number, «Шаг N» ("Step N") in small capitals, the step text. They are not links, so they do not respond to hover */
:root[data-theme="dark"] .sd .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(12px, 2vw, 20px); }
:root[data-theme="dark"] .sd .steps li {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; min-height: 0;
  padding: clamp(18px, 3vw, 26px); color: #ffffff; font: 700 clamp(16px, 1.6vw, 18px)/1.3 var(--font-body);
  background: linear-gradient(180deg, rgb(255 255 255 / .04), rgb(255 255 255 / .012) 60%), #0a0a0f;
  border: 1px solid rgb(255 255 255 / .07); border-radius: 18px;
}
:root[data-theme="dark"] .sd .steps li::before {
  position: static; order: -2; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 0 16px;
  font: 800 18px var(--font-body); color: var(--red-light); background: rgb(255 0 51 / .1); border: 1px solid rgb(255 0 51 / .28); border-radius: 13px; box-shadow: none;
}
:root[data-theme="dark"] .sd .steps li::after {
  content: "Шаг " counter(step); content: "Шаг " counter(step) / ""; order: -1; margin-bottom: 6px;
  font: 700 11.2px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
:root[data-theme="dark"] .sd .steps + .note { margin-top: 12px; }

/* A wide link to the glossary: an icon tile, a label, a red circle with an arrow */
:root[data-theme="dark"] .sd-wide {
  display: flex; align-items: center; gap: 16px; margin-top: clamp(14px, 2vw, 18px); padding: clamp(16px, 2.5vw, 20px) clamp(16px, 2.5vw, 22px);
  color: inherit; text-decoration: none; border: 1px solid rgb(255 0 51 / .4); border-radius: 18px;
  background: radial-gradient(90% 180% at 0% 50%, rgb(255 0 51 / .18), transparent 70%), #0a0a0f;
  transition: transform .35s var(--ease-expo), box-shadow .35s ease, border-color .25s ease;
}
:root[data-theme="dark"] .sd-wide-icon {
  position: relative; flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #ff3355, #b30024); box-shadow: 0 3px 0 0 #80001a, 0 12px 24px -12px var(--red-1);
}
:root[data-theme="dark"] .sd-wide-icon::after {
  content: ""; position: absolute; inset: 13px; background: #ffffff;
  -webkit-mask: url("../img/dark/icons/nav-help.svg") center / contain no-repeat; mask: url("../img/dark/icons/nav-help.svg") center / contain no-repeat;
}
:root[data-theme="dark"] .sd-wide-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
:root[data-theme="dark"] .sd-wide-copy strong { color: #ffffff; font-size: clamp(16px, 2vw, 18.4px); }
:root[data-theme="dark"] .sd-wide-copy span { color: var(--muted); font-size: 14px; }
:root[data-theme="dark"] .sd-wide-go {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: #ffffff;
  background: var(--red-grad); box-shadow: 0 3px 0 0 var(--red-edge), 0 6px 18px rgb(255 0 51 / .35); transition: transform .3s var(--ease-back);
}
:root[data-theme="dark"] .sd-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  :root[data-theme="dark"] .sd-wide:hover { border-color: rgb(255 0 51 / .65); box-shadow: 0 22px 44px -22px rgb(0 0 0 / .85); transform: translateY(-2px); }
  :root[data-theme="dark"] .sd-wide:hover .sd-wide-go { transform: translateX(3px); }
}
@media (max-width: 600px) {
  :root[data-theme="dark"] .sd-wide { align-items: flex-start; }
  :root[data-theme="dark"] .sd-wide-go { display: none; }
}

/* Similar servers: a heading with the «Все серверы …» ("All servers …") link, a row of cards scrolling sideways with buttons at the edges */
:root[data-theme="dark"] .sd-row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: clamp(14px, 2.5vw, 20px); }
:root[data-theme="dark"] .sd-row-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 32px); }
:root[data-theme="dark"] .sd-more {
  display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 40px; white-space: nowrap; text-decoration: none;
  font: 800 12.2px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--red-light);
}
:root[data-theme="dark"] .sd-more .sd-arrow { width: 14px; height: 14px; transition: transform .3s var(--ease-back); }
@media (hover: hover) { :root[data-theme="dark"] .sd-more:hover .sd-arrow { transform: translateX(3px); } }
@media (max-width: 600px) {
  :root[data-theme="dark"] .sd-row-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}
:root[data-theme="dark"] .sd-scroller { position: relative; }
:root[data-theme="dark"] .sd-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc(20% - clamp(11px, 1.4vw, 16px) / 1.25); gap: clamp(11px, 1.4vw, 16px);
  margin: -6px -2px -14px; padding: 6px 2px 14px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .16) transparent;
}
@media (hover: hover) { :root[data-theme="dark"] .sd-grid:hover { scrollbar-color: rgb(255 255 255 / .32) transparent; } }
:root[data-theme="dark"] .sd-grid:focus-visible { outline: 2px solid var(--red-light); outline-offset: 4px; border-radius: 16px; }
:root[data-theme="dark"] .sd-grid > li { display: flex; min-width: 0; scroll-snap-align: start; }
/* Scroll buttons are at the middle of the pictures: their height is 9/16 of the card width, and the card width is a share of the column width (cqi) */
:root[data-theme="dark"] .sd-scroll {
  position: absolute; z-index: 5; top: calc(5.6cqi - 24px); display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: #ffffff; cursor: pointer;
  background: rgb(14 14 20 / .92); border: 1px solid rgb(255 255 255 / .16); border-radius: 50%; box-shadow: 0 10px 24px -8px rgb(0 0 0 / .9);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}
:root[data-theme="dark"] .sd-scroll.prev { left: -6px; }
:root[data-theme="dark"] .sd-scroll.prev .sd-arrow { transform: rotate(180deg); }
:root[data-theme="dark"] .sd-scroll.next { right: -6px; }
:root[data-theme="dark"] .sd-scroll:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) { :root[data-theme="dark"] .sd-scroll:hover { border-color: rgb(255 0 51 / .7); transform: scale(1.06); } }
@media (hover: none) { :root[data-theme="dark"] .sd-scroll { display: none; } }

/* The similar server card: a 16:9 picture with the player count in the corner, the name, the slogan, likes and the row's mode. The color comes from the mode,
   the hover border is shared with the catalog cards. On hover and focus a red circle with an arrow appears in the picture corner */
:root[data-theme="dark"] .sd-card {
  --tone: var(--red-1);
  position: relative; isolation: isolate; overflow: hidden; flex: 1; min-width: 0;
  background: linear-gradient(rgb(255 255 255 / .043), rgb(255 255 255 / .012) 55%), #0d0d14;
  border: 1px solid rgb(255 255 255 / .07); border-radius: 18px;
  transition: transform .3s var(--ease-expo), border-color .25s ease, box-shadow .3s ease;
}
:root[data-theme="dark"] .sd-card.down[data-mode], :root[data-theme="dark"] .sd-card.down .tag[data-mode] { --tone: #9ca3af; }
:root[data-theme="dark"] .sd-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
:root[data-theme="dark"] .sd-card-link:focus-visible { outline: 2px solid var(--red-light); outline-offset: -2px; border-radius: 18px; }
:root[data-theme="dark"] .sd-card-media {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 24%, transparent), rgb(14 14 20 / .96));
}
:root[data-theme="dark"] .sd-card-media::after { content: ""; position: absolute; inset: auto 0 0; height: 55%; pointer-events: none; background: linear-gradient(transparent, rgb(5 5 9 / .82)); }
:root[data-theme="dark"] .sd-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-expo), filter .3s ease; }
:root[data-theme="dark"] .sd-card-media img.pano { object-position: 50% 100%; }
:root[data-theme="dark"] .sd-card.down .sd-card-media img { filter: grayscale(1); opacity: .45; }
:root[data-theme="dark"] .sd-card-media .online { position: absolute; z-index: 1; left: 8px; bottom: 8px; margin: 0; }
:root[data-theme="dark"] .sd-card-go {
  position: absolute; z-index: 1; right: 9px; bottom: 7px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: #ffffff; background: var(--red-grad); box-shadow: 0 6px 16px -4px rgb(255 0 51 / .75);
  opacity: 0; transform: translateY(6px) scale(.85); transition: opacity .2s ease, transform .3s var(--ease-back);
}
:root[data-theme="dark"] .sd-card-go .sd-arrow { width: 16px; height: 16px; }
@media (hover: none) { :root[data-theme="dark"] .sd-card-go { display: none; } }
:root[data-theme="dark"] .sd-card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 11px 13px 13px; }
:root[data-theme="dark"] .sd-card-title {
  display: block; overflow-wrap: anywhere;
  color: #ffffff; font: 800 clamp(14.4px, 1.3vw, 15.7px)/1.25 var(--font-body); letter-spacing: -.005em;
}
:root[data-theme="dark"] .sd-card-by { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 12.2px; }
:root[data-theme="dark"] .sd-card-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 2px 0 7px; color: #b8b8c0; font-size: 11.8px; font-weight: 700; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .sd-card-stats .badge.likes { padding: 0; font-size: 11.8px; }
:root[data-theme="dark"] .sd-card .tag { margin-top: auto; padding: 3px 9px; font-size: 10.4px; }
:root[data-theme="dark"] .sd-card:focus-within { border-color: color-mix(in srgb, var(--tone) 40%, transparent); box-shadow: 0 18px 36px -18px rgb(0 0 0 / .9), 0 0 30px -12px color-mix(in srgb, var(--tone) 75%, transparent); transform: translateY(-4px); }
:root[data-theme="dark"] .sd-card:focus-within::after { opacity: 1; }
:root[data-theme="dark"] .sd-card:focus-within .sd-card-go { opacity: 1; transform: none; }
/* Hover is counted on the list item, and it does not move: at the bottom edge a raised card would leave from under the cursor and jitter */
@media (hover: hover) {
  :root[data-theme="dark"] .sd-grid > li:hover > .sd-card { border-color: color-mix(in srgb, var(--tone) 40%, transparent); box-shadow: 0 18px 36px -18px rgb(0 0 0 / .9), 0 0 30px -12px color-mix(in srgb, var(--tone) 75%, transparent); transform: translateY(-4px); }
  :root[data-theme="dark"] .sd-grid > li:hover > .sd-card .sd-card-go { opacity: 1; transform: none; }
  :root[data-theme="dark"] .sd-grid > li:hover > .sd-card:not(.down) .sd-card-media img { filter: saturate(1.15); transform: scale(1.07); }
}

/* Questions: expandable rows with a «+» in a red frame, when expanded the «+» turns into «×», a red strip grows on the left */
:root[data-theme="dark"] .sd-faq { display: flex; flex-direction: column; gap: 14px; }
:root[data-theme="dark"] .sd-faq details {
  position: relative; overflow: hidden; border: 1px solid rgb(255 255 255 / .07); border-radius: 16px;
  background: linear-gradient(rgb(28 28 38 / .9), rgb(18 18 26 / .9));
  transition: border-color .35s var(--ease-expo), transform .35s var(--ease-expo), box-shadow .35s var(--ease-expo);
}
:root[data-theme="dark"] .sd-faq details::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; transform: scaleY(0); transform-origin: top;
  background: linear-gradient(var(--red-1), rgb(255 0 51 / .3)); transition: transform .4s var(--ease-expo);
}
:root[data-theme="dark"] .sd-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 26px 23px 28px;
  list-style: none; cursor: pointer; -webkit-user-select: none; user-select: none;
  color: #ffffff; font: 700 17.3px/1.5 var(--font-body); letter-spacing: -.005em; transition: color .25s var(--ease-expo);
}
:root[data-theme="dark"] .sd-faq summary::-webkit-details-marker { display: none; }
:root[data-theme="dark"] .sd-faq summary::after {
  content: "+"; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 42px; height: 42px; padding-bottom: 1px;
  color: var(--red-1); font: 300 27px/1 var(--font-body); background: rgb(255 0 51 / .08); border: 1px solid rgb(255 0 51 / .3); border-radius: 12px;
  transition: transform .45s var(--ease-back), background-color .35s ease, border-color .35s ease, color .35s ease, box-shadow .35s ease;
}
/* On rows with overflow: hidden the usual focus frame would be clipped, so it is drawn inside */
:root[data-theme="dark"] :is(.sd-faq, .report, .form-details) summary:focus-visible { outline-offset: -3px; border-radius: 15px; }
@media (hover: hover) {
  :root[data-theme="dark"] .sd-faq details:hover { border-color: rgb(255 0 51 / .3); transform: translateY(-1px); box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
  :root[data-theme="dark"] .sd-faq details:hover::before { transform: scaleY(.5); }
  :root[data-theme="dark"] .sd-faq summary:hover { color: var(--red-light); }
  :root[data-theme="dark"] .sd-faq details:not([open]):hover summary::after { background: rgb(255 0 51 / .15); border-color: rgb(255 0 51 / .5); }
}
:root[data-theme="dark"] .sd-faq details[open] {
  background: linear-gradient(rgb(35 20 28 / .95), rgb(20 14 20 / .95)); border-color: rgb(255 0 51 / .45);
  box-shadow: 0 14px 40px rgb(0 0 0 / .35), 0 0 0 1px rgb(255 0 51 / .08), 0 0 30px rgb(255 0 51 / .1);
}
:root[data-theme="dark"] .sd-faq details[open]::before { transform: scaleY(1); }
:root[data-theme="dark"] .sd-faq details[open] summary { padding-bottom: 19px; color: #ffffff; }
:root[data-theme="dark"] .sd-faq details[open] summary::after { color: #ffffff; background: var(--red-1); border-color: var(--red-1); transform: rotate(45deg); box-shadow: 0 0 0 4px rgb(255 0 51 / .14), 0 8px 22px rgb(255 0 51 / .2); }
:root[data-theme="dark"] .sd-faq details p { margin: 0; padding: 0 28px 26px; color: #b8b8c0; font-size: 16px; line-height: 1.8; animation: dark-drop .45s var(--ease-expo); }
:root[data-theme="dark"] .sd-faq details p::before { content: ""; display: block; width: 40px; height: 2px; margin-bottom: 16px; border-radius: 2px; background: linear-gradient(90deg, var(--red-1), rgb(255 0 51 / 0)); }
@media (max-width: 600px) {
  :root[data-theme="dark"] .sd-faq { gap: 10px; }
  :root[data-theme="dark"] .sd-faq summary { gap: 14px; padding: 16px 16px 16px 18px; font-size: 15.7px; line-height: 1.4; }
  :root[data-theme="dark"] .sd-faq details[open] summary { padding-bottom: 14px; }
  :root[data-theme="dark"] .sd-faq summary::after { width: 34px; height: 34px; border-radius: 10px; font-size: 22px; }
  :root[data-theme="dark"] .sd-faq details p { padding: 0 18px 19px; font-size: 15.2px; line-height: 1.7; }
}

/* Moderation: a flat panel of the same width as the comments above it, with no red and no glow.
   The heading in small capitals, like the filter groups; the buttons do not rise or turn red on hover */
:root[data-theme="dark"] .sd > .admin-tools {
  max-width: 880px; margin-top: clamp(28px, 3.5vw, 42px); padding: 12px 20px 4px;
  background: #0a0a0f; border-color: rgb(255 255 255 / .07); border-radius: 14px;
}
:root[data-theme="dark"] .sd > .admin-tools h2 { font: 800 11px/1.3 var(--font-body); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
:root[data-theme="dark"] .admin-tools .mod-label { font-size: 14px; color: #b8b8c0; }
:root[data-theme="dark"] .admin-tools .mod-findings { color: #fbbf24; }
:root[data-theme="dark"] .admin-tools .mod-inline input {
  font-size: 14px; color: #ffffff; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--radius-md);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] .admin-tools .mod-inline input:focus { outline: none; background: rgb(255 255 255 / .06); border-color: rgb(255 0 51 / .55); box-shadow: 0 0 0 3px rgb(255 0 51 / .16); }
:root[data-theme="dark"] .admin-tools .note { font-size: 13.5px; color: var(--muted); }
:root[data-theme="dark"] .admin-tools .note a { color: #b8b8c0; text-decoration-color: rgb(255 255 255 / .3); }
/* Card information (li.mod-info) is read as data, not as a hint for a button: the label is muted,
   the value is lighter, the label stands on the first line of the value */
:root[data-theme="dark"] .admin-tools .mod-info { align-items: baseline; }
:root[data-theme="dark"] .admin-tools .mod-info > .mod-label { font-size: 13px; color: var(--muted); }
:root[data-theme="dark"] .admin-tools .mod-info > .note:not(.mod-findings) { color: #c8c8d0; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .admin-tools .btn { min-height: 34px; padding: 6px 14px; font-size: 12px; box-shadow: none; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
:root[data-theme="dark"] .admin-tools .btn:active { transform: none; box-shadow: none; }
@media (hover: hover) {
  :root[data-theme="dark"] .admin-tools .btn:hover { color: #ffffff; background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .28); transform: none; box-shadow: none; }
  :root[data-theme="dark"] .admin-tools .note a:hover { color: #ffffff; }
}
@media (pointer: coarse) { :root[data-theme="dark"] .admin-tools .btn { min-height: 44px; } }

/* On a touch screen everything that is pressed is at least 44 px tall */
@media (pointer: coarse) {
  :root[data-theme="dark"] :is(.sd .chart .ranges .btn, .sd-hero .tabs .btn, .sd-more) { min-height: 44px; }
  :root[data-theme="dark"] .sd-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  :root[data-theme="dark"] .sd-crumbs { margin-block: -10px 6px; }
  :root[data-theme="dark"] .sd-chips a.badge { position: relative; }
  :root[data-theme="dark"] .sd-chips a.badge::after { content: ""; position: absolute; inset: -10px -2px; }
}

/* A narrow column: the header in one column (first the text, the picture under it, on a dark backing the labels read even over a bright picture),
   the description above the chart, three cards in the similar row */
@container (max-width: 780px) {
  :root[data-theme="dark"] .sd-hero { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme="dark"] .sd-hero-media { order: 2; max-width: 560px; }
  :root[data-theme="dark"] .sd-hero::after {
    background:
      linear-gradient(rgb(8 8 12 / .72), rgb(8 8 12 / .8)),
      linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px,
      linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px) 0 0 / 44px 44px;
  }
  :root[data-theme="dark"] .sd-hero h1 { font-size: clamp(22px, 8.4cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="11"] { font-size: clamp(18px, 8.0cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="12"] { font-size: clamp(18px, 7.33cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="13"] { font-size: clamp(18px, 6.77cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="14"] { font-size: clamp(18px, 6.29cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="15"] { font-size: clamp(18px, 5.87cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="16"] { font-size: clamp(18px, 5.5cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="17"] { font-size: clamp(18px, 5.18cqi, 40px); }
  :root[data-theme="dark"] .sd-hero h1[data-len="18"] { font-size: clamp(18px, 4.89cqi, 40px); }
  :root[data-theme="dark"] .sd-about { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme="dark"] .sd-grid { grid-auto-columns: calc(33.333% - clamp(11px, 1.4vw, 16px) / 1.5); }
  :root[data-theme="dark"] .sd-scroll { top: calc(9.3cqi - 24px); }
}
@container (max-width: 700px) {
  :root[data-theme="dark"] .sd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 560px) {
  :root[data-theme="dark"] .sd-hero { border-radius: 20px; }
  :root[data-theme="dark"] .sd-grid { grid-auto-columns: 46%; }
  :root[data-theme="dark"] .sd-scroll { top: calc(12.9cqi - 21px); }
}

/* Blocks slide up from below on scroll, like the catalog cards. There is no header here: it is always at the top of the page, and the animation
   would make it a containing block for position: fixed, and the «?» hint on a phone would go off the screen */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    :root[data-theme="dark"] :where(.sd-stat, .sd-panel, .sd .steps li, .sd-wide, .sd-card, .sd-faq details) {
      animation: dark-scroll-rise linear backwards; animation-timeline: view(); animation-range: entry 0% entry 50%;
    }
  }
}
