* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* フォント最適化 */
body {
    font-family: "Avenir Next", "Avenir", "Century Gothic", "Futura", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Yu Gothic", "Meiryo", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-color: #fff;
}

/* iOSデバイス向け調整 */
@supports (-webkit-touch-callout: none) {
    body {
        font-weight: 400;
    }
    
    .catalog-button {
        font-weight: 500;
    }
    
    #loading p {
        font-weight: 400;
    }
}

html, body, .video-container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: touch;
}

body {
    position: fixed;
    width: 100%;
    height: 100%;
}

.video-container {
    position: relative;
    overflow: hidden;
    touch-action: none;
    background-color: #fff;
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100vw, 177.77vh); /* 横幅優先で、縦も完全にカバー */
    height: max(100vh, 56.25vw); /* 縦幅優先で、横も完全にカバー */
    transform: translate(-50%, -50%);
    object-fit: cover;
    object-position: center;
}

/* iPad用 (768px - 1024px) */
@media (max-width: 1024px) {
    .video-container video,
    .video-container iframe {
        width: 177.77vh; /* 16:9のアスペクト比 */
        height: 100vh;
        min-width: 100vw;
        min-height: 56.25vw; /* 16:9のアスペクト比 */
    }
}

@media (max-width: 768px) {
    .video-container {
        height: 100vh;
        width: 100vw;
        margin: 0 auto;
    }
    /* モバイル端末で動画をズーム */
    .video-container video,
    .video-container iframe {
        width: 177.77vh; /* 16:9のアスペクト比 */
        height: 100vh;
        min-width: 100vw;
        min-height: 56.25vw; /* 16:9のアスペクト比 */
    }
    .button-image {
        max-width: 150px;
    }
}
@media (max-width: 480px) {
    .video-container {
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      position: relative;
    }
    /* iPhone用に動画のズームを調整 */
    .video-container video,
    .video-container iframe {
        width: auto;
        height: 70vh;
        min-width: 100vw;
        aspect-ratio: 16/9;
        top: 40%; /* 中央(50%)から上に移動 */
        transform: translate(-50%, -40%); /* transformも調整 */
    }
    
    .video-link {
        bottom: 45%; /* 40%から45%へ上に移動 */
        opacity: 0.6;
    }
    
    .button-image {
        max-width: 120px;
    }
    
    .loading p {
        font-size: 1rem;
        }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
    }
}

.video-link {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    z-index: 9;
    transition: all 0.3s ease;
    opacity: 0.8;
    white-space: nowrap;
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
}

.video-link:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
}

/* PC版の特別な配置 */
@media (min-width: 1024px) {
    .video-link {
        top: 50px;
        right: 50px;
        bottom: auto;
        left: auto;
        transform: none;
    }
    
    .video-link:hover {
        transform: scale(1.05);
    }
}

.button-image {
    max-width: 200px;
    height: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    pointer-events: auto;
    touch-action: manipulation;
}

.video-link:hover .button-image {
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7));
}

/* 動画フォールバック用スタイル */
.video-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 10;
}

.video-fallback a {
    color: #fff;
    text-decoration: underline;
}

/* ローディング表示 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
}

#loading .loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#loading p {
    margin: 20px 0 0 0;
    padding: 0;
    font-size: 16px;
    color: #333;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-align: center;
    font-feature-settings: "palt";
}

#loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ローディング完了時のアニメーション */
.loading.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* カタログボタン */
.catalog-button {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 0.1em;
    z-index: 10;
    font-feature-settings: "palt";
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}


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

.catalog-button:hover {
    animation: none;
    opacity: 1;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    transform: translateX(-50%) scale(1.05);
}

.catalog-text {
    display: inline-block;
}

.catalog-arrow {
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.catalog-button:hover .catalog-arrow {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .catalog-button {
        bottom: 18%;
        font-size: 20px;
    }
    
    .video-link {
        bottom: 10%;
    }
    
    .button-image {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .catalog-button {
        bottom: 35%; /* 25%から30%へ上に移動 */
        font-size: 18px;
    }
    
    .video-link {
        bottom: 20%; /* 10%から15%へ上に移動 */
    }
}
