.movie-detail {
  --pink: #e83d7d;
  --line: #323239;
  --surface: #17171c;
  --muted: #b8b8c2;
  background: #0e0e12;
  color: #f4f4f6;
  font-family: system-ui, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.movie-detail *, .movie-detail *::before, .movie-detail *::after { box-sizing: border-box; }
.movie-detail [hidden] { display: none !important; }
.movie-detail :focus-visible { outline: 2px solid #ff7baa; outline-offset: 3px; }
.movie-detail .new-header { text-align: center; }
.detail-main { width: min(calc(100% - 2rem), 68rem); margin: 0 auto; padding: 1rem 0 2.5rem; }
.detail-ad {
  display: grid; place-items: center; min-height: 5rem;
  border: 1px dashed #47474f; border-radius: .5rem; background: #141418;
  color: var(--muted); font-size: .8rem;
}
.detail-title { margin: 1.5rem auto .85rem; width: min(100%, 53rem); }
.detail-title h1 {
    width: auto;
    margin: 0;
    font-family: inherit;
    font-weight: 700;
    font-size: clamp(1.65rem, 5vw, 2.7rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    color: #e83d7d;
}
.detail-number { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; }
.detail-player {
  display: grid; grid-template-columns: minmax(4.25rem, 1fr) minmax(0, 53rem) minmax(4.25rem, 1fr);
  align-items: center; gap: .7rem;
}
.player-body { grid-column: 2; grid-row: 1; min-width: 0; }
.player-frame {
  aspect-ratio: 16 / 9; width: 100%; display: grid; overflow: hidden;
  background: #000; border: 1px solid var(--line); border-radius: .65rem;
}
.player-frame video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #000; }
.video-options { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin: 0 0 .55rem; font-size: .8rem; color: var(--muted); }
.video-options select, .detail-dialog button {
  color: #fff; background: #24242b; border: 1px solid #54545e; border-radius: .4rem; padding: .4rem .65rem; font: inherit;
}
.video-error { margin: .4rem 0 0; }
.detail-main .page-turn {
  grid-row: 1; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; min-height: 3.5rem; padding: .45rem .25rem; border-radius: .5rem;
  border: 1px solid var(--pink); color: #fff; background: #20131b;
  font-size: .74rem; line-height: 1.15; text-align: center; white-space: nowrap;
}
.detail-main a.page-turn:hover { background: #3c1728; }
.detail-main .page-turn[aria-disabled="true"] { border-color: #44444b; background: #17171c; color: var(--muted); }
.page-turn.previous { grid-column: 1; }
.page-turn.next { grid-column: 3; }
.page-turn .direction { color: var(--pink); font-size: 1.4rem; }
.page-turn[aria-disabled="true"] .direction { color: var(--muted); }
.detail-content { width: min(100%, 53rem); margin: .9rem auto 0; }
.detail-gallery, .detail-related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.35rem, 2vw, .85rem); }
.detail-gallery a, .detail-related a { display: block; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: .5rem; }
.detail-gallery a:hover, .detail-related a:hover { border-color: var(--pink); }
.detail-gallery img, .detail-related img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.detail-panel { margin-top: 1rem; padding: clamp(.85rem, 3vw, 1.25rem); border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.detail-panel h2 { margin: 0 0 .65rem; padding: 0 0 0 .65rem; border: 0; border-inline-start: 3px solid var(--pink); line-height: 1.35; font-size: 1.08rem; color: #fff; }
.detail-panel p { margin: 0; color: var(--muted); line-height: 1.65; }
.detail-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; }
.detail-content .detail-ad { margin-top: 1rem; }
.detail-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-main .detail-related a { background: #1f1f26; color: #fff; }
.detail-related span { display: block; padding: .55rem .65rem; font-size: .85rem; }
.movie-detail #footer { text-align: center; }
.detail-dialog {
  width: min(calc(100% - 1rem), 65rem); max-height: calc(100% - 1rem);
  margin: auto; padding: .65rem; background: #151519; color: #fff; border: 1px solid #44444b; border-radius: .6rem;
}
.detail-dialog::backdrop { background: rgba(0, 0, 0, .86); }
.dialog-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .5rem; }
.dialog-tools button { min-height: 2.75rem; cursor: pointer; }
.dialog-tools button:hover { border-color: var(--pink); }
.dialog-image { background: #000; min-height: 4rem; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.dialog-image img { display: block; max-width: 100%; max-height: 72vh; object-fit: contain; }
.dialog-image p { padding: 0 .5rem; }
.dialog-image p:empty { display: none; }

@media (max-width: 767px) {
  .detail-main { width: calc(100% - 1.25rem); }
  .detail-player { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .player-body { grid-column: 1 / -1; }
  .detail-main .page-turn { grid-row: 2; flex-direction: row; gap: .5rem; min-height: 2.85rem; }
  .page-turn.next { grid-column: 2; flex-direction: row-reverse; }
}
/* 作品情報の文字サイズ調整 */
.movie-detail .detail-facts dt {
    font-size: 15px;
}

.movie-detail .detail-facts dd {
    font-size: 16px;
}
/* 前後移動ボタンの矢印 */
.movie-detail .page-turn .direction {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 18px;
    font-size: 0;
    flex-shrink: 0;
}

.movie-detail .page-turn .direction::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 2px;
    width: 16px;
    height: 4px;
    background: currentColor;
    border-radius: 2px;
}

.movie-detail .page-turn .direction::after {
    content: "";
    position: absolute;
    top: 3px;
    width: 9px;
    height: 9px;
    border-top: 4px solid currentColor;
    border-right: 4px solid currentColor;
    box-sizing: content-box;
}

.movie-detail .previous .direction::after {
    left: 2px;
    transform: rotate(-135deg);
}

.movie-detail .next .direction::after {
    right: 2px;
    transform: rotate(45deg);
}
/* PICK UP カード */
.movie-detail .pickup-card {
    min-width: 0;
    overflow: hidden;
    background: #1f1f26;
    border: 1px solid var(--line);
    border-radius: .5rem;
    color: #fff;
}

.movie-detail .pickup-card span {
    display: block;
    padding: 10px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
/* 下部広告の外枠の横幅調整 */
.movie-detail .detail-content .contentsbox.mobile-prbox {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    box-sizing: border-box;
}
/* 上部・下部の外枠の横幅統一 */
.movie-detail .detail-main > aside > .contentsbox,
.movie-detail .detail-content .mobile-prbox {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* 下部の見出しの余白調整 */
.movie-detail .detail-content .mobile-prbox > h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* PCでは下部の外枠ごと非表示 */
@media screen and (min-width: 768px) {
    .movie-detail .detail-content .mobile-prbox {
        display: none;
    }
}
/* PC・スマートフォン共通の上下余白調整 */
.movie-detail .detail-main {
    padding-top: 0;
}

.movie-detail .detail-title {
    margin-top: 6px;
}