/* Library rules: artwork first, one accent, 8px spacing rhythm. */
body[data-page="library"] {
  --library-accent: var(--accent, #c4b4ff);
}
body[data-page="library"] .topbar .global-search {
  display: none;
}
body[data-page="library"] .desktop-navigation {
  margin-left: auto;
}
body[data-page="library"] .test-account-switcher {
  background: transparent;
  max-width: 1256px;
  margin: 0 auto;
  padding: 8px 0;
  font-size: 14px;
}
body[data-page="library"] .test-account-switcher > a {
  display: none;
}
body[data-page="library"] .test-account-switcher small {
  margin-left: auto;
  font-size: 14px;
}
body[data-page="library"] main {
  padding-top: 32px;
}
.player-library {
  --library-gap: 24px;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.library-heading > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.library-heading h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.2;
}
.library-heading span {
  color: #a6a9b7;
  font-size: 15px;
}
.library-tools-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #b7bac7;
}
.library-tools-button:hover {
  background: #ffffff08;
}
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.library-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
}
.library-tabs button {
  min-height: 44px;
  padding: 10px 16px;
  color: #aeb1bf;
  font-size: 15px;
  border-radius: 8px;
  white-space: nowrap;
}
.library-tabs button[aria-pressed="true"] {
  background: #c4b4ff14;
  color: var(--library-accent);
}
.library-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  background: #1b1d25;
  border-radius: 8px;
  color: #aeb1bf;
  max-width: 280px;
  flex: 1;
}
.library-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
  padding: 10px 0;
  color: #f2f3f7;
  width: 100%;
  min-width: 0;
  font-size: 15px;
}
.library-search:focus-within {
  outline: 2px solid var(--library-accent);
  outline-offset: 2px;
}
.library-search input:focus {
  outline: none;
  box-shadow: none;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
}
.library-card {
  min-width: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.library-card-art {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 12px;
  background: #20222b;
}
.library-art-button {
  display: block;
  height: 100%;
  width: 100%;
  padding: 0;
}
.library-art-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 0.15s ease;
}
.library-art-button:hover img {
  filter: brightness(1.08);
}
.library-art-button:focus-visible {
  outline: 3px solid var(--library-accent);
  outline-offset: -3px;
  border-radius: 12px;
}
.library-more {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111318d9;
  color: #f2f3f7;
}
.library-more:hover {
  background: #111318;
}
.library-card-info {
  padding-top: 16px;
  display: grid;
  gap: 8px;
}
.library-game-title {
  display: block;
  text-align: left;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  padding: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 48px;
}
.library-access {
  font-size: 14px;
  color: #aeb1bf;
  line-height: 1.5;
}
.library-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--library-accent);
  color: #211a34;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 650;
}
.library-play:hover {
  filter: brightness(1.06);
}
.library-restore {
  background: #252632;
  color: #ddd6f3;
}
.library-art-missing {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: #b5aecf;
  background:
    radial-gradient(ellipse at 20% 0%, #39314d, transparent 80%), #20222b;
}
.library-art-missing span {
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
}
.library-empty {
  padding: 64px 16px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}
.library-empty h2 {
  font-size: 24px;
  margin: 0;
}
.library-empty p {
  color: #aeb1bf;
  margin: 0;
}
.library-message {
  color: #b6b1c5;
  font-size: 15px;
  margin: 0 0 24px;
}
.library-message button,
.library-signin button {
  color: var(--library-accent);
  padding: 8px;
}
.library-signin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  color: #aeb1bf;
  font-size: 15px;
}
.library-manage-dialog h2 {
  font-size: 24px;
}
.library-manage-dialog h3 {
  font-size: 17px;
  margin-top: 24px;
}
.library-test-controls {
  margin-top: 24px;
}
.library-test-controls summary {
  color: #b9b3c8;
  min-height: 44px;
  cursor: pointer;
}
.library-test-controls .button {
  margin: 8px 8px 0 0;
}
@media (max-width: 1300px) {
  body[data-page="library"] .test-account-switcher {
    margin-inline: 32px;
  }
}
@media (max-width: 1050px) {
  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .library-toolbar {
    gap: 16px;
  }
  .library-tabs {
    gap: 0;
  }
  .library-tabs button {
    padding-inline: 12px;
  }
}
@media (max-width: 700px) {
  body[data-page="library"] .topbar {
    min-height: 72px;
    padding-block: 16px;
  }
  body[data-page="library"] .test-account-switcher {
    margin-inline: 18px;
    padding: 0 0 8px;
    gap: 8px;
  }
  body[data-page="library"] .test-account-switcher small {
    flex-basis: auto;
    font-size: 13px;
    margin-left: auto;
    max-width: 100px;
    line-height: 1.4;
  }
  body[data-page="library"] .test-account-button {
    min-height: 44px;
    padding: 8px;
  }
  body[data-page="library"] main {
    padding-top: 24px;
    padding-inline: 18px;
  }
  .library-heading {
    margin-bottom: 24px;
  }
  .library-heading h1 {
    font-size: 28px;
  }
  .library-heading > div {
    display: block;
  }
  .library-heading span {
    display: block;
    margin-top: 8px;
    font-size: 14px;
  }
  .library-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }
  .library-tabs {
    width: 100%;
    gap: 4px;
  }
  .library-tabs button {
    font-size: 14px;
    padding-inline: 12px;
  }
  .library-search {
    max-width: none;
    width: 100%;
    flex: auto;
  }
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }
  .library-card-art {
    aspect-ratio: 4/5;
    border-radius: 10px;
  }
  .library-card-info {
    padding-top: 12px;
    gap: 8px;
  }
  .library-game-title {
    font-size: 16px;
    min-height: 45px;
  }
  .library-access {
    font-size: 14px;
  }
  .library-play {
    margin-top: 4px;
  }
  .library-more {
    top: 4px;
    right: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .library-art-button img {
    transition: none;
  }
}
body[data-page="library"] .mobile-nav span {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
body[data-page="library"] .mobile-nav a {
  min-height: 56px;
}
@media (max-width: 700px) {
  .library-search input {
    font-size: 16px;
  }
}
body[data-page="library"] .profile-button {
  background: #25242e;
  color: #dfdce9;
}
