/* Library page — the shelf of converted Diamond Bullet Studios games. */

:root {
  color-scheme: dark;
  --bg: #0a0d08;
  --panel: #141a10;
  --panel-edge: #ffffff14;
  --ink: #e9eee4;
  --ink-dim: #a4b09a;
  --ink-faint: #75806e;
  --grass: #8ec63f;
  --grass-deep: #4d7a1f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 80% at 50% -10%, #1d2c12 0%, #0d1209 55%, var(--bg) 100%);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- masthead ---------- */

.masthead {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 11vw, 110px) 24px clamp(32px, 6vw, 56px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--grass);
}

.masthead h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.12;
  letter-spacing: -.01em;
}

.lede {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--ink-dim);
}

.count {
  margin: 26px 0 0;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

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

.shelf {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  gap: 26px;
  /* Capped rather than 1fr so a shelf holding one game centres a normal-sized
     card instead of stretching it across the page. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 330px));
  justify-content: center;
  align-items: start;
}

.loading { grid-column: 1 / -1; color: var(--ink-faint); text-align: center; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color .18s, transform .18s;
}

.card:hover { border-color: #8ec63f55; transform: translateY(-2px); }
.card.is-unplayable:hover { transform: none; border-color: var(--panel-edge); }

/* Box art. The originals are 64x64 marketplace thumbnails, so the tile is shown
   at whole-pixel scale over a blurred, stretched copy of itself rather than
   being smeared across the full card width. */
.art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: #070a05;
  overflow: hidden;
  box-shadow: inset 0 -40px 60px -30px #000000cc;
}

.art .backdrop {
  position: absolute;
  inset: -18%;
  width: 136%;
  height: 136%;
  object-fit: cover;
  filter: blur(24px) saturate(1.15) brightness(.42);
}

.art .tile {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 6px;
  box-shadow: 0 10px 26px #000000a8, 0 0 0 1px #ffffff1f;
}

.art .tile.pixelated { image-rendering: pixelated; }

.art .placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 6px;
  border: 1px dashed #ffffff26;
  font-family: var(--serif);
  font-size: 40px;
  color: var(--ink-faint);
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #0a0d08cc;
  border: 1px solid #ffffff24;
  color: var(--ink-dim);
}

.badge.playable { color: var(--grass); border-color: #8ec63f4d; }

.body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.1;
}

.title a { color: inherit; text-decoration: none; }
.title a:hover { color: var(--grass); }

.byline { margin: 0; font-size: 12.5px; color: var(--ink-faint); }
.blurb { margin: 0; font-size: 13.5px; color: var(--ink-dim); flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }

.modes { margin: 0; font-size: 12.5px; color: var(--ink-faint); }
.modes b { font-weight: 600; color: var(--ink-dim); }

.chips li {
  padding: 3px 9px;
  border-radius: 6px;
  background: #ffffff0d;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-edge);
}

.play {
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--grass);
  color: #10230a;
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
}

.play:hover { background: #a2dc4e; }

.play.disabled { background: #2b3524; color: var(--ink-faint); pointer-events: none; }

.notes { display: flex; gap: 12px; font-size: 12.5px; }
.notes a { color: var(--ink-faint); text-decoration: none; border-bottom: 1px solid #ffffff1f; }
.notes a:hover { color: var(--ink); }

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

footer {
  border-top: 1px solid var(--panel-edge);
  padding: 26px 24px 44px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
}

footer code { color: var(--ink-dim); font-size: 12px; }
footer a { color: var(--ink-dim); }

@media (prefers-reduced-motion: reduce) {
  .card, .card:hover { transition: none; transform: none; }
}
