/* Cover art. Every cover is a 3:4 case; titles without art get a
   generated case in a colour derived from the title. */
.art {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-3);
  box-shadow: var(--shadow-art);
  container-type: inline-size;
  isolation: isolate;
}
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
  background: linear-gradient(165deg, rgb(255 255 255 / 0.1), transparent 30%);
}
.art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.art-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 11% 10%;
  background:
    radial-gradient(120% 70% at 100% 0%, hsl(var(--hue) 80% 60% / 0.34), transparent 62%),
    linear-gradient(170deg, hsl(var(--hue) 34% 25%), hsl(calc(var(--hue) + 30) 40% 10%) 88%);
}
.art-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(125deg, rgb(255 255 255 / 0.05) 0 1.5px, transparent 1.5px 9px);
  -webkit-mask: linear-gradient(200deg, #000 10%, transparent 55%);
  mask: linear-gradient(200deg, #000 10%, transparent 55%);
}
.art-fallback::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 9%;
  height: 3px;
  border-radius: 3px;
  background: hsl(var(--hue) 85% 68% / 0.75);
  width: 22%;
}
.art-fallback span {
  position: relative;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  color: rgb(255 255 255 / 0.94);
  font-size: clamp(0.72rem, 10.5cqi, 1.6rem);
  font-weight: 820;
  font-stretch: 110%;
  line-height: 1.02;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* Tiles */
.tile { display: flex; flex-direction: column; gap: 11px; min-width: 0; color: inherit; }
.tile-art { position: relative; display: block; border-radius: var(--radius); transition: transform 0.4s var(--ease); }
.tile-art .art { transition: box-shadow 0.4s var(--ease); }
a.tile:hover .tile-art, a.tile:focus-visible .tile-art { transform: translateY(-5px); }
a.tile:hover .art, a.tile:focus-visible .art { box-shadow: var(--shadow-lift); }
a.tile:hover .art img { transform: scale(1.04); }
a.tile:focus-visible { outline: none; }
a.tile:focus-visible .tile-art { outline: 2px solid var(--accent); outline-offset: 4px; }
.tile-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.93rem;
  font-weight: 650;
  line-height: 1.28;
  transition: color 0.15s;
}
a.tile:hover .tile-name { color: #fff; }
.tile-foot { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-top: -6px; }
.tile-meta { min-width: 0; overflow: hidden; color: var(--muted); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.tile-foot .score-chip, .tile-foot .countdown { margin-left: auto; }
.countdown { flex: none; color: var(--accent-hi); font-size: 0.74rem; font-weight: 720; white-space: nowrap; }
.tile-flag {
  position: absolute;
  z-index: 3;
  left: 8px;
  top: 8px;
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgb(10 12 16 / 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  font-size: 0.68rem;
  font-weight: 700;
  font-stretch: 95%;
  letter-spacing: 0.03em;
}
.tile-flag { opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s var(--ease); }
a.tile:hover .tile-flag, a.tile:focus-visible .tile-flag { opacity: 1; transform: none; }
.tile-copies { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); }
.owner-copies { display: inline-flex; align-items: center; gap: 6px; }

.score-chip {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 21px;
  padding: 0 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 0.74rem;
  font-weight: 820;
  font-stretch: 110%;
  font-variant-numeric: tabular-nums;
}
.score-high { --c: var(--ok); }
.score-mid { --c: var(--gold); }
.score-low { --c: var(--accent); }

/* Grids and shelves */
.grid {
  --tile: 168px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
  gap: 34px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.grid-sm { --tile: 132px; gap: 26px 16px; }
@media (max-width: 640px) {
  .grid { --tile: 124px; gap: 26px 14px; }
  .grid-sm { --tile: 104px; }
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head .eyebrow { margin-bottom: 7px; }
.section-title { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.7rem); }
.section-count { color: var(--muted); font-size: 0.95rem; font-weight: 500; font-stretch: 100%; margin-left: 6px; }
.section-tools { display: flex; align-items: center; gap: 8px; }
.see-all { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; color: var(--ink-2); font-size: 0.9rem; font-weight: 650; }
.see-all:hover { color: var(--accent); }

/* Shelves bleed to the window edge while the first tile lines up with the
   page column. --bleed is the distance from the window edge to .wrap. */
.shelf {
  --tile: 176px;
  --bleed: max(var(--gutter), (100vw - var(--page)) / 2);
  --fade-l: 0px;
  --fade-r: 56px;
  margin-top: 60px;
}
.shelf-contained { --bleed: 0px; }
.shelf[data-scrolled] { --fade-l: 56px; }
.shelf[data-end] { --fade-r: 0px; }
.shelf-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--tile);
  gap: 22px;
  margin-inline: calc(-1 * var(--bleed));
  padding: 6px var(--bleed) 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--bleed);
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track > * { scroll-snap-align: start; }
.shelf-nav {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.04);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.shelf-nav:hover { background: rgb(255 255 255 / 0.12); }
.shelf-nav:disabled { opacity: 0.3; cursor: default; background: transparent; }
.shelf[data-static] .shelf-nav { display: none; }
@media (max-width: 640px) {
  .shelf { --tile: 128px; margin-top: 48px; }
  .shelf-nav { display: none; }
}

/* Chips and tabs */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-1);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 620;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { background: var(--bg-3); border-color: var(--line-2); color: var(--ink); }
.chip-count { color: var(--faint); font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-current="true"] .chip-count { color: rgb(10 12 16 / 0.55); }
.chip.is-empty:not([aria-current="true"]) { color: var(--faint); }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgb(255 255 255 / 0.06); border: 1px solid var(--line); width: fit-content; }
.tab { padding: 8px 18px; border-radius: 999px; color: var(--ink-2); font-size: 0.92rem; font-weight: 680; transition: background 0.15s, color 0.15s; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: var(--bg); }

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.07);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-busy { background: var(--gold-soft); color: var(--gold); }
.pill-busy::before { animation: pulse 1.4s ease-in-out infinite; }
.pill-error { background: var(--danger-soft); color: var(--danger); }
.pill-plain::before { display: none; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* Platform marks draw from the SVG files as masks, so they take the text colour. */
.mark {
  display: inline-block;
  flex: none;
  width: auto;
  height: 16px;
  aspect-ratio: 1;
  background: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
.mark-steam { --mark: url("/static/marks/steam.svg?v=3"); }
.mark-playstation { --mark: url("/static/marks/playstation.svg?v=3"); }
.mark-ps4 { --mark: url("/static/marks/ps4.svg?v=3"); aspect-ratio: 24 / 5.6; height: 10px; }
.mark-ps5 { --mark: url("/static/marks/ps5.svg?v=3"); aspect-ratio: 24 / 5.6; height: 10px; }
.mark-switch { --mark: url("/static/marks/switch.svg?v=3"); }
.mark-switch2 { --mark: url("/static/marks/switch2.svg?v=3"); aspect-ratio: 512 / 272; height: 13px; }
.mark-ps-plus { --mark: url("/static/marks/ps-plus.svg?v=3"); aspect-ratio: 799 / 811; height: 13px; background: var(--gold); }
.copy { display: inline-flex; align-items: center; gap: 5px; }
.copy-text { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.02em; }

/* Scores */
.score {
  --size: 64px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  background: rgb(10 12 16 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.score-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--c, var(--muted)) calc(var(--score) * 1%), rgb(255 255 255 / 0.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
}
.score-num { position: relative; font-size: calc(var(--size) * 0.36); font-weight: 850; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.score-sm { --size: 48px; }
.score-sm .score-ring { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }

/* Avatars */
.avatar {
  --size: 32px;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, hsl(var(--hue) 70% 58%), hsl(calc(var(--hue) + 40) 60% 38%));
  color: #fff;
  font-size: calc(var(--size) * 0.44);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
}
.avatar-xs { --size: 18px; font-size: 10px; }
.avatar-lg { --size: 52px; }

/* Cards and panels */
.card { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--bg-1); }
.card + .card { margin-top: 16px; }
.card-title { margin: 0 0 14px; font-size: 1.02rem; font-stretch: 108%; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin: 24px 0; }
.stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-1); }
.stat-num { display: block; font-size: 1.9rem; font-weight: 840; font-stretch: 115%; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 8px; color: var(--muted); font-size: 0.84rem; }

/* Franchise, series, and company cards: a fan of cases. */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.entity {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  transition: border-color 0.2s, transform 0.35s var(--ease), background 0.2s;
}
.entity:hover { border-color: var(--line-2); transform: translateY(-3px); background: linear-gradient(180deg, var(--bg-3), var(--bg-1)); }
.entity-name { margin-top: 18px; font-size: 1.02rem; font-weight: 720; font-stretch: 106%; line-height: 1.25; }
.entity-meta { margin-top: 4px; color: var(--muted); font-size: 0.84rem; }
.fan { position: relative; display: block; height: 148px; }
.fan > img, .fan > .art {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 102px;
  height: auto;
  aspect-ratio: 3 / 4;
  margin-left: -51px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 16px 28px -12px #000, 0 0 0 1px rgb(255 255 255 / 0.08);
  transform-origin: 50% 100%;
  transition: transform 0.45s var(--ease);
}
.fan > :nth-child(1) { z-index: 3; }
.fan > :nth-child(2) { z-index: 2; transform: translateX(-44px) rotate(-8deg) scale(0.9); filter: brightness(0.75); }
.fan > :nth-child(3) { z-index: 1; transform: translateX(44px) rotate(8deg) scale(0.9); filter: brightness(0.75); }
.entity:hover .fan > :nth-child(1) { transform: translateY(-4px); }
.entity:hover .fan > :nth-child(2) { transform: translateX(-60px) rotate(-12deg) scale(0.9); }
.entity:hover .fan > :nth-child(3) { transform: translateX(60px) rotate(12deg) scale(0.9); }

/* Search field with a button */
.search { position: relative; display: flex; gap: 10px; align-items: center; max-width: 620px; }
.search > .icon { position: absolute; left: 18px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input[type="search"] { max-width: none; height: 52px; padding-left: 48px; border-radius: 999px; background: rgb(255 255 255 / 0.07); border-color: var(--line-2); font-size: 1.02rem; }
.search .btn { height: 52px; padding: 0 24px; }
@media (max-width: 520px) { .search .btn { display: none; } }

/* Modal dialog */
.modal {
  width: min(480px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.modal[open] { animation: pop-in 0.2s var(--ease); }
.modal::backdrop { background: rgb(4 5 8 / 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-head { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; margin-bottom: 18px; }
.modal-head .art { border-radius: 7px; }
.modal-head h2 { font-size: 1.25rem; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-1);
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--line-2); }
.option:has(input:checked) { border-color: rgb(255 107 61 / 0.6); background: var(--accent-soft); }
.option .mark { color: var(--ink-2); }

/* Screenshot lightbox */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(4 5 8 / 0.94);
  color: var(--ink);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: min(94vw, 1720px); max-height: 86vh; border-radius: 12px; box-shadow: var(--shadow-pop); }
.lightbox-close, .lightbox-prev, .lightbox-next { position: fixed; z-index: 2; }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 18px; top: 50%; translate: 0 -50%; }
.lightbox-next { right: 18px; top: 50%; translate: 0 -50%; }
.lightbox .icon-btn { width: 48px; height: 48px; background: rgb(255 255 255 / 0.08); }
