/* Leaflet の CSS はプラグイン側（hoseifes-map.php）で読み込む */

/* =========================
   WORDPRESS RESET & BASE
========================= */

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f3f4f6;
    -webkit-tap-highlight-color: transparent;
}

.wp-site-blocks,
.entry-content,
.post-content,
.site-content,
.content,
#content,
main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
}

.entry-title,
.page-title {
    display: none !important;
}

/* =========================
   MAP
========================= */

.map-page {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.leaflet-container {
    background: #eef2f7;
}

/* =========================
   TOP UI
========================= */

.top-ui {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5000;
    width: min(520px, calc(100% - 24px));
    margin-left: 12px;
    padding-top: calc(env(safe-area-inset-top) + 80px);
    box-sizing: border-box;
}

.top-select-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.top-select {
    height: 46px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.search-box {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0 18px;
    font-size: 15px;
    color: #111827;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

/* =========================
   BUTTONS
========================= */

.side-btn {
    position: fixed;
    right: 16px;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 5000;
    font-size: 22px;
    color: #111827;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.side-btn:active {
    transform: scale(0.95);
}

.zoom-wrap {
    position: fixed;
    right: 16px;
    bottom: 110px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.zoom-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 26px;
    color: #111827;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn + .zoom-btn {
    border-top: 1px solid #e5e7eb;
}

.zoom-btn:active {
    background: rgba(229, 231, 235, 0.95);
}

.gps-btn {
    bottom: 240px;
}

.center-btn {
    bottom: 310px;
}

.filter-toggle {
    bottom: 380px;
}

.gps-btn.active {
    background: #2563eb;
    color: #fff;
}

/* =========================
   FILTER PANEL
========================= */

.filter-panel {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 24px);
    max-width: 420px;
    background: #fff;
    border-radius: 26px;
    padding: 20px;
    box-sizing: border-box;
    z-index: 6000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

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

.filter-panel {
    max-height: 70vh;
    overflow-y: auto;
}

.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-right: 40px; /* 右上の×ボタンと重ならないように */
}

/* 右上の×ボタン */
.filter-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1.5px solid #1a1a1a;
    border-radius: 50%;
    background: #fff;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.filter-close-btn:active {
    background: #f3f4f6;
    transform: scale(0.92);
}

.filter-head-title {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.filter-head-btns {
    display: flex;
    gap: 6px;
}

.filter-mini-btn {
    border: 1.5px solid #1a1a1a;
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.filter-fav {
    margin-top: 12px;
    background: #fff0f5 !important;
    color: #ff2d95 !important;
}

.filter-fav input[type="checkbox"] {
    accent-color: #ff2d95 !important;
}

.filter-item {
    background: #f3f4f6;
    border-radius: 14px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* =========================
   DETAIL SHEET & CAROUSEL
========================= */

#detail-sheet {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 80vh;
    background: transparent;
    z-index: 7000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none; /* シート領域外のタップを邪魔しない */
}

#detail-sheet.show {
    transform: translateY(0);
    /* カードのない左右・すき間は地図を触れるように、シート自体はタップを通す */
    pointer-events: none;
}

/* 触れるのはボタンとカードだけ */
#detail-sheet.show .sheet-toolbar button,
#detail-sheet.show .club-card {
    pointer-events: auto;
}

/* カードが画面からはみ出す（横スクロールが必要な）ときだけ、カルーセル全体で横スクロールを受ける
   （このときは左右にカードが並んでいて空いている場所がほぼ無いので、地図の操作は邪魔しない） */
#detail-sheet.show .card-carousel.is-scrollable {
    pointer-events: auto;
}

/* ▼で下げたとき（PC：画面の下へ隠れる） */
#detail-sheet.show.collapsed {
    transform: translateY(100%);
    pointer-events: none;
}

#detail-sheet.show.collapsed .club-card,
#detail-sheet.show.collapsed .card-carousel.is-scrollable {
    pointer-events: none;
}

/* モバイル対応：カード表示位置を画面下から 60px 上げる */
@media (max-width: 768px) {
    #detail-sheet {
        bottom: 60px !important;
    }

    /* スマホで下げたとき：下のメニューに隠れないよう、上の 60px（▲ボタン）だけ残す */
    #detail-sheet.show.collapsed {
        transform: translateY(calc(100% - 60px));
    }

    #detail-sheet.show.collapsed .sheet-toolbar {
        pointer-events: auto;
    }

    #detail-sheet.show.collapsed .card-carousel {
        opacity: 0;
    }

    /* スマホで最初に出るとき（compact）は画像を出さない。▲で画像まで出る */
    #detail-sheet.compact .club-card-thumb {
        display: none;
    }

    /* 画像がないぶん、タイトルが右上のハートと重ならないようにする */
    #detail-sheet.compact .club-card .club-card-title {
        padding-right: 30px !important;
    }
}

.sheet-close-btn[hidden] {
    display: none;
}

.card-carousel {
    transition: opacity 0.2s ease;
}

.sheet-inner {
    padding: 0 0 calc(env(safe-area-inset-bottom) + 16px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 閉じる・リンクコピーのボタン列 */
.sheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 10px;
}

.sheet-close-btn,
.sheet-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    color: #111827;
    font-size: 14px;
    transition: transform 0.15s ease, background-color 0.2s;
}

.sheet-link-btn {
    font-size: 16px;
    font-weight: 800;
}

.sheet-link-btn[hidden] {
    display: none;
}

.sheet-close-btn:active,
.sheet-link-btn:active {
    transform: scale(0.9);
    background: #e5e7eb;
}

/* カルーセル */
.card-carousel {
    position: relative;
    display: flex;
    gap: 12px;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 24px 16px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
}

.card-carousel::-webkit-scrollbar {
    display: none;
}

/* 1枚だけの時は中央寄せ */
.card-carousel.single-card {
    justify-content: center;
}

/* ---------- カード（検索結果と同じクラス・同じデザインをマップ用に小さく） ---------- */
#detail-sheet .club-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 172px;
    width: 172px;
    max-width: 80vw;
    box-sizing: border-box;
    scroll-snap-align: center;
    background: #fffdfb;
    border: 2px solid #1a1a1a;
    border-radius: 14px 6px 14px 6px;
    overflow: hidden;
    box-shadow: 3px 3px 0 #ff2d95;
    cursor: pointer;
}
#detail-sheet .club-card:nth-child(3n+1) { box-shadow: 3px 3px 0 #ff2d95; }
#detail-sheet .club-card:nth-child(3n+2) { box-shadow: 3px 3px 0 #00c2ff; }
#detail-sheet .club-card:nth-child(3n+3) { box-shadow: 3px 3px 0 #ffd400; }

#detail-sheet .club-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    overflow: hidden;
    border-bottom: 2px solid #1a1a1a;
}
#detail-sheet .club-card-thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

#detail-sheet .club-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 6px 8px 8px;
}

#detail-sheet .club-card .club-card-title {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-size: 11px;
    font-weight: 800;
    color: #222222;
    margin: 0 0 1px 0 !important;
    line-height: 1.3 !important;
    letter-spacing: 0.02em;
    display: block;
    overflow-wrap: anywhere;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}
#detail-sheet .club-card-title::before,
#detail-sheet .club-card-title::after {
    content: none !important;
    display: none !important;
}
/* 画像がないカードは、ハートと重ならないようにする */
#detail-sheet .btn-fav-heart + .club-card-body .club-card-title {
    padding-right: 30px !important;
}

#detail-sheet .club-card .club-card-sub-title {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    font-size: 9px;
    font-weight: 700;
    color: #777777;
    margin: 0 0 3px 0 !important;
    line-height: 1.3 !important;
    display: block;
    overflow-wrap: anywhere;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}

#detail-sheet .club-card .club-card-meta,
#detail-sheet .club-card .club-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0 0 3px 0 !important;
}

#detail-sheet .club-card .meta-chip,
#detail-sheet .club-card .genre-chip {
    display: inline-block;
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1.3;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1.5px solid #1a1a1a;
    color: #1a1a1a;
    white-space: nowrap;
}
#detail-sheet .club-card .meta-chip { background-color: #ffffff; }
#detail-sheet .club-card .meta-date { background-color: #ff8fd4; }
#detail-sheet .club-card .meta-building { background-color: #7fe8ff; }
#detail-sheet .club-card .meta-room { background-color: #b9f6a8; }
#detail-sheet .club-card .genre-chip { background-color: #fff44f; }

/* 押したカード（光らせているマーカーに対応するカード） */
#detail-sheet .club-card.is-focused {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 3px 3px 0 #2563eb !important;
}

#detail-sheet .club-card .club-card-excerpt {
    font-size: 8.5px;
    color: #4a4a4a;
    line-height: 1.5 !important;
    margin: 2px 0 0 0 !important;
    padding: 0;
    overflow-wrap: anywhere;
}

/* ハート（お気に入り） */
#detail-sheet .btn-fav-heart {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid #1a1a1a;
    background: #ffffff;
    color: #cccccc;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 1px 1px 0 #1a1a1a;
    transition: transform 0.1s;
}
#detail-sheet .btn-fav-heart.is-active {
    color: #ff2d95;
    background: #fff0f5;
    border-color: #ff2d95;
    transform: scale(1.1);
}

/* =========================
   SVG INTERACTION
========================= */

svg [id],
svg [data-name] {
    cursor: pointer;
    transition: filter 0.2s;
}

svg [id]:hover,
svg [data-name]:hover {
    filter: brightness(1.15);
}

/* マーカー（n{団体番号}_d.._f.._g.._教室名）の拡大縮小をなめらかに */
svg [id^="n"][id*="_f"][id*="_g"],
svg [data-name^="n"][data-name*="_f"][data-name*="_g"] {
    transition: transform 0.1s ease-out, filter 0.2s;
}

/* マーカーを光らせる演出（data-name だけのマーカーにも効くようにクラスで指定） */
svg .marker-highlight {
    filter: drop-shadow(0 0 6px #2563eb) drop-shadow(0 0 12px #2563eb);
    animation: marker-pulse 1s ease-in-out infinite;
}

@keyframes marker-pulse {
    0% {
        filter: drop-shadow(0 0 4px #2563eb) drop-shadow(0 0 8px #2563eb);
    }
    50% {
        filter: drop-shadow(0 0 10px #2563eb) drop-shadow(0 0 18px #2563eb);
    }
    100% {
        filter: drop-shadow(0 0 4px #2563eb) drop-shadow(0 0 8px #2563eb);
    }
}

/* =========================
   FACILITY（トイレ・喫煙所などのマーク。押しても何もしない）
========================= */

svg .facility-marker,
svg .facility-marker * {
    cursor: default;
}

svg .facility-marker:hover {
    filter: none;
}

svg .facility-marker {
    transition: transform 0.1s ease-out;
}

.filter-facility {
    margin-top: 8px;
    background: #e8f8ff !important;
}

.filter-facility input[type="checkbox"] {
    accent-color: #00a3d9 !important;
}

/* =========================
   LOADING（SVG・企画データの読み込み中表示）
========================= */

.map-loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 8000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid #1a1a1a;
    border-radius: 999px;
    box-shadow: 3px 3px 0 #ff2d95;
    font-size: 14px;
    font-weight: 800;
    color: #1a1a1a;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none; /* 表示中も地図の操作は邪魔しない */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-loading.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.map-loading-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #ffd1e8;
    border-top-color: #ff2d95;
    border-radius: 50%;
    animation: map-loading-spin 0.8s linear infinite;
}

.map-loading.is-error {
    box-shadow: 3px 3px 0 #1a1a1a;
}

.map-loading.is-error .map-loading-spinner {
    display: none;
}

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

/* =========================
   SEARCH TOGGLE（スマホのみ表示）
========================= */

.search-toggle {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #111827;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.search-toggle.is-open {
    background: #111827;
    color: #fff;
}

/* 検索窓を閉じていても検索中なら、ピンクの印を付ける */
.search-toggle.has-query::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff2d95;
    border: 1.5px solid #fff;
}

.search-box::-webkit-search-decoration {
    -webkit-appearance: none;
}

/* =========================
   MOBILE（マップを広く見せるための調整）
========================= */

@media (max-width: 768px) {

    /* 上のUI：高さを詰める */
    .top-ui {
        width: calc(100% - 16px);
        margin-left: 8px;
    }

    .top-select-wrap {
        grid-template-columns: 1fr 1fr 1fr 36px;
        gap: 6px;
        margin-bottom: 6px;
    }

    .top-select {
        height: 36px;
        border-radius: 12px;
        padding: 0 8px;
        font-size: 12px;
        text-align: center;
        text-align-last: center;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    }

    .search-toggle {
        display: flex;
        height: 36px;
    }

    /* 検索窓は虫めがねを押したときだけ出す */
    .search-box {
        display: none;
        height: 40px;
        border-radius: 12px;
        padding: 0 14px;
        font-size: 16px; /* 16px未満だと iPhone で入力時に勝手にズームされる */
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    }

    .top-ui.search-open .search-box {
        display: block;
        animation: search-drop 0.18s ease-out;
    }

    /* 右のボタン：小さくして下にまとめる（拡大縮小はピンチ操作で行う） */
    .zoom-wrap {
        display: none;
    }

    .side-btn {
        right: 10px;
        width: 42px;
        height: 42px;
        border-radius: 14px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
    }

    .side-btn svg {
        width: 19px;
        height: 19px;
    }

    .gps-btn {
        bottom: 80px;
    }

    .center-btn {
        bottom: 130px;
    }

    .filter-toggle {
        bottom: 180px;
    }

    /* 絞り込みパネル：少しコンパクトに */
    .filter-panel {
        bottom: 76px;
        padding: 14px 14px 16px;
        border-radius: 20px;
    }

    .filter-grid {
        gap: 8px;
    }

    .filter-item {
        padding: 9px 10px;
        font-size: 13px;
        border-radius: 12px;
    }

    .filter-fav {
        margin-top: 8px;
    }

    /* カードの上のボタンも少し小さく */
    .sheet-toolbar {
        gap: 8px;
        margin-bottom: 8px;
    }

    .sheet-close-btn,
    .sheet-link-btn {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .map-loading {
        font-size: 13px;
        padding: 10px 16px;
    }
}

@keyframes search-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   LEAFLET OVERRIDES
========================= */

.leaflet-control-attribution,
.leaflet-control-zoom {
    display: none !important;
}
/* =========================
   スマホ用のコンパクト表示（地図を広く見せる）
   ※ PC の見た目は変わりません
========================= */

@media (max-width: 768px) {

    /* 上の検索まわり：高さと余白を詰める
       （上の 80px はサイトのヘッダーぶん。ヘッダーの高さが違うときはここを変える） */
    .top-ui {
        width: calc(100% - 16px);
        margin-left: 8px;
        padding-top: calc(env(safe-area-inset-top) + 80px);
    }

    .top-select-wrap {
        gap: 6px;
        margin-bottom: 6px;
    }

    .top-select {
        height: 34px;
        border-radius: 11px;
        padding: 0 10px;
        font-size: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        /* 右端に小さな▼を付けて、プルダウンだと分かるように */
        background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
                          linear-gradient(135deg, #6b7280 50%, transparent 50%);
        background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
        background-size: 4px 4px, 4px 4px;
        background-repeat: no-repeat;
        padding-right: 20px;
        text-overflow: ellipsis;
    }

    .search-box {
        height: 38px;
        border-radius: 12px;
        padding: 0 14px;
        font-size: 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    /* 右のボタン：小さくして、下ではなく検索欄のすぐ下の右端に縦に並べる
       （下はカードとメニューが出る場所なので、カードとかぶらないように） */
    .side-btn {
        width: 40px;
        height: 40px;
        right: 8px;
        bottom: auto;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    }

    .side-btn svg {
        width: 19px;
        height: 19px;
    }

    .filter-toggle {
        top: calc(env(safe-area-inset-top) + 172px);
    }

    .center-btn {
        top: calc(env(safe-area-inset-top) + 218px);
    }

    .gps-btn {
        top: calc(env(safe-area-inset-top) + 264px);
    }

    /* ＋−ボタンは指でピンチすればいいので、スマホでは出さない */
    .zoom-wrap {
        display: none;
    }

    /* 絞り込みパネル：文字と余白を少し小さく */
    .filter-panel {
        padding: 14px 14px 16px;
        border-radius: 20px;
    }

    .filter-grid {
        gap: 6px;
    }

    .filter-item {
        padding: 9px 10px;
        font-size: 13px;
        border-radius: 11px;
    }

    .filter-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .filter-fav {
        margin-top: 8px;
    }

    .filter-close-btn {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .filter-head {
        margin-bottom: 10px;
    }

    .filter-head-title {
        font-size: 14px;
    }

    .filter-mini-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* カードまわり：ボタンとカードを少し小さく */
    .sheet-toolbar {
        gap: 8px;
        margin-bottom: 6px;
    }

    .sheet-close-btn,
    .sheet-link-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .sheet-link-btn svg {
        width: 15px;
        height: 15px;
    }

    .sheet-inner {
        padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
    }

    .card-carousel {
        gap: 10px;
        padding: 2px 16px 10px;
    }

    #detail-sheet .club-card {
        flex: 0 0 150px;
        width: 150px;
    }

    /* 読み込み中の表示も小さめに */
    .map-loading {
        padding: 9px 16px;
        font-size: 13px;
    }

    .map-loading-spinner {
        width: 15px;
        height: 15px;
    }
}

/* スマホ：プルダウンが長い選択肢（「地下1階（準備中）」など）に合わせて広がり、
   右端の虫めがねボタンが画面からはみ出すのを防ぐ */
@media (max-width: 768px) {
    .top-select-wrap {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.3fr) 36px;
    }

    .top-select {
        min-width: 0;
        width: 100%;
    }
}
/* =========================
   STAGE（ステージのアイコンと時間割のカード）
========================= */

svg .stage-marker {
    transition: transform 0.1s ease-out, filter 0.2s;
}

/* カードの上の見出し（ステージ名・日付） */
.sheet-heading {
    pointer-events: none;
    margin: 0 auto 8px;
    padding: 4px 14px;
    max-width: calc(100% - 32px);
    box-sizing: border-box;
    background: #fffdfb;
    border: 2px solid #1a1a1a;
    border-radius: 999px;
    box-shadow: 2px 2px 0 #ffd400;
    font-size: 13px;
    font-weight: 800;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
}

/* その日に企画が無いとき */
.sheet-empty {
    margin: 0 auto;
    padding: 12px 16px;
    background: #fffdfb;
    border: 2px dashed #1a1a1a;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #4a4a4a;
}

/* 「開催中」「まもなく」「終了」 */
#detail-sheet .club-card .card-status {
    align-self: flex-start;
    margin: 0 0 3px;
    padding: 1px 7px;
    border: 1.5px solid #1a1a1a;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.4;
    color: #1a1a1a;
    background: #fff;
}

#detail-sheet .club-card .card-status[data-status="now"] {
    background: #ff2d95;
    border-color: #ff2d95;
    color: #fff;
    animation: card-status-pulse 1.6s ease-in-out infinite;
}

#detail-sheet .club-card .card-status[data-status="soon"] {
    background: #fff44f;
}

#detail-sheet .club-card .card-status[data-status="ended"] {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #6b7280;
}

@keyframes card-status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 149, 0.5); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 45, 149, 0); }
}

/* 開催中のカードは枠をピンクに */
#detail-sheet .club-card.is-now {
    border-color: #ff2d95;
}

/* 終わった企画は薄く（♥は押せるまま） */
#detail-sheet .club-card.is-ended .club-card-thumb,
#detail-sheet .club-card.is-ended .club-card-body {
    opacity: 0.45;
    filter: grayscale(0.6);
}

#detail-sheet .club-card.is-ended {
    box-shadow: 3px 3px 0 #d1d5db !important;
}

@media (max-width: 768px) {
    .sheet-heading {
        margin-bottom: 6px;
        padding: 3px 12px;
        font-size: 12px;
    }
}
