/* Mage's Library (www/library/), in the Asar look. Every rule is scoped to .asar-library, so nothing else changes.
   No <section> tags on this page: the site's stylesheet hides them. */
.asar-library {
  --lib-purple: var(--asar-purple, rgb(140, 68, 173));
  --lib-red: var(--asar-red, rgb(250, 50, 50));
  --lib-gold: #e8c547;
  color: whitesmoke;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 16px;
  font-size: 1.05rem;
  line-height: 1.5;
}
.asar-library a { color: #d9a6f2; text-underline-offset: 0.15em; }
.asar-library a:hover { color: #fff; }
.asar-library a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 4px; }
.asar-library .section-title { text-align: center; }
.asar-library .section-title h2 { margin-bottom: 0.4em; }
.asar-library .lib-lead { color: #c9c4d4; text-align: center; margin: 0 0 1rem; font-size: 1.15rem; }
.asar-library .lib-you {
  margin: 0 auto 1.5rem; max-width: 46rem; padding: 0.75em 1.1em; text-align: center;
  border-left: 4px solid var(--lib-purple); background: rgba(255, 255, 255, 0.06); border-radius: 0 6px 6px 0;
}
.asar-library .lib-you .fa { margin-right: 0.35em; color: var(--lib-gold); }
.asar-library .lib-empty { text-align: center; font-weight: 600; }

.asar-library .lib-shelves { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0 0 1.5rem; }
.asar-library .lib-shelves[hidden] { display: none; }
.asar-library .lib-shelves button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.35em 1.1em; background: transparent;
  border: 2px solid var(--lib-purple); border-radius: 999px; color: whitesmoke; font-weight: 600; cursor: pointer;
}
.asar-library .lib-shelves button:hover, .asar-library .lib-shelves button[aria-selected="true"] { background: var(--lib-purple); }
.asar-library .lib-shelves button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.asar-library .lib-shelf[hidden] { display: none; }

.asar-library .lib-shelf { margin: 0 0 2.25rem; scroll-margin-top: 90px; }
.asar-library .lib-shelf h3 {
  font-size: 1.4rem; margin: 0 0 1rem; padding-bottom: 0.35em; border-bottom: 2px solid var(--lib-purple); color: #fff;
}
.asar-library .lib-books {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem;
}
.asar-library .lib-book {
  display: flex; flex-direction: column; background: rgba(20, 12, 28, 0.72);
  border: 1px solid rgba(140, 68, 173, 0.55); border-radius: 10px; overflow: hidden;
}
.asar-library .lib-cover { position: relative; aspect-ratio: 3 / 4; background: #1b1424; overflow: hidden; }
.asar-library .lib-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.asar-library .lib-nocover { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3rem; color: var(--lib-purple); }
.asar-library .is-locked .lib-cover img { filter: grayscale(0.85) brightness(0.45); }
.asar-library .lib-level {
  position: absolute; top: 0.6rem; left: 0.6rem; padding: 0.15em 0.65em; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; color: #111; background: #cfc6dd;
}
.asar-library .lib-level-0 { background: #b9e3c6; }
.asar-library .lib-level-2 { background: #d9a6f2; }
.asar-library .lib-level-3 { background: var(--lib-gold); }
.asar-library .lib-info { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.asar-library .lib-info h4 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 0.4em; color: #fff; }
.asar-library .lib-info p { margin: 0 0 0.6em; color: #c9c4d4; font-size: 0.97rem; }
.asar-library .lib-note { color: var(--lib-gold) !important; }
.asar-library .lib-locked { margin-top: auto !important; color: #e6e1ee !important; }
.asar-library .lib-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.asar-library .lib-btn {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px; padding: 0.3em 1em;
  background: var(--lib-purple); border: 2px solid var(--lib-purple); border-radius: 999px;
  color: #fff !important; text-decoration: none; font-weight: 600;
}
.asar-library .lib-btn:hover { background: var(--lib-red); border-color: var(--lib-red); }
.asar-library .lib-btn-alt { background: transparent; }
.asar-library .lib-size { font-size: 0.85rem; color: #a9a2b6; }
.asar-library .lib-credit { font-size: 0.8rem; color: #a9a2b6; margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.asar-library .lib-credit a, .asar-library .lib-credits a { color: inherit; text-decoration: underline; }
.asar-library .lib-credits { max-width: 52rem; margin: 0 auto 2rem; font-size: 0.8rem; color: #a9a2b6; overflow-wrap: anywhere; }
.asar-library .lib-credits h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.asar-library .lib-fine { text-align: center; font-size: 0.9rem; color: #a9a2b6; margin: 0 0 2rem; }
@media (prefers-reduced-motion: no-preference) {
  .asar-library .lib-book { transition: transform 0.2s ease, border-color 0.2s ease; }
  .asar-library .lib-book:hover { transform: translateY(-3px); border-color: var(--lib-purple); }
}

/* Videos (16 Nov 2026): wide cards, the player fills the picture area. */
.asar-library .lib-videos { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.asar-library .is-video .lib-cover { aspect-ratio: 16 / 9; background: #000; }
.asar-library .is-video .lib-cover img { object-position: center; }
.asar-library .lib-cover video { width: 100%; height: 100%; display: block; background: #000; }
.asar-library .lib-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.asar-library .lib-badge {
  padding: 0.15em 0.65em; border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: #111; background: #cfc6dd;
}
@media (prefers-reduced-motion: no-preference) {
  .asar-library .is-video:hover { transform: none; }
}

/* The shelves inside another page (the MTG page, /tcg/mtg/): no page padding, left-aligned text. */
.asar-library.lib-embed { padding: 0; margin: 1.5rem auto; text-align: left; font-size: 1rem; }
.asar-library.lib-embed .lib-you { text-align: center; }
.asar-library.lib-embed .lib-shelf h3 { text-align: center; }
@media (max-width: 400px) {
  .asar-library .lib-videos { grid-template-columns: 1fr; }
}
/* On phones the guide cards on the MTG page sit side by side with a small cover, so the page stays short. */
@media (max-width: 575px) {
  .asar-library.lib-embed .lib-books:not(.lib-videos) { grid-template-columns: 1fr; gap: 0.75rem; }
  .asar-library.lib-embed .lib-books:not(.lib-videos) .lib-book { flex-direction: row; }
  .asar-library.lib-embed .lib-books:not(.lib-videos) .lib-cover { width: 6.5rem; flex: none; align-self: flex-start; }
  .asar-library.lib-embed .lib-books:not(.lib-videos) .lib-level { top: 0.35rem; left: 0.35rem; font-size: 0.72rem; }
  .asar-library.lib-embed .lib-books:not(.lib-videos) .lib-info { padding: 0.6rem 0.75rem; }
}

/* Podcasts (build 4, 16 Nov 2026): episode lists and the player bar fixed to the bottom of the page. */
.asar-library .lib-episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.asar-library .lib-ep {
  display: flex; gap: 1rem; align-items: flex-start; padding: 0.85rem 1rem; text-align: left;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px;
}
.asar-library .lib-ep.is-current { border-color: var(--lib-gold); background: rgba(232, 197, 71, 0.08); }
.asar-library .lib-ep-play {
  flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 2px solid var(--lib-purple);
  background: var(--lib-purple); color: #fff; font-size: 1.25rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.asar-library button.lib-ep-play:hover { background: var(--lib-red); border-color: var(--lib-red); }
.asar-library button.lib-ep-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.asar-library .lib-ep-play .fa-play { margin-left: 0.15em; }
.asar-library .lib-ep-lock { background: transparent; color: #a9a2b6; cursor: default; }
.asar-library .lib-ep-info { flex: 1; min-width: 0; }
.asar-library .lib-ep-info h4 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 0.3em; color: #fff; }
.asar-library .lib-ep-info p { margin: 0 0 0.45em; color: #c9c4d4; font-size: 0.97rem; }
.asar-library .lib-ep-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0 !important; }
.asar-library .lib-ep-meta .lib-badge { position: static; }
.asar-library .lib-ep-dl { color: #e6e1ee; font-size: 0.9rem; }
.asar-library .lib-ep-dl:hover { color: var(--lib-gold); }
.asar-library .lib-ep .lib-locked { font-size: 0.9rem; }
.asar-library .lib-player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.6rem 1rem;
  background: #1b1424; border-top: 3px solid var(--lib-purple); box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.5); text-align: left;
}
.asar-library .lib-player[hidden] { display: none; }
.asar-library .lib-player-now { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; }
.asar-library .lib-player-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lib-gold); }
.asar-library .lib-player-title { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asar-library .lib-player-audio { flex: 2 1 18rem; min-width: 0; height: 2.6rem; }
.asar-library .lib-player-speed, .asar-library .lib-player-close {
  flex: none; min-width: 2.75rem; height: 2.4rem; padding: 0 0.6rem; border-radius: 999px; cursor: pointer; font-weight: 600;
  background: transparent; border: 2px solid var(--lib-purple); color: whitesmoke;
}
.asar-library .lib-player-speed:hover, .asar-library .lib-player-close:hover { background: var(--lib-purple); }
body.lib-player-on { padding-bottom: 7rem; }
body.lib-player-on .bd-mode-toggle { bottom: var(--lib-player-h, 5rem) !important; }
@media (max-width: 575.98px) {
  .asar-library .lib-ep { padding: 0.75rem; gap: 0.75rem; }
  .asar-library .lib-ep-play { width: 2.75rem; height: 2.75rem; font-size: 1.05rem; }
  .asar-library .lib-player-audio { flex-basis: 100%; order: 3; }
  body.lib-player-on { padding-bottom: 9rem; }
}

/* Private shelf (Mage's own bought copies, 17 Nov 2026): seen only by its owner. */
.asar-library .lib-level-p, .asar-library .lib-badge.lib-level-p { background: #3b3b4f; color: #fff; }
.asar-library .lib-private-note { font-size: 0.9rem; margin: -0.25rem 0 0.75rem; opacity: 0.85; }
