.home { max-width: 1040px; margin: 0 auto; padding: 52px 16px 60px; }

.hero { position: relative; margin-bottom: 40px; padding-right: 170px; }
.hero h1 { margin: 6px 0 14px; font-size: clamp(2.8rem, 8vw, 4.6rem); }
.hero .label { color: var(--on-sky, var(--muted)); }
.hero p { margin: 0; display: inline-block; padding: 8px 18px; border-radius: 999px; color: var(--ink); max-width: 46ch; line-height: 1.5; font-size: 1.1rem; font-weight: 600; }

/* A little stack of dice next to the title. */
.hero-mark { position: absolute; right: 10px; top: -10px; width: 150px; height: 140px; }
.hero-mark .die { position: absolute; width: 70px; height: 70px; padding: 0; }
.hero-mark .die:nth-child(1) { left: 0; bottom: 0; rotate: -6deg; }
.hero-mark .die:nth-child(2) { left: 74px; bottom: 0; rotate: 5deg; }
.hero-mark .die:nth-child(3) { left: 38px; bottom: 66px; rotate: -3deg; animation: bob 2.4s ease-in-out infinite; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: inset 0 2px 0 #fff, inset 0 0 0 3px #fff, 0 11px 0 var(--cream-dark), 0 26px 36px -16px rgba(90, 50, 150, 0.6); }

/* Cover: the game's colour with clouds and a few bouncing dice. */
.card-cover {
  position: relative;
  height: 170px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70px 30px at 16% 26%, rgba(255, 255, 255, 0.85) 98%, transparent),
    radial-gradient(ellipse 50px 24px at 26% 22%, rgba(255, 255, 255, 0.85) 98%, transparent),
    radial-gradient(ellipse 80px 32px at 86% 18%, rgba(255, 255, 255, 0.7) 98%, transparent),
    linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 45%, #fff), var(--card-accent));
  margin: 3px 3px 0;
  border-radius: 25px 25px 0 0;
}
.card-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: #ffc4e2;
  box-shadow: inset 0 5px 0 #ffd9ec;
}
.card-cover .die { position: absolute; z-index: 1; width: 62px; height: 62px; padding: 0; bottom: 20px; }
.card-cover .die:nth-child(1) { left: 22px; rotate: -4deg; }
.card-cover .die:nth-child(2) { left: 88px; rotate: 3deg; }
.card-cover .die:nth-child(3) { left: 154px; bottom: 74px; rotate: 8deg; animation: bob 2s ease-in-out infinite; }
a.card:hover .card-cover .die:nth-child(3) { animation-duration: 0.8s; }
.card-cover .cover-art { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }

.card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h2 { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.card-body p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 1.02rem; }

.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink-dark);
}
.best { font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.best strong { color: var(--ink); }

.card--soon {
  border: 4px dashed rgba(255, 255, 255, 0.95);
  background: rgba(255, 248, 236, 0.7);
  box-shadow: none;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 240px;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  padding: 24px;
}
.card--soon .die { width: 64px; height: 64px; padding: 0; rotate: -8deg; }
.card--soon p { margin: 0; }


@keyframes bob { 50% { translate: 0 -8px; } }

@media (max-width: 560px) {
  .hero { padding-right: 0; padding-top: 130px; }
  .hero-mark { left: 0; right: auto; top: 0; transform: scale(0.8); transform-origin: top left; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark .die, .card-cover .die { animation: none !important; }
}

/* Theme button and picker */
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0 10px;
  padding: 8px 18px 8px 10px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.theme-btn:hover { transform: translateY(-2px); }
.theme-btn:active { transform: translateY(2px); }
.theme-btn b { color: var(--pink-dark); }
.theme-btn-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--pink-soft); font-size: 1.2rem; }

.theme-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(58, 31, 74, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.theme-sheet { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 18px 22px; }
.theme-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-head h2 { margin: 0; font-size: 1.6rem; }
.theme-head .btn { padding: 10px 22px; font-size: 1.05rem; }
.theme-sub { margin: 4px 0 14px; color: var(--muted); font-weight: 500; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.theme-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 5px 0 var(--cream-dark);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.theme-tile:hover { transform: translateY(-3px); }
.theme-tile.on { box-shadow: 0 0 0 4px var(--pink), 0 5px 0 var(--cream-dark); }
.theme-tile .preview { height: 86px; background: center bottom / cover no-repeat; display: grid; place-items: center; font-size: 2.4rem; }
.theme-tile .preview span { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.18)); }
.theme-tile .name { padding: 8px 6px 10px; font-weight: 700; font-size: 1.02rem; }
.theme-tile .check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; background: var(--pink); color: #fff; font-weight: 700; }
.theme-tile.on .check { display: grid; }
