/* West Dot Logic | Games — library shell.
   Steam-library layout (sidebar list + featured hero + portrait capsules) on the
   existing WDL palette: deep teal ground, gold accent, seafoam chrome. */

:root {
  color-scheme: dark;
  --bg: #07131a;
  --bg-deep: #040b10;
  --surface: #0c1e28;
  --surface-2: #12303e;
  --line: rgba(240, 212, 149, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f3ecdb;
  --muted: #a4b3b8;
  --dim: #77878d;
  --accent: #efc45a;
  --sea: #59b8d8;
  --foam: #9fe6f4;
  --play: #7fb069;
  --play-2: #63924f;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --rail: 292px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 82% -10%, rgba(89, 184, 216, 0.14), transparent 26rem),
    radial-gradient(circle at 8% 4%, rgba(239, 196, 90, 0.1), transparent 20rem),
    linear-gradient(180deg, #0e2a37 0%, var(--bg) 40%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(transparent 0, transparent 24px, rgba(255, 255, 255, 0.03) 25px),
    linear-gradient(90deg, transparent 0, transparent 24px, rgba(255, 255, 255, 0.03) 25px);
  background-size: 25px 25px;
}

.art-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 15, 21, 0.82);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--foam);
}

.brand-sub {
  font-family: var(--serif);
  font-size: 1.22rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav-item {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
}

.topnav-item.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
}

a.topnav-item:hover {
  color: var(--foam);
}

/* ---------- shell ---------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 30px);
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 30px) clamp(16px, 3vw, 34px) 24px;
  align-items: start;
}

/* ---------- sidebar ---------- */

.sidebar {
  position: sticky;
  top: 78px;
  padding: 14px 12px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 34, 45, 0.9), rgba(8, 22, 30, 0.78));
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--dim);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(3, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.search input::placeholder {
  color: var(--dim);
}

.search input:focus-visible {
  outline: none;
  border-color: rgba(159, 230, 244, 0.42);
  box-shadow: 0 0 0 3px rgba(89, 184, 216, 0.16);
}

.shelf-label {
  margin: 18px 6px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.shelf-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.93rem;
  text-align: left;
  cursor: pointer;
}

.shelf-row:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.shelf-row[aria-current="true"] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

.shelf-thumb {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg-deep);
}

.thumb-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-text {
  min-width: 0;
}

.shelf-status {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-playable {
  background: var(--play);
  box-shadow: 0 0 8px rgba(127, 176, 105, 0.75);
}

.dot-development {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(239, 196, 90, 0.45);
}

.dot-archived {
  background: var(--dim);
}

.sidebar-empty,
.grid-empty {
  margin: 12px 8px 0;
  font-size: 0.88rem;
  color: var(--dim);
}

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

.content {
  display: grid;
  gap: clamp(20px, 2.6vw, 32px);
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(340px, 42vw, 460px);
  display: flex;
  align-items: flex-end;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.hero-art,
.hero-scrim {
  position: absolute;
  inset: 0;
}

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

.hero-scrim {
  background:
    linear-gradient(90deg, rgba(4, 11, 16, 0.94) 0%, rgba(4, 11, 16, 0.72) 42%, rgba(4, 11, 16, 0.08) 82%),
    linear-gradient(0deg, rgba(4, 11, 16, 0.9) 0%, transparent 62%);
}

.hero-copy {
  position: relative;
  padding: clamp(22px, 3vw, 38px);
  max-width: 40rem;
}

.kicker {
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.02;
}

.hero-blurb {
  margin: 14px 0 0;
  max-width: 34rem;
  line-height: 1.62;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.tags li {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 13px 22px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn-play {
  background: linear-gradient(180deg, var(--play), var(--play-2));
  color: #08150c;
  box-shadow: 0 10px 26px rgba(99, 146, 79, 0.28);
}

.btn-play:hover {
  filter: brightness(1.07);
}

.btn-idle {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  cursor: not-allowed;
}

/* ---------- capsule grid ---------- */

.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.shelf-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.42rem;
}

.shelf-meta {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: clamp(14px, 1.6vw, 20px);
}

.capsule {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.capsule:hover {
  transform: translateY(-4px);
  border-color: rgba(159, 230, 244, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.capsule.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(239, 196, 90, 0.45), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.capsule-art {
  position: absolute;
  inset: 0;
}

.cap-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capsule-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 11, 16, 0.94) 4%, rgba(4, 11, 16, 0.12) 52%, rgba(4, 11, 16, 0.34) 100%);
}

.capsule-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(159, 230, 244, 0.3);
  background: rgba(6, 20, 26, 0.86);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foam);
}

.capsule-name {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.capsule.is-archived .capsule-pill {
  border-color: var(--line-soft);
  color: var(--dim);
}

.capsule.is-archived .capsule-name {
  color: var(--muted);
}

.shelf-row:focus-visible,
.capsule:focus-visible,
.btn:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--foam);
  outline-offset: 2px;
}

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

.foot {
  position: relative;
  z-index: 1;
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 34px) 56px;
}

.foot p {
  margin: 0;
  max-width: 46rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--dim);
}

/* ---------- narrow ---------- */

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
  }

  .shelf-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    min-height: 0;
  }

  .hero-scrim {
    background: linear-gradient(0deg, rgba(4, 11, 16, 0.96) 26%, rgba(4, 11, 16, 0.55) 62%, rgba(4, 11, 16, 0.25) 100%);
  }

  .hero-copy {
    padding-top: clamp(150px, 34vw, 240px);
  }

  .btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .topnav-item:not(.is-active) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capsule {
    transition: none;
  }

  .capsule:hover {
    transform: none;
  }
}
