/*
 * The ZapsUI look: the same slate glass, cyan accent, CT blue and T gold as the in-game HUD (ZapsUI's HudPack).
 * Loaded after site.css: the tokens below retune every page, the rules after them restyle the shared components,
 * and the z-* classes are the pages built on the game database (live server, matches, players, boards).
 */

:root,
html[data-oz-theme="light"],
html[data-oz-theme="dark"] {
  color-scheme: dark;
  --oz-font-body: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --oz-font-display: "Rajdhani", "Noto Sans", "Segoe UI", sans-serif;

  --z-bg: #0d1016;
  --z-bg-2: #12161d;
  --z-panel: linear-gradient(180deg, rgba(43, 50, 62, 0.92), rgba(32, 38, 47, 0.92) 30%, rgba(24, 28, 35, 0.94));
  --z-panel-flat: rgba(28, 33, 41, 0.92);
  --z-well: linear-gradient(180deg, rgba(19, 23, 29, 0.92), rgba(25, 30, 37, 0.92));
  --z-raise: linear-gradient(180deg, rgba(42, 49, 61, 0.86), rgba(28, 33, 41, 0.86));
  --z-raise-hover: linear-gradient(180deg, rgba(52, 60, 74, 0.9), rgba(34, 40, 51, 0.9));
  --z-edge: rgba(255, 255, 255, 0.1);
  --z-edge-top: rgba(255, 255, 255, 0.2);
  --z-edge-soft: rgba(255, 255, 255, 0.06);
  --z-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --z-shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.3);

  --z-text: #f2f5f8;
  --z-text-2: #c2cbd6;
  --z-text-3: #8b95a5;
  /* the dimmest text still clears 4.5:1 on the panels */
  --z-text-4: #8a94a4;

  --z-accent: #19c3ff;
  --z-accent-2: #5fd8ff;
  --z-accent-deep: #1a8fd1;
  --z-accent-glow: rgba(25, 195, 255, 0.35);
  --z-ct: #96c8fa;
  --z-t: #eabe54;
  --z-good: #4cd28a;
  --z-warn: #f2b84b;
  --z-bad: #ff6b6b;
  --z-gold: #e4ae39;

  --z-radius-s: 8px;
  --z-radius: 12px;
  --z-radius-l: 16px;

  /* the site's own tokens, mapped onto the ZapsUI palette */
  --oz-bg: var(--z-bg);
  --oz-surface: #1b2028;
  --oz-surface-2: #20262f;
  --oz-text: var(--z-text);
  --oz-text-soft: var(--z-text-2);
  --oz-line: rgba(255, 255, 255, 0.08);
  --oz-line-strong: rgba(255, 255, 255, 0.16);
  --oz-blue: var(--z-accent-deep);
  --oz-green: #2fae6e;
  --oz-amber: var(--z-gold);
  --oz-red: #d9534f;
  --oz-link: var(--z-accent-2);
  --oz-link-hover: #a6ecff;
  --oz-navbar-bg: rgba(15, 18, 24, 0.82);
  --oz-navbar-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --oz-nav-text: var(--z-text-2);
  --oz-nav-active: #ffffff;
  --oz-table-bg: transparent;
  --oz-table-alt-bg: rgba(255, 255, 255, 0.025);
  --oz-table-hover-bg: rgba(25, 195, 255, 0.07);
  --oz-table-head-text: var(--z-text-3);
  --oz-footer-bg: rgba(13, 16, 22, 0.9);
  --oz-ghost-bg: rgba(255, 255, 255, 0.04);
  --oz-ghost-border: rgba(255, 255, 255, 0.14);
  --oz-ghost-hover-bg: rgba(255, 255, 255, 0.08);
  --oz-ghost-disabled-bg: rgba(255, 255, 255, 0.02);
  --oz-ghost-disabled-border: rgba(255, 255, 255, 0.08);
  --oz-ghost-disabled-text: var(--z-text-4);
}

/* ── page ──────────────────────────────────────────────────────────────────────────────────────── */

html {
  background: var(--z-bg);
}

/* Bulma's reset gives sections display: block, which would beat the hidden attribute */
[hidden] {
  display: none !important;
}

/* one focus ring everywhere: the HUD's cyan */
:where(a, button, input, select, textarea, summary, .button, [tabindex]):focus-visible {
  outline: 2px solid var(--z-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--z-accent-glow);
}

.button:focus:not(:focus-visible) {
  box-shadow: var(--z-shadow-soft);
}

body {
  color: var(--z-text);
  background:
    radial-gradient(1200px 520px at 15% -10%, rgba(25, 195, 255, 0.12), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(58, 134, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #10141b 0%, var(--z-bg) 420px);
  background-attachment: fixed;
}

::selection {
  background: rgba(25, 195, 255, 0.35);
  color: #fff;
}

h1, h2, h3, h4, h5, h6,
.title,
.subtitle {
  font-family: var(--oz-font-display);
  letter-spacing: 0.01em;
}

.title {
  color: var(--z-text);
  font-weight: 700;
}

.subtitle,
.has-text-oz-soft {
  color: var(--z-text-2) !important;
}

.container.is-max-desktop {
  max-width: 1180px !important;
}

/* ── header ────────────────────────────────────────────────────────────────────────────────────── */

.oz-navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.oz-navbar .navbar-item,
.oz-navbar .navbar-link {
  font-family: var(--oz-font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--z-text-2);
}

.oz-navbar .navbar-start > .navbar-item {
  position: relative;
  margin: 0 0.1rem;
  border-radius: var(--z-radius-s);
}

.oz-navbar .navbar-start > .navbar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.oz-navbar .navbar-start > a.navbar-item.is-active,
.oz-navbar .navbar-start > a.navbar-item.is-active:hover {
  color: #fff;
  background: transparent !important;
}

.oz-navbar .navbar-start > .navbar-item.is-active::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--z-accent);
  box-shadow: 0 0 12px var(--z-accent-glow);
}

.oz-brand.z-brand {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.z-brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-height: none;
  filter: drop-shadow(0 0 6px rgba(25, 195, 255, 0.55)) drop-shadow(0 0 18px rgba(25, 195, 255, 0.25));
  transition: filter 0.2s ease;
}

.z-brand:hover .z-brand-logo {
  filter: drop-shadow(0 0 8px rgba(95, 216, 255, 0.85)) drop-shadow(0 0 22px rgba(25, 195, 255, 0.4));
}

.navbar-burger {
  color: var(--z-text);
}

.oz-navbar .navbar-item.is-active {
  box-shadow: none;
}

/* dropdowns (account menu) */
.dropdown-content,
.oz-account-dropdown .dropdown-content {
  background: var(--z-panel);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  border-radius: var(--z-radius);
  box-shadow: var(--z-shadow);
}

.dropdown-item,
a.dropdown-item {
  color: var(--z-text-2);
}

a.dropdown-item:hover,
.dropdown-item-action:hover {
  background: rgba(25, 195, 255, 0.1);
  color: #fff;
}

.dropdown-divider {
  background: var(--z-edge-soft);
}

/* ── panels ────────────────────────────────────────────────────────────────────────────────────── */

.oz-block,
.oz-strip,
.box,
.card {
  background: var(--z-panel);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  border-radius: var(--z-radius-l);
  box-shadow: var(--z-shadow);
  color: var(--z-text);
}

.card-header,
.card-footer,
.card-footer-item {
  border-color: var(--z-edge-soft);
  box-shadow: none;
}

.card-header-title {
  color: var(--z-text);
  font-family: var(--oz-font-display);
}

hr {
  background: var(--z-edge-soft);
}

/* ── buttons ───────────────────────────────────────────────────────────────────────────────────── */

/* every button starts as the HUD's raised slate; the variants below recolor it */
.button {
  font-family: var(--oz-font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: var(--z-radius-s);
  background: var(--z-raise);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  color: var(--z-text);
  box-shadow: var(--z-shadow-soft);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.button:hover {
  background: var(--z-raise-hover);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.button:active {
  transform: translateY(1px);
}

.button.is-link,
.button.is-info,
.button.is-primary,
.button.is-oz-primary {
  color: #061018;
  background: linear-gradient(180deg, #5fd8ff, #19c3ff 55%, #13a4dc);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(25, 195, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.button.is-link:hover,
.button.is-info:hover,
.button.is-primary:hover,
.button.is-oz-primary:hover {
  color: #031016;
  background: linear-gradient(180deg, #7fe1ff, #2fcaff 55%, #19b0e8);
  box-shadow: 0 8px 26px rgba(25, 195, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.button.is-success {
  background: linear-gradient(180deg, #5fe39b, #2fae6e);
  border-color: rgba(255, 255, 255, 0.25);
  color: #04130b;
}

.button.is-danger {
  background: linear-gradient(180deg, #ff8a8a, #d9534f);
  border-color: rgba(255, 255, 255, 0.25);
}

.button.is-warning {
  background: linear-gradient(180deg, #ffd27a, #e4ae39);
  color: #1a1203;
}

.button.is-oz-ghost,
.button.is-light,
.button.is-white,
.button.is-dark {
  background: var(--z-raise);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  color: var(--z-text);
}

.button.is-oz-ghost:hover,
.button.is-light:hover,
.button.is-white:hover,
.button.is-dark:hover {
  background: var(--z-raise-hover);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.button[disabled],
fieldset[disabled] .button {
  opacity: 0.45;
  box-shadow: none;
}

/* ── tables ────────────────────────────────────────────────────────────────────────────────────── */

.table {
  background: transparent;
  color: var(--z-text);
}

.table thead th,
.table thead td {
  font-family: var(--oz-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--z-text-3) !important;
  border-bottom: 1px solid var(--z-edge) !important;
}

.table td,
.table th {
  border-color: var(--z-edge-soft);
  vertical-align: middle;
}

.table.is-hoverable tbody tr:not(.is-selected):hover,
.table.is-hoverable.is-striped tbody tr:not(.is-selected):hover {
  background: rgba(25, 195, 255, 0.07) !important;
}

/* ── tags, notifications, forms ────────────────────────────────────────────────────────────────── */

.tag:not(body) {
  border-radius: 999px;
  font-family: var(--oz-font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.07);
  color: var(--z-text-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag.is-success,
.tag.is-success.is-light {
  background: rgba(76, 210, 138, 0.14);
  color: #7fe7ad;
  border-color: rgba(76, 210, 138, 0.35);
}

.tag.is-warning,
.tag.is-warning.is-light {
  background: rgba(242, 184, 75, 0.14);
  color: #ffd27a;
  border-color: rgba(242, 184, 75, 0.35);
}

.tag.is-danger,
.tag.is-danger.is-light {
  background: rgba(255, 107, 107, 0.14);
  color: #ff9b9b;
  border-color: rgba(255, 107, 107, 0.35);
}

.tag.is-info,
.tag.is-link,
.tag.is-info.is-light,
.tag.is-link.is-light {
  background: rgba(25, 195, 255, 0.14);
  color: var(--z-accent-2);
  border-color: rgba(25, 195, 255, 0.35);
}

.notification {
  background: var(--z-well);
  border: 1px solid var(--z-edge);
  border-radius: var(--z-radius);
  color: var(--z-text);
}

.input,
.textarea,
.select select {
  background: rgba(10, 13, 18, 0.7);
  border: 1px solid var(--z-edge);
  border-radius: var(--z-radius-s);
  color: var(--z-text);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--z-text-4);
}

.input:focus,
.textarea:focus,
.select select:focus {
  border-color: var(--z-accent);
  box-shadow: 0 0 0 3px rgba(25, 195, 255, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.label {
  color: var(--z-text-2);
  font-family: var(--oz-font-display);
  letter-spacing: 0.04em;
}

/* ── footer ────────────────────────────────────────────────────────────────────────────────────── */

.oz-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(13, 16, 22, 0.6), rgba(9, 11, 15, 0.95));
}

.z-footer-logo {
  height: 30px;
  width: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(25, 195, 255, 0.4));
}

/* ════════════════════════════════════════════════════════════════════════════════════════════════
   z-*: pages built on the game database
   ════════════════════════════════════════════════════════════════════════════════════════════════ */

.z-num {
  font-family: var(--oz-font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.z-eyebrow {
  font-family: var(--oz-font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--z-text-3);
}

.z-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 0 1.25rem;
}

.z-page-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.z-page-head h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.05;
  font-weight: 700;
}

.z-page-head p {
  margin: 0.25rem 0 0;
  color: var(--z-text-2);
}

.z-card {
  position: relative;
  background: var(--z-panel);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  border-radius: var(--z-radius-l);
  box-shadow: var(--z-shadow);
  padding: 1.25rem 1.35rem;
  overflow: hidden;
}

.z-card + .z-card,
.z-card + .z-grid,
.z-grid + .z-card {
  margin-top: 1.25rem;
}

.z-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.z-card-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--z-text);
}

.z-glow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(25, 195, 255, 0.16), rgba(58, 134, 255, 0.05) 45%, transparent 70%);
}

.z-grid {
  display: grid;
  gap: 1.25rem;
}

/* grid cells may shrink below their tables (which scroll inside .z-scroll instead of widening the page) */
.z-grid > * {
  min-width: 0;
}

.z-grid > .z-card + .z-card {
  margin-top: 0;
}

.z-grid.is-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.z-grid.is-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.z-grid.is-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .z-grid.is-3,
  .z-grid.is-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .z-grid.is-2,
  .z-grid.is-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* stat tiles stay two across on phones */
  .z-grid.is-4 {
    gap: 0.6rem;
  }
}

@media (max-width: 380px) {
  .z-grid.is-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* headline numbers */
.z-kpi {
  background: var(--z-raise);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top-color: rgba(255, 255, 255, 0.17);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  min-width: 0;
}

.z-kpi-label {
  font-family: var(--oz-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--z-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.z-kpi-value {
  font-family: var(--oz-font-display);
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--z-text);
  white-space: nowrap;
}

.z-kpi-sub {
  font-size: 0.82rem;
  color: var(--z-text-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* chips */
.z-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-family: var(--oz-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--z-text-2);
}

.z-chip.is-live {
  background: rgba(76, 210, 138, 0.14);
  border-color: rgba(76, 210, 138, 0.4);
  color: #7fe7ad;
}

.z-chip.is-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4cd28a;
  box-shadow: 0 0 0 0 rgba(76, 210, 138, 0.6);
  animation: z-pulse 1.8s ease-out infinite;
}

.z-chip.is-off {
  color: var(--z-text-4);
}

.z-chip.is-accent {
  background: rgba(25, 195, 255, 0.14);
  border-color: rgba(25, 195, 255, 0.4);
  color: var(--z-accent-2);
}

.z-chip.is-gold {
  background: rgba(228, 174, 57, 0.14);
  border-color: rgba(228, 174, 57, 0.4);
  color: #ffd27a;
}

@keyframes z-pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 210, 138, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(76, 210, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 210, 138, 0); }
}

/* the level chip, like the in-game card's */
.z-level {
  display: inline-flex;
  align-items: center;
  padding: 0 0.45rem;
  height: 1.3rem;
  border-radius: 6px;
  font-family: var(--oz-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #e9f8ff;
  background: linear-gradient(180deg, #2a8fd0, #1765a0);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(25, 195, 255, 0.25);
}

.z-level.is-prestige {
  color: #fff6dc;
  background: linear-gradient(180deg, #d7a032, #9b6d12);
  box-shadow: 0 0 10px rgba(228, 174, 57, 0.3);
}

/* avatars: the picture, else the initial on a color */
.z-avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--oz-font-display);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2a3a52, #1b2433);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.z-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.z-avatar.is-large {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  font-size: 2.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.z-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.z-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--z-text);
}

a.z-player-name:hover {
  color: var(--z-accent-2);
}

/* boards: compact tables with their own header row */
.z-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.z-table th {
  font-family: var(--oz-font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--z-text-3);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--z-edge);
  white-space: nowrap;
}

.z-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--z-edge-soft);
  vertical-align: middle;
  white-space: nowrap;
}

.z-table tbody tr {
  transition: background 0.12s ease;
}

.z-table tbody tr:hover {
  background: rgba(25, 195, 255, 0.06);
}

.z-table tbody tr:last-child td {
  border-bottom: 0;
}

.z-table .is-num {
  text-align: right;
  font-family: var(--oz-font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.02rem;
}

.z-table th.is-num {
  font-size: 0.74rem;
}

.z-table .is-name {
  width: 100%;
  max-width: 0;
}

.z-table .is-dim {
  color: var(--z-text-4);
}

.z-table tr.is-bot {
  opacity: 0.55;
}

.z-table tr.is-dead .z-player-name {
  color: var(--z-text-4);
  text-decoration: line-through rgba(255, 255, 255, 0.25);
}

.z-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* the rank column: medals for the podium */
.z-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--oz-font-display);
  font-weight: 700;
  color: var(--z-text-3);
  background: rgba(255, 255, 255, 0.04);
}

.z-rank.is-1 {
  color: #2a1a00;
  background: linear-gradient(180deg, #ffe08a, #e4ae39);
  box-shadow: 0 0 14px rgba(228, 174, 57, 0.45);
}

.z-rank.is-2 {
  color: #10151c;
  background: linear-gradient(180deg, #f1f5f9, #aab4c0);
}

.z-rank.is-3 {
  color: #1d0f04;
  background: linear-gradient(180deg, #f0b787, #b8763d);
}

/* sides */
.z-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  font-family: var(--oz-font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.z-side-head.is-ct {
  color: var(--z-ct);
  background: linear-gradient(90deg, rgba(150, 200, 250, 0.16), rgba(150, 200, 250, 0.02));
  box-shadow: inset 3px 0 0 var(--z-ct);
}

.z-side-head.is-t {
  color: var(--z-t);
  background: linear-gradient(90deg, rgba(234, 190, 84, 0.16), rgba(234, 190, 84, 0.02));
  box-shadow: inset 3px 0 0 var(--z-t);
}

.z-ct {
  color: var(--z-ct);
}

.z-t {
  color: var(--z-t);
}

/* the scoreboard header: map, score, round */
.z-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin: 0.25rem 0 1.1rem;
}

.z-score-side {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.z-score-side.is-t {
  align-items: flex-end;
  text-align: right;
}

.z-score-team {
  white-space: nowrap;
  font-family: var(--oz-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.z-score-num {
  font-family: var(--oz-font-display);
  font-variant-numeric: tabular-nums;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
}

.z-score-mid {
  text-align: center;
}

.z-score-map {
  font-family: var(--oz-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--z-text);
}

.z-score-round {
  color: var(--z-text-3);
  font-size: 0.9rem;
}

/* the result strip on match rows */
.z-result {
  display: inline-block;
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  vertical-align: middle;
}

.z-result.is-win {
  background: var(--z-good);
  box-shadow: 0 0 8px rgba(76, 210, 138, 0.5);
}

.z-result.is-loss {
  background: var(--z-bad);
}

.z-result.is-draw {
  background: var(--z-text-3);
}

/* read out by screen readers, not shown */
.z-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .z-chip.is-live::before {
    animation: none;
  }

  .z-match,
  .button {
    transition: none;
  }
}

/* the hero on the home page */
.z-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 2.4rem 2.2rem;
  margin-top: 0.5rem;
  background:
    radial-gradient(600px 260px at 80% 20%, rgba(25, 195, 255, 0.22), transparent 70%),
    linear-gradient(160deg, rgba(43, 50, 62, 0.95), rgba(18, 22, 28, 0.96));
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  box-shadow: var(--z-shadow);
}

.z-hero-logo {
  display: block;
  width: min(420px, 80%);
  height: auto;
  filter: drop-shadow(0 0 10px rgba(25, 195, 255, 0.6)) drop-shadow(0 0 32px rgba(25, 195, 255, 0.3));
}

.z-hero p {
  margin-top: 0.9rem;
  color: var(--z-text-2);
  font-size: 1.1rem;
}

.z-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

/* pager */
.z-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  font-family: var(--oz-font-display);
  color: var(--z-text-3);
}

/* tabs (segmented control, like the HUD's) */
.z-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17, 20, 25, 0.86), rgba(23, 27, 34, 0.86));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.z-seg a {
  padding: 0.3rem 0.9rem;
  border-radius: 7px;
  font-family: var(--oz-font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--z-text-2);
  white-space: nowrap;
}

.z-seg a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.z-seg a.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(106, 118, 137, 0.86), rgba(61, 70, 86, 0.86));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.z-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--z-text-3);
}

.z-muted {
  color: var(--z-text-3);
}

/* ── page pieces ───────────────────────────────────────────────────────────────────────────────── */

.z-section {
  margin-top: 1.25rem;
}

.z-accent {
  color: var(--z-accent) !important;
  text-shadow: 0 0 18px rgba(25, 195, 255, 0.35);
}

.z-good {
  color: var(--z-good);
}

.z-zaps {
  color: var(--z-accent-2);
}

.z-ellipsis {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-spacer {
  flex: 1 1 auto;
}

.z-row-sub {
  font-size: 0.8rem;
  color: var(--z-text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-page-head .z-eyebrow a,
.z-card .z-eyebrow a {
  color: var(--z-text-3);
}

.z-page-head .z-eyebrow a:hover,
.z-card .z-eyebrow a:hover {
  color: var(--z-accent-2);
}

.z-card-head h2 a {
  color: inherit;
}

.z-card-head h2 a:hover {
  color: var(--z-accent-2);
}

.z-short {
  display: none;
}

@media (max-width: 640px) {
  .z-hide-s,
  .z-table .z-player .z-level,
  .z-long {
    display: none;
  }

  .z-short {
    display: inline;
  }

  .z-seg {
    display: flex;
    width: 100%;
  }

  .z-seg a {
    flex: 1 1 auto;
    padding: 0.3rem 0.45rem;
    text-align: center;
    font-size: 0.88rem;
  }

  .z-server-foot .z-chip.z-num {
    display: none;
  }

  .z-server-facts {
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  }

  .z-kpi-label {
    letter-spacing: 0.08em;
  }

  .z-hero-actions .button {
    flex: 1 1 auto;
  }

  /* older pages: Bulma's column gutters assume the wider page padding; keep their table cells on one line */
  .oz-main .columns {
    margin-left: 0;
    margin-right: 0;
  }

  .oz-table th,
  .oz-table td:first-child {
    white-space: nowrap;
  }

  /* phones: give the names the room */
  .oz-main.section {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .z-card,
  .z-live-body {
    padding: 0.9rem 0.75rem;
  }

  .z-live.z-card,
  .z-server.z-card,
  .z-match-hero.z-card {
    padding: 0;
  }

  .z-table th,
  .z-table td {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .z-table .is-num {
    font-size: 0.95rem;
  }

  .z-table .z-avatar {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 0.8rem;
  }

  .z-player {
    gap: 0.45rem;
  }

  .z-rank {
    width: 24px;
    height: 24px;
  }

  .z-page-head h1 {
    font-size: 1.9rem;
  }
}

/* hero */
.z-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.z-hero-grid > * {
  min-width: 0;
}

.z-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 860px) {
  .z-hero {
    padding: 1.6rem 1.25rem;
  }

  .z-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
  }
}

/* live scoreboard and server cards: a faint map picture behind the panel */
.z-live,
.z-server,
.z-match-hero {
  padding: 0;
}

.z-live-map {
  position: absolute;
  inset: 0 0 auto 0;
  height: 240px;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  pointer-events: none;
}

.z-live-map:not([style]) {
  background: linear-gradient(135deg, rgba(25, 195, 255, 0.2), rgba(58, 134, 255, 0.06) 45%, transparent 70%);
  opacity: 1;
}

.z-live-body {
  position: relative;
  padding: 1.25rem 1.35rem;
}

.z-live-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.z-live-title h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-live .z-card-head .button {
  flex: none;
  white-space: nowrap;
}

/* Staff panel (staff only) and Join server, side by side */
.z-live-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.z-sides {
  gap: 1rem;
}

.z-live-foot {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--z-text-4);
}

.z-empty-row:hover {
  background: transparent !important;
}

@media (max-width: 640px) {
  .z-score-num {
    font-size: 2.4rem;
  }

  .z-score-map {
    font-size: 1.15rem;
  }

  .z-score-team {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .z-live-body {
    padding: 1rem;
  }
}

/* server cards */
.z-server-facts {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
}

.z-kpi-value.is-text {
  font-size: 1.3rem;
  line-height: 1.85;
  overflow: hidden;
  text-overflow: ellipsis;
}

.z-server-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* match tiles */
.z-match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .z-match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .z-match-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.z-match {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--z-raise);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top-color: rgba(255, 255, 255, 0.17);
  color: var(--z-text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.z-match:hover {
  color: var(--z-text);
  transform: translateY(-2px);
  border-color: rgba(25, 195, 255, 0.45);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(25, 195, 255, 0.15);
}

.z-match-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  background: linear-gradient(135deg, #24354a, #161c26 70%);
  background-size: cover;
  background-position: center;
}

/* stock maps have no Workshop picture: a faint bolt instead */
.z-match-pic i,
.z-thumb i {
  color: rgba(25, 195, 255, 0.35);
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(25, 195, 255, 0.35));
}

.z-thumb i {
  font-size: 0.95rem;
}

.z-match-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "map score" "meta score";
  column-gap: 0.75rem;
  padding: 0.6rem 0.8rem 0.7rem;
}

.z-match-map {
  grid-area: map;
  font-family: var(--oz-font-display);
  font-weight: 700;
  font-size: 1.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-match-meta {
  grid-area: meta;
  font-size: 0.78rem;
  color: var(--z-text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.z-match-score {
  grid-area: score;
  align-self: center;
  font-family: var(--oz-font-display);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.z-match-score .z-ct:not(.is-won),
.z-match-score .z-t:not(.is-won) {
  opacity: 0.55;
}

/* match list */
.z-thumb-cell {
  width: 1%;
}

.z-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 36px;
  border-radius: 7px;
  background: linear-gradient(135deg, #24354a, #161c26 70%);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.z-match-chips,
.z-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.z-match-chips {
  justify-content: center;
}

.z-rating {
  color: var(--z-text);
}

.z-rating.is-high {
  color: var(--z-good);
}

.z-rating.is-low {
  color: var(--z-bad);
}

.z-crown {
  color: #ffd27a;
  white-space: nowrap;
}

/* events */
.z-event {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--z-raise);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--z-text);
}

.z-event:hover {
  color: var(--z-text);
  border-color: rgba(25, 195, 255, 0.45);
}

.z-event strong {
  color: var(--z-text);
  font-family: var(--oz-font-display);
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* player profile */
.z-profile-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.z-profile-id {
  flex: 1 1 auto;
  min-width: 0;
}

.z-profile-id h1 {
  margin: 0 0 0.45rem;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.1;
}

.z-profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .z-profile-head {
    flex-wrap: wrap;
  }

  .z-avatar.is-large {
    width: 72px;
    height: 72px;
    font-size: 2rem;
  }

  .z-profile-id h1 {
    font-size: 1.7rem;
  }

  .z-profile-links {
    flex-direction: row;
    align-items: center;
  }
}

/* footer brand */
.z-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* voice mode on the live scoreboard (static/home/js/voice.js) */
.z-voice-pane {
  margin-bottom: 1rem;
  padding: 0.55rem 0.85rem;
  box-shadow: var(--z-shadow), inset 3px 0 0 var(--z-good);
}

/* one row: who and how, the message, volume, Start listening; whole items wrap on a narrow screen, text never does */
.z-voice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.z-voice-id {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.z-voice-id h2 {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
}

.z-voice-msg {
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
  color: var(--z-text-2);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.z-voice-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.z-voice-actions .button,
.oz-voice-volume .button,
.oz-voice-extras .button {
  white-space: nowrap;
}

.oz-voice-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.oz-voice-volume input[type="range"] {
  width: 110px;
}

.oz-voice-volume .z-num {
  width: 2.8rem;
  text-align: right;
  font-size: 0.8rem;
}

.z-voice-choose,
.z-voice-more {
  margin-top: 8px;
}

.oz-voice-volume input[type="range"],
.oz-vc input[type="range"] {
  width: 100%;
  accent-color: var(--z-accent);
}

.z-table .voice-col {
  display: none;
}

.oz-voice-on .z-table .voice-col {
  display: table-cell;
  width: 130px;
  min-width: 110px;
}

.oz-vc {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.oz-vc-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.z-table tr.is-speaking .oz-vc-dot {
  background: var(--z-good);
  box-shadow: 0 0 6px var(--z-good);
}

.z-table tr.is-speaking .z-player-name {
  color: var(--z-good);
}

.oz-vc input[type="range"] {
  min-width: 36px;
}

.oz-vc-mute {
  flex: none;
  padding: 1px 5px;
  border: 1px solid var(--oz-ghost-border);
  border-radius: 6px;
  background: none;
  color: var(--z-text-2);
  font-size: 0.72rem;
  line-height: 1.4;
  cursor: pointer;
}

.oz-vc-mute.is-muted {
  color: var(--z-bad);
  border-color: rgba(255, 107, 107, 0.4);
}

.oz-vc-self {
  color: var(--z-text-2);
  font-weight: 500;
}

/* the pane's description: one sentence at a time, rolling up to the next */
.oz-voice-ticker {
  position: relative;
  overflow: hidden;
  transition: height 0.45s ease;
}

.oz-voice-ticker-track {
  transition: transform 0.45s ease;
}

.oz-voice-ticker-track > span {
  display: block;
}

.oz-voice-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .oz-voice-ticker,
  .oz-voice-ticker-track {
    transition: none;
  }
}

/* Corner player for the channel's newest video (static/home/js/latest-video.js) */
.oz-video {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 35;
  width: 340px;
  max-width: calc(100vw - 32px);
  /* Opaque, unlike --z-panel, so the page doesn't show through */
  background: linear-gradient(180deg, #2b323e, #20262f 30%, #181c23);
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  border-radius: var(--z-radius-l);
  box-shadow: var(--z-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.26s ease, transform 0.26s ease, width 0.2s ease;
  pointer-events: none;
}
.oz-video[hidden] { display: none; }
.oz-shell { padding-bottom: var(--oz-video-space, 0px); }
.oz-video.is-open { opacity: 1; transform: none; pointer-events: auto; }
.oz-video-head { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 8px 8px 12px; }
.oz-video-icon { flex: none; color: #ff4e45; font-size: 1.2rem; line-height: 1; }
.oz-video-text { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.oz-video-label {
  overflow: hidden;
  color: var(--z-text-3);
  font-family: var(--oz-font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.oz-video-title {
  overflow: hidden;
  color: var(--z-text);
  font-size: 0.86rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oz-video-title:hover, .oz-video-title:focus-visible { color: var(--z-accent-2); }
.oz-video-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--z-edge-soft);
  border-radius: var(--z-radius-s);
  background: var(--z-raise);
  color: var(--z-text-2);
  cursor: pointer;
}
.oz-video-btn:hover { background: var(--z-raise-hover); color: var(--z-text); }
.oz-video-btn:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 2px; }
.oz-video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.oz-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.oz-video.is-min { width: 270px; }
.oz-video.is-min .oz-video-frame { display: none; }
@media (max-width: 639px) {
  .oz-video { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 252px; }
  .oz-video.is-min { width: 230px; }
  .oz-video-btn { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .oz-video { transition: none; } }

/* Server switcher: the live scoreboard's server name opens a menu of every server (home page) */
.z-switch {
  position: relative;
  min-width: 0;
  /* the button's hover box reaches past the text; the wrapper's margins (unlike the button's) count in layout */
  margin: -0.35rem -0.5rem;
}
/* The menu opens past the card's edge (cards clip by default); the map picture keeps the rounded corners */
.z-live:has(.z-switch) { overflow: visible; }
.z-live:has(.z-switch) .z-live-map { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.z-switch-heading { min-width: 0; margin: 0; font-size: inherit; font-weight: inherit; }
.z-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--z-radius);
  background: transparent;
  color: var(--z-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.z-switch-btn:hover,
.z-switch.is-open .z-switch-btn {
  background: var(--z-raise);
  border-color: var(--z-edge);
}
.z-switch-btn:focus-visible { outline: 2px solid var(--z-accent); outline-offset: 2px; }
.z-switch-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.z-switch-name {
  overflow: hidden;
  font-size: 1.35rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.z-switch-sub {
  overflow: hidden;
  color: var(--z-text-3);
  font-family: var(--oz-font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.z-switch-caret {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--z-edge-soft);
  border-radius: var(--z-radius-s);
  background: var(--z-raise);
  color: var(--z-text-2);
  font-size: 0.75rem;
  transition: transform 0.18s ease, color 0.15s ease;
}
.z-switch-btn:hover .z-switch-caret { color: var(--z-accent-2); }
.z-switch.is-open .z-switch-caret { transform: rotate(180deg); color: var(--z-accent-2); }

.z-switch-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -0.5rem;
  z-index: 30;
  width: min(380px, calc(100vw - 48px));
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--z-edge);
  border-top-color: var(--z-edge-top);
  border-radius: var(--z-radius-l);
  background: linear-gradient(180deg, #2b323e, #20262f 40%, #1a1f27);
  box-shadow: var(--z-shadow);
  animation: z-switch-in 0.14s ease-out;
}
.z-switch-menu[hidden] { display: none; }
@keyframes z-switch-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.z-switch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 6px 10px 8px;
  color: var(--z-text-3);
  font-family: var(--oz-font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.z-switch-auto-icon {
  display: grid;
  place-items: center;
  width: 9px;
  color: var(--z-accent-2);
  font-size: 0.8rem;
}
.z-switch-item.is-auto { margin-bottom: 6px; }
.z-switch-item.is-auto::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -4px;
  left: 10px;
  height: 1px;
  background: var(--z-edge-soft);
}
/* the server "Follow the busiest" landed on */
.z-switch-item.is-followed { border-color: rgba(25, 195, 255, 0.2); }
.z-switch-item.is-followed .z-switch-item-name::after {
  content: "Showing";
  margin-left: 8px;
  padding: 0 0.45rem;
  border: 1px solid rgba(25, 195, 255, 0.35);
  border-radius: 999px;
  background: rgba(25, 195, 255, 0.12);
  color: var(--z-accent-2);
  font-family: var(--oz-font-display);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}
.z-switch-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--z-radius);
  color: var(--z-text);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.z-switch-item + .z-switch-item { margin-top: 2px; }
.z-switch-item:hover,
.z-switch-item:focus-visible {
  background: var(--z-raise-hover);
  border-color: var(--z-edge-soft);
  color: var(--z-text);
  outline: none;
}
.z-switch-item.is-current {
  background: rgba(25, 195, 255, 0.1);
  border-color: rgba(25, 195, 255, 0.32);
}
.z-switch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.z-switch-dot.is-on {
  background: var(--z-good);
  box-shadow: 0 0 0 3px rgba(76, 210, 138, 0.18);
}
.z-switch-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.z-switch-item-name,
.z-switch-item-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.z-switch-item-name { font-weight: 700; }
.z-switch-item-sub { color: var(--z-text-3); font-size: 0.8rem; }
.z-switch-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--z-edge-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--z-text);
  font-family: var(--oz-font-display);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
.z-switch-count i { color: var(--z-text-3); font-size: 0.68rem; }
.z-switch-count.is-off { color: var(--z-text-4); font-size: 0.76rem; letter-spacing: 0.04em; }
.z-switch-check { color: var(--z-accent-2); font-size: 0.8rem; opacity: 0; }
.z-switch-item.is-current .z-switch-check { opacity: 1; }

/* Switching: the old server's numbers fade until the new one answers */
.z-live.is-switching .z-score,
.z-live.is-switching .z-sides { opacity: 0.45; transition: opacity 0.15s ease; }

@media (max-width: 640px) {
  .z-live .z-card-head:has(.z-switch) { flex-wrap: wrap; }
  .z-live .z-card-head:has(.z-switch) .z-live-title { position: relative; flex: 1 1 100%; }
  .z-switch-name { font-size: 1.2rem; }
  /* the menu spans the title row (the card's width) instead of hanging off the button */
  .z-switch { position: static; }
  .z-switch-menu { left: 0; right: 0; width: auto; }
  /* no room for the badge beside a long name: the outline says it */
  .z-switch-item.is-followed .z-switch-item-name::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .z-switch-menu { animation: none; }
  .z-switch-caret, .z-switch-btn { transition: none; }
}
