/* 更新履歴はページ最下部（フッター直前）に表示する */
body {
    display: flex;
    flex-direction: column;
}

body > * {
    order: 0;
}

body > .update-history-section {
    order: 998;
}

body > .footer {
    order: 999;
}

.update-history-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--color-bg-primary) 0%, #0a0a0f 100%);
    position: relative;
    overflow: hidden;
}

.update-history-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 0%, rgba(212, 175, 55, 0.09), transparent 34%), radial-gradient(circle at 82% 12%, rgba(212, 175, 55, 0.06), transparent 30%);
    pointer-events: none;
}

.update-history-section .container {
    position: relative;
    z-index: 1;
}

.update-history-summary {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.update-history-heading {
    margin: 0;
}

.update-history-lead {
    max-width: 860px;
    margin: 2rem auto 0;
}

.update-history-list {
    max-width: 980px;
    margin: 2.5rem auto 0;
    border-top: 1px solid rgba(212, 175, 55, 0.28);
}

.update-item {
    position: relative;
    padding: 1.35rem 0 1.35rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.update-item::before {
    content: "";
    position: absolute;
    top: 1.68rem;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d4af37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.update-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    margin-bottom: 0.45rem;
}

.update-meta time,
.update-date-text {
    color: #f4d03f;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.94rem;
}

.update-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.15rem 0.65rem;
    border: 1px solid rgba(212, 175, 55, 0.42);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    color: #f7e2a0;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.update-title {
    margin: 0 0 0.55rem;
    color: var(--color-text-primary, #fff);
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.55;
    font-weight: 700;
}

.update-description {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.94rem;
    line-height: 1.85;
}

.update-description p {
    margin: 0;
}

/* JavaScript有効時のみ、本文を項目ごとの＋で開閉する */
.update-history-section.is-enhanced .update-item.has-item-accordion > .update-meta,
.update-history-section.is-enhanced .update-item.has-item-accordion > .update-title {
    display: none;
}

.update-item-toggle {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: -0.35rem 0 0.75rem;
    padding: 0.35rem 0.45rem 0.35rem 0;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
}

.update-item-toggle:hover,
.update-item-toggle:focus-visible {
    background: rgba(212, 175, 55, 0.08);
    outline: 1px solid rgba(244, 208, 63, 0.45);
    transform: translateY(-1px);
}

.update-item-heading {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.update-item-toggle .update-meta {
    margin-bottom: 0.45rem;
}

.update-item-toggle .update-title {
    display: block;
    margin: 0;
}

.update-item-plus {
    align-items: center;
    background: linear-gradient(90deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 999px;
    color: #111;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 1.2rem;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    line-height: 1;
    margin-top: 0.2rem;
    width: 32px;
}

.update-history-section.is-enhanced .update-item.is-description-collapsed .update-description,
.update-description[hidden] {
    display: none;
}

.update-history-actions {
    text-align: center;
    margin-top: 2rem;
}

.update-history-toggle {
    appearance: none;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 999px;
    background: linear-gradient(90deg, #d4af37 0%, #f4d03f 100%);
    color: #111;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 48px;
    padding: 0.85rem 1.6rem;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.update-history-toggle:hover,
.update-history-toggle:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.32);
    outline: none;
}

.update-history-toggle[hidden] {
    display: none;
}

.update-history-floating-close {
    appearance: none;
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1000;
    border: 1px solid rgba(244, 208, 63, 0.72);
    border-radius: 999px;
    background: linear-gradient(90deg, #d4af37 0%, #f4d03f 100%);
    color: #111;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 48px;
    padding: 0.85rem 1.35rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38), 0 10px 28px rgba(212, 175, 55, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.update-history-floating-close:hover,
.update-history-floating-close:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.44), 0 14px 34px rgba(212, 175, 55, 0.38);
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
}

.update-history-floating-close[hidden] {
    display: none;
}

.update-history-section.is-latest-collapsed .update-item:nth-of-type(n+6) {
    display: none;
}

@media (max-width: 768px) {
    .update-history-section {
        padding: 3.25rem 0;
    }

    .update-history-list {
        margin-top: 2rem;
    }

    .update-item {
        padding: 1.2rem 0 1.2rem 1.15rem;
    }

    .update-item::before {
        top: 1.5rem;
        width: 7px;
        height: 7px;
    }

    .update-item-toggle {
        gap: 0.8rem;
        padding-right: 0.25rem;
    }

    .update-title {
        font-size: 1rem;
    }

    .update-item-plus {
        flex-basis: 30px;
        font-size: 1.1rem;
        height: 30px;
        width: 30px;
    }

    .update-description {
        font-size: 0.92rem;
        line-height: 1.8;
        overflow-wrap: anywhere;
    }

    .update-history-toggle {
        width: 100%;
        max-width: 360px;
    }

    .update-history-floating-close {
        left: max(1rem, env(safe-area-inset-left));
        right: max(1rem, env(safe-area-inset-right));
        width: auto;
        padding: 0.85rem 1rem;
    }
}
