/* リセットcss */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button {
  padding: 0;
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
  background: none;
}

/* メインコンテンツ */

body {
    max-width: 1600px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFE5B4 0%, #FFD4A3 100%), #FFE5B4;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    &.is-modal-open {
        overflow: hidden;
    }
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px;
    text-align: center;
    .is-modal-open & {
        scrollbar-gutter: stable;
        overflow: auto;
    }
}

/* 戻るボタン */
.back-button {
    position: fixed;
    left: 32px;
    top: 16px;
    z-index: 500;
    display: inline-block;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8C42 100%);
    border: none;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    &:hover, &:focus {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgba(255, 107, 107, 0.4);
        outline: 2px solid #fff;
    }
    &:active {
        transform: translateY(-1px);
    }
}

/* ロゴセクション */
.logo-section {
    margin-bottom: 40px;
    max-width: 800px;
    animation: slideDown 0.6s ease-out;
    .logo-image {
        max-width: 100%;
    }
}
@media (max-width: 800px) {
    .logo-section {
        margin: 64px 0;
    }
}

/* 企画説明セクション */
.description-section {
    max-width: 800px;
    font-size: 18px;
    margin-bottom: 50px;
    padding: 16px 35px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: fadeIn 0.8s ease-out 0.2s both;
    p {
        color: #555;
        line-height: 1.8;
        font-weight: 500;
        margin-bottom: 24px;
    }
    h3 {
        font-size: 20px;
        font-weight: bold;
        &::before, &::after {
            content: "＊";
            font-size: 0.8em;
            color: #FF6B6B;
            margin: 0 8px;
        }
    }
    ul li {
        list-style-type: none;
        margin-top: 8px;
        .hissori {
            font-size: 0.8em;
            opacity: 0.2;
        }
    }
}

/* 動画サムネイル */

.video-card {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    cursor: pointer;
    animation: fadeIn 0.6s ease-out backwards;
    width: 400px;
    &:hover, &:focus {
        transform: scale(1.05);
    }
    &:focus {
        outline: 4px solid #fff;
    }
    .thumbnail {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        background-color: #000;
        overflow: hidden;
        img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }
    .information {
        font-size: 16px;
        font-weight: 600;
        text-align: center;
        line-height: 1.5;
        .timestamp {
            font-size: 0.7em;
            color: #888;
        }
        .title-container {
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 4px 8px 18px;
            .title-text {
                color: #333;
            }
        }
    }
}

/* ピックアップ動画セクション */
.video-pickup-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    h2 {
        font-size: 20px;
        border-bottom: 2px solid #FFB347;
        margin-bottom: 20px;
        animation: fadeIn 0.8s ease-out 0.4s both;
    }
    .pickup-videos {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 450px));
        min-height: 320px;
        align-items: center;
        gap: 32px;
        justify-content: center;
        .video-card {
            width: 100%;
            max-width: 450px;
            justify-self: center;
        }
    }
    .pickup-shuffle-button {
        margin-top: 32px;
        padding: 12px 36px;
        font-size: 16px;
        font-weight: bold;
        color: white;
        background: linear-gradient(135deg, #FFB347 0%, #FF9966 100%);
        border: none;
        border-radius: 50px;
        cursor: pointer;
        box-shadow: 0 6px 16px rgba(255, 155, 102, 0.3);
        transition: all 0.3s ease;
        animation: fadeIn 0.8s ease-out 0.6s both;
        &:hover, &:focus {
            transform: translateY(-3px);
            box-shadow: 0 10px 24px rgba(255, 155, 102, 0.4);
            outline: 2px solid #fff;
        }
        &:active {
            transform: scale(0.9);
        }
    }
}
@media (max-width: 1000px) {
    .video-pickup-section .pickup-videos {
        grid-template-columns: minmax(0, 100%);
        .video-card {
            max-width: 600px;
        }
    }
}

/* すべての動画を表示ボタン */
.show-all-videos-button {
    align-self: flex-end;
    margin-top: 20px;
    padding: 24px 48px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #FFB347 0%, #FF9966 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255, 155, 102, 0.3);
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease-out 0.8s both;
    &:hover, &:focus {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgba(255, 155, 102, 0.4);
        outline: 2px solid #fff;
    }
    &:active {
        transform: scale(0.95);
    }
    body.is-show-all & {
        display: none;
    }
}

/* 動画一覧ボタンセクション */
.all-videos-section {
    margin: 50px 0 100px;
    padding-top: 32px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    h2 {
        font-size: 20px;
        border-bottom: 2px solid #FFB347;
        margin-bottom: 20px;
        animation: fadeIn 0.8s ease-out;
    }
    .all-videos {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 400px));
        align-items: center;
        gap: 24px;
        justify-content: center;
        .video-card {
            width: 100%;
        }
    }
    body:not(.is-show-all) & {
        display: none;
    }
}
@media (max-width: 1200px) {
    .all-videos-section .all-videos {
        grid-template-columns: repeat(2, minmax(0, 400px));
    }
}
@media (max-width: 800px) {
    .all-videos-section .all-videos {
        grid-template-columns: repeat(1, minmax(0, 450px));
    }
}

/* ===== モーダルとポップアップ ===== */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    padding: 4px;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;   
    .popup-content {
        position: relative;
        background-color: white;
        box-sizing: content-box;
        border-radius: 16px;
        width: 100%;
        max-width: 1000px;
        aspect-ratio: 16 / 9;
        overflow-y: auto;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        padding: 8px;
        .video-player-wrapper {
            display: block;
            width: 100%;
            height: 100%;
            animation: fadeIn 0.3s ease-out;
            .video-player {
                width: 100%;
                height: 100%;
                border-radius: 12px;
            }
        }
        .description-wrapper {
            display: flex;
            flex-direction: column;
            height: 100%;
            padding: 20px;
            text-align: center;
            font-size: 16px;
            color: #666;
            animation: fadeIn 1s ease-out;
            line-height: 1.8;

            .result-panel {
                margin-bottom: 18px;
                text-align: center;

                .result-title {
                    font-size: 3rem;
                    font-weight: 900;
                    color: #ff6f3c;
                    margin-bottom: 16px;
                    letter-spacing: 0.08em;
                    line-height: 1;
                }

                .food-results {
                    display: flex;
                    flex-wrap: wrap;
                    justify-content: center;
                    gap: 14px;
                    margin: 0 auto;

                    .food-item {
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        width: 92px;
                        gap: 8px;

                        img {
                            width: 100px;
                            height: 100px;
                            object-fit: cover;
                            border-radius: 16px;
                            border: 2px solid #ffe0c1;
                            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
                            background: #fff7ef;
                        }

                        span {
                            font-size: 16px;
                            color: #7d5138;
                            line-height: 1.3;
                            font-weight: 600;
                        }
                    }
                }
            }

            .description {
                text-align: left;
                margin-top: 22px;
                color: #4d433f;
                font-size: 16px;
            }

            .video-controls {
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                gap: 18px;
                width: 100%;
                margin-top: auto;
                padding-top: 24px;
                .replay-button {
                    padding: 12px 28px;
                    font-size: 16px;
                    font-weight: bold;
                    color: white;
                    background: linear-gradient(135deg, #FFB347 0%, #FF9966 100%);
                    border: none;
                    border-radius: 50px;
                    cursor: pointer;
                    box-shadow: 0 6px 16px rgba(255, 155, 102, 0.3);
                    transition: all 0.3s ease;
                    display: block;
                    &:hover {
                        transform: translateY(-3px);
                        box-shadow: 0 10px 24px rgba(255, 155, 102, 0.4);
                    }
                    &:active {
                        transform: translateY(-1px);
                    }
                }
                .close-button {
                    position: relative;
                    align-self: center;
                    padding: 12px 28px;
                    font-size: 16px;
                    font-weight: bold;
                    color: white;
                    background: linear-gradient(135deg, #FF6B6B 0%, #FF8C42 100%);
                    border: none;
                    border-radius: 50px;
                    cursor: pointer;
                    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.3);
                    transition: all 0.3s ease;
                    z-index: 1001;
                    display: block;
                    &:hover {
                        transform: translateY(-3px);
                        box-shadow: 0 10px 24px rgba(255, 107, 107, 0.4);
                    }
                    &:active {
                        transform: translateY(-1px);
                    }
                }
            }
        }
    }
    .skip-button {
        position: absolute;
        right: 0px;
        bottom: 0px;
        align-self: center;
        padding: 20px 20px;
        font-size: 12px;
        font-weight: bold;
        color: lightgray;
        background: transparent;
        border: none;
        cursor: pointer;
        display: block;
        &:hover {
            transform: translateY(-3px);
        }
    }
    body:not(.is-modal-open) &,
    &:not(.show-video-player) .video-player-wrapper,
    &:not(.show-video-player) .skip-button,
    &:not(.show-description) .description-wrapper {
        display: none;
    }
}



/* ===== アニメーション ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}
