/* Google FontsのMedievalSharpを読み込む */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');

body {
    margin: 0;
    padding: 20px;
    font-family: 'MedievalSharp', cursive;
    color: #f5deb3;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    
    background-image: url('../img/background-map.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: #6a4f31;
    overflow-y: auto;
}

.camera-container {
    background-color: rgba(43, 35, 29, 0.9);
    border: 3px solid #d2b48c;
    border-radius: 15px;
    padding: 30px 40px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    max-width: 500px;
    width: 90%;
    margin-top: 30px;
    margin-bottom: 30px;
}

.camera-title {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    text-align: center;
    color: #f5deb3;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9);
}

.back-to-top-link {
    display: block;
    margin-bottom: 25px;
    color: #d2b48c;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.2s ease;
    text-align: center;
}

.back-to-top-link:hover {
    color: #f0e68c;
}

.video-area {
    position: relative;
    margin-bottom: 20px;
}

#myCanvas {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 2px solid #7a6a5d;
}

.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    border-radius: 8px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
    color: #d2b48c;
}

input[type="text"], textarea {
    width: calc(100% - 24px);
    padding: 10px;
    border: 1px solid #7a6a5d;
    border-radius: 5px;
    background-color: #3b2f21;
    color: #f5deb3;
    font-size: 1em;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
    font-family: 'MedievalSharp', cursive;
}

textarea {
    resize: vertical;
}

.geo-group {
    display: flex;
    gap: 10px;
}
.geo-group .input-group {
    flex-grow: 1;
}

.submit-button {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.5em;
    background: linear-gradient(#4b6928, #3a521e);
    color: #fff;
    border: 2px solid #a3c182;
    border-radius: 10px;
    padding: 12px 25px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
    width: 100%;
}

.submit-button:hover {
    background: linear-gradient(#5a7e30, #4c6628);
    transform: translateY(-2px);
}

/* --- モーダル共通スタイル --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    padding: 15px;
}

.modal-content {
    background-color: #2b231d;
    color: #f5deb3;
    padding: 20px;
    border: 3px solid #d2b48c;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
    text-align: center;
    width: 95%;
    max-width: 500px;
    position: relative;
    animation: fadeInModal 0.5s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: #d2b48c;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover { color: #fff; }
.modal-icon { width: 80px; height: 80px; margin-bottom: 15px; }
.modal-content h2 { font-size: 2em; margin-top: 0; margin-bottom: 15px; color: #fff; }
.modal-content p { font-size: 1.1em; line-height: 1.6; margin-bottom: 20px; }

#confirmCanvas {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
}

.confirm-details {
    text-align: left;
    background-color: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.confirm-details p {
    font-size: 1em;
    margin: 5px 0;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-button {
    font-family: 'MedievalSharp', cursive;
    font-size: 1.2em;
    color: #fff;
    border: 2px solid;
    border-radius: 10px;
    padding: 10px 25px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

.modal-button.success {
    background: linear-gradient(#4b6928, #3a521e); border-color: #a3c182;
}
.modal-button.success:hover {
    background: linear-gradient(#5a7e30, #4c6628); transform: translateY(-2px);
}

.modal-button.failure {
    background: linear-gradient(#8b0000, #5c0000); border-color: #d2b48c;
}
.modal-button.failure:hover {
    background: linear-gradient(#a30000, #7a0000); transform: translateY(-2px);
}


/* =================================================== */
/* レスポンシブデザイン (タブレット以上) */
/* =================================================== */
@media (min-width: 768px) {
    .main-logo {
        width: 180px; /* ロゴを少し大きく */
    }

    .game-title {
        font-size: 4.5em;
    }

    .tagline {
        font-size: 1.5em;
    }

    .nav-button-text {
        font-size: 1.1em; /* ボタンテキストのサイズ */
    }

    .section-title {
        font-size: 2.5em;
    }

    .preview-icon {
        width: 150px; /* プレビューアイコンを少し大きく */
        height: 150px;
    }
}

/* =================================================== */
/* レスポンシブデザイン (PCサイズ以上) */
/* =================================================== */
@media (min-width: 1024px) {
    .main-logo {
        width: 200px; /* ロゴをさらに大きく */
    }

    .game-title {
        font-size: 5.5em;
    }

    .tagline {
        font-size: 1.8em;
    }

    .nav-button-text {
        font-size: 1.2em;
    }

    .section-title {
        font-size: 3em;
    }

    .preview-icon {
        width: 180px; /* プレビューアイコンをさらに大きく */
        height: 180px;
    }
}