/* =========================================================
    🏔️ 1. カラー変数（Solar Auto-Theme用テーマ管理）
========================================================= */
:root {
    /* ☀️ ライトモード（爽やかなコロラド・マウンテンブルーテーマ） */
    --bg-color: #f4f8fb;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --primary-color: #0284c7;      /* 🏔️ コロラド・スカイブルー */
    --primary-hover: #0369a1;
    --accent-color: #f59e0b;       /* 👑 太陽のゴールドアンバー */
    --nav-bg: #ffffff;
    --modal-bg: rgba(15, 23, 42, 0.65);
}

/* 🌙 ダークモード（夜間 18:00〜6:00：ロッキー山脈の澄んだ夜空） */
body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-color: #38bdf8;      /* 夜間用見やすいライトブルー */
    --primary-hover: #7dd3fc;
    --accent-color: #fbbf24;
    --nav-bg: #1e293b;
    --modal-bg: rgba(0, 0, 0, 0.85);
}

/* =========================================================
    📱 2. リセット＆PWA基本レイアウト
========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-bottom: 20px; 
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* 🏔️ 画面最下部に固定されるどっしりとしたロッキー山脈シルエット */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 110px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 160' preserveAspectRatio='none'%3E%3Cpath d='M 0,160 L 0,120 L 75,110 L 150,80 L 225,50 L 300,30 L 375,62 L 450,75 L 550,40 L 650,15 L 725,52 L 800,70 L 875,47 L 950,35 L 1025,70 L 1100,85 L 1150,92 L 1200,110 L 1200,160 Z' fill='%230284c7' opacity='0.35'/%3E%3Cpath d='M 0,160 L 0,130 L 90,100 L 180,50 L 250,70 L 320,100 L 400,80 L 480,40 L 550,60 L 620,90 L 720,67 L 820,25 L 910,47 L 1000,80 L 1060,77 L 1120,55 L 1160,82 L 1200,120 L 1200,160 Z' fill='%230284c7' opacity='0.8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: 100% 100%;
    opacity: 0.08; /* ☀️ ライトモード：上品な8% */
    pointer-events: none;
    z-index: 0;
}

body.dark-mode::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 160' preserveAspectRatio='none'%3E%3Cpath d='M 0,160 L 0,120 L 75,110 L 150,80 L 225,50 L 300,30 L 375,62 L 450,75 L 550,40 L 650,15 L 725,52 L 800,70 L 875,47 L 950,35 L 1025,70 L 1100,85 L 1150,92 L 1200,110 L 1200,160 Z' fill='%2338bdf8' opacity='0.35'/%3E%3Cpath d='M 0,160 L 0,130 L 90,100 L 180,50 L 250,70 L 320,100 L 400,80 L 480,40 L 550,60 L 620,90 L 720,67 L 820,25 L 910,47 L 1000,80 L 1060,77 L 1120,55 L 1160,82 L 1200,120 L 1200,160 Z' fill='%2338bdf8' opacity='0.8'/%3E%3C/svg%3E");
    opacity: 0.15; /* 🌙 ダークモード：15% */
}

/* 共通パーツ：非表示用クラス */
.hidden {
    display: none !important;
}

/* =========================================================
    🛡️ 3. 免責事項同意モーダル (Startup Consent)
========================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal-box {
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.modal-header h2 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.modal-header h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.modal-body p {
    margin-bottom: 12px;
}

.modal-footer {
    padding: 16px;
    text-align: center;
}

#agree-button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#agree-button:not([disabled]) {
    background-color: var(--primary-color);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#agree-button:not([disabled]):active {
    transform: scale(0.98);
}

/* =========================================================
    📱 4. アプリヘッダー（2段モバイル最適化レイアウト）
========================================================= */
.app-header {
    background-color: var(--card-bg);
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.header-logo-svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

#btn-header-home {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.35rem;
    padding: 2px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    outline: none;
    flex-shrink: 0;
}

#page-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.header-avatar-box {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.15);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    overflow: hidden;
    cursor: pointer;
}

.header-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(128, 128, 128, 0.12);
}

.btn-header-update {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(2, 132, 199, 0.1);
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.btn-header-update:active {
    transform: scale(0.96);
    background: rgba(2, 132, 199, 0.2);
}

#sync-icon {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.3s ease;
}

.header-utility-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    height: 30px;
    padding: 0 10px;
    cursor: pointer;
    color: inherit;
    border-radius: 15px;
    opacity: 0.85;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: sans-serif;
    outline: none;
    transition: all 0.15s ease;
}

.header-icon-btn.help-btn {
    width: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 900;
}

.header-icon-btn:active {
    opacity: 1;
    background: rgba(128, 128, 128, 0.2);
}

/* =========================================================
    🖥️ 5. メインエリア＆画面切り替え
========================================================= */
#main-content {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.app-view {
    animation: fadeIn 0.2s ease-in-out;
}

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

.scout-stats, .card {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    position: relative;
    z-index: 1;
}

/* =========================================================
    🏠 6. ホーム画面（コロラド・グラデーション＆カードデザイン）
========================================================= */
.nav-hub-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 20px 20px 20px 16px;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(2, 132, 199, 0.08) 100%);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
    position: relative;
    z-index: 1;
}

body.dark-mode .nav-hub-btn {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(56, 189, 248, 0.12) 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.nav-hub-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.hub-btn-icon {
    font-size: 2.2rem;
    margin-right: 16px;
    line-height: 1;
}

.hub-btn-text {
    display: flex;
    flex-direction: column;
}

.hub-btn-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.hub-btn-desc {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* =========================================================
    📊 SHOWS画面（会場カードUI）の装飾
========================================================= */
.view-title {
    margin-bottom: 16px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.show-card {
    margin-bottom: 14px;
}

.show-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.show-card-header h3 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 20px;
}
.badge-open { background-color: #e0f2fe; color: #0284c7; }
.badge-closed { background-color: #eee; color: #777; }

.show-card-body p {
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.show-vendors strong {
    color: var(--accent-color); 
    font-size: 1rem;
}

.admission-tag {
    background-color: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.show-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-nav, .btn-reg {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-nav:active, .btn-reg:active {
    background-color: var(--border-color);
}

/* =========================================================
    🏬 VENDORS画面（検索窓 ＆ DNAバーUI）の装飾
========================================================= */
.search-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.search-box input, .search-box select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.vendor-card {
    padding: 14px;
    margin-bottom: 12px;
}

.vendor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.vendor-card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    max-width: 70%;
}

.vendor-show-badge {
    font-size: 0.75rem;
    font-weight: bold;
    background-color: var(--primary-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}

.vendor-booth {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dna-container {
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.dna-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.dna-row:last-child { margin-bottom: 0; }

.dna-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 40%;
}

.dna-bar-wrapper {
    display: flex;
    gap: 3px;
    width: 55%;
    height: 10px;
}

.dna-block {
    flex: 1;
    background-color: var(--border-color); /* 通常は灰色 */
    border-radius: 2px;
}

/* 5段階のうち、スコアを満たしているブロックに色を塗る */
.dna-block.active {
    background-color: var(--accent-color); /* 🌅 アリゾナ・サンセットオレンジで美しく可視化 */
}

/* 👍 👎 ボタンUI */
.vendor-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.btn-add-report:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

/* =========================================================
    ⭐️ FAVORITES View (Sanctuary Note UI) Style
========================================================= */
.favorite-card {
    padding: 14px;
    margin-bottom: 12px;
    border-left: 5px solid var(--primary-color); /* おおらかな赤土色で強調 */
}

.fav-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fav-card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-remove-fav {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

/* 🔒 秘密のメモエリア */
.note-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: 6px;
}

.note-area label {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
}

.txt-note {
    width: 100%;
    height: 70px;
    padding: 8px;
    font-size: 1rem;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    resize: none; /* スマホでの誤動作防止のためサイズ固定 */
}

.btn-save-note {
    align-self: flex-end;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

/* =========================================================
    ★ Favorite Toggle Button Styles
========================================================= */
.vendor-title-block {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 75%;
}

.btn-fav-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    color: var(--text-muted);
    transition: transform 0.1s ease;
}

.btn-fav-toggle.active {
    color: var(--accent-color); /* お気に入り時はサンセットオレンジの輝き */
    transform: scale(1.1);
}

/* =========================================================
   📢 広告バナー枠（募集用 / スポンサー用スタイル）
========================================================= */
.ad-banner-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* ---------------------------------------------------------
   🚧 募集用バナー (省スペース・グリッドレイアウト)
--------------------------------------------------------- */
.ad-banner-card.recruitment {
    background-color: rgba(2, 132, 199, 0.06);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color); /* 左端のアクセント線で同化を防止 */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 
        "badge btn"
        "msg btn";
    gap: 6px 12px;
    align-items: center;
    padding: 12px 14px;
}

body.dark-mode .ad-banner-card.recruitment {
    background-color: rgba(56, 189, 248, 0.08);
    border-color: var(--border-color);
    border-left-color: var(--accent-color);
}

.ad-banner-card.recruitment .ad-header-row {
    grid-area: badge;
    display: flex;
    justify-content: flex-start;
}

.ad-badge-recruitment {
    font-size: 0.68rem;
    font-weight: 800;
    color: #0284c7;
    background: rgba(2, 132, 199, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

body.dark-mode .ad-badge-recruitment {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.2);
}

.ad-recruitment-msg {
    grid-area: msg;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.35;
    margin: 0;
}

.ad-action-btn.recruitment-btn {
    grid-area: btn;
    background-color: var(--accent-color);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

body.dark-mode .ad-action-btn.recruitment-btn {
    background-color: #fbbf24;
    color: #0f172a;
}

.ad-action-btn.recruitment-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* ---------------------------------------------------------
   💎 スポンサー掲載用バナー (コンパクトな上品スタイル)
--------------------------------------------------------- */
.ad-banner-card.sponsored {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(2, 132, 199, 0.05) 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03);
}

body.dark-mode .ad-banner-card.sponsored {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(56, 189, 248, 0.08) 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.ad-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ad-badge-sponsored {
    font-size: 0.65rem;
    font-weight: 800;
    color: #ffffff;
    background: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

body.dark-mode .ad-badge-sponsored {
    background: #38bdf8;
    color: #0f172a;
}

.ad-booth-info {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(128,128,128,0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-sponsor-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 2px 0 0 0;
    line-height: 1.25;
}

.ad-sponsor-msg {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 4px 0;
}

.ad-action-btn.sponsored-btn {
    align-self: flex-start;
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease;
}

body.dark-mode .ad-action-btn.sponsored-btn {
    background: #38bdf8;
    color: #0f172a;
}

.ad-action-btn.sponsored-btn:active {
    transform: scale(0.96);
}