:root {
  --paper: #f2ede3;
  --ink: #161412;
  --ink-soft: #5d574f;
  --hot: #ff4d2e;
  --gap: clamp(14px, 3vw, 28px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  overflow-x: hidden;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: max(28px, env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) 8px max(var(--gap), env(safe-area-inset-left));
}
.mark {
  margin: 0;
  font-family: "Dela Gothic One", sans-serif;
  font-weight: 400;
  font-size: clamp(52px, 13vw, 132px);
  line-height: .9;
  letter-spacing: -.02em;
}
.xlink {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .12s ease;
}
.xlink svg { width: 24px; height: 24px; fill: var(--paper); }
.xlink:hover { transform: scale(1.08) rotate(-6deg); }
.xlink:active { transform: scale(.94); }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: calc(var(--gap) + 6px) var(--gap);
  padding: var(--gap) max(var(--gap), env(safe-area-inset-right)) 64px max(var(--gap), env(safe-area-inset-left));
}

.tile {
  --c: var(--hot);
  position: relative;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  outline: none;
  transform-origin: 50% 60%;
  transition: transform .14s cubic-bezier(.3, 1.6, .5, 1);
  -webkit-tap-highlight-color: transparent;
}
.tile .thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 18px 18px 18px 4px;
  background: var(--c);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--ink);
  transition: box-shadow .14s ease;
}
.tile .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile .thumb img[src=""] { display: none; }
.tile .thumb .initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Dela Gothic One", sans-serif;
  font-size: clamp(44px, 9vw, 72px);
  color: var(--ink);
  mix-blend-mode: multiply;
  opacity: .85;
}
.tile .no {
  position: absolute;
  z-index: 2;
  top: -12px;
  left: 14px;
  padding: 3px 10px 4px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Dela Gothic One", sans-serif;
  font-size: 15px;
  letter-spacing: .04em;
}
.tile .meta { display: block; padding: 14px 4px 0; }
.tile .name {
  display: block;
  font-weight: 900;
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.25;
}
.tile .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 15px;
}
.tile .players { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.tile .players[hidden] { display: none; }
.tile .players svg { width: 18px; height: 18px; fill: currentColor; }
.tile .players b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* カーソルを合わせたら大きくし、影を落として持ち上げる。押したら沈む。 */
.tile:hover, .tile:focus-visible { transform: scale(1.06) rotate(-1deg); z-index: 3; }
.tile:hover .thumb, .tile:focus-visible .thumb { box-shadow: 12px 12px 0 var(--ink); }
.tile:focus-visible .thumb { outline: 5px solid var(--ink); outline-offset: 5px; }
.tile:active { transform: scale(.96); transition-duration: .05s; }
.tile:active .thumb { box-shadow: 2px 2px 0 var(--ink); }

.tile.is-new .no { background: var(--hot); color: var(--ink); }

.fade {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.fade.on { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .tile, .tile .thumb, .xlink, .fade { transition: none; }
}
