/* PerfectShelf — dark theme default (this audience lives in dark mode). */

:root {
  --bg: #0d1117;
  --panel: #161c26;
  --line: #262d3a;
  --text: #e6edf3;
  --sub: #97a1b0;
  --gold: #f0b43c;
  --gold-soft: rgba(240, 180, 60, 0.35);
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(240, 180, 60, 0.08), transparent 65%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

::selection { background: var(--gold-soft); }

a { color: inherit; }

/* ---------- primary navigation ---------- */

.site-nav {
  position: sticky;
  z-index: 50;
  top: 10px;
  width: 80vw;
  margin: 14px auto 0;
  padding: 9px 11px 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: rgba(14, 18, 25, 0.88);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}
.nav-brand {
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.nav-brand span,
.nav-brand small { color: var(--gold); }
.nav-brand small { font-size: 0.62em; vertical-align: top; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--sub);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a[aria-current="page"] { color: #14161a; background: var(--gold); }
.nav-brand:focus-visible,
.nav-links a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- hero ---------- */

/* PC-first: content fills the center 80% of the viewport (~10% margins).
   1080p/1440p/4K drive the design; small screens go full-width below. */
.hero {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 80vw;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) 24px 10px;
}

.hero.solo { flex: 1; align-items: center; text-align: center; justify-content: center; padding-bottom: 40px; }

/* The current default uses the most recently perfected game's official Steam
   Library Hero. These five code-native themes are deliberate fallbacks and a
   future user-selectable banner scaffold; they add no image or API cost. */
.profile-hero {
  position: relative;
  isolation: isolate;
  min-height: 248px;
  margin-top: 22px;
  padding: clamp(32px, 5vw, 62px) clamp(24px, 4vw, 54px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: var(--banner-fallback, linear-gradient(125deg, #111927, #202b3c 52%, #10141c));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}
.profile-banner-art {
  position: absolute;
  z-index: -2;
  inset: 0;
}
.profile-banner-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 10, 15, 0.9) 0%, rgba(7, 10, 15, 0.69) 43%, rgba(7, 10, 15, 0.4) 100%),
    linear-gradient(0deg, rgba(7, 10, 15, 0.78), transparent 70%);
}
.profile-banner-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.crop-left-top { object-position: left top !important; }
.crop-center-top { object-position: center top !important; }
.crop-right-top { object-position: right top !important; }
.crop-left-center { object-position: left center !important; }
.crop-center-center { object-position: center center !important; }
.crop-right-center { object-position: right center !important; }
.crop-left-bottom { object-position: left bottom !important; }
.crop-center-bottom { object-position: center bottom !important; }
.crop-right-bottom { object-position: right bottom !important; }
.profile-hero.banner-fallback .profile-banner-art { display: none; }
.profile-hero .avatar,
.profile-hero .profile-identity { position: relative; z-index: 1; }
.profile-hero .avatar { border-color: rgba(255, 255, 255, 0.35); }
.profile-hero h1,
.profile-hero .stat,
.profile-hero .meta { text-shadow: 0 2px 9px rgba(0, 0, 0, 0.82); }
.banner-theme-midnight { --banner-fallback: linear-gradient(125deg, #0d1825, #1d3148 52%, #101722); }
.banner-theme-aurora { --banner-fallback: radial-gradient(circle at 78% 22%, #339993 0%, transparent 30%), linear-gradient(125deg, #101629, #29365b 50%, #142b35); }
.banner-theme-ember { --banner-fallback: radial-gradient(circle at 75% 30%, #a74624 0%, transparent 32%), linear-gradient(125deg, #1a1116, #48231d 55%, #19131a); }
.banner-theme-trophy { --banner-fallback: radial-gradient(circle at 76% 28%, #8b6720 0%, transparent 32%), linear-gradient(125deg, #151617, #39301c 54%, #171719); }
.banner-theme-blueprint { --banner-fallback: linear-gradient(90deg, rgba(77, 151, 210, 0.09) 1px, transparent 1px), linear-gradient(rgba(77, 151, 210, 0.09) 1px, transparent 1px), linear-gradient(125deg, #101925, #1a3145); background-size: 38px 38px, 38px 38px, auto; }
.banner-edit-button {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.8);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.banner-edit-button:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }
.profile-owner-links { display: inline-flex; align-items: center; gap: 11px; margin-top: 8px; }
.profile-owner-links > a { color: #dbe5ef; font-size: 0.85rem; text-underline-offset: 3px; }
.profile-owner-links .shelf-logout { margin: 0; }

.banner-editor {
  width: min(920px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d131c;
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}
.banner-editor::backdrop { background: rgba(2, 5, 9, 0.78); backdrop-filter: blur(5px); }
.banner-editor form { padding: clamp(20px, 4vw, 34px); }
.banner-editor-heading { display: flex; justify-content: space-between; gap: 22px; }
.banner-editor-heading h2 { margin: 2px 0; }
.banner-editor-heading p:last-child { margin: 4px 0 0; color: var(--sub); }
.banner-editor-heading > button { align-self: flex-start; border: 0; background: transparent; color: var(--sub); font-size: 1.8rem; cursor: pointer; }
.banner-editor fieldset { margin: 24px 0 0; padding: 0; border: 0; }
.banner-editor legend { margin-bottom: 10px; color: var(--sub); font-size: 0.76rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.banner-choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.game-banner-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.banner-choice { position: relative; display: grid; gap: 6px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #111823; cursor: pointer; }
.banner-choice:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240, 180, 60, 0.16); }
.banner-choice input { position: absolute; top: 10px; left: 10px; z-index: 1; accent-color: var(--gold); }
.banner-choice-preview { display: block; height: 76px; overflow: hidden; border-radius: 7px; background: var(--banner-fallback, linear-gradient(125deg, #111927, #202b3c)); }
.banner-choice-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.banner-choice strong { overflow: hidden; padding-inline: 2px; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.banner-choice small { padding-inline: 2px; color: var(--sub); }
.banner-editor-actions { position: sticky; bottom: -34px; display: flex; justify-content: flex-end; gap: 9px; margin: 28px -34px -34px; padding: 16px 34px; border-top: 1px solid var(--line); background: rgba(13, 19, 28, 0.96); }
.banner-editor-actions button { padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; background: #151e2a; color: var(--text); cursor: pointer; }
.banner-editor-actions button[type="submit"] { border-color: #dfa932; background: var(--gold); color: #14161a; font-weight: 750; }

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: 2px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
}

.stat { margin: 4px 0 0; font-size: 1.05rem; }
.stat b { color: var(--gold); font-size: 1.35em; font-variant-numeric: tabular-nums; }
.sub { color: var(--sub); }
.sub.small { font-size: 0.85rem; }
.gold { color: var(--gold); }

.tag { margin: 2px 0 10px; color: var(--gold); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; }

.landing .sub { max-width: 46ch; margin-inline: auto; }

.cta {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--gold);
  color: #14161a;
  font-weight: 650;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--gold-soft); }
.steam-signin { display: inline-block; line-height: 0; transition: transform 0.15s ease, filter 0.15s ease; }
.steam-signin img { display: block; width: 180px; height: 35px; }
.steam-signin:hover { transform: translateY(-2px); filter: brightness(1.08); }
.steam-signin:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.cta:focus-visible,
.quiet-link:focus-visible,
.resync:focus-visible,
.logout button:focus-visible,
.card button.art:focus-visible,
.game-view button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.quiet-link { color: var(--sub); text-underline-offset: 3px; }
.quiet-link:hover { color: var(--text); }

.account-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.account-actions .cta { margin-top: 0; }

.logout { display: inline-block; }
.logout button {
  border: 0;
  padding: 7px 3px;
  background: transparent;
  color: var(--sub);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.logout button:hover { color: var(--text); }
.shelf-logout { margin-left: 8px; }
.privacy-note { max-width: 54ch; margin: 18px auto 0; }

/* ---------- landing ---------- */

.landing-stage {
  position: relative;
  isolation: isolate;
  min-height: 560px;
  margin-top: -74px;
  padding: 154px 0 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(92, 145, 191, 0.42);
  background: #0b1017;
}
.landing-backdrop,
.landing-shade { position: absolute; inset: 0; z-index: -2; }
.landing-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.025);
  animation: landing-banner-cycle 24s linear infinite;
}
.landing-backdrop.js-rotation img { animation: none; opacity: 0; transform: scale(1.075); transition: opacity 0.9s ease, transform 6s linear; }
.landing-backdrop.js-rotation img.active { opacity: 1; transform: scale(1.025); }
.landing-backdrop img:nth-child(2) { animation-delay: 6s; }
.landing-backdrop img:nth-child(3) { animation-delay: 12s; }
.landing-backdrop img:nth-child(4) { animation-delay: 18s; }
.landing-backdrop.count-3 img { animation-name: landing-banner-cycle-3; animation-duration: 18s; }
.landing-backdrop.count-2 img { animation-name: landing-banner-cycle-2; animation-duration: 12s; }
.landing-backdrop.single img { opacity: 1; animation: none; }
.landing-shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 8, 12, 0.91), rgba(5, 8, 12, 0.53) 55%, rgba(5, 8, 12, 0.78)),
    linear-gradient(0deg, rgba(5, 8, 12, 0.94) 0%, transparent 58%, rgba(5, 8, 12, 0.65));
}
.landing-content {
  width: 80vw;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 5vw, 82px);
  padding: 58px 24px 74px;
}
.landing-pitch { max-width: 690px; }
.landing-pitch h1 {
  margin: 0;
  font-size: clamp(3.2rem, 7.5vw, 6.9rem);
  line-height: 0.93;
  letter-spacing: -0.07em;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.72);
}
.landing-pitch > p:not(.eyebrow):not(.tag) { max-width: 58ch; color: #c8d0da; }
.landing-actions {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(8, 12, 18, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(13px);
}
.profile-finder { display: flex; gap: 9px; }
.profile-finder input {
  min-width: 0;
  flex: 1;
  padding: 11px 13px;
  border: 1px solid #3b4657;
  border-radius: 9px;
  background: rgba(18, 24, 34, 0.92);
  color: var(--text);
  font: inherit;
}
.profile-finder button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid #e5ad38;
  border-radius: 9px;
  background: var(--gold);
  color: #15181d;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.profile-finder input:focus-visible,
.profile-finder button:focus-visible { outline: 3px solid #f8d488; outline-offset: 3px; }
.finder-context,
.profile-search-notice { margin: 10px 0 0; font-size: 0.78rem; line-height: 1.4; }
.finder-context { color: var(--sub); }
.profile-search-notice { color: #ffd983; }
.landing-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #c8d0da;
  font-size: 0.83rem;
}
.landing-login .cta,
.landing-login .account-actions { margin: 0; }
.landing-auth-action { flex: 0 0 auto; text-align: right; }
.landing-auth-action > p { margin: 0; }
.landing-auth-action > .sub.small { max-width: 250px; margin-top: 7px; }
.home-stats {
  width: 80vw;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  background: var(--line);
}
.home-stat {
  min-width: 0;
  padding: 17px 18px;
  background: rgba(14, 19, 27, 0.94);
  text-align: center;
}
.home-stat strong { display: block; font-size: clamp(1.45rem, 3vw, 2.25rem); font-weight: 430; line-height: 1; font-variant-numeric: tabular-nums; }
.home-stat span { display: block; margin-top: 7px; color: var(--sub); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.055em; }
.home-main { padding-top: clamp(48px, 7vw, 88px); }
.home-section-heading { max-width: 760px; margin: 0 auto 30px; text-align: center; }
.home-section-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.08; letter-spacing: -0.035em; }
.home-section-heading > p:last-child { color: var(--sub); }
.home-feeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.home-feeds article { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.home-feeds article > p { margin: 0; padding: 15px 17px 18px; color: var(--sub); font-size: 0.84rem; }
.feed-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #1a2230; }
.feed-title h3 { margin: 0; font-size: 0.95rem; }
.feed-title span { color: var(--gold); font-size: 0.67rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.feed-placeholder { height: 128px; background: linear-gradient(120deg, #121a25, #253248 48%, #151b25); }

@keyframes landing-banner-cycle {
  0%, 20% { opacity: 1; transform: scale(1.025); }
  25%, 95% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1.025); }
}
@keyframes landing-banner-cycle-3 {
  0%, 28% { opacity: 1; transform: scale(1.025); }
  33%, 95% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1.025); }
}
@keyframes landing-banner-cycle-2 {
  0%, 42% { opacity: 1; transform: scale(1.025); }
  50%, 92% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1.025); }
}

/* ---------- account ---------- */

.account-main { width: min(1120px, 80vw); margin: 0 auto; padding: clamp(48px, 8vw, 90px) 24px; }
.account-heading { max-width: 760px; margin-bottom: 28px; }
.account-heading h1 { margin: 2px 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.account-heading > p:last-child { color: var(--sub); }
.account-notice { padding: 12px 14px; border: 1px solid rgba(102, 209, 158, 0.4); border-radius: 9px; background: rgba(102, 209, 158, 0.08); color: #a6e5c8; }
.account-grid { display: grid; grid-template-columns: minmax(260px, 0.75fr) minmax(340px, 1.25fr); gap: 16px; }
.account-panel { padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.steam-identity-panel > div { display: flex; align-items: center; gap: 14px; }
.steam-identity-panel img { border-radius: 14px; }
.steam-identity-panel strong, .steam-identity-panel span, .steam-identity-panel a { display: block; }
.steam-identity-panel span, .steam-identity-panel > p:last-child { color: var(--sub); font-size: 0.8rem; }
.steam-identity-panel a { margin-top: 4px; color: #67c1f5; font-size: 0.82rem; }
.contact-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.contact-panel h2 { margin: 2px 0 14px; }
.contact-status { padding: 3px 8px; border-radius: 99px; background: rgba(240, 180, 60, 0.12); color: var(--gold); font-size: 0.67rem; font-weight: 750; text-transform: uppercase; }
.contact-status.verified { background: rgba(102, 209, 158, 0.12); color: #66d19e; }
.contact-panel form { display: grid; gap: 8px; }
.contact-panel label { color: var(--sub); font-size: 0.78rem; font-weight: 700; }
.contact-panel input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0a1018; color: var(--text); }
.contact-panel form p { margin: 4px 0 8px; color: var(--sub); font-size: 0.76rem; }
.contact-panel button { justify-self: start; padding: 9px 15px; border: 0; border-radius: 8px; background: var(--gold); color: #14161a; font-weight: 750; cursor: pointer; }
.account-privacy { margin-top: 16px; }
.account-privacy h2 { margin-top: 0; }
.account-privacy li { margin-block: 7px; color: var(--sub); }

/* ---------- sync box ---------- */

.meta { margin: 8px 0 0; color: var(--sub); font-size: 0.9rem; }

.resync {
  margin-left: 10px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.resync:hover:not(:disabled) { border-color: var(--gold); }
.resync:disabled { opacity: 0.55; cursor: default; }
.syncbox .meta > .resync:first-child { margin-left: 0; }

.bar {
  display: none;
  margin-top: 10px;
  height: 6px;
  max-width: 340px;
  border-radius: 99px;
  background: var(--panel);
  overflow: hidden;
}
.hero.solo .bar { margin-inline: auto; }
.syncbox.running .bar { display: block; }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), #ffd97a);
  transition: width 0.4s ease;
}
.syncmsg { margin: 6px 0 0; min-height: 1.2em; color: var(--sub); font-size: 0.85rem; }

/* ---------- shelf ---------- */

main { flex: 1; width: 80vw; margin: 0 auto; padding: 18px 24px 48px; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.profile-stat {
  min-width: 0;
  min-height: 102px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 17px 20px 16px;
  background: rgba(17, 22, 30, 0.96);
  text-align: center;
}
.profile-stat strong {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 430;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.profile-stat span { display: block; margin-top: 7px; color: var(--sub); font-size: 0.88rem; }

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.delay-1 { animation-delay: 60ms; }
.delay-2 { animation-delay: 120ms; }
.delay-3 { animation-delay: 180ms; }
.delay-4 { animation-delay: 240ms; }
.delay-5 { animation-delay: 300ms; }
.delay-6 { animation-delay: 360ms; }
.delay-7 { animation-delay: 420ms; }
.delay-8 { animation-delay: 480ms; }
.delay-9 { animation-delay: 540ms; }
.delay-10 { animation-delay: 600ms; }
.delay-11 { animation-delay: 660ms; }
.delay-12 { animation-delay: 720ms; }
.card:hover,
.card:has(button.art:focus-visible) { z-index: 20; }

.card button.art {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.card:hover button.art,
.card:has(button.art:focus-visible) button.art {
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--gold-soft);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Missing capsule art (rare): header.jpg crop gets a permanent title band. */
.card.noart button.art::after {
  content: attr(data-name);
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 12px;
  background: rgba(7, 9, 13, 0.92);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.3;
}

/* Permanent caption: solid and separate from the art so titles and stats stay
   readable while the capsule itself still lifts on hover/focus. */
.card-caption {
  position: relative;
  min-height: 132px;
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #10141c;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover .card-caption,
.card:has(button.art:focus-visible) .card-caption {
  border-color: rgba(240, 180, 60, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.card-caption strong {
  display: -webkit-box;
  overflow: hidden;
  padding-right: 50px;
  font-size: 0.98rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.card-caption span { color: var(--sub); }
.card-caption .done { color: var(--gold); }

/* Steam players recognize blue award-ribbon language as "completed." This is
   an independently authored CSS mark—not Valve artwork—so it remains sharp,
   distinct, and adds no asset request to the shelf read path. */
.card-caption .perfect-ribbon {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 12px;
  width: 44px;
  height: 58px;
  color: #123652;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.46));
}
.perfect-ribbon::before,
.perfect-ribbon::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 29px;
  width: 19px;
  height: 28px;
  border: 1px solid rgba(118, 205, 238, 0.25);
  background: linear-gradient(160deg, #318fbd, #17658f 68%, #114b70);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 52% 79%, 12% 100%);
}
.perfect-ribbon::before { left: 4px; transform: rotate(7deg); }
.perfect-ribbon::after { right: 4px; transform: rotate(-7deg); filter: brightness(0.84); }
.perfect-ribbon-check {
  position: absolute;
  inset: 0 auto auto 0;
  isolation: isolate;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 59% 7%, 70% 3%, 77% 13%, 89% 14%, 91% 27%, 100% 35%, 95% 47%, 100% 58%, 91% 67%, 90% 80%, 77% 81%, 70% 94%, 58% 90%, 50% 100%, 40% 92%, 28% 96%, 22% 83%, 9% 81%, 10% 68%, 0 59%, 5% 47%, 0 36%, 10% 27%, 11% 14%, 24% 14%, 30% 3%, 41% 7%);
  background: linear-gradient(145deg, #7bd8f0 0%, #258ab6 50%, #125a84 100%);
  box-shadow: inset 0 0 0 3px rgba(205, 242, 250, 0.34), inset 0 -4px 8px rgba(5, 48, 75, 0.35);
  color: #173c57 !important;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 247, 202, 0.72);
}
.perfect-ribbon-check::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 9px;
  border: 2px solid #f8d768;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff1a3, #e7ad2f 64%, #ad7216 100%);
  box-shadow: 0 1px 3px rgba(3, 35, 55, 0.58);
}

/* ---------- foreground achievement view ---------- */

.game-view {
  width: min(1440px, 94vw);
  height: min(860px, 92dvh);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: visible;
  background: transparent;
  color: var(--text);
  opacity: 0;
  transform: translateY(18px) scale(0.975);
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.game-view.visible { opacity: 1; transform: none; }
.game-view::backdrop {
  background: rgba(4, 7, 11, 0.82);
  backdrop-filter: blur(9px);
}
.game-view-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.65fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  background:
    radial-gradient(700px 400px at 18% 10%, rgba(240, 180, 60, 0.10), transparent 70%),
    #0f141c;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}
.game-view-close {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 11, 16, 0.88);
  color: var(--text);
  font: 400 1.65rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.game-view-close:hover { border-color: var(--gold); background: #171d27; }

.game-cover-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 3vw, 48px);
  border-right: 1px solid var(--line);
}
.focused-art {
  width: 100%;
  max-height: calc(100% - 72px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.focused-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.art-picker { display: flex; gap: 10px; margin: 0 0 14px; }
.art-picker button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141a23;
  color: var(--sub);
  font: 700 0.9rem/1 inherit;
  cursor: pointer;
}
.art-picker button.active { border-color: var(--gold); color: var(--gold); background: rgba(240, 180, 60, 0.10); }
.art-picker button:disabled { opacity: 0.32; cursor: not-allowed; }
.art-source { margin: 10px 0 0; color: var(--sub); font-size: 0.75rem; }

.achievement-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: clamp(30px, 4vw, 58px) clamp(24px, 4vw, 58px) 34px;
  overflow: hidden;
}
.game-view-heading { flex: 0 0 auto; padding-right: 38px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.game-view-heading h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -0.025em; }
.game-view-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 10px 0 18px; color: var(--sub); font-size: 0.88rem; }
.game-view-meta span:not(:empty)::before { content: ""; }

.achievement-status {
  display: grid;
  flex: 1;
  min-height: 180px;
  place-items: center;
  color: var(--sub);
  text-align: center;
}
.achievement-content { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.achievement-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.achievement-tools-reserved { flex: 1 1 auto; min-height: 20px; }
.achievement-sort { display: inline-flex; align-items: center; gap: 7px; color: var(--sub); font-size: 0.72rem; }
.achievement-sort select {
  max-width: 220px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141a23;
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
}

.achievement-detail {
  flex: 0 0 auto;
  min-height: 86px;
  max-height: min(180px, 28dvh);
  margin-bottom: 14px;
  padding: 12px 15px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(22, 28, 38, 0.82);
}
.achievement-detail strong { display: block; line-height: 1.25; }
.achievement-detail span { display: block; margin-top: 3px; color: var(--sub); font-size: 0.82rem; }
.achievement-detail p { margin: 6px 0 0; color: #bdc5d0; font-size: 0.8rem; line-height: 1.35; }
.achievement-detail p.missing-description { color: #7f8997; font-style: italic; }
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);
  grid-auto-rows: 72px;
  align-content: start;
  justify-content: start;
  gap: 11px;
  min-height: 0;
  padding: 3px 8px 12px 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #475165 #121721;
}
.achievement-tile {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  padding: 1px;
  overflow: hidden;
  border: 3px solid #3b4657;
  border-radius: 11px;
  background: #111722;
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.achievement-tile img { width: 100%; height: 100%; display: block; border-radius: 6px; object-fit: cover; }
.achievement-tile:hover,
.achievement-tile:focus-visible { z-index: 2; transform: translateY(-3px) scale(1.035); filter: brightness(1.08); }
.achievement-tile.rarity-gold {
  border-color: transparent;
  background:
    linear-gradient(#111722, #111722) padding-box,
    linear-gradient(110deg, #704400 0%, #e9a82e 18%, #fff2ad 38%, #b86d00 56%, #ffd768 76%, #704400 100%) border-box;
  background-size: 100% 100%, 260% 100%;
  box-shadow: 0 0 14px rgba(242, 193, 78, 0.42), 0 0 3px rgba(255, 241, 166, 0.8);
  animation: gold-border-sheen 2.6s linear infinite, gold-border-pulse 1.7s ease-in-out infinite alternate;
}

.achievement-warmup { display: inline-block; margin: 6px 0 0 10px; color: var(--sub); font-size: 0.78rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
}

@keyframes gold-border-sheen {
  to { background-position: 0 0, -260% 0; }
}

@keyframes gold-border-pulse {
  to { box-shadow: 0 0 22px rgba(242, 193, 78, 0.68), 0 0 6px rgba(255, 241, 166, 0.95); }
}

/* ---------- discover scaffold ---------- */

.discover-page { padding-top: clamp(52px, 8vw, 90px); }
.discover-heading { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.discover-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.04em; }
.discover-heading > p:last-child { color: var(--sub); }
.discover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.discover-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.discover-placeholder { height: 180px; border-radius: 10px; background: linear-gradient(120deg, #1a2130, #242d3d 45%, #151b26); }
.discover-grid h2 { margin: 14px 0 4px; font-size: 1.05rem; }
.discover-grid p { margin: 0; color: var(--sub); font-size: 0.86rem; }

.empty-state {
  max-width: 560px;
  margin: 40px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
  color: var(--sub);
}
.empty-state h2 { margin: 0 0 6px; color: var(--text); }
.empty-state p { margin: 0; }

/* ---------- footer ---------- */

footer {
  padding: 26px 24px 30px;
  text-align: center;
  color: var(--sub);
  font-size: 0.82rem;
}
.beta { color: var(--gold); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .site-nav, .hero, main, .landing-content, .home-stats { width: 100%; }
  .site-nav { top: 0; margin-top: 0; border-width: 0 0 1px; border-radius: 0; }
  .profile-hero { margin-top: 0; border-width: 0 0 1px; border-radius: 0; }
  .landing-stage { margin-top: -62px; padding-top: 126px; }
  .discover-grid { grid-template-columns: 1fr; }
  .account-main { width: 100%; }
}

/* Mobile: supported, never design-driving (the audience is PC gamers). */
@media (max-width: 640px) {
  .site-nav { padding-left: 12px; gap: 8px; }
  .nav-brand { font-size: 0.9rem; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 7px 8px; font-size: 0.76rem; }
  .hero { flex-direction: column; text-align: center; gap: 14px; }
  .profile-hero { min-height: 330px; justify-content: center; padding-block: 38px; }
  .profile-banner-art::after {
    background: linear-gradient(0deg, rgba(7, 10, 15, 0.92) 0%, rgba(7, 10, 15, 0.63) 76%, rgba(7, 10, 15, 0.52));
  }
  .bar { margin-inline: auto; }
  .shelf { grid-template-columns: 1fr; gap: 26px; justify-items: center; }
  .card { width: min(80vw, 330px); }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-stat { padding: 14px; }
  .landing-stage { min-height: 680px; }
  .landing-content { grid-template-columns: 1fr; gap: 30px; padding: 48px 20px 52px; }
  .landing-pitch { text-align: center; }
  .landing-pitch h1 { font-size: clamp(3.1rem, 16vw, 5.2rem); }
  .landing-pitch > p:not(.eyebrow):not(.tag) { margin-inline: auto; }
  .profile-finder, .landing-login { flex-direction: column; align-items: stretch; text-align: center; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 0; }
  .home-feeds { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-main { padding: 42px 16px; }
  .banner-choice-grid, .game-banner-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .banner-editor form { padding: 18px; }
  .banner-editor-actions { bottom: -18px; margin: 24px -18px -18px; padding: 14px 18px; }
}

@media (max-width: 760px) {
  .game-view { width: 100vw; height: 100dvh; border-radius: 0; }
  .game-view-frame { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .game-cover-panel {
    display: grid;
    grid-template-columns: auto 112px 1fr;
    align-items: end;
    gap: 10px;
    padding: 18px 58px 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .focused-art { grid-column: 2; grid-row: 1 / span 2; width: 112px; }
  .art-picker { grid-column: 1; grid-row: 1; flex-direction: column; margin: 0; }
  .art-source { grid-column: 3; margin: 0; align-self: end; }
  .achievement-panel { padding: 20px 18px 18px; }
  .game-view-heading { padding-right: 28px; }
  .game-view-heading h2 { font-size: 1.45rem; }
  .game-view-meta { margin-bottom: 12px; }
  .achievement-detail { min-height: 76px; max-height: min(210px, 30dvh); }
  .achievement-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .achievement-grid { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .card button.art, .cta, .resync, .bar i, .card-caption,
  .game-view, .achievement-tile { transition: none; }
  .achievement-tile.rarity-gold { animation: none; }
  .landing-backdrop img { opacity: 0; animation: none; transform: none; }
  .landing-backdrop img:first-child { opacity: 1; }
}
