* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f6f1e7;
}

#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

html.search-map-restoring #map {
    visibility: hidden;
}

/* --- コントロールパネル (ドロワー) --- */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, calc(100vw - 32px));
    z-index: 20;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: env(safe-area-inset-top) 16px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.map-overlay.drawer-open {
    transform: translateX(0);
}

.map-overlay-inner {
    background: rgba(245, 240, 230, 0.6);
    box-shadow: none;
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.map-overlay label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.map-overlay input[type='range'] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #c9a96e, #8b6914);
    outline: none;
    margin-top: 8px;
    cursor: pointer;
}

.map-overlay input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #8b6914;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* --- トグルスイッチ --- */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #c9a96e, #8b6914);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* --- 解放済みフィルター --- */
.unlocked-filter-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

.unlocked-filter-badge:empty {
    display: none;
}

.unlocked-filter-hint {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    line-height: 1.4;
}

/* --- 登録ボタン --- */
.register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-btn.inactive {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 2px 12px rgba(139, 105, 20, 0.3);
}

.register-btn.inactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.4);
}

.register-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    animation: pulse-glow 2s infinite;
}

.edo-road-draw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edo-road-draw-btn.inactive {
    background: linear-gradient(135deg, #b04a4a, #8e3f32);
    color: #fff;
    box-shadow: 0 2px 12px rgba(176, 74, 74, 0.28);
}

.edo-road-draw-btn.inactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(176, 74, 74, 0.38);
}

.edo-road-draw-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 2px 12px rgba(231, 76, 60, 0.3);
    }

    50% {
        box-shadow: 0 2px 20px rgba(231, 76, 60, 0.6);
    }
}

/* --- ホーム画面追加ガイド --- */
.home-screen-panel {
    padding: 0;
    overflow: hidden;
}

.home-screen-guide-btn {
    width: 100%;
    min-height: 58px;
    border: 1px solid rgba(22, 94, 131, 0.14);
    background: rgba(255, 255, 255, 0.68);
    color: #2f3b3f;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.home-screen-guide-btn:hover {
    background: #fff;
    border-color: rgba(22, 94, 131, 0.28);
}

.home-screen-guide-btn:active {
    transform: scale(0.98);
}

.home-screen-guide-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: #165e83;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
}

.home-screen-guide-title,
.home-screen-guide-subtitle {
    display: block;
}

.home-screen-guide-title {
    font-size: 13px;
    font-weight: 700;
}

.home-screen-guide-subtitle {
    margin-top: 2px;
    color: #667277;
    font-size: 11px;
}

/* --- 登録モード表示 --- */
.register-mode-banner {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
    animation: slide-down 0.3s ease;
    align-items: center;
    gap: 12px;
}

.register-mode-banner.show {
    display: flex;
}

.banner-back-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.banner-back-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.banner-back-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.banner-back-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #8e3f32;
}

.banner-back-btn.active {
    background: rgba(255, 255, 255, 0.96);
    color: #1f7a5b;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.edo-road-banner {
    background: rgba(142, 63, 50, 0.94);
    box-shadow: 0 4px 16px rgba(142, 63, 50, 0.35);
    max-width: min(94vw, 720px);
    border-radius: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.edo-road-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

@keyframes slide-down {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* --- モーダル --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    animation: fade-in 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    width: 380px;
    max-width: 90vw;
    max-height: min(
        85vh,
        calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)
    );
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-pop 0.3s ease;
}

@keyframes modal-pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.modal .form-group input[type='text'],
.modal .form-group input[type='number'],
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    border-color: #c9a96e;
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 96px;
}

.edo-road-modal-inner {
    max-width: 460px;
}

.coord-input-row {
    display: flex;
    gap: 10px;
}

.coord-input-row .coord-field {
    flex: 1;
}

.coord-input-row .coord-field label {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
}

.coord-input-row .coord-field input[type='number'] {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Noto Sans JP', monospace;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}

.coord-input-row .coord-field input[type='number']:focus {
    border-color: #c9a96e;
    background: #fff;
}

/* Chrome/Safari: hide number spinner */
.coord-input-row .coord-field input[type='number']::-webkit-inner-spin-button,
.coord-input-row .coord-field input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox: hide number spinner */
.coord-input-row .coord-field input[type='number'] {
    -moz-appearance: textfield;
}

.btn-change-coord {
    margin-top: 8px;
    padding: 7px 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-change-coord:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.35);
}

/* --- ファイルアップロード --- */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
    font-size: 13px;
}

.file-upload-area:hover {
    border-color: #c9a96e;
    background: #fdf8ef;
    color: #8b6914;
}

.file-upload-area.has-file {
    border-color: #27ae60;
    background: #f0faf3;
    color: #27ae60;
}

.file-upload-area input {
    display: none;
}

.file-upload-area .preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    margin-top: 8px;
}

/* --- ボタン群 --- */
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-1px);
}

/* --- ポップアップ ボタン群 --- */
.ukiyoe-popup .popup-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.edit-btn {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    border: 1px solid #c9a96e;
    background: linear-gradient(135deg, #fdf3e0, #f5e6c8);
    color: #8b6914;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #c9a96e, #8b6914);
    color: #fff;
    transform: translateY(-1px);
}

/* --- ポップアップ 閉じるボタン --- */
.maplibregl-popup-close-button {
    font-size: 24px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    top: -12px;
    right: -12px;
    border: 2px solid #fff;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    padding: 0;
    z-index: 1;
}

.maplibregl-popup-close-button:hover {
    background: rgba(231, 76, 60, 0.9);
    transform: scale(1.1);
}

/* --- ポップアップ(浮世絵詳細) --- */
.ukiyoe-popup {
    width: 230px;
}

.ukiyoe-popup h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #2c3e50;
}

.ukiyoe-popup img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ukiyoe-popup .delete-btn {
    flex: 1;
    padding: 6px 0;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: center;
}

.ukiyoe-popup .delete-btn:hover {
    background: #c0392b;
}

/* --- トースト通知 --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast.success {
    background: #27ae60;
    color: #fff;
}

.toast.error {
    background: #e74c3c;
    color: #fff;
}

/* --- ローディング --- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* カーソル変更 */
.register-cursor .maplibregl-canvas {
    cursor: crosshair !important;
}

/* --- タグ入力 --- */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-height: 42px;
    cursor: text;
    transition: border-color 0.2s;
}

.tag-input-container:focus-within {
    border-color: #c9a96e;
}

.tag-input-container input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 80px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 2px 0;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fdf3e0, #f5e6c8);
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 14px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    animation: chip-in 0.2s ease;
}

@keyframes chip-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tag-chip .remove-tag {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag-chip .remove-tag:hover {
    opacity: 1;
}

/* --- タグ検索 --- */

/* ポップアップ内タグ */
.ukiyoe-popup .popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.ukiyoe-popup .popup-tag {
    display: inline-block;
    background: #fdf3e0;
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-popup .popup-tag:hover {
    background: #c9a96e;
    color: #fff;
}

/* --- ドロワー開閉ボタン --- */
.drawer-toggle {
    display: flex;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 11;
    height: 40px;
    padding: 0 14px 0 4px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    color: #333;
    white-space: nowrap;
}

.drawer-toggle .app-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c9a96e;
}

.drawer-toggle .app-name {
    font-weight: 700;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    letter-spacing: 0.5px;
}

.drawer-toggle .hamburger-icon {
    font-size: 20px;
    line-height: 1;
    color: #555;
    padding: 0 4px;
}

.drawer-toggle:active {
    transform: scale(0.9);
}

/* --- ヘッダーラッパー（タイトル＋検索バー） --- */
.header-bar {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.header-bar > * {
    pointer-events: auto;
}

/* drawer-toggleを相対配置に変更 */
.drawer-toggle {
    position: relative;
    top: auto;
    left: auto;
}

/* --- ドロワー内ガイドラインリンク --- */
.drawer-guideline-link {
    padding: 12px 16px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.97);
}

.drawer-guideline-link a {
    color: #888;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-guideline-link a:hover {
    color: #165e83;
    text-decoration: underline;
}

.drawer-contact-link {
    padding: 10px 16px 12px;
    text-align: center;
    background: rgba(255, 255, 255, 0.97);
}

.drawer-contact-link a {
    color: #888;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-contact-link a:hover {
    color: #165e83;
    text-decoration: underline;
}

/* --- ドロワーヘッダー --- */
.drawer-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 12px;
    margin: 0 -16px 10px;
    padding-left: 16px;
    padding-right: 14px;
    border-bottom: none;
}

.drawer-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.drawer-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.drawer-close-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

.drawer-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-title .drawer-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c9a96e;
}

/* モバイル用の認証バー位置調整 */
@media (max-width: 480px) {
    .auth-bar .user-info span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 140px;
        display: inline-block;
        vertical-align: middle;
    }
}

/* --- 画像プレビュー ライトボックス --- */
.image-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    animation: fade-in 0.25s ease;
    touch-action: none;
}

.image-preview-overlay.show {
    display: flex;
}

.image-preview-overlay img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    transition: transform 0.1s ease;
    transform-origin: center center;
}

.image-preview-overlay img.dragging {
    transition: none;
    cursor: grabbing;
}

.image-preview-overlay img.zoomed {
    cursor: grab;
}

.image-preview-overlay .zoom-indicator {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview-overlay .zoom-indicator.show {
    opacity: 1;
}

.image-preview-overlay .preview-title {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    margin-top: 16px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.image-preview-overlay .preview-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.2s;
}

.image-preview-overlay .preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ナビゲーションボタン（前後画像） */
.image-preview-overlay .preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 48px;
    width: 56px;
    height: 80px;
    border-radius: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s,
        transform 0.2s;
    z-index: 10;
    line-height: 1;
    padding: 0;
    font-family: sans-serif;
}

.image-preview-overlay .preview-nav.show {
    display: flex;
}

.image-preview-overlay .preview-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-preview-overlay .preview-nav:active {
    transform: translateY(-50%) scale(0.92);
}

.image-preview-overlay .preview-nav-prev {
    left: 16px;
}

.image-preview-overlay .preview-nav-next {
    right: 16px;
}

/* 画像カウンター（1/3 など） */
.image-preview-overlay .preview-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.image-preview-overlay .preview-counter.show {
    display: block;
}

@media (max-width: 600px) {
    .image-preview-overlay .preview-nav {
        font-size: 36px;
        width: 44px;
        height: 64px;
    }

    .image-preview-overlay .preview-nav-prev {
        left: 8px;
    }

    .image-preview-overlay .preview-nav-next {
        right: 8px;
    }
}

.ukiyoe-popup img {
    cursor: pointer;
    transition: opacity 0.2s;
}

.ukiyoe-popup img:hover {
    opacity: 0.8;
}

/* --- 無効状態パネル --- */
.map-overlay-inner.disabled-panel {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}

/* --- ウェルカムモーダル --- */
.welcome-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fade-in 0.3s ease;
}

.welcome-overlay.show {
    display: flex;
}

.welcome-card {
    background: linear-gradient(160deg, #fffdf7 0%, #faf3e4 100%);
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: 360px;
    max-width: 90vw;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(201, 169, 110, 0.2);
    text-align: center;
    animation: modal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-card .welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c9a96e;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
    margin-bottom: 16px;
}

.welcome-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px;
}

.welcome-card .welcome-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.6;
}

.welcome-card .welcome-features {
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

.welcome-card .welcome-features span {
    display: block;
}

.welcome-card .welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-card .btn-welcome-register {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.3);
    transition: all 0.2s ease;
}

.welcome-card .btn-welcome-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.4);
}

.welcome-card .btn-welcome-browse {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: transparent;
    color: #999;
    transition: color 0.2s;
}

.welcome-card .btn-welcome-browse:hover {
    color: #666;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Noto Sans JP', sans-serif;
    color: #999;
    line-height: 1;
}

.reaction-btn:hover {
    transform: translateY(-1px);
}

.reaction-btn.like-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef0ef;
}

.reaction-btn.like-btn.active {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fef0ef;
}

.reaction-btn.dislike-btn:hover {
    border-color: #3498db;
    color: #3498db;
    background: #eef6fd;
}

.reaction-btn.dislike-btn.active {
    border-color: #3498db;
    color: #3498db;
    background: #eef6fd;
}

.reaction-btn .reaction-count {
    font-size: 12px;
    min-width: 8px;
    text-align: center;
}

/* コメント・返信内リアクション */
.inline-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.inline-reactions .reaction-btn {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 12px;
}

.inline-reactions .reaction-btn .reaction-count {
    font-size: 11px;
}

/* --- 右ドロワー リサイズハンドル --- */
.drawer-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}

.drawer-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 36px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.drawer-resize-handle:hover {
    background: rgba(0, 0, 0, 0.08);
}

.drawer-resize-handle:hover::after {
    background: rgba(0, 0, 0, 0.3);
}

/* --- 浮世絵 右スライドアウトドロワー --- */
.ukiyoe-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ukiyoe-detail-drawer.open {
    transform: translateX(0);
}

.ukiyoe-detail-drawer-header {
    background: transparent;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

/* ヘッダー タイトル+管理者ボタン グループ */
.drawer-header-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#ukiyoe-drawer-admin-actions,
#premium-drawer-admin-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ヘッダー内管理者アイコンボタン */
.drawer-header-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
    color: #888;
    line-height: 1;
    padding: 0;
}

.drawer-header-icon-btn.edit:hover {
    background: rgba(201, 169, 110, 0.15);
    color: #8b6914;
}

.drawer-header-icon-btn.delete:hover {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.ukiyoe-detail-drawer-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.ukiyoe-detail-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.2s;
}

.ukiyoe-detail-drawer-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.ukiyoe-detail-drawer-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-image:hover {
    opacity: 0.85;
}

/* --- スライドショー (ドロワー内) --- */
.ukiyoe-slideshow {
    position: relative;
    margin-bottom: 14px;
}

.slideshow-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.slideshow-viewport .ukiyoe-drawer-image {
    margin-bottom: 0;
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.slideshow-nav:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: translateY(-50%) scale(1.08);
}

.slideshow-prev {
    left: 8px;
}

.slideshow-next {
    right: 8px;
}

.slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}

.slideshow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 0.2s;
}

.slideshow-dot:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: scale(1.2);
}

.slideshow-dot.active {
    background: #c9a96e;
    transform: scale(1.15);
    box-shadow: 0 0 4px rgba(201, 169, 110, 0.4);
}

.slideshow-counter {
    text-align: center;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* --- 追加画像グリッド (編集モーダル) --- */
.extra-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 6px;
}

.extra-image-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    transition: border-color 0.2s;
}

.extra-image-thumb.pending {
    border-color: #c9a96e;
    border-style: dashed;
}

.extra-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.extra-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(231, 76, 60, 0.85);
    color: #fff;
    font-size: 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0;
}

.extra-image-thumb:hover .extra-image-remove {
    opacity: 1;
}

.extra-image-add {
    aspect-ratio: 1;
    width: 100%;
    background: none;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 24px;
    color: #aaa;
}

.extra-image-add:hover {
    border-color: #c9a96e;
    color: #c9a96e;
    background: rgba(201, 169, 110, 0.06);
}

.ukiyoe-detail-drawer .ukiyoe-drawer-name {
    font-size: 17px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-share-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
    flex-wrap: wrap;
}

.ukiyoe-detail-drawer .ukiyoe-share-btn {
    border: 1px solid rgba(201, 169, 110, 0.55);
    background: #fffaf0;
    color: #6b5421;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-share-btn.primary,
.ukiyoe-detail-drawer .ukiyoe-share-btn:hover {
    background: #c9a96e;
    border-color: #c9a96e;
    color: #fff;
}

.ukiyoe-detail-drawer .ukiyoe-share-menu {
    position: absolute;
    top: 34px;
    left: 0;
    z-index: 10;
    min-width: 160px;
    padding: 6px;
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.ukiyoe-detail-drawer .ukiyoe-share-menu[hidden] {
    display: none;
}

.ukiyoe-detail-drawer .ukiyoe-share-menu-btn {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #5a4a2a;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: left;
    cursor: pointer;
}

.ukiyoe-detail-drawer .ukiyoe-share-menu-btn[hidden] {
    display: none;
}

.ukiyoe-detail-drawer .ukiyoe-share-menu-btn:hover {
    background: #fffaf0;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-description {
    background: linear-gradient(135deg, rgba(245, 240, 230, 0.4), rgba(240, 235, 220, 0.5));
    border-radius: 10px;
    border: 1.5px solid rgba(201, 169, 110, 0.2);
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    font-family: 'Noto Sans JP', sans-serif;
}

.ukiyoe-detail-drawer .ukiyoe-desc-title {
    font-size: 14px;
    font-weight: 700;
    color: #5a4a2a;
    padding-left: 10px;
    border-left: 3px solid #c9a96e;
    margin-bottom: 6px;
    margin-top: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.2);
}

.ukiyoe-detail-drawer .ukiyoe-desc-title:first-child {
    margin-top: 0;
}

.ukiyoe-detail-drawer .ukiyoe-desc-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: #6b5a3a;
    margin-top: 12px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
}

.ukiyoe-detail-drawer .ukiyoe-desc-subtitle:first-child {
    margin-top: 0;
}

.ukiyoe-detail-drawer .ukiyoe-desc-body {
    font-size: 13px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 4px;
    word-break: break-word;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-description strong {
    color: #5a4a2a;
    font-weight: 700;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tag {
    display: inline-block;
    background: #fdf3e0;
    color: #8b6914;
    border: 1px solid #e0c88a;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-drawer-tag:hover {
    background: #c9a96e;
    color: #fff;
}

.ukiyoe-detail-drawer .ukiyoe-tour-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #8b6914, #c9a96e);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(201, 169, 110, 0.2);
    width: calc(100% - 32px);
    box-sizing: border-box;
}

.ukiyoe-detail-drawer .ukiyoe-tour-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(201, 169, 110, 0.35);
    background: linear-gradient(135deg, #9b7924, #d9b97e);
    color: #fff !important;
}

.ukiyoe-detail-drawer .ukiyoe-tour-link-btn:active {
    transform: translateY(0);
}

.ukiyoe-detail-drawer .ukiyoe-drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.ukiyoe-detail-drawer .comment-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.ukiyoe-detail-drawer .comment-section {
    max-height: 300px;
    overflow-y: auto;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(201, 169, 110, 0.35);
    border-radius: 8px;
    background: #fffaf0;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta-title {
    font-size: 13px;
    font-weight: 700;
    color: #5a4a2a;
    margin-bottom: 6px;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta-body {
    font-size: 12px;
    line-height: 1.7;
    color: #6b5a3a;
    margin-bottom: 12px;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta-btn {
    border: 1px solid rgba(201, 169, 110, 0.65);
    background: #fff;
    color: #6b5421;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.ukiyoe-detail-drawer .ukiyoe-guest-cta-btn.primary,
.ukiyoe-detail-drawer .ukiyoe-guest-cta-btn:hover {
    background: #c9a96e;
    border-color: #c9a96e;
    color: #fff;
}

.ukiyoe-detail-drawer .comment-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.ukiyoe-detail-drawer .comment-item:last-child {
    border-bottom: none;
}

.ukiyoe-detail-drawer .comment-author {
    font-weight: 500;
    color: #165e83;
    margin-right: 6px;
}

.ukiyoe-detail-drawer .comment-date {
    color: #ccc;
    font-size: 11px;
    margin-left: 4px;
}

.ukiyoe-detail-drawer .comment-delete {
    float: right;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: #ccc;
    font-size: 11px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: color 0.2s;
}

.ukiyoe-detail-drawer .comment-delete:hover {
    color: #e74c3c;
}

.ukiyoe-detail-drawer .comment-body {
    color: #555;
    margin-top: 4px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.ukiyoe-detail-drawer .comment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.ukiyoe-detail-drawer .comment-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    line-height: 1.5;
}

.ukiyoe-detail-drawer .comment-input:focus {
    border-color: #c9a96e;
}

.ukiyoe-detail-drawer .comment-submit {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
}

.ukiyoe-detail-drawer .comment-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 105, 20, 0.4);
}

/* モバイル用ボトムドロワー（600px以下） */
@media (max-width: 600px) {
    .drawer-resize-handle {
        display: none;
    }

    /* --- 浮世絵 & プレミアムドロワー --- */
    .ukiyoe-detail-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: min(68dvh, calc(100dvh - env(safe-area-inset-top) - 24px));
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .ukiyoe-detail-drawer.open {
        transform: translateY(0);
    }

    .ukiyoe-detail-drawer::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }
}

/* --- 表示名設定 (削除済み: ポップオーバーに移行) --- */

/* --- マーカー共通ホバー＆クリック改善 --- */
.maplibregl-marker {
    cursor: pointer !important;
}

/* 内部SVGにトランジション適用 */
.maplibregl-marker svg {
    transition:
        transform 0.15s ease,
        filter 0.15s ease;
    transform-origin: bottom center;
}

/* ホバー時に少し大きくして押せることを示す */
.maplibregl-marker:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* クリック可能領域を広げる透明ヒットエリア */
.maplibregl-marker::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -12px;
    right: -12px;
    bottom: -4px;
}

/* ドロワー表示中のピン — ホバー状態を維持 */
.marker-active {
    z-index: 10 !important;
}

.marker-active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* --- 文字数カウンター --- */
.char-counter {
    width: 100%;
    text-align: right;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.char-counter.over {
    color: #e74c3c;
    font-weight: 500;
}

/* --- ピン色選択 --- */
.color-picker-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.color-swatch.selected {
    border-color: #333;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px #333;
}

.color-swatch.selected::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- アバターアップロード --- */
.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-upload-controls {
    flex: 1;
    min-width: 0;
}

.avatar-preview-container {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f5f0e5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0d5c0;
    position: relative;
    flex-shrink: 0;
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-placeholder {
    font-size: 24px;
    color: #ccc;
}

.avatar-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.avatar-remove-btn:hover {
    background: #c0392b;
}

.btn-avatar-upload {
    padding: 6px 14px;
    border: 1px solid #d5c8a8;
    border-radius: 8px;
    background: #fdf8ef;
    color: #8b6914;
    font-size: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-avatar-upload:hover {
    background: #f5edd8;
    border-color: #c9a96e;
}

/* --- サブスクリプション管理 --- */
#account-subscription-section {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

#account-subscription-section + .account-field {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.subscription-status.active {
    background: rgba(243, 156, 18, 0.1);
    color: #c98a0e;
}

.subscription-status.free {
    background: rgba(0, 0, 0, 0.04);
    color: #aaa;
}

.subscription-badge {
    font-weight: 700;
    font-size: 11px;
}

.btn-subscription-upgrade {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    box-shadow: 0 2px 12px rgba(243, 156, 18, 0.3);
    transition: all 0.2s ease;
}

.btn-subscription-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.4);
}

.btn-subscription-manage {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0d5c0;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: #fdf8ef;
    color: #8b6914;
    transition: all 0.2s;
}

.btn-subscription-manage:hover {
    background: #f5edd8;
    border-color: #c9a96e;
}

.subscription-benefits {
    margin-top: 8px;
    text-align: center;
    color: #999;
}

.subscription-benefits small {
    font-size: 12px;
}

/* --- プレミアムコンテンツピン（ゴールド + kuro_edo.png） --- */
.premium-pin-custom {
    cursor: pointer;
}

.premium-pin-custom:hover svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.premium-pin-custom svg {
    transition:
        transform 0.15s ease,
        filter 0.15s ease;
    transform-origin: bottom center;
}

/* --- プレミアム 複数画像リスト（モーダル内） --- */
.premium-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.premium-image-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0d5c0;
}

.premium-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premium-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.premium-image-remove:hover {
    background: #c0392b;
}

.premium-image-add {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 2px dashed #d5c8a8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #c9a96e;
    font-size: 24px;
}

.premium-image-add:hover {
    border-color: #c9a96e;
    background: #fdf8ef;
}

/* --- プレミアム 画像ギャラリー（ドロワー内） --- */
.premium-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.premium-gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.premium-gallery-thumb:hover {
    opacity: 0.8;
}

/* --- プレミアム 記事テキスト（ドロワー内） --- */
.premium-body-text {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 14px;
    padding: 16px;
    background: rgba(245, 240, 230, 0.5);
    border-radius: 12px;
    word-break: break-word;
    white-space: pre-wrap;
}

/* --- プレミアム動画コンテナ --- */
.premium-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.premium-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.premium-video-link {
    margin-bottom: 14px;
    padding: 16px;
    background: rgba(245, 240, 230, 0.5);
    border-radius: 12px;
    text-align: center;
}

.premium-video-link a {
    color: #c9a96e;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.premium-video-link a:hover {
    color: #8b6914;
}

/* --- プレミアムコンテンツバナー --- */
.premium-content-banner {
    background: rgba(201, 169, 110, 0.9) !important;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.4) !important;
}

/* --- プレミアム記事 textarea --- */
#premium-body {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#premium-body:focus {
    border-color: #c9a96e;
}

/* =============================================
   通知ベル & ドロワー
   ============================================= */

/* --- 通知ベル --- */

.notification-bell-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.notification-bell-btn:hover {
    background: rgba(201, 169, 110, 0.15);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: 0;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.4);
    animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* --- 通知ドロワー --- */
.notification-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
}

.notification-drawer.open {
    transform: translateX(0);
}

.notification-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0ead8;
    flex-shrink: 0;
}

.notification-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.notification-drawer-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.notification-drawer-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* --- 通知リスト --- */
.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
    font-size: 14px;
}

.notification-actions {
    padding: 8px 16px;
    border-bottom: 1px solid #f5f0e5;
}

.notification-mark-all {
    background: none;
    border: none;
    color: #c9a96e;
    font-size: 13px;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.notification-mark-all:hover {
    color: #8b6914;
}

/* --- 通知アイテム --- */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: 0;
    color: inherit;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.notification-item:hover {
    background: #fdf8ef;
}

.notification-item.unread {
    background: rgba(201, 169, 110, 0.08);
    border-left: 3px solid #c9a96e;
}

.notification-item.unread:hover {
    background: rgba(201, 169, 110, 0.15);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    padding-top: 2px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    word-break: break-word;
}

.notification-message strong {
    color: #333;
    font-weight: 600;
}

.notification-time {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* =============================================
   アクティビティフィード
   ============================================= */

/* --- 左ドロワー内ボタン --- */
.activity-feed-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 2px solid #c9a96e;
    border-radius: 10px;
    background: linear-gradient(135deg, #fdf8ef, #f5e6c8);
    color: #8b6914;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}

.activity-feed-btn:hover {
    background: linear-gradient(135deg, #c9a96e, #a88532);
    color: #fff;
    border-color: #a88532;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(168, 133, 50, 0.35);
}

/* --- アクティビティドロワー --- */
.activity-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
}

.activity-drawer.open {
    transform: translateX(0);
}

.activity-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0ead8;
    flex-shrink: 0;
}

.activity-drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.activity-drawer-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.activity-drawer-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* --- アクティビティリスト --- */
.activity-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
    font-size: 14px;
}

.activity-loading {
    text-align: center;
    padding: 40px 20px;
    color: #c9a96e;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* --- アクティビティアイテム --- */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: 0;
    color: inherit;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.activity-item:hover {
    background: #fdf8ef;
}

.activity-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f4eb;
    border-radius: 8px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.activity-label {
    font-size: 11px;
    font-weight: 700;
    color: #c9a96e;
    background: rgba(201, 169, 110, 0.12);
    padding: 1px 8px;
    border-radius: 8px;
}

.activity-time {
    font-size: 11px;
    color: #aaa;
    flex-shrink: 0;
}

.activity-author {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.activity-body {
    font-size: 12px;
    color: #777;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 浮世絵アクティビティ（サムネイル付き） --- */
.activity-item-ukiyoe {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-ukiyoe-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #e0d5c0;
    background: #f5f0e5;
}

.activity-ukiyoe-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.activity-item-ukiyoe:hover .activity-ukiyoe-thumb img {
    transform: scale(1.08);
}

.activity-label-ukiyoe {
    background: rgba(201, 169, 110, 0.18) !important;
    color: #8b6914 !important;
}

.activity-ukiyoe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.activity-ukiyoe-tag {
    font-size: 11px;
    color: #8b6914;
    background: rgba(201, 169, 110, 0.12);
    padding: 1px 7px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.5;
}

/* =============================================
   ベースマップ切替コントロール
   ============================================= */
.basemap-switcher {
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden;
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
}

.basemap-switcher button {
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Noto Sans JP', sans-serif;
    padding: 8px 16px;
    min-width: 80px;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
    line-height: 1;
    white-space: nowrap;
}

.basemap-switcher button:not(:last-child) {
    border-right: 1px solid #ddd;
}

.basemap-switcher button:hover {
    background: rgba(240, 240, 240, 0.95);
}

.basemap-switcher button.active,
.basemap-switcher button.active:hover,
.basemap-switcher button.active:focus,
.basemap-switcher button.active:active {
    background: #3b82f6 !important;
    color: #fff !important;
}

.basemap-switcher button:active {
    background: rgba(59, 130, 246, 0.16);
}

.raster-map-select {
    width: 100%;
    margin: 6px 0 10px;
    padding: 7px 9px;
    border: 1px solid rgba(139, 105, 20, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    color: #4c4537;
    font: inherit;
}

/* =============================================
   マップ左下のコントロール横並び化 (Basemap & Terrain)
   ============================================= */
.maplibregl-ctrl-bottom-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PCでドロワーが開いているとき、左下コントロールをドロワーの右側に移動 */
@media (min-width: 601px) {
    body.drawer-open .maplibregl-ctrl-bottom-left {
        transform: translateX(280px);
    }
}

.maplibregl-ctrl-bottom-left .maplibregl-ctrl {
    margin: 0 0 max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    clear: none !important;
    float: none !important;
}

@media (max-width: 600px) {
    .maplibregl-ctrl-bottom-left {
        max-width: calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right));
        flex-wrap: wrap !important;
    }

    .basemap-switcher button {
        min-width: 64px;
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .register-btn.inactive:hover,
    .home-screen-guide-btn:hover,
    .banner-back-btn:hover,
    .drawer-close-btn:hover,
    .search-tab:hover,
    .basemap-switcher button:hover,
    .building-3d-ctrl-btn:hover,
    .label-ctrl-btn:hover,
    .maplibregl-marker:hover svg {
        transform: none;
        filter: none;
    }
}

/* =============================================
   建物3D コントロールボタン
   ============================================= */
.building-3d-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    transition:
        color 0.2s,
        background 0.2s;
    border-radius: 4px;
}

.building-3d-ctrl-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.building-3d-ctrl-btn.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* =============================================
   ラベル表示コントロールボタン
   ============================================= */
.label-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #333;
    transition:
        color 0.2s,
        background 0.2s;
    border-radius: 4px;
}

.label-ctrl-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.label-ctrl-btn.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* =============================================
   クイズ機能
   ============================================= */

@keyframes quiz-btn-shimmer {
    0% {
        transform: translateX(-100%);
    }

    50%,
    100% {
        transform: translateX(100%);
    }
}

/* --- クイズオーバーレイ --- */
.quiz-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 0 16px 24px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.4s ease,
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-overlay.show {
    opacity: 1;
    transform: translateY(0);
}

.quiz-overlay.show .quiz-card {
    pointer-events: auto;
}

/* --- クイズカード --- */
.quiz-card {
    background: rgba(255, 252, 245, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px 24px 24px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    box-shadow:
        0 -4px 30px rgba(0, 0, 0, 0.12),
        0 4px 20px rgba(139, 105, 20, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(201, 169, 110, 0.25);
}

/* --- クイズヘッダー --- */
.quiz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.quiz-badge {
    background: linear-gradient(135deg, #6b4e2c, #3d2b1a);
    color: #f5e6c8;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.quiz-progress {
    font-size: 13px;
    color: #8b7355;
    font-weight: 500;
    margin-left: auto;
}

.quiz-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans JP', sans-serif;
}

.quiz-close-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* --- 問題文 --- */
.quiz-question {
    font-size: 16px;
    font-weight: 600;
    color: #2c1a08;
    line-height: 1.6;
    margin-bottom: 18px;
    text-align: center;
    padding: 12px 8px;
    background: rgba(201, 169, 110, 0.08);
    border-radius: 12px;
    border-left: 3px solid #c9a96e;
}

/* --- 選択肢 --- */
.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-choice-btn {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8dcc8;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #3a2a1a;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Noto Sans JP', sans-serif;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.quiz-choice-btn:hover:not(:disabled) {
    border-color: #c9a96e;
    background: rgba(201, 169, 110, 0.08);
    transform: translateX(4px);
}

.quiz-choice-btn:active:not(:disabled) {
    transform: translateX(2px) scale(0.99);
}

.quiz-choice-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* 正解ハイライト */
.quiz-choice-btn.correct {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
    color: #1a7a42;
    opacity: 1 !important;
}

.quiz-choice-btn.selected-correct {
    border-color: #27ae60;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.15), rgba(39, 174, 96, 0.08));
    color: #1a7a42;
    opacity: 1 !important;
    animation: quiz-correct-pulse 0.5s ease;
}

.quiz-choice-btn.selected-wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    color: #c0392b;
    opacity: 1 !important;
    animation: quiz-wrong-shake 0.4s ease;
}

@keyframes quiz-correct-pulse {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes quiz-wrong-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* --- クイズ完了モーダル --- */
.quiz-complete-modal {
    text-align: center;
    max-width: 340px;
}

.quiz-score-emoji {
    font-size: 48px;
    margin: 12px 0 8px;
}

.quiz-score-main {
    font-size: 24px;
    font-weight: 700;
    color: #2c1a08;
    margin-bottom: 4px;
}

.quiz-score-percent {
    font-size: 16px;
    color: #8b7355;
    margin-bottom: 18px;
}

.quiz-score-progress {
    background: rgba(201, 169, 110, 0.08);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 8px;
}

.quiz-progress-label {
    font-size: 12px;
    color: #8b7355;
    font-weight: 500;
    margin-bottom: 8px;
}

.quiz-progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(139, 105, 20, 0.12);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.quiz-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a96e, #8b6914);
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-progress-count {
    font-size: 13px;
    color: #6b4e2c;
    font-weight: 600;
}

/* --- モバイル対応 --- */
@media (max-width: 600px) {
    .quiz-overlay {
        padding: 0 8px 12px;
    }

    .quiz-card {
        padding: 16px 16px 20px;
        border-radius: 16px;
    }

    .quiz-question {
        font-size: 14px;
        padding: 10px 6px;
    }

    .quiz-choice-btn {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* --- クイズイントロオーバーレイ --- */
.quiz-intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 12, 4, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.quiz-intro-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.quiz-intro-card {
    background: linear-gradient(165deg, #fffcf5, #f5ead6);
    border-radius: 28px;
    padding: 36px 32px 32px;
    max-width: 420px;
    width: 92%;
    max-height: 90dvh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.3),
        0 4px 24px rgba(139, 105, 20, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(201, 169, 110, 0.3);
    transform: scale(0.88) translateY(30px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-intro-overlay.show .quiz-intro-card {
    transform: scale(1) translateY(0);
}

.quiz-intro-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    font-size: 15px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans JP', sans-serif;
    z-index: 2;
}

.quiz-intro-close-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.quiz-intro-icon {
    font-size: 56px;
    margin-bottom: 8px;
    animation: quiz-intro-float 3s ease-in-out infinite;
}

@keyframes quiz-intro-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.quiz-intro-title {
    font-size: 24px;
    font-weight: 800;
    color: #2c1a08;
    margin: 0 0 6px;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

.quiz-intro-subtitle {
    font-size: 13px;
    color: #8b7355;
    line-height: 1.7;
    margin: 0 0 20px;
}

/* --- サムネイルギャラリー --- */
.quiz-intro-thumbnails {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    min-height: 56px;
}

.quiz-intro-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(201, 169, 110, 0.4);
    animation: quiz-intro-thumb-pop 0.4s ease both;
    transition: transform 0.2s ease;
}

.quiz-intro-thumb:hover {
    transform: scale(1.1);
}

@keyframes quiz-intro-thumb-pop {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quiz-intro-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quiz-intro-thumb.locked img {
    filter: blur(3px) grayscale(0.5);
}

.quiz-intro-thumb-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 26, 8, 0.35);
    font-size: 18px;
}

/* --- 進捗セクション --- */
.quiz-intro-stats {
    background: rgba(201, 169, 110, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(201, 169, 110, 0.15);
}

.quiz-intro-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.quiz-intro-progress-label {
    font-size: 12px;
    color: #8b7355;
    font-weight: 500;
}

.quiz-intro-progress-value {
    font-size: 20px;
    font-weight: 800;
    color: #6b4e2c;
}

.quiz-intro-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(139, 105, 20, 0.12);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quiz-intro-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a96e, #8b6914);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-intro-progress-detail {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #a08b6e;
}

/* --- ルール説明 --- */
.quiz-intro-desc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    text-align: left;
}

.quiz-intro-rule {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #5a4a30;
    line-height: 1.5;
}

.quiz-intro-rule-icon {
    flex-shrink: 0;
    font-size: 16px;
    margin-top: 1px;
}

/* --- 開始ボタン --- */
.quiz-intro-start-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #6b4e2c, #3d2b1a);
    color: #f5e6c8;
    box-shadow: 0 4px 20px rgba(61, 43, 26, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quiz-intro-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(201, 169, 110, 0.3), transparent);
    transform: translateX(-100%);
    animation: quiz-btn-shimmer 3s infinite;
}

.quiz-intro-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(61, 43, 26, 0.5);
    background: linear-gradient(135deg, #7d5c36, #4a3520);
}

.quiz-intro-start-btn:active {
    transform: translateY(0);
}

/* --- モバイル対応 --- */
@media (max-width: 600px) {
    .quiz-intro-card {
        padding: 28px 20px 24px;
        border-radius: 24px;
    }

    .quiz-intro-title {
        font-size: 20px;
    }

    .quiz-intro-thumb {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .quiz-intro-start-btn {
        font-size: 15px;
        padding: 14px;
    }
}

/* --- 街道ツアーの新機能ウェルカムモーダル --- */
.tour-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 12, 4, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tour-welcome-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.tour-welcome-card {
    background: linear-gradient(165deg, #fffcf5, #f5ead6);
    border-radius: 24px;
    padding: 40px 36px 32px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 4px 20px rgba(139, 105, 20, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(201, 169, 110, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-welcome-overlay.show .tour-welcome-card {
    transform: scale(1) translateY(0);
}

.tour-welcome-icon {
    font-size: 56px;
    margin-bottom: 12px;
    animation: tour-welcome-float 3s ease-in-out infinite;
}

@keyframes tour-welcome-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.tour-welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c1a08;
    line-height: 1.5;
    margin: 0 0 12px;
}

.tour-welcome-desc {
    font-size: 14px;
    color: #8b7355;
    line-height: 1.6;
    margin: 0 0 28px;
}

.tour-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tour-welcome-btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: linear-gradient(135deg, #6b4e2c, #3d2b1a);
    color: #f5e6c8;
    box-shadow: 0 4px 16px rgba(61, 43, 26, 0.35);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tour-welcome-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(201, 169, 110, 0.25), transparent);
    transform: translateX(-100%);
    animation: quiz-btn-shimmer 3s infinite;
}

.tour-welcome-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61, 43, 26, 0.45);
}

.tour-welcome-btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    background: transparent;
    color: #8b7355;
    transition: all 0.2s ease;
}

.tour-welcome-btn-secondary:hover {
    background: rgba(139, 105, 20, 0.08);
    color: #6b4e2c;
}
