html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
}

/* 店名ラベルマーカー */
.shop-name-marker {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.1s;
}

.shop-name-marker:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.shop-name-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-name-distance {
    font-size: 10px;
    color: #93c5fd;
    flex-shrink: 0;
}

/* 店舗サムネイルモーダル */
.shop-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.shop-modal.show {
    opacity: 1;
    visibility: visible;
}

.shop-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.shop-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.shop-modal-close:hover {
    color: #000;
}

.shop-modal-name {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.shop-modal-thumb-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.shop-modal-thumb {
    max-width: 100%;
    max-height: 50vh;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

.shop-modal-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.shop-modal-thumb-wrapper:hover .shop-modal-play {
    opacity: 1;
}

.shop-modal-play::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}


/* ハイライト用ツールチップ */
.shop-tooltip-highlight {
    background: #2563eb !important;
    font-weight: bold !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
}
.shop-tooltip-highlight::before {
    border-top-color: #2563eb !important;
}

/* トースト */
#toast {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#toast.show {
    opacity: 1;
}

/* 店舗グループ（サムネイルリスト用） */
.shop-group {
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.shop-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f3f4f6;
    cursor: pointer;
    transition: background 0.2s;
}

.shop-group-header:hover {
    background: #e5e7eb;
}

.shop-group-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.shop-group-count {
    font-size: 11px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

.shop-group-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.shop-group-thumbs::-webkit-scrollbar {
    height: 4px;
}

.shop-group-thumbs::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 2px;
}

.shop-group-thumbs::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 2px;
}

.shop-thumb-item {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.shop-thumb-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.shop-thumb-item img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    display: block;
}

/* 詳細表示の店舗情報パネル */
#detail-info {
    scrollbar-width: thin;
}

#detail-info::-webkit-scrollbar {
    width: 4px;
}

#detail-info::-webkit-scrollbar-track {
    background: #f3f4f6;
}

#detail-info::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* 詳細表示のサムネイルコンテナ */
#detail-thumb-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#detail-thumb-container::-webkit-scrollbar {
    display: none;
}

/* 詳細表示のサムネイルアイテム */
.detail-thumb-item {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
}

.detail-thumb-item:hover {
    transform: scale(1.03);
}

.detail-thumb-item.selected {
    border-color: #2563eb;
}

.detail-thumb-item img {
    height: calc(33vh - 40px);
    width: auto;
    display: block;
}

.detail-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.detail-thumb-item:hover .detail-thumb-play {
    opacity: 1;
}

.detail-thumb-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

/* ===========================================
   サムネイルクロップ（YouTubeショート対応）
   元画像480x360から中央200x360を切り出し
   =========================================== */

.thumbnail-crop {
    aspect-ratio: 200 / 360;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ===========================================
   カルーセル（横スクロール店舗リスト）
   =========================================== */

#shop-carousel {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* PC版ドラッグスクロール対応 */
    user-select: none;
    -webkit-user-select: none;
}

#shop-carousel::-webkit-scrollbar {
    display: none;
}

#shop-carousel img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* 店舗カード */
.shop-card {
    flex-shrink: 0;
    position: relative;
    width: 130px;
    height: calc(33vh - 16px);
    cursor: pointer;
    snap-align: start;
    transition: transform 0.2s;
}

.shop-card:hover {
    transform: scale(1.03);
}

.shop-card:active {
    transform: scale(0.98);
}

/* スタックカード（複数動画時の重なり表現） */
.shop-card-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 32px);
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 3枚目（最背面） */
.shop-card-stack.stack-3 {
    transform: translate(8px, -8px);
    z-index: 1;
}

/* 2枚目（中間） */
.shop-card-stack.stack-2 {
    transform: translate(4px, -4px);
    z-index: 2;
}

/* 1枚目（最前面） */
.shop-card-stack.stack-1 {
    transform: translate(0, 0);
    z-index: 3;
}

.shop-card-stack img {
    width: 100%;
    height: 100%;
    /* thumbnail-cropのaspect-ratioを上書き */
    aspect-ratio: unset;
}

/* 店舗情報エリア */
.shop-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    z-index: 10;
}

.shop-card-name {
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 4px;
}

/* 動画数バッジ */
.shop-card-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.shop-card-badge.single {
    background: #6b7280;
}

/* カルーセル空状態 */
.carousel-empty {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
}

/* 現在位置ボタン */
.location-btn {
    width: 30px;
    height: 30px;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.location-btn:hover {
    background: #f4f4f4;
}

.location-btn.active {
    background: #2563eb;
}

.location-btn.active svg {
    fill: white;
}

/* 現在位置の人アイコンマーカー */
.location-person-icon {
    background: none !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-person-inner {
    width: 32px;
    height: 32px;
    background: #2563eb;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: location-pulse 2s ease-in-out infinite;
}

.location-person-inner svg {
    width: 18px;
    height: 18px;
    fill: white;
}

@keyframes location-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 12px rgba(37, 99, 235, 0); }
}

/* 現在位置の精度円 */
.location-accuracy-circle {
    fill: rgba(37, 99, 235, 0.1);
    stroke: rgba(37, 99, 235, 0.3);
    stroke-width: 1;
}
