/* Brad Stine Catalog — DVD shelf */

.bsc-shelf {
  --bsc-gold: #e0a030;
  --bsc-frame: #ffffff;
  --bsc-panel: #141414;
  --bsc-text: #ffffff;
  --bsc-gap: 18px;
  display: grid;
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
}

.bsc-row {
  background: var(--bsc-panel);
  border: 13px solid var(--bsc-frame);
}

/* Tiles are sized by the row's nominal column count, so a short last row
   keeps the same tile size and is centered. */
.bsc-row-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: var(--bsc-gap);
  padding: 20px;
}

.bsc-tile {
  flex: 0 0 calc((100% - (var(--bsc-cols, 4) - 1) * var(--bsc-gap)) / var(--bsc-cols, 4));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none !important;
  color: var(--bsc-text);
}

.bsc-case {
  position: relative;
  display: block;
  width: 100%;
  transition: transform 0.2s ease;
}

a.bsc-tile:hover .bsc-case,
a.bsc-tile:focus-visible .bsc-case {
  transform: translateY(-4px);
}

/* Default: covers are finished product art (frame + disc baked in). */
.bsc-cover {
  display: block;
  width: 100%;
  height: auto;
}

.bsc-cover--blank {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, #2d2d2d, #050505);
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1.2;
  padding: 10px;
  box-sizing: border-box;
}

.bsc-disc {
  display: none;
}

/* Silver DVD with an iridescent sheen and a center hole. */
.bsc-shelf--framed .bsc-disc,
.bsc-tile--bundle .bsc-disc {
  display: block;
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #141414 0 13%, #9a9a9a 13% 15%, #e9e9e9 15% 27%, transparent 27%),
    conic-gradient(
      from 20deg,
      #d8d8d8, #f7f7f7 10%, #b9c9dc 18%, #e9dcf2 26%, #f4f1d8 33%,
      #c8c8c8 42%, #fafafa 52%, #bcd3c8 60%, #e3d4ef 68%, #f6f6f6 78%,
      #cfcfcf 88%, #d8d8d8
    );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    -3px 3px 8px rgba(0, 0, 0, 0.55);
}

/* Optional framed mode, for plain poster covers. */
.bsc-shelf--framed .bsc-tile:not(.bsc-tile--bundle) .bsc-case {
  width: 78%;
  padding: 7%;
  box-sizing: border-box;
  background: #0b0b0b;
  box-shadow: 0 0 0 2px var(--bsc-gold) inset;
}

.bsc-shelf--framed .bsc-tile:not(.bsc-tile--bundle) .bsc-cover {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.bsc-shelf--framed .bsc-tile:not(.bsc-tile--bundle) .bsc-disc {
  right: -12%;
  bottom: -4%;
  width: 40%;
}

/* Bundle tile: drawn to match the 3:4 framed product art. */
.bsc-tile--bundle .bsc-case {
  aspect-ratio: 3 / 4;
  padding: 7%;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.05), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(255, 255, 255, 0.04), transparent 45%),
    #0c0c0c;
}

.bsc-tile--bundle .bsc-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--bsc-gold);
}

.bsc-tile--bundle .bsc-disc {
  right: 0;
  bottom: 1%;
  width: 28%;
}

.bsc-bundle {
  display: flex;
  flex-direction: column;
  gap: 7%;
  padding: 10% 7% 7%;
  box-sizing: border-box;
  background: #111;
  overflow: hidden;
}

.bsc-bundle-head {
  font-family: Impact, "Anton", "Oswald", "Arial Narrow Bold", sans-serif;
  color: var(--bsc-gold);
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(16px, 3vw, 26px);
  line-height: 0.95;
  letter-spacing: 0.5px;
}

.bsc-bundle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: center;
  gap: 4%;
  flex: 1;
  min-height: 0;
}

.bsc-bundle-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.bsc-title {
  font-size: 15px;
  line-height: 1.3;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--bsc-text);
  overflow-wrap: anywhere;
}

a.bsc-tile:hover .bsc-title {
  color: var(--bsc-gold);
}

.bsc-error {
  color: #ff6b6b;
}

/* Phones: two tiles per row everywhere. */
@media (max-width: 640px) {
  .bsc-row {
    border-width: 8px;
  }
  .bsc-row-inner {
    padding: 16px 12px;
    --bsc-gap: 12px;
    row-gap: 22px;
  }
  .bsc-row .bsc-tile {
    --bsc-cols: 2;
  }
  .bsc-title {
    font-size: 14px;
  }
}
