.key-icon2 {
    width: min(200px, 28vw);
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 0;
    /* ここでtransformも初期値を固定！（↓でOK） */
    transform: translateY(-44vh) rotate(-45deg) scale(1.7);
    filter: none;
    transition: none;
}

@keyframes keyDrop {
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1.2);
    }
}

@keyframes keyFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(1.2);
    }

    50% {
        transform: translateY(6px) rotate(-15deg) scale(1.2);
    }

    100% {
        transform: translateY(0) rotate(-90deg) scale(1.2);
    }
}

.key-icon2.burst {
    animation: keyBurst .55s cubic-bezier(.36, 1.3, .64, 1) forwards;
}

@keyframes keyBurst {
    0% {
        filter: none;
        opacity: 1;
        transform: scale(1.2) rotate(-90deg);
    }

    30% {
        filter: brightness(2) drop-shadow(0 0 20px gold);
        opacity: 1;
    }

    100% {
        filter: blur(10px);
        opacity: 0;
        transform: scale(2.5) rotate(-90deg);
    }
}

@keyframes keyTotal {
    0% {
        opacity: 0;
        filter: none;
        transform: translateY(-44vh) rotate(-45deg) scale(1.7);
    }

    12% {
        opacity: 1;
    }

    65% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translateY(0) rotate(-135deg) scale(1.2);
    }

    90% {
        opacity: 1;
        filter: brightness(2) drop-shadow(0 0 24px gold);
    }

    100% {
        filter: blur(10px);
        opacity: 0;
        transform: scale(2.2) rotate(-135deg);
    }
}

.key-icon2.anim {
    opacity: 1;
    animation: keyTotal 2.1s cubic-bezier(.18, .85, .4, 1.1) both;
}

.key-particles {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
}

.key-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fffbe9 60%, #fd0 100%);
    opacity: 0;
    transform: scale(0.6);
}

.key-particles.show span {
    animation: particle-burst 0.8s ease-out forwards;
}

.key-particles.show {
    opacity: 1;
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }

    100% {
        opacity: 0;
        transform: scale(2.4) translate(var(--tx), var(--ty));
    }
}

#unlockOverlay.unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(0, 0, 0, .92) 0%, #000 70%);
    gap: 5vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity .6s ease;
}

#unlockOverlay.unlock-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.unlock-message {
    font-size: clamp(38px, 4vw, 52px);
    margin-bottom: 90px;
    font-weight: bold;
    color: #fff8e0;
    text-shadow: 0 2px 10px #e0ba54, 0 0 30px #ad5600;
    letter-spacing: 2px;
    margin-bottom: 32px;
    opacity: 0;
    text-align: center;
    z-index: 10;
    animation: msgIn .7s ease forwards 2.1s;
}

@keyframes msgIn {
    to {
        opacity: 1;
    }
}

.key-icon2 {
    width: min(200px, 28vw);
    height: auto;
    display: block;
    object-fit: contain;
    /* ここ大事 */
}

.unlock-songinfo {
    position: absolute;
    left: 50%;
    top: 54%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1.4rem 2.2rem;
    border: 0px solid #d89f4c;
    border-radius: 1rem;
    background: rgba(0, 0, 0, .7);
    box-shadow: 0 0 18px #000a, 0 0 22px #d89f4c14 inset;
    opacity: 0;
    transition: opacity .6s, transform .6s;
    gap: 1.6rem;
    padding: 0.7rem 1.1rem;
    min-width: 260px;
    max-width: 92vw;
}

.unlock-songinfo.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
}

.unlock-banner-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.2rem;
}

#unlockBanner {
    width: 300px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.4em;
    box-shadow: 0 2px 18px #0006;
}

.unlock-song-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#unlockGenre, #unlockArtist {
    font-size: clamp(16px, 1.8vw, 24px);
    opacity: .89;
}

#unlockTitle {
    font-size: clamp(22px, 2.6vw, 32px);
    font-weight: bold;
    margin: 0.1em 0 0.18em 0;
    text-align: center;
}

body:not([data-theme="dark"]) .unlock-songinfo,
html:not([data-theme="dark"]) .unlock-songinfo {
    color: #ffffff;
}

body:not([data-theme="dark"]) #unlockTitle {
    color: #ffffff;
    /* しっかり濃い茶系 */
}

body:not([data-theme="dark"]) #unlockGenre {
    color: #ffffff;
}

body:not([data-theme="dark"]) #unlockArtist {
    color: #ffffff;
}