/* Backdrops sit behind heroes and banners. Artwork or a screenshot fills
   the frame; without one the cover is blown up and blurred into a colour field. */
.backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.66;
  animation: backdrop-in 1.1s var(--ease) both;
}
.backdrop-soft img { opacity: 0.6; filter: blur(60px) saturate(1.7); transform: scale(1.4); }
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(10 12 16 / 0.7) 0, rgb(10 12 16 / 0) calc(var(--topbar) + 90px)),
    linear-gradient(90deg, rgb(10 12 16 / 0.94) 0%, rgb(10 12 16 / 0.62) 40%, rgb(10 12 16 / 0.05) 78%),
    linear-gradient(0deg, var(--bg) 0%, rgb(10 12 16 / 0.72) 26%, rgb(10 12 16 / 0) 58%);
}
@keyframes backdrop-in { from { opacity: 0; transform: scale(1.03); } }
.backdrop-soft img { animation-name: backdrop-soft-in; }
@keyframes backdrop-soft-in { from { opacity: 0; } }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(460px, 64vh, 660px);
  margin-top: calc(-1 * var(--topbar));
  padding: calc(var(--topbar) + 64px) 0 56px;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: end; }
.hero-copy { max-width: 680px; }
.hero-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--ink-2);
  font-size: 1.08rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.hero-cover { display: block; width: 230px; transform: rotate(2.5deg); transition: transform 0.5s var(--ease); }
.hero-cover:hover { transform: rotate(0deg) translateY(-4px); }
.hero-cover .art { box-shadow: 0 40px 70px -24px #000, 0 0 0 1px rgb(255 255 255 / 0.1); }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cover { display: none; }
}

/* Page heads with a wall of covers on the right */
.page-head {
  position: relative;
  isolation: isolate;
  margin-top: calc(-1 * var(--topbar));
  padding: calc(var(--topbar) + 56px) 0 36px;
  overflow: hidden;
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(90% 120% at 85% 0%, rgb(255 107 61 / 0.1), transparent 55%);
}
.page-head .lede { margin-top: 14px; }
.page-head-body { position: relative; }
.page-head-body > * { max-width: 720px; }
.page-head .search { margin-top: 26px; }
.page-head .tabs { margin-top: 26px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.crumbs .icon { width: 14px; height: 14px; }
.cover-wall {
  position: absolute;
  z-index: -1;
  top: -60px;
  right: -90px;
  width: min(62%, 860px);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  transform: rotate(-9deg);
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 45%), linear-gradient(0deg, transparent 5%, #000 55%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 2%, #000 45%), linear-gradient(0deg, transparent 5%, #000 55%);
  mask-composite: intersect;
}
.cover-wall img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.cover-wall img:nth-child(7n + 2), .cover-wall img:nth-child(7n + 5) { translate: 0 30%; }
@media (max-width: 760px) { .cover-wall { width: 110%; opacity: 0.22; right: -30%; } }

/* Entity banners (company, franchise, series) */
.banner { min-height: 0; padding: calc(var(--topbar) + 84px) 0 44px; }
.banner-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; color: var(--ink-2); font-size: 1rem; }
.banner-meta a { color: var(--ink); font-weight: 650; }
.banner-meta a:hover { color: var(--accent); }

/* Home */
.home-shelf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 32px;
  align-items: end;
  margin-top: 56px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(80% 140% at 0% 0%, rgb(255 107 61 / 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
}
.home-shelf h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); font-stretch: 118%; font-weight: 850; line-height: 1; }
.home-shelf h2 span { color: var(--muted); font-size: 0.42em; font-weight: 600; font-stretch: 100%; letter-spacing: 0; margin-left: 4px; }
.families { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; grid-column: 1; }
.family {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px 0 14px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.family:hover { background: rgb(255 255 255 / 0.09); border-color: var(--line-2); color: var(--ink); }
.family strong { color: var(--ink); font-size: 1.05rem; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.home-shelf-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 700px) {
  .home-shelf { grid-template-columns: 1fr; padding: 22px; }
  .home-shelf-actions { grid-column: 1; grid-row: auto; }
}
.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 28px 30px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-l);
  color: var(--muted);
}
.empty p { margin: 0; max-width: 60ch; }
.empty-inline { padding: 22px 24px; }
.notice-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; transition: border-color 0.15s; }
.notice-link:hover { border-color: rgb(255 107 61 / 0.55); }
.notice-link > span:first-of-type { flex: 1; }
.notice-link .see-all { margin: 0; flex: none; color: var(--accent-hi); }
.notice-link strong { color: #fff; }

/* Library */
.library-bar { display: grid; gap: 14px; margin: 8px 0 34px; }
.library-bar-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.filter-field { position: relative; width: min(100%, 300px); }
.filter-field .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.filter-field input[type="search"] { height: 40px; padding-left: 40px; border-radius: 999px; }
.result-line { margin: 0 0 22px; color: var(--muted); font-size: 0.9rem; }
.result-line strong { color: var(--ink); }
.hidden-games { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 28px; }
.hidden-games summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; color: var(--ink-2); font-weight: 700; font-stretch: 106%; }
.hidden-games summary::-webkit-details-marker { display: none; }
.hidden-games summary .icon { transition: transform 0.2s; }
.hidden-games[open] summary .icon { transform: rotate(90deg); }
.hidden-games summary span { color: var(--muted); font-weight: 500; font-stretch: 100%; }
.hidden-games .grid { margin-top: 26px; }

/* Game page */
.hero-game { min-height: clamp(520px, 72vh, 720px); padding-bottom: 44px; }
.hero-game-inner { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; align-items: end; }
.hero-game-cover .art { box-shadow: 0 44px 80px -26px #000, 0 0 0 1px rgb(255 255 255 / 0.12); border-radius: 12px; }
.game-title { max-width: 16ch; }
.eyebrow-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.eyebrow-links a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 16px 0 0; color: var(--ink-2); font-size: 1.02rem; }
.hero-meta > * + *::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 18px; border-radius: 50%; background: var(--faint); vertical-align: middle; }
.hero-meta a { color: var(--ink); font-weight: 650; }
.hero-meta a:hover { color: var(--accent); }
.hero-game .tags { margin-top: 16px; }
.hero-scores { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 24px; }
.score-block { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.score-block > span:last-child { display: grid; line-height: 1.25; }
.score-block strong { font-size: 0.95rem; font-stretch: 106%; }
.score-block span span { color: var(--ink-2); font-size: 0.86rem; }
a.score-block:hover strong { color: var(--accent); }
.owned-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ok-soft);
  border: 1px solid rgb(63 214 143 / 0.35);
  color: var(--ok);
  font-size: 0.92rem;
  font-weight: 720;
}
.owned-pill .mark { color: #d4f7e6; }
@media (max-width: 760px) {
  .hero-game-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-game-cover { width: 150px; }
  .hero-meta > * + *::before { margin-right: 12px; }
}

.game-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; margin-top: 48px; }
.game-main > * + * { margin-top: 56px; }
.game-main .shelf { margin-top: 56px; }
.game-side { position: sticky; top: calc(var(--topbar) + 24px); align-self: start; }
.block-title { margin-bottom: 16px; font-size: 1.3rem; }
.prose { color: var(--ink-2); font-size: 1.06rem; line-height: 1.7; max-width: 72ch; }
.prose-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
.prose-clamp.is-open { display: block; }
.more-toggle { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 650; cursor: pointer; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.shots li:first-child { grid-column: span 2; grid-row: span 2; }
.shot { display: block; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 9; background: var(--bg-3); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06) inset; cursor: zoom-in; }
.shots li:first-child .shot { height: 100%; aspect-ratio: auto; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), filter 0.3s; }
.shot:hover img { transform: scale(1.05); filter: brightness(1.08); }
.facts { display: grid; gap: 16px; margin: 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { color: var(--muted); font-size: 0.72rem; font-weight: 700; font-stretch: 90%; letter-spacing: 0.12em; text-transform: uppercase; }
.facts dd { margin: 0; color: var(--ink); font-weight: 550; }
.facts dd a { color: var(--ink); font-weight: 650; border-bottom: 1px solid var(--line-2); }
.facts dd a:hover { color: var(--accent); border-color: var(--accent); }
.platforms { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.platforms li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.platforms li.is-owned { background: var(--ok-soft); color: var(--ink); }
.platform-glyph { display: inline-grid; place-items: center start; width: 46px; color: var(--ink-2); flex: none; }
.platform-glyph .icon { color: var(--faint); }
.owned-check { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: auto; border-radius: 50%; background: var(--ok); color: #06301c; }
.owned-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.patches { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.patches li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.patches li:last-child { border-bottom: 1px solid var(--line); }
.patches-name { font-weight: 650; }
.patches-meta { color: var(--muted); font-size: 0.92rem; }
.people { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.people-name { font-weight: 650; }
.people .copies { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; color: var(--ink-2); }
@media (max-width: 1000px) {
  .game-body { grid-template-columns: 1fr; gap: 40px; }
  .game-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
  .game-side .card + .card { margin-top: 0; }
}
@media (max-width: 640px) {
  .shots { grid-template-columns: 1fr 1fr; }
}

/* Linked accounts */
.platform-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; align-items: start; }
.platform-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-1);
}
.platform-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -140px;
  right: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand-glow), transparent);
}
.platform-steam { --brand: #7ac4f0; --brand-glow: rgb(102 192 244 / 0.24); }
.platform-playstation { --brand: #5b9dff; --brand-glow: rgb(0 112 209 / 0.3); }
.platform-nintendo { --brand: #ff5a5f; --brand-glow: rgb(230 0 18 / 0.24); }
.platform-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.platform-card-head h2 { font-size: 1.3rem; }
.platform-card-head .pill { margin-left: auto; }
.platform-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  color: var(--brand);
}
.platform-icon .mark { height: 24px; }
.platform-icon .mark-switch { height: 22px; }
.platform-card .muted { font-size: 0.93rem; }
.platform-card input[type="password"], .platform-card input[type="file"] { max-width: none; }
.platform-facts { display: grid; gap: 4px; margin: 0 0 18px; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.93rem; }
.platform-facts strong { color: var(--ink); }
.platform-card > form:not(:last-child) { margin-bottom: 24px; }
.steps { margin: 0 0 6px; padding-left: 20px; color: var(--ink-2); font-size: 0.93rem; }
.steps li + li { margin-top: 6px; }
.steps li::marker { color: var(--brand); font-weight: 800; }

/* Household */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.member { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.member-name { display: grid; line-height: 1.3; min-width: 0; }
.member-name strong { overflow: hidden; text-overflow: ellipsis; }
.member-name span { overflow: hidden; color: var(--muted); font-size: 0.84rem; text-overflow: ellipsis; }
.copy-field { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.copy-field input { max-width: none; font-family: var(--mono); font-size: 0.86rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* Match queue */
.match-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.match-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-1);
}
.match-row .art { border-radius: 7px; box-shadow: none; }
.match-title { display: grid; gap: 3px; min-width: 0; }
.match-title strong { font-weight: 680; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-title span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; }
.match-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.match-actions form { display: flex; gap: 8px; align-items: center; margin: 0; }
.match-actions select { width: 260px; height: 38px; font-size: 0.9rem; }
.suggestions { margin: 26px 0 32px; }
@media (max-width: 860px) {
  .match-row { grid-template-columns: 44px minmax(0, 1fr); }
  .match-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .match-actions select { width: 100%; }
}

/* Sign in */
.auth { position: relative; isolation: isolate; display: grid; place-items: center; min-height: calc(100vh - var(--topbar) - 90px); padding: 48px 16px; overflow: hidden; }
.auth-wall {
  position: absolute;
  z-index: -1;
  inset: -20% -10%;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 18px;
  transform: rotate(-12deg);
  opacity: 0.55;
  -webkit-mask: radial-gradient(60% 60% at 50% 50%, transparent 20%, #000 75%);
  mask: radial-gradient(60% 60% at 50% 50%, transparent 20%, #000 75%);
}
.auth-wall .art { box-shadow: none; }
.auth-wall .art:nth-child(odd) { translate: 0 22%; }
.auth-card {
  width: min(430px, 100%);
  padding: 36px 34px 32px;
  border: 1px solid var(--line-2);
  border-radius: 26px;
  background: rgb(15 18 23 / 0.84);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--shadow-pop);
}
.auth-card .logo { width: 44px; height: 44px; margin-bottom: 18px; }
.auth-card h1 { font-size: 2rem; }
.auth-card p { margin-top: 10px; color: var(--muted); }
.auth-card input { max-width: none; }
.auth-card .btn { width: 100%; margin-top: 26px; height: 50px; }

/* Admin */
.admin-tabs { margin-top: 24px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.admin-grid .card + .card { margin-top: 0; }
.inline-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filters-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 6px 0 18px; }
.filters-form label { margin: 0 0 6px; }
.filters-form input, .filters-form select { width: 220px; height: 40px; }
.pager { display: flex; gap: 10px; margin-top: 16px; }
.danger-zone { border-color: rgb(255 92 108 / 0.3); }

/* Errors */
.error-page { display: grid; justify-items: start; gap: 18px; padding: 96px 0 40px; }
.error-code {
  font-size: clamp(6rem, 22vw, 15rem);
  font-weight: 900;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 2px rgb(255 255 255 / 0.18);
  background: linear-gradient(180deg, rgb(255 107 61 / 0.35), transparent 70%);
  -webkit-background-clip: text;
  background-clip: text;
}
