/* The list of the servers (views/servers.js, #/servers) as square covers, in the manner of the albums of Apple Music: a soft gradient of the icon's colour, the icon
   on it, the name at the bottom left in white; under the cover the state and one button. No pill and no panel that opens: every cover is the same square. The cards are
   still the computer cards of computers.css (the colours come from the same classes, sb-h0 ... sb-h23); this file only reshapes them, under .server-albums. */
.server-albums.computer-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(176px, 100%), 1fr));
  gap: 26px 20px;
  padding-bottom: 24px;
}
.server-albums .server-card { transition: none; }

/* The cover: a square with a gradient of the icon's hue (lighter above, deeper below). */
.server-albums .server-card.server-card .computer-banner.server-banner {
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(165deg, hsl(var(--sb-hue) var(--sb-s) 62%), hsl(var(--sb-hue) var(--sb-s) 34%));
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* A server with no colour yet (no icon): a quiet grey cover. */
.server-albums .server-card:not([class*="sb-h"]) .computer-banner.server-banner { background: linear-gradient(165deg, light-dark(#c9ccd2, #4b4e55), light-dark(#9a9ea6, #2c2e33)); }
.server-albums .computer-banner.server-banner::before { box-shadow: none; }
.server-albums .computer-banner.server-banner::after { background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 40%, rgba(0, 0, 0, 0.32)); }
.server-albums .server-banner > .banner-glow-live { display: none !important; }
/* The glow: a picture of soft blobs of the icon's colours (blue when there is no icon) under the icon; it shows for a server with no icon and one whose icon has see-through parts. */
.server-albums .server-banner > .banner-glow:not(.banner-glow-live) { display: block; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.server-albums .server-banner > .banner-glow[hidden] { display: none; }

/* The icon fills the whole cover (the gradient shows only for a server with no icon, or while it loads). */
.server-albums .server-banner > .banner-icon {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  -webkit-mask-image: none;
  mask-image: none;
  /* the game's icon is only 64x64: the browser's own smooth scaling softens it naturally (no pixelated rendering, no sharpening) */
  image-rendering: auto;
  filter: blur(1.2px); /* a little soft (the game's icon is only 64x64) */
}
.server-albums .server-card:not([data-state="online"]) .server-banner > .banner-icon { filter: grayscale(1) blur(1.2px); }
/* An icon with see-through parts: a little smaller, whole, on the glow. */
.server-albums .server-banner.icon-small > .banner-icon { inset: 15%; width: 70%; height: 70%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)) blur(1px); }

/* The name: white and a little see-through, at the bottom left, with a wide soft glow (white close in, the icon's hue farther out, a dark halo under it all) so that it reads on any picture. */
.server-albums .server-card .server-banner .banner-name {
  right: 12px;
  bottom: 11px;
  left: 12px;
  width: auto;
  max-width: none;
  z-index: 4;
  /* (no overflow clip and no line clamp: Safari cuts a text shadow off at the box of such an element, which showed as a hard rectangle around the glow) */
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10.5cqw;
  filter: none;
  opacity: 1;
  font-weight: 700;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.22),
    0 0 14px hsl(var(--sb-hue, 222) var(--sb-s, 85%) 76% / 0.55),
    0 0 34px hsl(var(--sb-hue, 222) var(--sb-s, 85%) 66% / 0.45),
    0 0 60px hsl(var(--sb-hue, 222) var(--sb-s, 85%) 58% / 0.3);
}

/* The menu on the cover's top right. */
.server-albums .computer-card > .menu-wrap { top: 8px; right: 8px; }

/* Under the cover: the state and the line of the core (no buttons: a press on the cover opens the server). The name is on the cover (the h2 stays for readers of the screen). */
.server-albums .server-card .computer-panel {
  position: static;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 2px 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
}
.server-albums .computer-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.server-albums .computer-status { margin-top: 0; font-size: 13px; }
.server-albums .computer-status.server-info { overflow: hidden; margin-top: 1px; color: var(--faint); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }

/* The tile to add a server: a square of the same size with a dashed edge. */
.server-albums .add-card { aspect-ratio: 1; border: 2px dashed var(--separator); border-radius: 10px; background: transparent; box-shadow: none; }
.server-albums .add-card:hover { background: var(--hover); }

/* Under the cover, on the picture behind the page in the dark mode: the state, the line of the core and the owner are bright (no shadow), the grey dot white. */
.server-albums .computer-status { color: light-dark(var(--muted), #ffffff); }
.server-albums .computer-status.server-info { color: light-dark(var(--faint), rgba(255, 255, 255, 0.92)); }
.server-albums .server-card:not([data-state="online"]) .status-dot { background: light-dark(var(--faint), #ffffff); }
.server-albums .computer-card[data-state="online"] .status-text { color: light-dark(var(--ok), #6ff59a); }
.server-albums .computer-card[data-state="online"] .status-dot { background: light-dark(var(--ok), #6ff59a); }

/* Pointing at a cover (or a key on it): the picture blurs and the name gives place to "관리하기". The cover does not lift. */
.server-albums .banner-name-manage { display: none; }
.server-albums .server-card:hover .banner-name-text,
.server-albums .server-card:has(:focus-visible) .banner-name-text,
.server-albums .server-card:has(> .menu-wrap > [aria-expanded="true"]) .banner-name-text { display: none; }
.server-albums .server-card:hover .banner-name-manage,
.server-albums .server-card:has(:focus-visible) .banner-name-manage,
.server-albums .server-card:has(> .menu-wrap > [aria-expanded="true"]) .banner-name-manage { display: inline; }
.server-albums .server-banner > .banner-icon, .server-albums .server-banner > .banner-glow { transition: filter 0.25s ease; }
.server-albums .server-card:hover .server-banner > .banner-icon,
.server-albums .server-card:has(:focus-visible) .server-banner > .banner-icon,
.server-albums .server-card:has(> .menu-wrap > [aria-expanded="true"]) .server-banner > .banner-icon { filter: blur(9px); }
.server-albums .server-card:not([data-state="online"]):hover .server-banner > .banner-icon,
.server-albums .server-card:not([data-state="online"]):has(:focus-visible) .server-banner > .banner-icon { filter: grayscale(1) blur(9px); }
.server-albums .server-card:hover .server-banner > .banner-glow:not(.banner-glow-live) { filter: blur(6px); }

/* The copy of a cover that grows over the window when it is pressed (views/servers.js openServer): a fixed box that takes the place and size of the cover and grows; what is in it
   fills it. The panel and the menu of the card are not shown. */
.cover-zoom { position: fixed; z-index: 400; overflow: hidden; border-radius: 10px; pointer-events: none; transform-origin: 50% 50%; will-change: transform; }
.cover-zoom .computer-card { width: 100%; height: 100%; }
.cover-zoom .computer-panel, .cover-zoom .menu-wrap { display: none; }
.cover-zoom .server-card.server-card .computer-banner.server-banner { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.cover-zoom .banner-name { opacity: 0 !important; }
