/* ==========================================================================
   1. グローバル & 基本レイアウト
   ========================================================================== */
* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #1a1a1a;
}

/* ==========================================================================
   2. メインコンテナ
   ========================================================================== */
.container {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative; /* 中に重ねる要素の基準点 */
    z-index: 1;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* ==========================================================================
   3. テキスト関連
   ========================================================================== */
h1 {
    color: #333;
    text-shadow: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    margin: 0 0 15px 0;
    padding-top: 40px;
}

/* ★★ テキスト要素の共通スタイル ★★ */
#description, #message_above_buttons, #message_below_buttons, #map-info-text, .map-description {
    background-color: rgba(255, 255, 255, 0.85); /* 半透明の白 */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 12px 18px;
    border-radius: 10px;
    width: 95%;
    max-width: 500px;
    margin: 15px auto;
    color: #222; /* 白背景に合うように文字色を黒に */
    font-weight: bold;
    line-height: 1.6;
}

/* 個別のフォントサイズ調整 */
#description, .map-description {
    font-size: 16px;
}
#message_above_buttons, #message_below_buttons, #map-info-text {
    font-size: 14px;
}

/* テキストコンテナ内のp, ol, liタグのスタイル */
#description p, #description ol li,
.map-description p, .map-description ol li {
    font-weight: normal;
    text-align: left;
    margin: 0.8em 0;
}

/* ==========================================================================
   4. ページ固有コンテンツ & 共通コンポーネント
   ========================================================================== */
.ad-container {
    width: 100%;
    margin: 15px 0;
    min-height: 50px;
}
.ad-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* 広告画像にも角丸を適用 */
}

.extra-image-container {
    margin-top: 25px; /* ボタンとの間に余白を作成 */
    width: 100%;
}

.extra-image-container img {
    max-width: 80%; /* 画像が大きくなりすぎないように調整 */
    height: auto;   /* 縦横比を維持 */
}

.camera-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 30px;
}
#cameraPreview {
    display: block;
    width: 100%;
    height: auto;
}
.overlay-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}
.overlay-image {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
#map {
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* ==========================================================================
   5. ボタン
   ========================================================================== */
.button-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background-color: #d63e8b;
    color: white;
}
button:hover {
    background-color: #b83576;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#switchCameraBtn {
    width: 56px;
    height: 56px;
    padding: 14px;
    border-radius: 50%;
}
#switchCameraBtn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   6. PC表示への対応 (メディアクエリ)
   ========================================================================== */
@media (min-width: 600px) {
    .container {
        width: 100%;
        max-width: 600px;
        min-height: auto;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.2);
        margin: 30px auto;
        background-color: rgba(255, 255, 255, 0.97);
    }
    .container::before {
        display: none;
    }
    h1 {
        color: #333;
        text-shadow: none;
    }
}

/* ==========================================================================
   黒背景に合うリッチ版 index.html 用スタイル
   ========================================================================== */
body.rich-mode {
    background-color: #000;
    color: #fff;
}

.rich-mode .container {
    background-color: transparent;
    text-align: center;
    visibility: visible;
    opacity: 1;
    padding-top: 60px;
}

.rich-mode h1,
.rich-mode p,
.rich-mode .map-description,
.rich-mode .ad-container {
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.rich-mode .description-box {
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 16px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 600px;
    font-size: 16px;
    line-height: 1.7;
}

/* 画像に柔らかい白枠と影を追加 */
.rich-mode .featured-image {
    max-width: 90%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(255,255,255,0.1);
    margin: 30px auto;
}

/* 元のボタンをそのまま使いつつ中央に配置 */
.rich-mode .button-group {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-direction: row;
    gap: 20px;
}

ul {
    list-style: none;
}

/* ==========================================================================
   7. サンプルスポットギャラリーのスタイル
   ========================================================================== */

.spot-gallery {
    display: flex;
    flex-wrap: wrap; /* 画面幅に応じて折り返す */
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.spot-item {
    position: relative; /* 中に重ねる要素の基準点にする */
    width: 100%;
    border-radius: 12px;
    overflow: hidden; /* 角丸を画像にも適用 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.spot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像をコンテナいっぱいに表示 */
    display: block;
}

.spot-description {
    position: absolute; /* 親要素(.spot-item)に重ねる */
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;

    /* グラデーション背景で文字を読みやすくする */
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);

    color: white;
    text-align: left;
}

.spot-description p {
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}