.wsc-grid {
  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(var(--wsc-card-min, 300px), 1fr));

  gap: clamp(12px, calc(var(--wsc-card-min, 300px) * 0.11), 44px);
}

.wsc-skeleton {
  aspect-ratio: 6 / 7;
  background: var(--wsc-bg);
  border: 1px solid var(--wsc-border);
  border-radius: var(--wsc-radius);
  position: relative;
  overflow: hidden;
}

.wsc-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, .05) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: wsc-skeleton-sweep 1.4s ease-in-out infinite;
}

@keyframes wsc-skeleton-sweep {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .wsc-skeleton::after { animation: none; }
}

.wsc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container-type: inline-size;

  --wsc-fs:        clamp(11px, 4.5cqw, 20px);

  --wsc-fs-brand:  clamp(17px, 9.6cqw, 38px);
  --wsc-fs-title:  clamp(13px, 6.4cqw, 26px);
  --wsc-fs-btn:    clamp(10px, 4.7cqw, 18px);

  --wsc-fs-small:  clamp(10px, 3.6cqw, 14px);

  --wsc-fs-axis:   clamp(8px, 2.4cqw, 12px);
  --wsc-pad:       clamp(7px, 3cqw, 14px);

  background: var(--wsc-bg);
  border: 1px solid var(--wsc-border);
  border-radius: var(--wsc-radius);
  color: var(--wsc-text);
  font: var(--wsc-fs)/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;

  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.wsc-card:hover,
.wsc-card:focus-within {
  border-color: var(--wsc-hover-border);
  box-shadow: var(--wsc-hover-glow);
}

.wsc-card--clickable {
  cursor: pointer;
}

.wsc-card--clickable .wsc-actions,
.wsc-card--clickable .wsc-track,
.wsc-card--clickable .wsc-chart {
  cursor: pointer;
}

.wsc-card--clickable .wsc-btn {
  cursor: pointer;
}

.wsc-card.is-dark { opacity: .5; }
/* the preview before the first answer of query.php (window.__wscBoot.preview): fixed data, the live values still loading */
.wsc-card.is-pending { opacity: .8; }

.wsc-plot__bg {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.wsc-plot__bg.is-ready { opacity: 1; }

/* an image placed by its LOOK (ChartMaps, settings.chart_maps; cards.js sets --wsc-img-zoom, -x, -y, -ratio on it): zoom % as
   wide as the chart with the ratio of the image, its point x/y on the middle of the chart, kept inside the edges like the tool
   does while dragging (left and top clamped so the image always covers the chart: a chart a little taller or wider than the
   previews of the tool moves the image by that much, never shows an edge). The chart is the container (cqw, cqh) and clips
   the rest; CSS keeps it in place at every size. An image without LOOK fills .wsc-plot__bg by cover as before. */
.wsc-plot__bg--placed {
  overflow: hidden;
  background: none;
  container-type: size;
}

.wsc-plot__img {
  --wsc-img-w: calc(var(--wsc-img-zoom, 100) * 1cqw);
  --wsc-img-h: calc(var(--wsc-img-zoom, 100) * var(--wsc-img-ratio, .5625) * 1cqw);
  position: absolute;
  width: var(--wsc-img-w);
  height: var(--wsc-img-h);
  left: clamp(calc(100cqw - var(--wsc-img-w)), calc(50cqw - var(--wsc-img-w) * var(--wsc-img-x, 50) / 100), 0px);
  top: clamp(calc(100cqh - var(--wsc-img-h)), calc(50cqh - var(--wsc-img-h) * var(--wsc-img-y, 50) / 100), 0px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.wsc-plot__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    var(--wsc-chart-shade-top, rgba(6, 7, 9, .5)) 0%,
    var(--wsc-chart-shade-bottom, rgba(6, 7, 9, .72)) 100%);
}

.wsc-plot__bg ~ .wsc-plot__area .wsc-plot__axis,
.wsc-plot__bg ~ .wsc-plot__pending {
  color: #b9bfc6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 6px rgba(0, 0, 0, .75);
}

@media (prefers-reduced-motion: reduce) {
  .wsc-plot__bg { transition: none; }
}

.wsc-plate {
  padding: var(--wsc-pad) var(--wsc-pad) calc(var(--wsc-pad) * .8);
  background: var(--wsc-plate-bg);
  text-align: center;
}

.wsc-plate__title {
  margin: 0;
  color: var(--wsc-title-text);
  font-size: var(--wsc-fs-title);
  font-weight: 700;
  line-height: 1.28;

  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  text-wrap: balance;
}

.wsc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: calc(var(--wsc-pad) * .6);
  padding: 0 calc(var(--wsc-pad) * .85) calc(var(--wsc-pad) * .5);
  background: var(--wsc-plate-bg);
}

.wsc-actions--primary { padding-bottom: calc(var(--wsc-pad) * .8); }

.wsc-btn {
  padding: .35em .8em;
  border: 1px solid var(--wsc-action-edge);
  border-radius: var(--wsc-radius);
  background: var(--wsc-action-bg);
  color: var(--wsc-action-text);
  cursor: pointer;
  font: inherit;
  font-size: var(--wsc-fs-btn);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;

  transition: background-color 180ms ease-out;
}

.wsc-btn:hover { background: var(--wsc-action-hover); }
.wsc-btn:focus-visible { outline: 2px solid var(--wsc-label-text); outline-offset: 2px; }

.wsc-btn--primary {
  flex: 0 0 auto;
  padding: .4em 1.35em;
  font-size: calc(var(--wsc-fs-btn) * 1.08);
}

.wsc-btn.is-copied::after { content: " ✓"; }

@media (pointer: coarse) {
  .wsc-btn { min-height: 44px; }
}

.wsc-brand {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: calc(var(--wsc-pad) * .55) var(--wsc-pad);
  background: var(--wsc-plate-bg);
  font-size: var(--wsc-fs-brand);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
}

.wsc-brand__flag {
  margin-right: .35em;
  font-size: 1.05em;
  line-height: 1;
}

img.wsc-brand__flag {
  height: 0.85em;
  width: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.wsc-brand__mark   { color: var(--wsc-title-text); }
.wsc-brand__accent { color: #e8443a; }

.wsc-plate__code {
  color: var(--wsc-muted);
  font-weight: 700;
}

.wsc-band__label {
  flex: 0 0 auto;
  margin: 0 calc(var(--wsc-pad) * .35);
  padding: .22em .75em;

  background: linear-gradient(90deg, var(--wsc-label-from), var(--wsc-label-to));
  border: 1px solid var(--wsc-label-edge);
  border-radius: var(--wsc-radius);
  color: var(--wsc-label-text);
  font-size: var(--wsc-fs);

  font-weight: 600;
  text-transform: uppercase;
}

.wsc-band__value {
  flex: 0 0 auto;
  margin: 0;
  padding: calc(var(--wsc-pad) * .4) var(--wsc-pad) calc(var(--wsc-pad) * .65);
  font-size: var(--wsc-fs);
  overflow-wrap: anywhere;
}

.wsc-band__value--name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(2 * 1.4em);
}

.wsc-mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.wsc-band__value--host {
  display: flex;
  align-items: center;
  gap: .6em;
}

.wsc-dot {
  flex: 0 0 auto;
  width: .78em;
  height: .78em;
  border-radius: 2px;
  background: var(--wsc-dot-fresh);
}
.wsc-dot--fresh { background: var(--wsc-dot-fresh); }
.wsc-dot--stale { background: var(--wsc-dot-stale); }
.wsc-dot--unknown { background: var(--wsc-dot-unknown); }

.wsc-players {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: calc(var(--wsc-pad) * .7);
  padding: calc(var(--wsc-pad) * .4) var(--wsc-pad) calc(var(--wsc-pad) * .55);
}

.wsc-players__count {
  flex: 0 0 auto;
  font-size: calc(var(--wsc-fs) * 1.06);
  font-weight: 700;
}

.wsc-players__bots {
  flex: 0 0 auto;
  font-size: calc(var(--wsc-fs) * 0.86);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.wsc-bar {
  display: flex;
  flex: 1 1 auto;
  height: clamp(11px, 3.9cqw, 20px);
  background: var(--wsc-rank-empty);
  border-radius: var(--wsc-radius);
}

.wsc-bar__seg {
  position: relative;
  height: 100%;
  transition: filter 150ms ease-out;
}

.wsc-bar__seg:first-child { border-radius: var(--wsc-radius) 0 0 var(--wsc-radius); }
.wsc-bar__seg:last-child  { border-radius: 0 var(--wsc-radius) var(--wsc-radius) 0; }

.wsc-bar__seg:only-child   { border-radius: var(--wsc-radius); }

.wsc-bar__seg:hover {
  filter: brightness(1.4) saturate(1.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .75);
}

.wsc-bar__seg::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  z-index: var(--wsc-z-tip);
  padding: 3px 7px;
  border: 1px solid var(--wsc-border);
  border-radius: var(--wsc-radius);
  background: var(--wsc-tip-bg);
  box-shadow: var(--wsc-tag-shadow);
  color: var(--wsc-tip-text);
  font-size: var(--wsc-fs-small);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  pointer-events: none;
}

.wsc-bar__seg:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.wsc-bar__seg::before {
  content: "";
  position: absolute;
  inset: -6px 0;
}
.wsc-bar__seg--legend { background: var(--wsc-rank-legend); }
.wsc-bar__seg--pro    { background: var(--wsc-rank-pro); }
.wsc-bar__seg--human  { background: var(--wsc-rank-player); }
.wsc-bar__seg--vip    { background: var(--wsc-rank-vip); }
.wsc-bar__seg--f2p    { background: var(--wsc-rank-f2p); }

.wsc-bar__seg--player { background: var(--wsc-rank-player); }

.wsc-bar__seg--bot    { background: var(--wsc-rank-bot); }

.wsc-chart {

  flex: 1 1 auto;
  display: flex;
  min-height: clamp(78px, 38cqw, 200px);

  padding: calc(var(--wsc-pad) * .5) var(--wsc-pad) calc(var(--wsc-pad) * 1.1);
  margin-bottom: calc(var(--wsc-pad) * .4);
}

.wsc-plot {
  position: relative;
  flex: 1 1 auto;
  padding: 2px 2px 4px calc(var(--wsc-fs-axis, 9px) * 2.4);
  background: var(--wsc-chart-bg);
  border: 1px solid var(--wsc-chart-frame);
  border-radius: 4px;
}

.wsc-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(64px, 32cqw, 180px);
}

.wsc-plot__pending {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--wsc-fs-small);
  color: var(--wsc-muted);
  pointer-events: none;
}

.wsc-plot__pending--error {
  color: var(--wsc-danger);
  opacity: 0.75;
}

.wsc-plot__axis {
  position: absolute;
  right: calc(100% + 2px);
  width: calc(var(--wsc-fs-axis, 9px) * 2.1);
  color: var(--wsc-muted);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--wsc-fs-axis, 9px);
  line-height: 1;
  text-align: right;
  transform: translateY(-50%);
  pointer-events: none;
}

.wsc-plot__area {
  position: relative;
  width: 100%;
  height: 100%;
}

.wsc-hover__guide,
.wsc-hover__dot,
.wsc-hover__tip {
  opacity: 0;
  pointer-events: none;
  transition: opacity .08s linear;
}

.wsc-plot__area.is-hovering .wsc-hover__guide,
.wsc-plot__area.is-hovering .wsc-hover__dot,
.wsc-plot__area.is-hovering .wsc-hover__tip { opacity: 1; }

.wsc-hover__guide {
  stroke: var(--wsc-hover-guide);
  stroke-width: 1;

  vector-effect: non-scaling-stroke;
}

.wsc-hover__dot {
  position: absolute;
  width: var(--wsc-hover-dot-size, 7px);
  height: var(--wsc-hover-dot-size, 7px);
  margin: calc(var(--wsc-hover-dot-size, 7px) / -2) 0 0 calc(var(--wsc-hover-dot-size, 7px) / -2);
  border-radius: 50%;
  background: var(--wsc-chart-line);
  box-shadow: 0 0 0 2px var(--wsc-chart-bg);
}

/* with a visible map image (wsc-plot--image) the line of the humans and its hover dot in the colour of that image (cards.js
   sets --wsc-chart-line-on-image on the plot from its LOOK; without one the theme's colour); the bots line stays. The
   colour changes over the fade-in of the image (.4s, .wsc-plot__bg), so it never changes before the image shows */
.wsc-plot--image .wsc-chart__line:not(.wsc-chart__line--bots) { stroke: var(--wsc-chart-line-on-image, #fff); }
.wsc-plot--image .wsc-hover__dot { background: var(--wsc-chart-line-on-image, #fff); }
.wsc-chart__line:not(.wsc-chart__line--bots) { transition: stroke .4s ease; }
@media (prefers-reduced-motion: reduce) {
  .wsc-chart__line:not(.wsc-chart__line--bots) { transition: none; }
}

.wsc-hover__dot.is-empty {
  background: transparent;
  border: 1px solid var(--wsc-hover-guide);
  box-shadow: none;
}

.wsc-hover__tip {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 3px;

  border: 1px solid var(--wsc-hover-tip-edge);
  background: var(--wsc-hover-tip-bg);
  color: var(--wsc-hover-tip-fg);
  font-size: var(--wsc-fs-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  z-index: 2;
}

.wsc-hover__tip.is-start { transform: translateX(0); }
.wsc-hover__tip.is-end   { transform: translateX(-100%); }

.wsc-chart__grid { stroke: var(--wsc-chart-grid); stroke-width: 1; }
.wsc-chart__tick { stroke: var(--wsc-chart-frame); stroke-width: 1; }
.wsc-chart__line {
  fill: none;
  stroke: var(--wsc-chart-line);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wsc-chart__line--bots {
  stroke: var(--wsc-chart-line-bots, var(--wsc-chart-line));
  stroke-width: 1.3;
  opacity: .55;
}

.wsc-chart__gap {
  stroke: var(--wsc-chart-gap);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  opacity: .45;
}

.wsc-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: var(--wsc-z-tip);
  padding: .32em .8em;
  border-radius: var(--wsc-radius);
  pointer-events: none;
}

.wsc-status--kickrisk    { background: var(--wsc-tag-kickrisk-bg);   color: var(--wsc-tag-kickrisk-fg); }
.wsc-status--fullvip     { background: var(--wsc-tag-fullvip-bg);    color: var(--wsc-tag-fullvip-fg); }
.wsc-status--fulllegend  { background: var(--wsc-tag-fulllegend-bg); color: var(--wsc-tag-fulllegend-fg); }
.wsc-status--full        { background: var(--wsc-tag-full-bg);       color: var(--wsc-tag-full-fg); }
.wsc-status--stale       { background: var(--wsc-tag-stale-bg);      color: var(--wsc-tag-stale-fg); }
.wsc-status--freehumans  { background: var(--wsc-tag-freehumans-bg); color: var(--wsc-tag-freehumans-fg); }

.wsc-note {
  flex: 0 0 auto;
  margin: 0 var(--wsc-pad) calc(var(--wsc-pad) * .75);
  color: var(--wsc-muted);
  font-size: var(--wsc-fs-small);
}

.wsc-band__value--none,
.wsc-band__value--pending {
  color: var(--wsc-muted);
}

/* The field: everything from the server name to the bottom of the card. The tags (status, LEGEND, PRO) move in
   .wsc-field__tags above all bands and bounce off its edges and off each other; the motion is computed in cards.js
   (createTagMotion), here is only the place and the look. */
.wsc-field {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.wsc-field__tags {
  position: absolute;
  inset: 0;
  z-index: calc(var(--wsc-z-tip) - 1);
  pointer-events: none;
}

.wsc-field__tags > .wsc-tag {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transition: opacity .25s ease, background-color .3s ease, color .3s ease;
}

.wsc-field__tags > .wsc-tag.is-entering,
.wsc-field__tags > .wsc-tag.is-leaving { opacity: 0; }

.wsc-tag {
  padding: .28em .8em;
  border: 1px solid var(--wsc-tag-ring);
  border-radius: 999px;
  box-shadow: var(--wsc-tag-shadow);
  font-size: var(--wsc-fs-small);
  font-weight: 700;
  white-space: nowrap;
}

.wsc-tag--legend { background: var(--wsc-rank-legend); color: var(--wsc-tag-presence-fg); }
.wsc-tag--pro    { background: var(--wsc-rank-pro);    color: var(--wsc-tag-presence-fg-pro); }

/* Reduced motion (and browsers without the observers): no movement, the tags stand in a row at the top of the field. */
@media (prefers-reduced-motion: reduce) {
  .wsc-field__tags {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
    padding: 14px;
  }
  .wsc-field__tags > .wsc-tag {
    position: static;
    transform: none !important;
    transition: none;
  }
  .wsc-field__tags > .wsc-tag.is-entering { opacity: 1; }
}

.wsc-field__tags.is-static {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  padding: 14px;
}
.wsc-field__tags.is-static > .wsc-tag { position: static; transform: none !important; }

.wsc-banner {
  display: none !important;
}

.wsc-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 40px 12px;
  text-align: center;
  color: var(--wsc-muted);
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
}

.wsc-band__value--map {
  display: flex;
  align-items: center;
  gap: .5em;
}
.wsc-map__thumb {
  flex: 0 0 auto;
  width: 1.6em;
  height: 1.6em;
  object-fit: contain;
}

.wsc-card__desc {
  font-weight: 700;
  color: #ffffff;
  background: transparent;
}

.wsc-card__meta, .wsc-card__addr {
  font-weight: 700;
  color: #ffffff;
  background: transparent;
}

.wsc-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 35px 0 25px 0;
  padding: 10px;
}

.wsc-filter-btn {
  background: #191b1f;
  color: #c8cdd4;
  border: 1px solid #2e333d;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  line-height: 1.4;
}

.wsc-filter-btn:hover {
  background: #2b313d;
  color: #fff;
  border-color: #4a5263;
  transform: translateY(-1px);
}

.wsc-filter-btn.active {
  background: #d92626;
  color: #ffffff;
  border-color: #d92626;
  box-shadow: 0 0 12px rgba(217, 38, 38, 0.45);
  cursor: default;
}

.wsc-filter-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.wsc-filter-count {
  color: #8c939e;
  font-size: 13px;
  margin-left: 10px;
  font-weight: 500;
}

.wsc-pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 35px 0 25px 0;
  padding: 10px;
}

.wsc-page-btn {
  background: #191b1f;
  color: #c8cdd4;
  border: 1px solid #2e333d;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
}

.wsc-page-btn:hover {
  background: #2b313d;
  color: #fff;
  border-color: #4a5263;
  transform: translateY(-1px);
}

.wsc-page-btn.active {
  background: #d92626;
  color: #ffffff;
  border-color: #d92626;
  box-shadow: 0 0 12px rgba(217, 38, 38, 0.45);
  cursor: default;
}

.wsc-page-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.wsc-page-info {
  color: #8c939e;
  font-size: 13px;
  margin-left: 10px;
  font-weight: 500;
}

.wsc-cards { max-width: 100%; margin: 10px auto 40px; }
.wsc-cards .wsc-grid,
#servercards-grid.wsc-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
@media (max-width: 1199px) {
    .wsc-cards .wsc-grid, #servercards-grid.wsc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 850px) {
    .wsc-cards .wsc-grid, #servercards-grid.wsc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 575px) {
    .wsc-cards .wsc-grid, #servercards-grid.wsc-grid { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
}
