/* シリーズのトップ */
.top-hero {
  text-align: center;
  padding: 32px 0 24px;
}

/* タイトルの上に案内役クラベ（64px）。読めないときは薄いミント色の丸 */
.top-kurabe {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
}

.top-kurabe img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.top-kurabe.is-fallback {
  border-radius: 50%;
  background: var(--mint-light);
}

.top-title {
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--mint-dark);
  letter-spacing: 0.04em;
}

.top-tagline {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* キャラの帯：5体を横に並べる。狭い画面（幅 360px 未満）は4体 */
.top-band {
  --band-gap: 8px;
  list-style: none;
  margin: 20px auto 0;
  padding: 0;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--band-gap);
}

.band-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  animation: band-hop 2.4s ease-in-out infinite;
}

.band-item:nth-child(2) { animation-delay: -0.5s; }
.band-item:nth-child(3) { animation-delay: -1s; }
.band-item:nth-child(4) { animation-delay: -1.5s; }
.band-item:nth-child(5) { animation-delay: -2s; }

.band-avatar {
  display: block;
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
}

.band-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.band-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86%;
  height: 86%;
  margin: 7%;
  border-radius: 50%;
  background: #c9cfcd;
  color: var(--ink);
  font-size: 0.9rem;
}

.band-name {
  max-width: 100%;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.3;
  text-align: center;
  line-break: strict;
  overflow-wrap: anywhere;
}

/* まだなかまでないキャラ：図鑑と同じシルエット */
.band-item--locked .band-avatar img {
  filter: brightness(0) opacity(0.35);
}

.band-item--locked .band-name {
  letter-spacing: 0.1em;
}

@keyframes band-hop {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .band-item {
    animation: none;
  }
}

@media (max-width: 359px) {
  .top-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .band-item:nth-child(n + 5) {
    display: none;
  }
}

.top-section {
  max-width: 640px;
  margin: 16px auto 0;
}

.top-section-title {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--ink-soft);
}

.works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.work-card {
  position: relative;
  display: block;
  min-height: 44px;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.15s;
}

.work-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.work-card-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.work-card-field {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
}

/* タイトルのリンクをカードいっぱいに広げて、カードのどこを押しても開くようにする */
.work-card-link {
  text-decoration: none;
}

.work-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.work-card-link:focus-visible {
  outline: none;
}

.work-card:has(.work-card-link:focus-visible) {
  outline: 3px solid var(--mint-dark);
  outline-offset: 2px;
}

/* 進みぐあい（左）と「はじめる／つづきから」（右）。狭いときはボタンが下に回る */
.work-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-top: 10px;
}

.work-card-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

/* カードいっぱいのリンクより上に出して、ボタンは別のリンクとして押せるようにする */
.work-card-play {
  position: relative;
  z-index: 1;
  margin-left: auto;
  min-width: 140px;
}

.work-card-play:empty {
  visibility: hidden;
}

.work-card-stat {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--mint-light);
  color: var(--mint-dark);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.work-card-stat:empty {
  display: none;
}

@media (hover: hover) {
  .work-card:hover {
    border-color: var(--mint);
  }
  .work-card:has(.work-card-play:hover) {
    border-color: var(--line);
  }
}

.top-zukan {
  text-align: center;
  margin-top: 32px;
}
