/* Tarjetas cuadradas: Bootstrap ordena la cuadrícula; Pixelarticons aporta los iconos. */
.game-group.substances {
  --accent: #148875;
  --game-wash: #e1f3ed;
}
.game-group.family {
  --accent: #bd5b43;
  --game-wash: #fff0e9;
}
.game-group.safety {
  --accent: #7160b1;
  --game-wash: #f0edfb;
}
.game-grid.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  counter-reset: game-track;
}
.game-grid.row > [class*="col-"] {
  display: flex;
}
.game-grid .game {
  counter-increment: game-track;
}
.game.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: auto !important;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #dbe6e2;
  border-top: 4px solid var(--accent);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff 0%, #fff 74%, var(--game-wash) 145%);
  box-shadow:
    4px 5px 0 color-mix(in srgb, var(--accent) 18%, white),
    0 7px 16px #15344d0a;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.game .card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 15px 16px 14px;
}
.game .card-body::before {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  content: "PLAY / " counter(game-track, decimal-leading-zero);
  font:
    400 0.54rem/1.4 "Press Start 2P",
    "Courier New",
    monospace;
  letter-spacing: 0.02em;
}
.game .card-body::after {
  position: absolute;
  top: 37px;
  right: 16px;
  width: 60px;
  height: 60px;
  background: var(--tile-icon) center/contain no-repeat;
  content: "";
  filter: grayscale(1);
  opacity: 0.17;
  pointer-events: none;
}
.game-group.substances article:nth-child(1) .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/heart.svg");
}
.game-group.substances article:nth-child(2) .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/target.svg");
}
.game-group.substances article:nth-child(3n) .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/play.svg");
}
.game-group.substances article:nth-child(3n + 1) .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/heart.svg");
}
.game-group.family article:nth-child(odd) .game,
.game-group.safety article .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/heart.svg");
}
.game-group.family article:nth-child(even) .game {
  --tile-icon: url("https://unpkg.com/pixelarticons@2.1.2/svg/target.svg");
}
.game .format {
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
  border-radius: 5px;
  background: var(--game-wash);
  color: var(--accent);
  font:
    800 0.58rem/1.2 "Courier New",
    monospace;
  letter-spacing: 0.06em;
}
.game h4 {
  margin: 10px 0 6px;
  font-size: 0.9rem;
  line-height: 1.27;
}
.game p {
  margin-bottom: 0;
  font-size: 0.74rem;
  line-height: 1.45;
}
.game a {
  padding-top: 11px;
  color: var(--accent);
  font-size: 0.69rem;
  letter-spacing: 0.01em;
}
.game:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, white);
  box-shadow:
    5px 7px 0 color-mix(in srgb, var(--accent) 22%, white),
    0 10px 18px #15344d12;
}
.game:focus-within {
  border-color: var(--accent);
}
@media (max-width: 560px) {
  .game .card-body {
    padding: 13px;
  }
  .game .card-body::after {
    top: 34px;
    right: 13px;
    width: 52px;
    height: 52px;
  }
  .game .card-body::before {
    font-size: 0.48rem;
  }
}
