/* The opening page: one card per world. style.css supplies the colours. */

html, body.library { height: auto; overflow: auto; }
body.library {
  min-height: 100%;
  background: linear-gradient(#05070f, #0f0a1a) fixed;
}
.library main {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 28px 40px;
  display: grid;
  gap: 22px;
}
.library header { display: grid; gap: 6px; }
.library h1 { margin: 0; font-size: 2rem; font-weight: 600; line-height: 1.15; }
.library .eyebrow { letter-spacing: 0.18em; }
.library .lede { max-width: 640px; color: var(--secondary); font-size: 0.98rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
}
.card:hover { background: rgba(44, 48, 66, 0.8); border-color: rgba(255, 255, 255, 0.24); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card h2 { font-size: 1.15rem; }
.card .formula { font-size: 0.92rem; font-weight: 500; color: var(--accent); }
.card p:not(.formula) { color: var(--secondary); }

/* A card that opens a shelf of worlds rather than one world. */
.card.shelf { min-height: 0; border-color: rgba(120, 170, 255, 0.45); }
.card.shelf .count { color: var(--accent); font-weight: 600; }
.library .back { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.library .back:hover { text-decoration: underline; }
