body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Times New Roman', serif; /* 上品なフォントに変更 */
    
    display: flex;
    justify-content: center;
    align-items: center;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: #DAA520; /* ゴールド */
}

#splash-screen h1 {
    font-family: 'Times New Roman', serif; /* Times New Romanのようなフォント */
    font-size: 2em; /* 文字サイズを小さく */
    text-align: center; /* 中央揃え */
    margin-bottom: 10px; /* サブタイトルとの間隔を調整 */
}

.splash-subtitle {
    font-family: 'Times New Roman', serif;
    font-size: 0.8em; /* より小さく */
    text-align: center;
    color: #ccc; /* 少し薄い色に */
    margin-bottom: 30px; /* スピナーとの間隔を調整 */
}

.loading-spinner {
    border: 8px solid rgba(255, 255, 255, 0.3); /* 薄い白 */
    border-top: 8px solid #DAA520; /* ゴールド */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    color: #DAA520;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative; /* 擬似要素の基準位置 */
}

.intro-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7); /* 黒で不透明度70% */
    z-index: 1;
}

.intro-text {
    font-family: 'Times New Roman', serif;
    font-size: 1.2em;
    opacity: 0;
    animation: fadeIn 2s forwards;
    color: #fff;
    position: relative; /* オーバーレイの上に表示 */
    z-index: 2; /* オーバーレイの上に表示 */
}

#intro-screen-1 .intro-text {
    font-size: 1.5em; /* 最初の導入画面のテキストを大きく */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#gallery {
    width: 100%;
    max-width: 500px; /* スマートフォン表示に最適化 */
    height: 100%;
    display: flex;
    flex-direction: column;
    /* justify-content: space-between; */ /* 作品タイトルとキャプションを固定解除 */
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.artwork-container {
    width: 90%;
    position: relative;
    margin-bottom: 20px;
}

#artwork-image {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 50vh; /* Viewport heightの50%を最大高に */
    object-fit: contain; /* アスペクト比を維持 */
    cursor: grab;
    user-select: none; /* 画像の選択を防ぐ */
    -webkit-user-drag: none; /* ドラッグを防ぐ */
}

.artwork-info {
    text-align: center;
    margin-bottom: 20px;
}

#artwork-title {
    margin: 0 0 10px 0;
    font-size: 1.5em; /* タイトルを少し大きく */
    font-weight: bold;
}

#artwork-caption {
    margin: 0;
    font-size: 1em; /* キャプションを少し大きく */
    color: #ccc;
}

.controls {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px; /* マージンを広げる */
    flex-wrap: wrap;
    position: fixed;
    bottom: 120px; /* actionsボタンの上に配置 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 500px; /* galleryのmax-widthに合わせる */
}

.actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px; /* マージンを広げる */
    flex-wrap: wrap;
    position: fixed;
    bottom: 70px; /* lang-toggle-buttonの上に配置 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 500px; /* galleryのmax-widthに合わせる */
}

button {
    background-color: #DAA520; /* ゴールド */
    color: #000;
    border: none;
    padding: 8px 16px; /* パディングを小さく */
    margin: 3px 6px; /* マージンを小さく */
    font-size: 0.9em; /* フォントサイズを小さく */
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s; /* ホバーエフェクトを追加 */
}

button:hover {
    background-color: #F0C040; /* 明るいゴールド */
    transform: translateY(-2px); /* 少し浮き上がるエフェクト */
}

.lang-toggle-button {
    display: block;
    margin: 10px auto; /* 中央に配置し、上下にマージン */
    position: fixed;
    bottom: 20px; /* 画面下部に固定 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 500px; /* galleryのmax-widthに合わせる */
}

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column; /* ボタンを配置するためにflex-directionをcolumnに変更 */
    justify-content: center;
    align-items: center;
    z-index: 999; /* スプラッシュスクリーンの下 */
    color: #DAA520; /* ゴールド */
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.intro-screen .intro-text {
    flex-grow: 1; /* テキストが利用可能なスペースを占めるように */
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-screen .intro-lang-toggle-button {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001; /* 他の要素より手前に */
}



@media (min-width: 768px) {
    #gallery {
        max-width: 649px; /* PC表示用にギャラリーの最大幅を調整 */
    }

    .artwork-container {
        max-height: 75.7vh; /* PC表示用にコンテナの最大高を調整 */
    }

    #artwork-image {
        max-height: 100%; /* 親コンテナの高さに合わせる */
    }
}