/* ── Bento mosaic grid — shared across all game category pages ── */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 180px;
  gap: 10px;
  grid-auto-flow: dense;
}

/* Card base */
.bento-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  background: #1c1c1e;
  cursor: pointer;
  outline: none;
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.28s ease;
}
.bento-card:hover {
  transform: translateY(-4px) scale(1.018);
  box-shadow: 0 18px 44px rgba(0,0,0,0.65), 0 0 0 1.5px rgba(41,151,255,0.55);
  z-index: 10;
}
.bento-card:focus-visible { outline: 2px solid #2997ff; outline-offset: 2px; }

/* Image */
.bento-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.35s ease;
  pointer-events: none;
}
.bento-card:hover img { transform: scale(1.08); filter: brightness(0.52); }

/* Gradient overlay */
.bento-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,0.84) 0%,
    rgba(0,0,0,0.28) 40%,
    transparent 68%);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.bento-card:hover::after { opacity: 1; }

/* Featured card (2×2) — permanent gradient */
.bento-featured::after  { opacity: 0.6; }
.bento-featured:hover::after { opacity: 0.9; }

/* Name label — slides up on hover */
.bento-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: 0.7rem 0.9rem;
  transform: translateY(calc(100% + 4px));
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.28, 0.64, 1),
              opacity 0.25s ease;
  pointer-events: none;
}
.bento-card:hover .bento-label { transform: translateY(0); opacity: 1; }
.bento-label h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f5f5f7;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0,0,0,0.95);
}
.bento-tag {
  display: block;
  font-size: 0.64rem;
  font-weight: 500;
  color: rgba(255,255,255,0.58);
  letter-spacing: 0.07em;
  margin-bottom: 0.18rem;
  text-transform: uppercase;
}

/* GIF countdown ring (shown only when data-gif is present) */
.gif-ring {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  width: 28px; height: 28px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.bento-card:hover .gif-ring { opacity: 1; }
.gif-ring svg { width: 28px; height: 28px; transform: rotate(-90deg); }
.gif-ring circle { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 3; }
.gif-ring .progress {
  fill: none; stroke: #2997ff; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 57; stroke-dashoffset: 57;
}
.bento-card:hover .gif-ring .progress {
  animation: gifCountdown 3s linear forwards;
}
@keyframes gifCountdown {
  from { stroke-dashoffset: 57; }
  to   { stroke-dashoffset: 0;  }
}
.gif-text {
  position: absolute;
  bottom: 0.55rem; right: 0.6rem;
  z-index: 3;
  background: rgba(0,0,0,0.65);
  color: rgba(255,255,255,0.72);
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.07em;
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.bento-card:hover .gif-text { opacity: 1; }
.bento-card.gif-active .gif-text { background: #2997ff; color: #fff; }

/* Span variants */
.bento-featured { grid-column: span 2; grid-row: span 2; border-radius: 18px; }
.bento-featured .bento-label { transform: translateY(0); opacity: 1; }
.bento-featured .bento-label h3 { font-size: clamp(1.05rem,1.8vw,1.35rem); white-space: normal; }
.bento-featured .bento-tag { font-size: 0.7rem; }
.bento-wide { grid-column: span 2; }
.bento-tall { grid-row: span 2; }

/* Section label */
.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #86868b;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 0.8rem;
}
.bento-section { margin-bottom: 2.5rem; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .bento-grid { grid-template-columns: repeat(4,1fr); grid-auto-rows: 165px; }
}
@media (max-width: 780px) {
  .bento-grid { grid-template-columns: repeat(3,1fr); grid-auto-rows: 140px; gap: 8px; }
}
@media (max-width: 520px) {
  .bento-grid { grid-template-columns: repeat(2,1fr); grid-auto-rows: 125px; gap: 7px; }
  .bento-wide { grid-column: span 2; }
}
