/* The cards a collector wears (#1065, worn-cards.js): an Acrylic Keychain on the wallet's ring, pins and patches
   on the profile card. */

.wallet-fob.is-keychain {
    right: auto;
    left: 150px;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The desk reaches further down under a hung keychain, as it does under the watch. */
.wallet-desk:has(.wallet-keychain-charm) {
    padding-bottom: 130px;
}

.wallet-fob.is-keychain .pocket-watch-chain {
    width: 10px;
    height: auto;
}

.wallet-keychain-ring {
    width: 30px;
    height: 30px;
    margin-top: -4px;
    padding: 0;
    border: 4px solid #b9bec6;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1px #5b6068, 0 0 0 1px #5b6068, 0 2px 3px rgb(0 0 0 / 0.35);
    cursor: pointer;
}

.wallet-keychain-ring:hover,
.wallet-keychain-ring:focus-visible {
    border-color: #e1e4e8;
    outline: none;
}

.wallet-fob.is-keychain.is-empty .wallet-keychain-ring {
    border-style: dashed;
    opacity: 0.75;
}

.wallet-keychain {
    display: block;
    margin-top: -6px;
    transform-origin: 50% 0;
}

/* Clear acrylic around the art: a thick see-through rim, a gloss across it and the hole the ring goes through. */
.wallet-keychain-charm {
    position: relative;
    display: block;
    width: 84px;
    padding: 7px;
    border-radius: 12px;
    background: rgb(255 255 255 / 0.28);
    border: 1px solid rgb(255 255 255 / 0.7);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12), 0 4px 8px rgb(0 0 0 / 0.3);
    transform-origin: 50% 0;
}

.wallet-keychain-charm::before {
    content: "";
    position: absolute;
    top: 3px;
    left: calc(50% - 4px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(0 0 0 / 0.25);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6);
    z-index: 2;
}

.wallet-keychain-charm::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(125deg, rgb(255 255 255 / 0.55) 0%, rgb(255 255 255 / 0) 35%, rgb(255 255 255 / 0) 70%, rgb(255 255 255 / 0.25) 100%);
    pointer-events: none;
    z-index: 2;
}

.wallet-keychain-charm img {
    display: block;
    width: 100%;
    margin-top: 6px;
    border-radius: 6px;
}

.wallet-keychain-charm.is-arriving {
    animation: worn-keychain-arrives 900ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes worn-keychain-arrives {
    0% { transform: translateY(-60px) rotate(0deg); opacity: 0; }
    35% { transform: translateY(4px) rotate(14deg); opacity: 1; }
    55% { transform: translateY(0) rotate(-10deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0deg); }
}

/* The pins on a profile card. */
.profile-card-pins {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.profile-card-pins[hidden] {
    display: none;
}

.profile-pin {
    display: block;
    width: 44px;
    filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.4));
    transition: transform 0.15s ease;
}

.profile-pin:hover,
.profile-pin:focus-visible {
    transform: translateY(-2px) rotate(-4deg);
}

.profile-pin img {
    display: block;
    width: 100%;
    border-radius: 6px;
}

.profile-pin.is-arriving {
    animation: worn-pin-pressed 520ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes worn-pin-pressed {
    0% { transform: scale(1.6) rotate(-18deg); opacity: 0; filter: drop-shadow(0 14px 10px rgb(0 0 0 / 0.3)); }
    60% { transform: scale(0.92) rotate(3deg); opacity: 1; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.5)); }
    100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.4)); }
}

.profile-pins-button[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .wallet-keychain-charm.is-arriving,
    .profile-pin.is-arriving {
        animation: none;
    }

    .profile-pin {
        transition: none;
    }
}
