/* =======================================================================
   学苑祭 終了通知モーダル（全ページ共通・ヘッダー機能として実装）
   site_settings により有効化された場合のみ表示。
   2026/06/21 13:00 以降は自動表示（管理パネルから強制ON/OFFも可能）。
   ======================================================================= */

.fes_end_overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 35%, rgba(20, 30, 70, 0.78) 0%, rgba(5, 8, 20, 0.92) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.fes_end_overlay.show {
    opacity: 1;
    visibility: visible;
}

.fes_end_card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border-radius: 22px;
    padding: 40px 30px 32px;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(246, 220, 159, 0.10) 0%, transparent 55%),
        linear-gradient(180deg, #0d1530 0%, #0a1128 55%, #070c1d 100%);
    border: 1px solid rgba(246, 220, 159, 0.28);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

.fes_end_overlay.show .fes_end_card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* 上部の星屑装飾 */
.fes_end_stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 22px;
    pointer-events: none;
}

.fes_end_star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.5;
    animation: fesEndTwinkle 3.5s ease-in-out infinite;
}

@keyframes fesEndTwinkle {
    0%, 100% { opacity: 0.15; }
    50%      { opacity: 0.8; }
}

.fes_end_inner {
    position: relative;
    z-index: 2;
}

.fes_end_close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fes_end_close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: rotate(90deg);
}

.fes_end_badge {
    display: inline-block;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.35em;
    text-indent: 0.35em;
    text-transform: uppercase;
    color: rgba(246, 220, 159, 0.75);
    margin-bottom: 14px;
}

/* 上品な金の星章（ロゴ画像の色味がテーマと衝突するため差し替え） */
.fes_end_crest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 2px auto 14px;
    color: #f6dc9f;
}

.fes_end_crest_line {
    width: clamp(40px, 14vw, 64px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(246, 220, 159, 0.6));
}

.fes_end_crest_line:last-child {
    background: linear-gradient(90deg, rgba(246, 220, 159, 0.6), transparent);
}

.fes_end_crest_star {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 8px rgba(246, 220, 159, 0.5));
}

.fes_end_kicker {
    font-family: "Shippori Mincho", serif;
    font-weight: 500;
    font-size: clamp(10px, 2.8vw, 12px);
    letter-spacing: 0.14em;
    color: rgba(232, 224, 212, 0.62);
    margin-bottom: 12px;
}

.fes_end_title {
    font-family: "Zen Old Mincho", serif;
    font-weight: 900;
    font-size: clamp(21px, 5.8vw, 28px);
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: #f6dc9f;
    text-shadow: 0 0 36px rgba(246, 220, 159, 0.25);
    margin-bottom: 16px;
}

.fes_end_msg {
    font-family: "Shippori Mincho", serif;
    font-weight: 500;
    font-size: clamp(13px, 3.4vw, 15px);
    line-height: 2;
    color: rgba(232, 224, 212, 0.85);
    margin-bottom: 22px;
}

.fes_end_divider {
    width: 48px;
    height: 1px;
    margin: 0 auto 22px;
    background: linear-gradient(90deg, transparent, rgba(246, 220, 159, 0.5), transparent);
}

/* 総来場者数 */
.fes_end_count_wrap {
    margin: 0 auto 26px;
    padding: 20px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(246, 220, 159, 0.18);
}

.fes_end_count_label {
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: rgba(232, 224, 212, 0.6);
    margin-bottom: 8px;
}

.fes_end_count_value {
    font-family: "Zen Old Mincho", serif;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 0 30px rgba(160, 190, 255, 0.4);
}

.fes_end_count_value .fes_end_count_num {
    font-size: clamp(38px, 11vw, 56px);
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, #ffffff 0%, #f6dc9f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fes_end_count_value .fes_end_count_unit {
    font-size: clamp(16px, 4vw, 20px);
    color: rgba(246, 220, 159, 0.85);
    margin-left: 4px;
}

/* 集計中（来場者数 未設定）の表示 */
.fes_end_count_pending {
    font-family: "Shippori Mincho", serif;
    font-weight: 600;
    font-size: clamp(18px, 5vw, 24px);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fes_end_count_pending .fes_end_dots {
    display: inline-flex;
    gap: 4px;
}

.fes_end_count_pending .fes_end_dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(246, 220, 159, 0.8);
    animation: fesEndDot 1.4s ease-in-out infinite;
}

.fes_end_count_pending .fes_end_dots span:nth-child(2) { animation-delay: 0.2s; }
.fes_end_count_pending .fes_end_dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fesEndDot {
    0%, 100% { opacity: 0.25; transform: translateY(0); }
    50%      { opacity: 1; transform: translateY(-3px); }
}

.fes_end_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    padding: 14px 28px;
    font-family: "Shippori Mincho", serif;
    font-weight: 600;
    font-size: 15px;
    color: #0a1128;
    background: linear-gradient(135deg, #f6dc9f 0%, #dab584 100%);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 8px 24px rgba(246, 220, 159, 0.25);
}

.fes_end_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(246, 220, 159, 0.35);
}

.fes_end_note {
    margin-top: 16px;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: rgba(232, 224, 212, 0.45);
    line-height: 1.7;
}

@media screen and (max-width: 400px) {
    .fes_end_card {
        padding: 34px 22px 26px;
        border-radius: 18px;
    }
    .fes_end_count_wrap {
        padding: 16px 12px;
    }
}
