/* 手機螢幕示意（共用：主頁第 01 步、立體導覽頁）：.join-screen 以 matrix3d 貼合顧客手機螢幕、.join-qr 貼合店員手機 QR */
.join-ui { position: absolute; inset: 0; pointer-events: none; transition: transform .8s var(--ease); }
.join-screen {
    position: absolute; left: 0; top: 0; width: 300px; height: 600px; transform-origin: 0 0; visibility: hidden;
    overflow: hidden; border-radius: 20px; background: #fefefc; line-height: 1.2;
}
.join-screen.ready, .join-qr.ready { visibility: visible; }
.join-screen > * { position: absolute; }

/* 與底圖相同的版面：上緣米色狀態列、瀏海、右上掃碼、LINE 綠圈、灰色人像 */
.jn-band { left: 0; right: 0; top: 0; height: 74px; background: linear-gradient(#f7dbbd 80%, #f0dfc6); }
.jn-notch { left: 28%; width: 44%; top: 0; height: 20px; border-radius: 0 0 12px 12px; background: #8f857d; }
.jn-scan {
    left: 232px; top: 90px; width: 46px; height: 46px; overflow: visible;
    fill: none; stroke: #5c544e; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
    transition: transform .2s, stroke .3s;
}
.jn-ring {
    left: 42px; top: 114px; width: 216px; height: 216px; border-radius: 50%; border: 40px solid #66b08f;
    display: grid; place-items: center;
}
.jn-ring b { font-size: 50px; font-weight: 900; color: #54a682; letter-spacing: .02em; }
.jn-user { left: 0; right: 0; top: 387px; height: 143px; transform-origin: 150px 0; transition: transform .5s var(--ease); }
.jn-user i { position: absolute; background: #b0a69f; }
.jn-head { left: 117px; top: 0; width: 66px; height: 66px; border-radius: 50%; }
.jn-body { left: 95px; top: 88px; width: 110px; height: 55px; border-radius: 55px 55px 10px 10px; }

/* 加好友徽章：+（綠）→ ✓（橘） */
.jn-user .jn-badge {
    left: 160px; top: 38px; width: 40px; height: 40px; border-radius: 50%; background: #3f9a6e;
    box-shadow: 0 0 0 5px #fefefc; display: grid; place-items: center; color: #fff;
    transform: scale(0); transition: transform .4s var(--ease), background .3s;
}
.jn-badge b { grid-area: 1 / 1; font-size: 30px; font-weight: 900; line-height: 1; transition: opacity .3s; }
.jn-badge b + b { opacity: 0; font-size: 24px; }

/* 人像下方的文字：加入好友 → 參與活動 */
.jn-label {
    left: 50%; top: 498px; translate: -50% 0; display: grid; padding: 12px 30px; border-radius: 40px;
    background: #3f9a6e; color: #fff; white-space: nowrap; box-shadow: 0 6px 14px rgba(63, 154, 110, .3);
    opacity: 0; transform: translateY(16px) scale(.85); transition: opacity .35s, transform .45s var(--ease), background .35s, box-shadow .35s;
}
.jn-label b { grid-area: 1 / 1; font-size: 42px; font-weight: 900; text-align: center; transition: opacity .35s; }
.jn-label b + b { opacity: 0; }

.join-screen[data-state="friend"] .jn-user,
.join-screen[data-state="join"] .jn-user { transform: translateY(-34px) scale(.9); }
.join-screen[data-state="friend"] .jn-badge,
.join-screen[data-state="join"] .jn-badge { transform: scale(1); }
.join-screen[data-state="friend"] .jn-label,
.join-screen[data-state="join"] .jn-label { opacity: 1; transform: none; }
.join-screen[data-state="join"] .jn-badge,
.join-screen[data-state="join"] .jn-label { background: #dc6c45; }
.join-screen[data-state="join"] .jn-label { box-shadow: 0 6px 14px rgba(220, 108, 69, .35); animation: jn-pop .45s var(--ease); }
.join-screen[data-state="join"] .jn-badge b:first-child,
.join-screen[data-state="join"] .jn-label b:first-child { opacity: 0; }
.join-screen[data-state="join"] .jn-badge b + b,
.join-screen[data-state="join"] .jn-label b + b { opacity: 1; }
@keyframes jn-pop { 40% { transform: scale(1.12); } }

/* 聚光：螢幕變暗，只留右上角掃碼圖示 */
.jn-spot {
    inset: 0; opacity: 0; transition: opacity .45s;
    background: radial-gradient(circle at 255px 113px, transparent 0 38px, rgba(25, 32, 28, .62) 46px);
}
.jn-halo {
    left: 217px; top: 75px; width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff;
    opacity: 0; transition: opacity .3s;
}
.join-screen[data-state="spot"] .jn-spot,
.join-screen[data-state="tap"] .jn-spot { opacity: 1; }
.join-screen[data-state="spot"] .jn-halo { opacity: 1; animation: jn-halo 1s ease-in-out infinite; }
@keyframes jn-halo { 50% { transform: scale(1.18); opacity: .55; } }

/* 假裝點擊：圖示按下＋波紋 */
.jn-tap { left: 225px; top: 83px; width: 60px; height: 60px; border-radius: 50%; background: rgba(255, 255, 255, .8); opacity: 0; transform: scale(0); }
.join-screen[data-state="tap"] .jn-scan { transform: scale(.82); stroke: #3f9a6e; }
.join-screen[data-state="tap"] .jn-tap { animation: jn-tap .5s ease-out forwards; }
@keyframes jn-tap { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.9); } }
.join-screen[data-state="scan"] .jn-scan { stroke: #3f9a6e; animation: jn-blink .5s ease-in-out infinite alternate; }
@keyframes jn-blink { to { opacity: .35; } }

/* 店員手機 QR：掃描框＋掃描線 */
.join-qr { position: absolute; left: 0; top: 0; width: 200px; height: 200px; transform-origin: 0 0; visibility: hidden; }
.jq-frame { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.jq-frame i { position: absolute; width: 46px; height: 46px; border: 0 solid #3f9a6e; }
.jq-frame i:nth-child(1) { left: 0; top: 0; border-width: 9px 0 0 9px; border-radius: 14px 0 0 0; }
.jq-frame i:nth-child(2) { right: 0; top: 0; border-width: 9px 9px 0 0; border-radius: 0 14px 0 0; }
.jq-frame i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 9px 9px; border-radius: 0 0 0 14px; }
.jq-frame i:nth-child(4) { right: 0; bottom: 0; border-width: 0 9px 9px 0; border-radius: 0 0 14px 0; }
.jq-line {
    position: absolute; left: 8%; right: 8%; top: 8%; height: 12px; border-radius: 6px; opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(63, 154, 110, .95) 20%, rgba(63, 154, 110, .95) 80%, transparent);
    box-shadow: 0 0 16px 6px rgba(63, 154, 110, .4);
}
.join-qr.scanning .jq-frame { opacity: 1; animation: jq-in .35s var(--ease); }
.join-qr.scanning .jq-line { opacity: 1; animation: jq-scan .7s ease-in-out 2 alternate; }
@keyframes jq-in { from { transform: scale(1.25); opacity: 0; } }
@keyframes jq-scan { from { top: 8%; } to { top: 86%; } }

/* 點示意圖加入 LINE（line-join.js）：平板／手機直接開 LINE 加好友；桌面淡入 QR Code 10 秒，點 QR 才開新分頁 */
.join-link { position: absolute; inset: 0; z-index: 2; border-radius: 14px; }
.join-link:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; }
.join-pop {
    position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    gap: 6px; padding: 0 6% 6%; background: rgba(253, 246, 234, .94); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.join-pop.show { opacity: 1; visibility: visible; }
.join-pop__qr {
    display: block; width: 52%; padding: 2.5%; border-radius: 14px; background: #fff;
    box-shadow: 0 10px 26px rgba(70, 55, 35, .18); transform: scale(.88); transition: transform .45s var(--ease), box-shadow .3s;
}
.join-pop.show .join-pop__qr { transform: none; }
.join-pop__qr:hover { box-shadow: 0 0 0 4px rgba(63, 154, 110, .35), 0 12px 28px rgba(70, 55, 35, .22); }
.join-pop__qr:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.join-pop__qr img { display: block; width: 100%; height: auto; }
.join-pop__tip { margin-top: 4px; text-align: center; font-size: .95rem; font-weight: 900; line-height: 1.4; color: var(--green-deep); }
.join-pop__tip small { display: block; font-size: .78rem; font-weight: 500; color: #6b746c; }
.join-pop__count { width: 52%; font-size: .78rem; text-align: center; color: var(--muted-ink, #6e655b); font-variant-numeric: tabular-nums; }
.join-pop__count i { display: block; height: 4px; margin-bottom: 4px; border-radius: 2px; background: var(--orange); transform-origin: left; }
.join-pop.show .join-pop__count i { animation: join-count 10s linear forwards; }
@keyframes join-count { to { transform: scaleX(0); } }
.motion-paused .join-pop__count i { animation-play-state: running !important; }   /* QR 浮層倒數條是計時資訊，不隨裝飾動畫暫停 */
.join-pop.hold .join-pop__count i { animation-play-state: paused !important; }    /* 游標停留或鍵盤焦點在浮層上：暫停倒數 */
.join-pop .join-pop__qr img { border-radius: 0; }   /* 不套用立體導覽卡片圖片的圓角 */
.t-join .join-link, .t-join .join-pop { border-radius: 16px; }
.t-join .join-pop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(253, 246, 234, .96); }   /* 3D 舞台中不用背景模糊 */

