/* ===============================================
   Three.js 3Dシーン関連のスタイル
   =============================================== */

body {
    margin: 0;
    overflow: hidden; /* スクロールバーを非表示 */
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

canvas {
    display: block; /* canvas下の余分なスペースを削除 */
}

/* エラーメッセージ */
.error-message {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    display: none; /* 初期は非表示 */
}

/* ローディング画面 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    pointer-events: auto;
}

#loading-record {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#loading-overlay p {
    font-size: 24px;
    color: #555;
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

/* クリック時のカスタムポップアップ */
.custom-popup-container {
    position: absolute;
    width: 500px;
    min-height: 150px;
    background-color: white;
    border-radius: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease-out;
    pointer-events: none;
    z-index: 99;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

.custom-popup-image-wrapper {
    width: 100%;
    max-height: 75%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.custom-popup-container img {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.custom-popup-container p {
    font-size: 18px;
    color: #333;
    text-align: center;
    margin: 0;
    line-height: 1.5;
    max-height: 20%;
    overflow-y: auto;
    width: 100%;
    font-family: inherit;
}

/* ポップアップ（画像なしの場合） */
.custom-popup-container.no-image .custom-popup-image-wrapper {
    display: none;
}

.custom-popup-container.no-image #popup-text {
    max-height: 100%;
    font-size: 20px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-top: 0;
}

/* ポップアップの吹き出し部分 */
.popup-callout {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid white;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 3px 2px rgba(0,0,0,0.2));
}

.popup-callout.up {
    border-top: none;
    border-bottom: 20px solid white;
    bottom: auto;
    top: -20px;
    filter: drop-shadow(0 -3px 2px rgba(0,0,0,0.2));
}

/* 右下の固定テキスト */
#bottom-right-text {
    position: fixed;
    bottom: 15px;
    right: 20px;
    color: #000000;
    font-size: 58px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    z-index: 90;
    pointer-events: none;
    font-weight: bold;
    -webkit-text-stroke: 1px white;
    text-stroke: 1px white;
    paint-order: stroke fill;
}

/* チュートリアル画面 */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(63, 63, 63, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

#tutorial-modal {
    background-color: white;
    padding: 25px 35px;
    border-radius: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 406px;
    width: 90%;
}

#tutorial-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

#tutorial-modal p {
    font-size: 16px;
    line-height: 1.8;
    color: #007bff;
    margin-bottom: 25px;
    text-align: left;
}

#close-tutorial-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 40px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: bold;
}

#close-tutorial-btn:hover {
    background-color: #0056b3;
}