* {
  box-sizing: border-box;
}

:root {
  --border-color: #111;
  --border-width: 3px;
}

body {
  margin: 0;
  background: #242424;
  color: #111;
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.page {
  width: min(540px, calc(100% - 24px));
  margin: 20px auto 40px;
}

.header-image {
  position: relative;
  width: 100%;
  aspect-ratio: 540 / 90;
  margin: 0 auto;
  border: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

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

.image-placeholder {
  display: none;
  place-items: center;
  font-size: clamp(18px, 5vw, 28px);
}

.gallery {
  width: 100%;
  margin: 42px auto 0;
  border: 0;
}

.thumbnail-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  border-bottom: 0;
  line-height: 0;
  gap: 0;
  margin-bottom: 0px;
}

.thumbnail {
  position: relative;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 90 / 70;
  padding: 0;
  border: 0;
  background: #242424;
  color: #111;
  cursor: pointer;
  overflow: hidden;
}

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

.thumb-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  font-size: clamp(10px, 2.5vw, 16px);
  overflow-wrap: anywhere;
}

.main-display {
  position: relative;
  background-image: url("images/Page_Character_List/Display_BG.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  width: 100%;
  height: 490px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.main-display > img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(330px, 100%);
  max-height: 120px;
  object-fit: contain;
}

.ticket-stack {
  position: relative;
  width: min(330px, 100%);
  height: 120px;
  flex: none;
}

.ticket-link {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(var(--ticket-rotation, 0deg)) scale(1);
  transform-origin: top right;
  cursor: pointer;
}

/* ホバー中だけ、右上を支点に10%拡大・縮小を繰り返す */
.ticket-link:hover {
  animation: ticket-breathe 2.0s ease-in-out infinite;
}

@keyframes ticket-breathe {
  0%, 100% {
    transform: rotate(var(--ticket-rotation, 0deg)) scale(1);
  }
  50% {
    transform: rotate(var(--ticket-rotation, 0deg)) scale(1.1);
  }
}

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

.main-placeholder {
  display: none;
  width: min(100%, 330px);
  aspect-ratio: 330 / 120;
  background: #000;
  color: #fff;
  place-items: center;
  font-size: clamp(28px, 8vw, 64px);
}

.footer {
  display: flex;
  justify-content: center;
  margin-top: 42px;
}

.bottom-button {
  display: inline-grid;
  place-items: center;
  min-width: 110px;
  min-height: 50px;
  padding: 6px 20px;
  border: var(--border-width) solid var(--border-color);
  border-color: #4e4e4e;
  color: #fff;
  background: #242424;
  text-decoration: none;
  font-size: clamp(20px, 5vw, 30px);
  transition: background-color 0.15s, color 0.15s;
}

.bottom-button:hover,
.bottom-button:focus-visible {
  background: #242424;
  color: #fff;
}

@media (max-width: 420px) {
  .page {
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .gallery {
    margin-top: 24px;
  }

  .main-display {
    height: 490px;
    min-height: 490px;
  }

  .footer {
    margin-top: 28px;
  }
}
