/* ============================================================
   gamelog.css — /media no estilo "game log" (client/js/shelf/log.ts):
   barra lateral com busca e filtros, grade de caixas de DVD que giram
   e brilham ao passar o mouse. Celular: barra em cima, 3 capas por linha.
   ============================================================ */

.shelf-page { container: gamelog / inline-size; }
.gamelog {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.gamelog__side {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  color: var(--ink);
}
.gamelog__search { width: 100%; padding: 7px 8px; border: 1px solid var(--ink); background: var(--panel-hi); color: var(--ink); font: var(--fs-s)/1.3 var(--serif); }
.gamelog__intro { font: var(--fs-s)/1.5 var(--serif); }
.gamelog__intro p { margin: 0 0 .6em; }
.gamelog__buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.gamelog__buttons .btn { padding: 3px 8px; font-size: var(--fs-xs); }
.gamelog__buttons .btn.on { background: var(--ink); color: var(--sheet); }
.gamelog__side .shelf-adder > summary,
.gamelog__side .shelf-jump,
.gamelog__side .shelf-view-toggle { width: 100%; text-align: center; }

/* banner com as capas do que está em "agora" */
.gamelog__banner {
  position: relative;
  display: block;
  height: 120px;
  border: 1px solid var(--ink);
  background: var(--ink) center 30% / cover no-repeat;
  transition: background-image .4s ease;
}
.gamelog__banner span {
  position: absolute;
  inset: auto 0 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgb(0 0 0 / .75));
  color: #fff;
  font: var(--fs-xs)/1.3 var(--mono);
}

/* a grade de caixas */
.gamelog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 18px 14px;
  align-content: start;
}

.dvd { position: relative; display: block; color: var(--ink); text-decoration: none; perspective: 600px; }
.dvd__case {
  position: relative;
  display: block;
  padding: 14px 3px 3px 10px;
  border-radius: 3px 5px 5px 3px;
  background: linear-gradient(90deg, #1a1a1a, #3a3a3a 6%, #222 9%, #2b2b2b);
  box-shadow: 0 6px 12px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 255 255 / .12);
  overflow: hidden;
  transition: transform .3s ease;
  transform-origin: left center;
}
.dvd__band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 13px;
  padding: 0 6px;
  background: linear-gradient(#f2f2f2, #cfcfcf);
  color: #1a1a1a;
  font: bold 9px/13px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.dvd__cover { width: 100%; box-shadow: none; }
.dvd__spine { position: absolute; top: 13px; bottom: 0; left: 0; width: 8px; background: linear-gradient(90deg, rgb(255 255 255 / .15), transparent); }

/* o brilho atravessa a caixa no hover */
.dvd__case::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgb(255 255 255 / .45), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
}
.dvd:hover .dvd__case,
.dvd:focus-visible .dvd__case { transform: rotateY(-18deg) scale(1.03); }
.dvd:hover .dvd__case::after,
.dvd:focus-visible .dvd__case::after { animation: dvd-shine .75s ease forwards; }
@keyframes dvd-shine { to { left: 125%; } }

.dvd__badge {
  position: absolute;
  right: -4px;
  bottom: -6px;
  max-width: 90%;
  padding: 1px 6px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--sheet);
  font: var(--fs-xs)/1.4 var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dvd--current .dvd__badge { background: var(--accent); color: var(--accent-text); }
.dvd--queue .dvd__case { filter: saturate(.55); }

@container gamelog (max-width: 640px) {
  .gamelog { grid-template-columns: minmax(0, 1fr); }
  .gamelog__side { position: static; }
  .gamelog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .gamelog__banner { height: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .dvd__case { transition: none; }
  .dvd:hover .dvd__case, .dvd:focus-visible .dvd__case { transform: none; }
  .dvd:hover .dvd__case::after, .dvd:focus-visible .dvd__case::after { animation: none; }
}
