/* Server page background ("hero") — the IP lives here, not in the details box.
   The block is intentionally NOT a .container: it spans the navbar's width and
   reads as a page header, so the address is the first thing a visitor sees. */

.server-hero {
  position: relative;
  /* #content is already the navbar-width column (95% / max 1000px), so the
     hero spans the content edge-to-edge instead of insetting itself again. */
  width: 100%;
  margin: 10px auto;
  border-radius: 6px;
  box-shadow: 0 0 10px #0005;
  background-color: #203658;
  /* Own stacking context (z-index, not isolation:isolate) so the hero paints
     above the page containers that follow it. The head tooltips and the +N list
     open downwards out of the hero onto that area; without a positive level
     here, the later-in-DOM containers win the paint order and cover them. */
  isolation: isolate;
  z-index: 2;
}

.server-hero-backdrop {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  z-index: -1;
}

.server-hero-banner {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Readability wash: dark from the left (where the text sits) and from the
   bottom, so a bright banner never swallows the title. */
.server-hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, #0b1830fa 0%, #102648e6 45%, #1026488c 100%),
    linear-gradient(0deg, #0b183099 0%, #0b183000 55%);
}

/* No banner: don't stretch the site's own placeholder art behind the hero —
   a themed gradient reads as "this server has no banner yet". */
.server-hero.is-placeholder .server-hero-banner {
  display: none;
}

.server-hero.is-placeholder {
  background-image: linear-gradient(135deg, #1b3358 0%, #203658 45%, #2b4d7a 100%);
}

.server-hero.is-placeholder .server-hero-backdrop::after {
  background-image: linear-gradient(90deg, #0b1830d9 0%, #10264866 60%, #10264800 100%);
}

.server-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 120px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.server-hero-icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1a2f4f;
  color: #8fa8c8;
  font-size: 28px;
  box-shadow: 0 0 0 2px #ffffff26, 0 4px 12px #0007;
}

.server-hero-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.server-hero-text {
  flex: 1 1 260px;
  min-width: 0;
}

.server-hero-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* Above the name/meta lines: the player-head tooltip and the +N list open
     downwards from here and must not be painted over by the heading below. */
  position: relative;
  z-index: 3;
  gap: 0 7px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: #cfdcec;
}

.server-hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #8fa0b5;
  box-shadow: 0 0 8px currentColor;
}

.server-hero-status.is-online .server-hero-dot {
  background-color: #3ddc84;
  color: #3ddc84;
}

.server-hero-status.is-online .server-hero-status-label {
  color: #7bf0ad;
}

.server-hero-status.is-offline .server-hero-dot {
  background-color: #ff5d5d;
  color: #ff5d5d;
}

.server-hero-status.is-offline .server-hero-status-label {
  color: #ff9b9b;
}

.server-hero-players {
  color: #fff;
}

/* The live client toggles these with the `hidden` attribute; the chip rules set
   display themselves, which would otherwise beat the UA `[hidden]` style. */
.server-hero-players[hidden],
.server-hero-players-unit[hidden],
.server-hero-heads[hidden],
.server-hero-chip[hidden] {
  display: none;
}

.server-hero-players-unit {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #cfdcec;
}

/* ------------------------------------------------------- player heads
   Up to three overlapped skin heads after the player count, plus a +N badge
   that opens the full name list. The whole cluster is re-rendered by the SSE
   client (js/page-server-live.js), so both paths must produce this markup. */
.server-hero-heads {
  display: inline-flex;
  align-items: center;
  /* The status row already spaces its items with a gap; this only keeps the
     first face's ring from touching the "players" label. */
  padding-left: 2px;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
  /* Own stacking context: the hero chips/address plate that follow this cluster
     paint above it otherwise, which would slice the tooltip in half. Inside
     the context the heads and the +N badge are isolated from each other, so a
     hovered head is never covered by the next one. */
  position: relative;
  isolation: isolate;
  z-index: 3;
}

.server-hero-head {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  /* Overlap: each head covers most of the previous one's right edge. */
  margin-left: -8px;
  background-color: #102648;
  box-shadow: 0 0 0 2px #16253c;
}

.server-hero-head:first-child {
  margin-left: 0;
}

.server-hero-head img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  image-rendering: pixelated;
  transition: transform 0.12s;
}

/* Hovered/focused head pops above its neighbours so the tooltip and the ring
   are not covered by the next face. Only the face scales — the tooltip stays
   at its own size. */
.server-hero-head:hover,
.server-hero-head:focus-visible {
  z-index: 2;
  outline: none;
}

.server-hero-head:hover img,
.server-hero-head:focus-visible img {
  transform: scale(1.2);
}

/* Name tooltip. It must hang off the wrapper: ::after on the <img> itself
   never renders, replaced elements have no pseudo-element box. It opens
   BELOW the faces — the status row is the topmost line of the hero, so a
   tooltip above it would escape the plate and ride over the navbar. */
.server-hero-head::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid #ffffff26;
  background-color: #0b1830f2;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Names can contain spaces and long ad prefixes; keep one line, clip the rest. */
  box-sizing: border-box;
  box-shadow: 0 6px 16px #0007;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  visibility: hidden;
}

.server-hero-head:hover::after,
.server-hero-head:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

/* "+N" badge: the same box as a head, reads as the last item of the stack.
   The overlap matches .server-hero-head's so it covers the preceding face by
   exactly the same amount the second head covers the first. */
.server-hero-heads-more {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* A data attribute never changes layout, so the badge may contain any number
     of digits: it grows to the right from the overlap, like a wider head. */
  min-width: 22px;
  height: 22px;
  margin-left: -8px;
  padding: 0 5px;
  border-radius: 11px;
  border: 1px solid #ffffff26;
  background-color: #ffffff14;
  color: #dbe6f4;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  cursor: help;
}

.server-hero-heads-more:hover,
.server-hero-heads-more:focus-visible {
  background-color: #ffffff26;
  color: #fff;
  outline: none;
}

/* The full list: a plain block opened on hover/focus/click, anchored BELOW the
   badge (same side as the head tooltips) so it stays inside the hero plate
   instead of escaping over the page header. */
.server-hero-heads-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  display: none;
  box-sizing: border-box;
  min-width: 150px;
  max-width: 260px;
  max-height: 210px;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ffffff26;
  background-color: #0b1830f5;
  color: #fff;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 20px #0009;
  cursor: default;
  z-index: 5;
}

.server-hero-heads-more:hover .server-hero-heads-list,
.server-hero-heads-more:focus-visible .server-hero-heads-list,
.server-hero-heads-more:focus-within .server-hero-heads-list,
.server-hero-heads-more.is-open .server-hero-heads-list {
  display: block;
}

.server-hero-heads-list-head {
  display: block;
  margin-bottom: 5px;
  color: #eebc62;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.server-hero-heads-list-items {
  display: block;
}

.server-hero-heads-list-item {
  display: block;
  overflow-wrap: anywhere;
}

.server-hero-name {
  margin: 3px 0 0;
  font-size: 27px;
  line-height: 1.18;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px #0009;
  overflow-wrap: anywhere;
}

.server-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.server-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid #ffffff1f;
  background-color: #ffffff14;
  color: #dbe6f4;
  font-size: 12.5px;
  line-height: 1.7;
}

.server-hero-chip .fa {
  color: #eebc62;
  font-size: 12px;
}

.server-hero-chip.is-featured {
  border-color: #eebc6255;
  background-color: #eebc6222;
  color: #f6d79c;
}

/* The address: the loudest element on the page by design (it used to hide in a
   title/value row). Click = copy, same data-* contract as the list cards. */
.server-hero-address {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 9px 16px;
  border-radius: 6px;
  background-color: #eebc62;
  color: #16253c;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 16px #0007, inset 0 0 0 1px #ffffff55;
  transition-property: background-color, top;
  transition-duration: 0.15s;
}

.server-hero-address:hover {
  background-color: #f7cd82;
}

.server-hero-address:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.server-hero-address-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.server-hero-copy-icon {
  font-size: 15px;
  opacity: 0.7;
}

.server-hero-address.copied {
  background-color: #3ddc84;
}

.server-hero-address.copyerror {
  background-color: #ff6b6b;
}

/* Plate signs (address + edit/delete): ONE shared definition, so the boxes are
   pixel identical no matter what font, line-height, padding or border width the
   host plate has. They are absolutely positioned, so hiding them via
   visibility keeps them out of layout while the box metrics stay fixed. */
.server-hero-address::after,
.server-action-btn::after {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 27px;
  padding: 0 10px;
  content: attr(data-copy-hint);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  bottom: auto;
  border-radius: 6px;
  border: 1px solid #ffffff26;
  background-color: #0b1830f2;
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 6px 16px #0007;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
}

.server-action-btn::after {
  content: attr(data-tip);
}

.server-hero-address:hover::after,
.server-hero-address.copied::after,
.server-hero-address.copyerror::after,
.server-action-btn:hover::after,
.server-action-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.server-hero-address.copied::after {
  content: attr(data-copied-hint);
  background-color: #0f6b3cf2;
  border-color: #3ddc8466;
}

.server-hero-address.copyerror::after {
  content: attr(data-copy-error-hint);
  background-color: #a01f2af2;
  border-color: #ff8a9566;
}

/* Address + owner/admin actions form ONE plate row at the hero's right edge:
   [edit] [delete] [address]. The buttons reuse the address plate's fill, radius
   and shadow and stretch to its height, so the cluster reads as a single unit. */
/* The sign is absolutely positioned against the plate, and the fa class puts the
   icon font on the whole button — keep the glyph on ::before and let the sign
   inherit the page font. */
.server-action-btn {
  position: relative;
}

.server-action-btn.fa {
  font-family: inherit;
}

.server-action-btn.fa::before {
  font-family: FontAwesome, "Font Awesome 5 Free", sans-serif;
  font-weight: 400;
}

.server-hero-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  max-width: 100%;
}

.server-hero-controls .server-hero-address {
  margin-left: 0;
}

.server-hero-actions {
  position: static;
  top: auto;
  right: auto;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.server-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  min-height: 44px;
  max-height: 56px;
  box-sizing: border-box;
  padding: 0;
  border-radius: 6px;
  border: none;
  background-color: #eebc62;
  color: #16253c;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 16px #0007, inset 0 0 0 1px #ffffff55;
  transition-property: background-color, color;
  transition-duration: 0.15s;
}

.server-action-btn:hover {
  background-color: #f7cd82;
  color: #16253c;
}

.server-action-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.server-action-danger:hover {
  background-color: #ff6b6b;
  border-color: transparent;
  color: #2a0b0b;
}



.server-page {
  display: flex;
  margin-bottom: -10px;
}

.left-section {
  width: 40%;
  float: left;
}

.right-section {
  width: calc(60% - 10px);
  margin-left: 10px;
  float: left;
}

.left-section .container,
.right-section .container {
  margin-bottom: 10px;
  margin-top: 10px;
}

/* Details: a label/value list (label muted left, value right) instead of the
   old centred title-then-value stacks. */
.server-detail-list {
  display: flex;
  flex-direction: column;
}

.server-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 2px;
  font-size: 14px;
  border-bottom: 1px solid #ffffff14;
}

.server-detail-row:last-child {
  border-bottom: none;
}

.server-detail-label {
  color: #b7c6da;
}

.server-detail-value {
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.server-detail-badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.server-detail-badge.is-yes {
  background-color: #8a5a1f;
  color: #ffe8c2;
}

.server-detail-badge.is-no {
  background-color: #1f7a45;
  color: #eaffef;
}

.server-detail-badge.is-unknown {
  background-color: #3a4a63;
  color: #dbe6f5;
}

/* Related servers (server_relations bridge): full list-style cards stacked
   under each other — the lists' 2-per-row grid doesn't fit the narrow
   server-page column (half-width cards side by side read as broken). */
.related-servers .content.serverlist {
  display: flex;
  flex-wrap: wrap;
}

.related-servers .oneserver {
  width: 90%;
}

.vote-form h3 {
  margin-top: 0;
  margin-bottom: 5px;
  text-align: center;
}

.vote-form .form-feedback {
  margin-bottom: 5px;
  color: #f77;
  font-size: 14px;
  text-align: center;
}

.vote-form {
  display: none;
}

#voteForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 4px 6px;
}

.vote-form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vote-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.vote-name-field .multiform-input {
  width: 100%;
  box-sizing: border-box;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 10px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: #0b1830;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition-property: background-color, border-color, color;
  transition-duration: 0.15s;
}

.vote-btn .fa {
  font-size: 14px;
}

.vote-btn-up {
  border-color: rgba(238, 188, 98, 0.45);
  color: #eebc62;
}

.vote-btn-up:hover,
.vote-btn-up:focus-visible {
  background-color: #eebc62;
  border-color: #eebc62;
  color: #16253c;
}

.vote-btn-down {
  border-color: rgba(248, 136, 136, 0.4);
  color: #f88;
}

.vote-btn-down:hover,
.vote-btn-down:focus-visible {
  background-color: #f88;
  border-color: #f88;
  color: #2a0b0b;
}

.vote-reward-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(238, 188, 98, 0.55);
  background-image: linear-gradient(90deg, rgba(238, 188, 98, 0.2) 0%, rgba(238, 188, 98, 0.06) 100%);
  box-shadow: inset 3px 0 0 #eebc62;
  color: #f3d9a0;
  font-size: 13px;
  line-height: 1.4;
}

.vote-reward-note .fa {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #eebc62;
  font-size: 16px;
}

.vote-captcha {
  display: flex;
  justify-content: center;
}

.vote-cooldown {
  text-align: center;
  padding: 12px 8px;
}

.vote-cooldown-text {
  margin: 0;
  font-size: 16px;
  color: #eebc62;
}

.vote-form .buttons a {
  text-align: center;
  display: block;
  margin-top: 5px;
}

/* Player-count history: stats + range pills above a gold filled line. */
#main .container .content.analytics-panel {
  overflow: hidden;
  padding: 12px 12px 10px;
  --chart-line: #eebc62;
  --chart-fill-top: rgba(238, 188, 98, 0.42);
  --chart-fill-bottom: rgba(238, 188, 98, 0.02);
  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-tick: #b7c6da;
  --chart-crosshair: rgba(238, 188, 98, 0.5);
  --chart-offline: rgba(220, 70, 70, 0.16);
  --chart-gap: rgba(255, 255, 255, 0.05);
  --chart-tooltip-bg: rgba(11, 24, 48, 0.96);
  --chart-tooltip-border: rgba(238, 188, 98, 0.45);
  --chart-tooltip-title: #eebc62;
  --chart-tooltip-body: #fff;
}

.analytics-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.analytics-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 8px;
  flex: 1 1 200px;
  min-width: 0;
}

.analytics-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.analytics-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b7c6da;
}

.analytics-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-stat-value.is-offline {
  color: #f88;
}

.analytics-ranges {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 6px;
  background-color: #0b1830;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.analytics-range {
  margin: 0;
  padding: 5px 9px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #b7c6da;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition-property: background-color, color;
  transition-duration: 0.15s;
}

.analytics-range:hover,
.analytics-range:focus-visible {
  color: #fff;
}

.analytics-range.is-active {
  background-color: #eebc62;
  color: #16253c;
}

.analytics-chart-wrap {
  position: relative;
  height: 210px;
  border-radius: 6px;
  background-image: linear-gradient(180deg, rgba(11, 24, 48, 0.5) 0%, rgba(11, 24, 48, 0.18) 100%);
}

.analytics-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media only screen and (max-width: 750px) {
  .server-hero-inner {
    padding: 12px;
    gap: 10px;
    min-height: 0;
  }

  .server-hero-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .server-hero-name {
    font-size: 22px;
  }

  .server-hero-controls {
    width: 100%;
    gap: 6px;
  }

  .server-hero-address {
    margin-left: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    justify-content: center;
    font-size: 17px;
    padding: 8px 12px;
  }

  .server-action-btn {
    width: 42px;
    min-height: 40px;
    max-height: 40px;
    align-self: center;
  }

  .server-action-btn::after {
    right: auto;
    left: 0;
  }

  .server-page {
    flex-direction: column;
  }

  .left-section {
    width: 100%;
  }

  .right-section {
    width: 100%;
    margin-left: 0px;
  }

  /* The +N list is right-anchored to the badge on wide screens (it grows to
     the left, away from the address plate). On a narrow screen the status row
     starts near the hero's left edge, so it opens to the RIGHT instead of
     being clipped. */
  .server-hero-heads-list {
    right: auto;
    left: 0;
    min-width: 130px;
    max-width: 220px;
  }
}
