.first-shop-guide {
  box-sizing: border-box;
  max-inline-size: min(19rem, calc(100vw - 24px));
  margin: .6rem auto;
  padding: .7rem .9rem;
  border: 1px solid #e6a0f1;
  border-radius: 23px;
  background: linear-gradient(145deg, #fffaff 4%, #fce4f6 58%, #eee3ff);
  color: #4c2273;
  box-shadow: 0 5px 24px #9547b82b, 0 0 0 3px #ffffffb3, inset 0 1px 0 #fff;
  font: inherit;
  font-size: .92rem;
  text-align: start;
}
.shop-page .first-shop-guide { position: sticky; inset-block-start: .6rem; z-index: 30; }
.shop-item.first-shop-target { scroll-margin-block-start: 9rem; }
.first-shop-guide p { margin: 0; line-height: 1.4; font-weight: 750; text-wrap: pretty; }
.first-shop-guide p + p { margin-block-start: .4rem; font-weight: 500; }
.first-shop-actions { display: flex; justify-content: flex-end; gap: .45rem; margin-block-start: .25rem; }
.first-shop-action {
  width: auto;
  min-block-size: 44px;
  padding: .35rem .8rem;
  border: 1px solid #ba7ad4;
  border-radius: 999px;
  background: linear-gradient(#fff, #f4e7ff);
  box-shadow: 0 2px 5px #6a358a14;
  color: #653084;
  font: inherit;
  font-size: .84em;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.first-shop-action:hover { background: #eddbff; }
.first-shop-action:disabled { opacity: .55; cursor: wait; }
.first-shop-invitation { position: fixed; inline-size: min(280px, calc(100vw - 24px)); margin: 0; z-index: 100; }
.first-shop-invitation::after { content: ""; position: absolute; left: calc(var(--first-shop-arrow-x, 50%) - 7px); bottom: -7px; width: 12px; height: 12px; background: #f3e3fb; border-right: 1px solid #e6a0f1; border-bottom: 1px solid #e6a0f1; transform: rotate(45deg); pointer-events: none; }
.first-shop-compact { inline-size: min(232px, calc(100vw - 24px)); padding: .5rem .7rem; font-size: .8rem; }
.first-shop-target { outline: 3px solid #d45dd9; outline-offset: 4px; border-radius: 16px; }
.first-shop-pulse { animation: firstShopBreathe 1.1s ease-in-out 3; }
.first-shop-pointer { position: fixed; z-index: 101; font-size: 32px; line-height: 1; width: 40px; text-align: center; filter: drop-shadow(0 2px 4px #a351b34d); pointer-events: none; user-select: none; animation: firstShopPoint 1.1s ease-in-out 3; }
.first-shop-guide button:focus-visible, .shop-item[role="button"]:focus-visible { outline: 3px solid #692d86; outline-offset: 4px; }
.shop-page .shop-item.owned::after { content: none; }
.shop-owned-badge { position: absolute; inset-block-start: .4rem; inset-inline-end: .4rem; z-index: 1; display: inline-block; margin: .35rem .5rem; padding: .2rem .6rem; border-radius: 999px; background: linear-gradient(135deg, #d9ffe8, #c5f2ed); color: #145c40; font-size: .8rem; font-weight: 800; box-shadow: 0 2px 7px #14664821; }
.shop-owned-hint { display: block; margin-block: .35rem; color: #fff; text-shadow: 0 1px 3px #3b195c; font-size: .85rem; font-weight: 700; }
@keyframes firstShopBreathe { 50% { transform: scale(1.025); box-shadow: 0 0 0 6px #ed83bc40, 0 0 18px #e97bcb55; } }
@keyframes firstShopPoint { 50% { transform: translateY(4px) scale(1.06); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .first-shop-pulse, .first-shop-pointer { animation: none; } }

/* One non-modal unlock, only on the card confirmed owned by the server. */
body.shop-page .shop-grid .shop-item.first-shop-collected { cursor: default; }
.shop-item.first-shop-unlock-pending .shop-item-icon img { filter: grayscale(1) blur(2px); opacity: .7; transition: none; }
.first-shop-unlock-pending .shop-owned-badge { visibility: hidden; }
.shop-item.first-shop-unlocking { animation: firstShopUnlock 1s cubic-bezier(.2,.8,.3,1); }
.first-shop-unlocking .shop-item-icon img { animation: firstShopUnlockColor 1s ease-out both; }
.first-shop-unlocking .shop-owned-badge { animation: firstShopUnlockBadge 1s ease-out both; }
.shop-page .shop-item.first-shop-unlocking::after { content: "✨"; position: absolute; inset: 16% 0 auto; font-size: 3rem; background: none; box-shadow: none; pointer-events: none; animation: firstShopUnlockSparkle 1s ease-out both; }
@keyframes firstShopUnlock { 0% { transform: scale(1); } 55% { transform: scale(1.08) rotate(-1deg); box-shadow: 0 0 0 6px #f8df92aa, 0 0 45px #ed83bccc; } 100% { transform: scale(1.05); } }
@keyframes firstShopUnlockColor { 0%, 12% { filter: grayscale(1) blur(2px); opacity: .7; } 65%, 100% { filter: none; opacity: 1; } }
@keyframes firstShopUnlockBadge { 0%, 50% { opacity: 0; } 100% { opacity: 1; } }
@keyframes firstShopUnlockSparkle { 0% { opacity: 0; transform: translateY(15px) scale(.5); } 45% { opacity: 1; } 100% { opacity: 0; transform: translateY(-35px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .shop-item.first-shop-unlocking, .first-shop-unlocking .shop-item-icon img, .first-shop-unlocking .shop-owned-badge, .shop-page .shop-item.first-shop-unlocking::after { animation: none; }
  .shop-page .shop-item.first-shop-unlocking::after { content: none; }
}


/* First eligible Home visit spotlight */
.first-shop-spotlight-shade {
    position: fixed;
    z-index: 2147480000;
    background: rgba(6, 8, 29, .86);
    pointer-events: auto;
}

body.first-shop-home-spotlight .first-shop-invitation {
    z-index: 2147481000;
    border: 2px solid #ffd6f7;
    box-shadow:
        0 14px 42px rgba(0, 0, 0, .35),
        0 0 0 3px rgba(255, 255, 255, .9),
        0 0 26px rgba(255, 118, 221, .5);
}

body.first-shop-home-spotlight .first-shop-pointer {
    z-index: 2147481100;
    animation: firstShopPoint 1.15s ease-in-out infinite;
}

body.first-shop-home-spotlight .first-shop-target {
    outline: 4px solid #fff;
    outline-offset: 5px;
    animation: firstShopBreathe 1.3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    body.first-shop-home-spotlight .first-shop-pointer,
    body.first-shop-home-spotlight .first-shop-target {
        animation: none;
    }
}


/* Home spotlight polish override */
.first-shop-spotlight-shade {
    background: rgba(10, 12, 34, .74);
    backdrop-filter: blur(2px);
}

body.first-shop-home-spotlight .first-shop-invitation {
    inline-size: min(340px, calc(100vw - 24px));
    max-inline-size: min(340px, calc(100vw - 24px));
    padding: .95rem 1rem .9rem;
    border: 2px solid #e9a8f5;
    border-radius: 26px;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,.92), rgba(255,255,255,0) 42%),
        linear-gradient(145deg, #fff9fe 0%, #fde8f7 55%, #efe4ff 100%);
    box-shadow:
        0 16px 46px rgba(17, 16, 46, .32),
        0 0 0 4px rgba(255,255,255,.72),
        0 0 30px rgba(255, 131, 225, .26);
    color: #4d256f;
}

body.first-shop-home-spotlight .first-shop-invitation::after {
    width: 16px;
    height: 16px;
    left: calc(var(--first-shop-arrow-x, 50%) - 8px);
    bottom: -9px;
    background: #f6e5fb;
    border-right: 2px solid #e9a8f5;
    border-bottom: 2px solid #e9a8f5;
}

body.first-shop-home-spotlight .first-shop-invitation p {
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: .01em;
    text-wrap: balance;
}

body.first-shop-home-spotlight .first-shop-actions {
    margin-block-start: .65rem;
}

body.first-shop-home-spotlight .first-shop-action {
    min-block-size: 42px;
    padding: .42rem .95rem;
    border: 1px solid #c987e2;
    border-radius: 999px;
    background: linear-gradient(180deg, #fffdfd 0%, #f7e8ff 100%);
    box-shadow: 0 4px 14px rgba(118, 54, 152, .12);
    color: #7a3d9e;
    font-size: .82rem;
    font-weight: 800;
}

body.first-shop-home-spotlight .first-shop-action:hover {
    background: linear-gradient(180deg, #fff 0%, #efd9ff 100%);
}

body.first-shop-home-spotlight .first-shop-target {
    border-radius: 22px;
    outline: 4px solid rgba(255,255,255,.96);
    outline-offset: 6px;
    box-shadow:
        0 0 0 8px rgba(255, 138, 232, .22),
        0 0 26px rgba(255, 116, 211, .42),
        0 10px 24px rgba(0,0,0,.18);
    animation: firstShopBreathePolished 1.45s ease-in-out infinite;
}

body.first-shop-home-spotlight .first-shop-pointer {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 30%, rgba(255,255,255,.98), rgba(255,255,255,.88) 42%, rgba(255,236,248,.94) 72%, rgba(245,208,255,.92) 100%);
    box-shadow:
        0 10px 24px rgba(20, 10, 38, .22),
        0 0 0 4px rgba(255,255,255,.45),
        0 0 22px rgba(255, 129, 218, .28);
    font-size: 34px;
    line-height: 1;
    animation: firstShopPointerPolished 1.45s ease-in-out infinite;
    transform-origin: center center;
}

body.first-shop-home-spotlight .first-shop-pointer::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(255,171,231,.32) 0%, rgba(255,171,231,.08) 55%, rgba(255,171,231,0) 72%);
    z-index: -1;
}

@keyframes firstShopBreathePolished {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 8px rgba(255, 138, 232, .18),
            0 0 20px rgba(255, 116, 211, .24),
            0 10px 24px rgba(0,0,0,.16);
    }
    50% {
        transform: scale(1.04);
        box-shadow:
            0 0 0 12px rgba(255, 138, 232, .24),
            0 0 34px rgba(255, 116, 211, .42),
            0 12px 28px rgba(0,0,0,.2);
    }
}

@keyframes firstShopPointerPolished {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(5px) scale(1.08);
        opacity: .96;
    }
}

@media (min-width: 900px) {
    body.first-shop-home-spotlight .first-shop-invitation {
        inline-size: min(390px, calc(100vw - 32px));
        max-inline-size: min(390px, calc(100vw - 32px));
        padding: 1.05rem 1.15rem 1rem;
    }

    body.first-shop-home-spotlight .first-shop-invitation p {
        font-size: 1.06rem;
    }
}

@media (max-width: 420px) {
    body.first-shop-home-spotlight .first-shop-invitation {
        inline-size: min(300px, calc(100vw - 18px));
        max-inline-size: min(300px, calc(100vw - 18px));
        padding: .82rem .82rem .8rem;
        border-radius: 22px;
    }

    body.first-shop-home-spotlight .first-shop-invitation p {
        font-size: .93rem;
    }

    body.first-shop-home-spotlight .first-shop-pointer {
        width: 58px;
        height: 58px;
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.first-shop-home-spotlight .first-shop-target,
    body.first-shop-home-spotlight .first-shop-pointer {
        animation: none;
    }
}

/* Keep the real Shop link stable for reliable clicks. Animate its halo instead. */
body.first-shop-home-spotlight .first-shop-target {
    animation: none !important;
    transform: none !important;
}

body.first-shop-home-spotlight .first-shop-target::before {
    content: "";
    position: absolute;
    inset: -8px;
    border: 3px solid rgba(255, 160, 230, .7);
    border-radius: inherit;
    pointer-events: none;
    animation: firstShopHaloPulse 1.45s ease-in-out infinite;
}

@keyframes firstShopHaloPulse {
    0%, 100% {
        opacity: .45;
        box-shadow: 0 0 0 3px rgba(255, 130, 220, .15);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 8px rgba(255, 130, 220, .25);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.first-shop-home-spotlight .first-shop-target::before {
        animation: none;
    }
}