h3 {
    margin: auto;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    max-height: 80vh;
    transform: translate(-50%, -50%);
    width: min(92%, 420px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.modal-body {
    padding: 8px 16px 16px 16px;
}

.search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.search-result {
    margin-top: 12px;
}

/* 一覧全体 */
.rally-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;

    /* ▼ ここがポイント */
    max-height: 70vh;
    overflow-y: auto;

    padding: 20px 6px;
    scrollbar-gutter: stable;
}

/* Chrome / Edge / Safari */
.rally-list::-webkit-scrollbar {
    width: 6px;
}

.rally-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.rally-list::-webkit-scrollbar-track {
    background: transparent;
}

/* Firefox */
.rally-list {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}


/* 1件カード */
.rally-item {
    display: flex;
    align-items: stretch;
    /* 高さを揃える */
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10),
        0 10px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    border: 1px solid #80808021;
}

.rally-item::last child {
    margin-bottom:
        10px;
}

/* hover */
.rally-item:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 8px 20px rgba(0, 0, 0, 0.08);
}

/* 画像 */
/* 画像ラッパー */
.rally-item-image {
    width: 96px;
    /* 固定幅で左に寄せる */
    height: auto;
    flex-shrink: 0;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
}

/* 画像 */
.rally-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* 余白防止 */
}

/* 情報エリア */
.rally-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 10px 5px;
}

/* 名前 */
.rally-item-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

/* エリア */
.rally-item-info p:nth-of-type(1) {
    font-size: 12px;
    color: #555;
}

/* 日付 */
.rally-item-info p:nth-of-type(2) {
    font-size: 11px;
    color: #888;
}
