/* TOPページ固有のスタイル */

/* TOPICS用バウンス（グレー→ピンク） */
#topics .title-bounce {
    animation: textBounceGrey 5s ease-in-out infinite;
}

#topics .title-bounce:nth-child(1) { animation-delay: 0s; }
#topics .title-bounce:nth-child(2) { animation-delay: 0.4s; }
#topics .title-bounce:nth-child(3) { animation-delay: 0.8s; }
#topics .title-bounce:nth-child(4) { animation-delay: 1.2s; }
#topics .title-bounce:nth-child(5) { animation-delay: 1.6s; }
#topics .title-bounce:nth-child(6) { animation-delay: 2.0s; }

/* DIARY用バウンス（白→ピンク） */
#diary .title-bounce {
    animation: textBounceWhite 5s ease-in-out infinite;
}

#diary .title-bounce:nth-child(1) { animation-delay: 0s; }
#diary .title-bounce:nth-child(2) { animation-delay: 0.4s; }
#diary .title-bounce:nth-child(3) { animation-delay: 0.8s; }
#diary .title-bounce:nth-child(4) { animation-delay: 1.2s; }
#diary .title-bounce:nth-child(5) { animation-delay: 1.6s; }

/* SCHEDULE用バウンス（グレー→ピンク） */
#schedule .title-bounce {
    animation: textBounceGrey 5s ease-in-out infinite;
}

#schedule .title-bounce:nth-child(1) { animation-delay: 0s; }
#schedule .title-bounce:nth-child(2) { animation-delay: 0.4s; }
#schedule .title-bounce:nth-child(3) { animation-delay: 0.8s; }
#schedule .title-bounce:nth-child(4) { animation-delay: 1.2s; }
#schedule .title-bounce:nth-child(5) { animation-delay: 1.6s; }
#schedule .title-bounce:nth-child(6) { animation-delay: 2.0s; }
#schedule .title-bounce:nth-child(7) { animation-delay: 2.4s; }
#schedule .title-bounce:nth-child(8) { animation-delay: 2.8s; }

/* TOPICS セクション */
#topics {
    height: 702px;
    padding-top: 130px;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

/* Canvas ドット背景アニメーション */
#topicsDotsCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#topics h2 {
    color: #6e6e6e;
    position: relative;
    z-index: 2;
    font-weight: 300;
    -webkit-text-stroke: 5px #ffffff;
    text-stroke: 5px #ffffff;
    paint-order: stroke fill;
}

#topics h2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 5px);
    width: 1182px;
    height: 15px;
    background: linear-gradient(90deg,
        #ffcfe3 0%,
        #eaeaff 40%,
        #eaeaff 60%,
        #ffcfe3 100%);
    background-size: 200% 100%;
    border-radius: 5px;
    z-index: -1;
    animation: borderGradientFlow 10s ease-in-out infinite;
}

@keyframes borderGradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.topics-images {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
    width: 1180px;
    margin-left: calc(50% - 590px - 1px);
    margin-right: auto;
}

.topics-images img {
    display: block;
    width: 228px;
    border-radius: 5px;
}

.topics-card {
    position: relative;
    width: 228px;
    display: block;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
}

.topics-card img {
    display: block;
    width: 228px;
    transition: transform 0.3s ease;
}

.topics-card:hover img {
    transform: scale(1.1);
}

.topics-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 228px;
    height: 98px;
    background-color: rgba(239, 142, 183, 0.85);
    padding: 10px;
    border-radius: 0 0 5px 5px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topics-card-overlay p {
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 16px;
    color: #ffffff;
    line-height: 20px;
    margin: 0;
    text-align: left;
}

.topics-overlay-lines {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.topics-overlay-line {
    width: 208px;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.topics-overlay-line.marquee {
    text-align: left;
}

.topics-overlay-line .marquee-inner {
    display: inline-block;
    animation: marqueeScroll 12s linear infinite;
}

.topics-card:nth-child(2) .topics-card-overlay,
.topics-card:nth-child(4) .topics-card-overlay {
    background-color: rgba(157, 175, 228, 0.85);
}

/* DIARY セクション */
#diary {
    height: 700px;
    background-color: #c4c8d2;
    padding-top: 50px;
    justify-content: flex-start;
    position: relative;
}

#diary h2 {
    color: #ffffff;
    position: relative;
    z-index: 2;
    font-weight: 300;
}


.diary-view-more {
    position: absolute;
    top: calc(450px + 160px + 17px);
    right: calc(50% - 576px);
    font-family: 'Times New Roman', Times, serif;
    font-size: 20px;
    color: #ffffff;
    text-decoration: none;
    display: inline-block;
    animation: viewMoreBlink 1.5s ease-in-out infinite;
}

#diary .diary-box{
  width: 1180px;
}



@keyframes viewMoreBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* SCHEDULE セクション */
#schedule {
    height: auto;
    min-height: 942px;
    padding-top: 150px;
    padding-bottom: 100px;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

/* Canvas ドット背景アニメーション（SCHEDULE用） */
#scheduleDotsCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#schedule h2 {
    color: #6e6e6e;
    position: relative;
    z-index: 2;
    font-weight: 300;
    -webkit-text-stroke: 5px #ffffff;
    text-stroke: 5px #ffffff;
    paint-order: stroke fill;
}

#schedule h2::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 5px);
    width: 1180px;
    height: 15px;
    background: linear-gradient(90deg,
        #ffcfe3 0%,
        #eaeaff 40%,
        #eaeaff 60%,
        #ffcfe3 100%);
    background-size: 200% 100%;
    border-radius: 5px;
    z-index: -1;
    animation: borderGradientFlow 10s ease-in-out infinite;
}

.schedule-images {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 20px;
    margin-top: 50px;
    width: 1180px;
    margin-left: calc(50% - 590px - 1px);
    margin-right: auto;
}

.schedule-images img {
    display: block;
    width: 280px;
}

.schedule-card {
    position: relative;
    width: 280px;
    height: 550px;
    background-image: url('../images/schedulecard_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* カード縁アニメーション用Canvas */
.card-border-canvas {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 288px;
    height: 558px;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* カード全体のホバー時に縁アニメーションを表示（デフォルト） */
.schedule-card:hover .card-border-canvas {
    opacity: 1;
}

/* マルチカードは手動制御（JavaScriptで制御） */
/* デフォルトの縁アニメーションは非表示（JavaScriptでshow-borderクラスを制御） */
.schedule-card-multi .card-border-canvas {
    opacity: 0;
}

/* マルチカードで縁アニメーション表示クラス */
.schedule-card-multi.show-border .card-border-canvas {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 画像エリアホバー時は強制的に非表示 */
.schedule-card-multi.image-hover .card-border-canvas {
    opacity: 0 !important;
    transition: none !important;
}

.schedule-card img {
    display: block;
    width: 280px;
}

/* マルチ画像カルーセル用 */
.multi-image-container {
    position: relative;
    width: 280px;
    height: 280px;
    pointer-events: auto; /* 画像エリアは独立したホバー判定 */
    z-index: 10; /* カード本体より上に配置 */
}

/* ポップアップ表示中は画像カルーセルを無効化 */
.schedule-card.popup-active .multi-image-container {
    pointer-events: none;
}

.multi-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
    cursor: grab;
    pointer-events: auto;
    z-index: 5;
    opacity: 0.6;  /* 奥の画像は80%透過 */
}

.multi-img:active {
    cursor: grabbing;
}

/* デフォルト状態: すべて中央に重なる */
.multi-img-left,
.multi-img-right {
    z-index: 6;
    opacity: 0.6;  /* 奥の画像は80%透過 */
}

.multi-img-center {
    z-index: 7;
    opacity: 1;  /* 手前の画像は透過なし */
}

/* 画像エリアホバー時のみ: 左右の画像が飛び出す（20%縮小） */
.schedule-card-multi .multi-image-container:hover .multi-img-left {
    transform: translateX(-60px) scale(0.8);
}

.schedule-card-multi .multi-image-container:hover .multi-img-center {
    transform: scale(1);
}

.schedule-card-multi .multi-image-container:hover .multi-img-right {
    transform: translateX(60px) scale(0.8);
}

/* 星が飛び出すアニメーション（非表示） */
.burst-star {
    display: none;
}

/* 電光掲示板アニメーション */
.led-text-container {
    position: absolute;
    top: 90%;
    left: 0;
    width: 100%;
    height: 60px;
    transform: translateY(-50%);
    overflow: hidden;
    pointer-events: none;
    z-index: 10;  /* 画像の上に表示 */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 画像エリアホバー時のみ電光掲示板を非表示 */
.schedule-card-multi .multi-image-container:hover .led-text-container {
    opacity: 0;
}

.led-text {
    position: absolute;
    white-space: nowrap;
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: 900;
    /* ★サイズ設定★ ここでフォントサイズを調整できます */
    font-size: 50px;
    /* ★カラー設定★ ここで色を変更できます */
    color: #fa85bfd7;
    animation: ledScroll 8s linear infinite, ledBlink 0.8s ease-in-out infinite;
    letter-spacing: 1px;
    text-transform: uppercase;
    /* ドット感を出すためのフィルター */
    filter: contrast(2) brightness(1.2);
}

/* カード2専用の電光掲示板カラー */
.schedule-card-multi-2 .led-text {
    /* ★カード2のカラー設定★ ここで色を変更できます */
    color: #6a8acfd7;  /* カード2は青色 */
}

/* カード4専用の電光掲示板カラー */
.schedule-card-multi-4 .led-text {
    /* ★カード4のカラー設定★ ここで色を変更できます */
    color: #6a8acfd7;  /* カード4は青色 */
}

@keyframes ledScroll {
    0% {
        transform: translateX(100%) scaleY(1.2);
    }
    100% {
        transform: translateX(-100%) scaleY(1.2);
    }
}

@keyframes ledBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.schedule-card-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 16px;
    color: #6e6e6e;
    z-index: 2;
    pointer-events: auto;  /* クリック可能に */
    cursor: pointer;
    animation: textBlink 0.8s ease-in-out infinite;
}

@keyframes textBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.1;
    }
}

.schedule-card-girl-image {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 234px;
    height: 320px;
    background-color: #f0f0f0;
    z-index: 1;
}

.schedule-card-girl-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.schedule-card-info {
    position: absolute;
    top: 48px;
    left: 0;
    width: 280px;
    height: 502px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;  /* クリックを画像に通す */
    z-index: 2;
}

.schedule-card-name {
    position: absolute;
    top: 332px;
    width: 234px;
    font-family: "Yu Mincho", "YuMincho", serif;
    color: #6e6e6e;
    text-align: center;
    pointer-events: auto;  /* クリック可能に */
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.schedule-card-name.marquee {
    text-align: left;
}

.schedule-card-name .marquee-inner {
    display: inline-block;
    animation: marqueeScroll 12s linear infinite;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    35% { transform: translateX(0); }
    65% { transform: translateX(-50%); }
    100% { transform: translateX(-50%); }
}

.schedule-card-name .name-main {
    font-size: 30px;
    display: inline-block;
    position: relative;
}

/* カード全体ホバー時のname-mainアニメーション用の擬似要素 */
.schedule-card-name .name-main::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: scale(1);
    pointer-events: none;
}

/* JavaScriptで制御するため、クラスベースに変更 */
.schedule-card-name .name-main.zoom-active::before {
    animation: zoomFadeOut 0.5s ease forwards;
}

@keyframes zoomFadeOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.schedule-card-name .name-age {
    font-size: 14px;
}

.schedule-card-size {
    position: absolute;
    top: 379px;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 13px;
    color: #6e6e6e;
    text-align: center;
    pointer-events: auto;  /* クリック可能に */
    cursor: pointer;
}

.schedule-card-time {
    position: absolute;
    top: 414px;
    width: 234px;
    height: 38px;
    background-color: #f8a5c8;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 17px;
    color: #ffffff;
    pointer-events: auto;  /* クリック可能に */
    cursor: pointer;
    gap: 6px; /* アイコンとテキストの間隔 */
}

/* 時計アイコン（FontAwesome） */
.schedule-card-time::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 17px;
    display: inline-block;
    flex-shrink: 0;
}

/* 時間未登録時はアイコン非表示 */
.schedule-card-time.no-time::before {
    display: none;
}

/* カード2と4の青色バージョン */
.schedule-card-time-blue {
    background-color: #8cbaff;
}

.schedule-card-fee {
    position: absolute;
    top: 463px;
    width: 234px;
    font-family: "Yu Mincho", "YuMincho", serif;
    font-size: 16px;
    color: #6e6e6e;
    text-align: center;
    pointer-events: auto;  /* クリック可能に */
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.schedule-card-fee.marquee {
    text-align: left;
}

.schedule-card-fee .marquee-inner {
    display: inline-block;
    animation: marqueeScroll 12s linear infinite;
}

.schedule-view-more {
    align-self: flex-end;
    margin-top: 20px;
    margin-right: calc(50% - 590px);
    font-family: 'Times New Roman', Times, serif;
    font-size: 20px;
    color: #6e6e6e;
    text-decoration: none;
    display: inline-block;
    animation: viewMoreBlink 1.5s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

/* 日記ウィジェットPC/SP切り替え */
.diary-box-sp {
    display: none;
}

/* ====================================
   TOPページ レスポンシブ
   ==================================== */
@media screen and (max-width: 1024px) {
    #topics {
        height: auto;
        padding-top: 80px;
        padding-bottom: 60px;
    }

    .topics-images {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        flex-wrap: wrap;
    }

    .topics-card,
    .topics-card img,
    .topics-card-overlay {
        width: 100%;
    }

    .topics-images img {
        width: 100%;
    }

    .topics-card {
        flex: 0 0 calc(20% - 8px);
    }

    #topics h2::before {
        width: 90%;
    }

    #diary {
        height: auto;
        padding-bottom: 60px;
    }

    #diary .diary-box {
        width: 90%;
    }

    .diary-view-more {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 15px;
        align-self: flex-end;
        margin-right: 5%;
    }

    #schedule {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 60px;
    }

    #schedule h2::before {
        width: 90%;
    }

    .schedule-images {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: repeat(4, 280px);
        justify-content: center;
    }

    .schedule-view-more {
        margin-right: 5%;
    }
}

@media screen and (max-width: 768px) {
    #topics {
        padding-top: 50px;
        padding-bottom: 40px;
    }

    .topics-images {
        width: 95%;
        gap: 8px;
    }

    .topics-card {
        flex: 0 0 calc(33.333% - 6px);
    }

    .topics-overlay-line {
        width: 100%;
        font-size: 12px;
    }

    #topics h2::before {
        width: 95%;
    }

    #diary {
        padding-top: 30px;
        padding-bottom: 40px;
    }

    #diary .diary-box-pc {
        display: none;
    }

    .diary-box-sp {
        display: flex !important;
        justify-content: center;
    }

    #diary .diary-box {
        width: 95%;
    }

    .diary-view-more {
        font-size: 16px;
        margin-right: 2.5%;
    }

    #schedule {
        padding-top: 50px;
        padding-bottom: 40px;
    }

    #schedule h2::before {
        width: 95%;
    }

    .schedule-images {
        width: 95%;
        grid-template-columns: repeat(2, 280px);
        justify-content: center;
    }

    .schedule-view-more {
        margin-right: 2.5%;
    }
}

@media screen and (max-width: 620px) {
    .schedule-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .schedule-card {
        width: 100%;
        height: auto;
        aspect-ratio: 280 / 550;
        background-size: 100% 100%;
    }

    .schedule-card-text {
        width: 100%;
        height: calc(48 / 550 * 100%);
        font-size: 14px;
    }

    .schedule-card-girl-image {
        width: 83.57%;
        height: calc(320 / 550 * 100%);
        top: calc(48 / 550 * 100%);
    }

    .multi-image-container {
        width: 100%;
        height: 0;
        padding-bottom: 100%;
    }

    .multi-img {
        width: 100%;
        height: 100%;
    }

    .schedule-card-info {
        width: 100%;
        height: calc(502 / 550 * 100%);
        top: calc(48 / 550 * 100%);
    }

    .schedule-card-name {
        top: calc(332 / 502 * 100%);
        width: 83.57%;
    }

    .schedule-card-name .name-main {
        font-size: 22px;
    }

    .schedule-card-name .name-age {
        font-size: 12px;
    }

    .schedule-card-size {
        top: calc(379 / 502 * 100%);
        font-size: 11px;
    }

    .schedule-card-time {
        top: calc(414 / 502 * 100%);
        width: 83.57%;
        height: calc(38 / 550 * 100%);
        font-size: 14px;
    }

    .schedule-card-fee {
        top: calc(463 / 502 * 100%);
        width: 83.57%;
        font-size: 13px;
    }

    .card-border-canvas {
        width: calc(100% + 8px);
        height: calc(100% + 8px);
    }

    .led-text {
        font-size: 32px;
    }

    .led-text-container {
        height: 40px;
    }
}

@media screen and (max-width: 480px) {
    .topics-card {
        flex: 0 0 calc(50% - 4px);
    }

    .topics-card-overlay {
        height: auto;
        padding: 8px;
    }

    .topics-overlay-line {
        font-size: 11px;
    }

    .topics-card:nth-child(5) {
        display: none;
    }
}
