/* 宝石镶嵌: gem sprites, sockets, the pouch, the 宝石福袋 page */
.jw-im { display: inline-block; flex: none; width: 40px; height: 40px; vertical-align: middle; image-rendering: pixelated; }
.jw-im.s { width: 20px; height: 20px; }
.jw-im.l { width: 60px; height: 60px; }
.jw-im.tw { animation: jwTw 2.4s steps(6) infinite; }
.jw-rb { background: var(--ju) 0 0 / 1600% 100% no-repeat; animation: jwRb 1.6s steps(16, jump-none) infinite; }
@keyframes jwRb { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@keyframes jwTw { 0%, 100% { filter: none; } 50% { filter: brightness(1.22) drop-shadow(0 0 3px rgba(255, 255, 255, 0.45)); } }
.jw-rbt { background: linear-gradient(90deg, #ff6a6a, #ffd35a, #62e687, #5ac8ff, #c06cff, #ff6a6a); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: jwRbt 2s linear infinite; font-weight: normal; }
@keyframes jwRbt { to { background-position: 200% 0; } }
.jw-tg { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; vertical-align: middle; }
.jw-tg b { font-weight: normal; }
.jw-tg em { font-style: normal; font: 600 12px var(--font-px); color: var(--text); margin-left: 1px; }
.jw-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; background: var(--bad); box-shadow: 0 0 0 1px var(--edge); vertical-align: top; }

/* the 自选 token: a gem with a little label */
.jw-pk-i { position: relative; display: inline-grid; place-items: center; }
.jw-pk-i i { position: absolute; right: -4px; bottom: -3px; font: 10px/1 var(--font-cn); font-style: normal; padding: 1px 2px; color: #2a1206; background: var(--gold); box-shadow: 0 0 0 1px var(--edge); }
.jw-pk-i.s i { right: -5px; bottom: -4px; font-size: 9px; padding: 0 1px; }

/* ---- item page: the 镶嵌 tab ---- */
.jw-plate { display: grid; justify-items: center; gap: 6px; padding: 12px 8px 8px; background: radial-gradient(circle at 50% 30%, rgba(192, 108, 255, 0.16), transparent 62%), linear-gradient(#241a32, #150f1e); box-shadow: var(--px), inset 0 0 0 1px #3f3354; }
.jw-socks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.jw-sk { position: relative; width: 56px; height: 56px; border: 0; padding: 0; display: grid; place-items: center; background: var(--sk) center / 100% 100% no-repeat; image-rendering: pixelated; cursor: pointer; transition: transform 0.08s steps(2); }
.jw-sk:active { transform: translateY(1px); }
.jw-sk .jw-im { width: 40px; height: 40px; }
.jw-sk.on { filter: drop-shadow(0 0 0 #ffd35a) drop-shadow(0 0 4px rgba(255, 211, 90, 0.85)); }
.jw-sk.on::after { content: ""; position: absolute; left: 50%; top: -9px; width: 0; height: 0; transform: translateX(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--gold); animation: upBob 0.8s steps(2) infinite; }
.jw-sk-e { font: 11px var(--font-cn); font-style: normal; color: #6a6080; }
.jw-sk.add { background: rgba(20, 14, 30, 0.6); box-shadow: inset 0 0 0 2px #3f3354; outline: 2px dashed #6a5a88; outline-offset: -6px; align-content: center; gap: 0; color: var(--muted); }
.jw-sk.add small { font: 11px var(--font-cn); color: #ffd8a8; }
.jw-psum { font-size: 12px; color: #d8c8f0; text-align: center; }
.jw-cur { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--plate); box-shadow: var(--px), inset 0 3px 0 0 var(--gold); }
.jw-cur.e { box-shadow: var(--px), inset 0 3px 0 0 var(--line); grid-template-columns: auto minmax(0, 1fr); }
.jw-cur-m { display: grid; gap: 2px; min-width: 0; }
.jw-cur-m b { font: 16px var(--font-cn); font-weight: normal; }
.jw-cur-m small { font-size: 12px; color: var(--text); }
.jw-cur-m small.muted { color: var(--muted); }
.jw-hole { width: 56px; height: 56px; image-rendering: pixelated; opacity: 0.85; }
.jw-list { display: grid; gap: 5px; }
.jw-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 8px 4px 4px; background: var(--plate); box-shadow: var(--px); }
.jw-rm { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 4px; min-width: 0; }
.jw-rm b { font: 14px var(--font-cn); font-weight: normal; white-space: nowrap; }
.jw-rm em { font-style: normal; font: 600 12px var(--font-px); color: var(--muted); align-self: center; }
.jw-rm small { grid-column: 1 / -1; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jw-gain { font: 600 11px var(--font-px); font-style: normal; white-space: nowrap; }
.jw-gain.up { color: var(--good); }
.jw-gain.down { color: var(--bad); }
.jw-drill { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; background: linear-gradient(90deg, rgba(200, 122, 58, 0.18), transparent 60%), var(--plate); box-shadow: var(--px); }
.jw-drill div { display: grid; gap: 1px; }
.jw-drill b { font: 15px var(--font-cn); font-weight: normal; color: #ffd8a8; }
.jw-drill small { font-size: 11px; }

/* item cards: the gems in a piece */
.jw-line { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; font-size: 12px; color: #d8c8f0; }
.jw-line span { margin-left: 3px; }
.jw-e { display: inline-block; width: 14px; height: 14px; margin: 3px; background: #0c0814; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 2px #5a5070; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }

/* bag cells & paperdoll slots: one pip per socket */
.jw-pips { position: absolute; left: 2px; top: 50%; z-index: 1; display: grid; gap: 1px; transform: translateY(-50%); pointer-events: none; }
.jw-pips b { display: block; width: 4px; height: 4px; background: var(--c, #2a2236); box-shadow: 0 0 0 1px #06040a; }
.jw-pips b.e { background: #120c1a; box-shadow: 0 0 0 1px #06040a, inset 0 0 0 1px #6a6080; }
.jw-pips b.rb { background: linear-gradient(#ff4a5a, #ffd34a 35%, #62e06a 60%, #4a7aff); }

/* ---- the pouch (equip page) ---- */
.jw-card h4 { display: inline-flex; align-items: center; gap: 4px; }
.jw-pouch { width: 28px; height: 28px; image-rendering: pixelated; }
.jw-res { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text); }
.jw-res span { display: inline-flex; align-items: center; gap: 3px; }
.jw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; }
.jw-cell { position: relative; aspect-ratio: 1; border: 0; padding: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.06), transparent 65%), #100c16; box-shadow: 0 0 0 2px var(--edge), inset 0 0 0 2px var(--qcol, var(--line)); cursor: pointer; }
.jw-cell .jw-im { width: 40px; height: 40px; }
.jw-cell em { position: absolute; right: 2px; bottom: 0; font: 700 11px var(--font-px); font-style: normal; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.jw-cell:active { transform: translateY(1px); }
.jw-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.jw-pick { display: grid; gap: 4px; padding: 6px 8px; background: linear-gradient(90deg, rgba(255, 211, 90, 0.16), transparent 70%), #1a1020; box-shadow: var(--px), inset 0 0 0 1px var(--gold); }
.jw-pick b { font: 14px var(--font-cn); font-weight: normal; }
.jw-pick span { display: flex; flex-wrap: wrap; gap: 4px; }
.jw-pick button { width: 44px; height: 44px; border: 0; padding: 0; display: grid; place-items: center; background: #100c16; box-shadow: 0 0 0 2px var(--edge), inset 0 0 0 1px var(--line); cursor: pointer; }
.jw-pick button:active { transform: translateY(1px); }
.jw-craft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; background: #140e1c; box-shadow: var(--px), inset 0 0 0 1px #5a3a7a; }
.jw-cr-in { display: inline-flex; align-items: center; gap: 2px; }
.jw-cr-in .ci { display: inline-grid; font-style: normal; opacity: 0.35; filter: grayscale(1); }
.jw-cr-in .ci.ok { opacity: 1; filter: none; }
.jw-cr-in b { margin: 0 2px; color: var(--muted); font-weight: normal; }
.jw-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; background: radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.1), transparent 45%), var(--plate); box-shadow: var(--px); }

/* ---- the 宝石 shop page ---- */
.jw-lock { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.jw-lock h4 { margin: 0 0 3px; }
.jw-ban { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 10px; overflow: hidden; background: radial-gradient(circle at 18% 45%, rgba(192, 108, 255, 0.4), transparent 55%), linear-gradient(#2c1446, #150a24); box-shadow: var(--px), inset 0 0 0 1px #7a4ad8, 0 0 14px rgba(160, 90, 255, 0.25); }
.jw-ban::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%) no-repeat; background-size: 260% 100%; animation: shine 3.4s steps(16) infinite; }
.jw-bag { width: 102px; height: 102px; image-rendering: pixelated; animation: jwBob 1.4s steps(2) infinite; }
@keyframes jwBob { 50% { transform: translateY(-3px); } }
.jw-ban-m { position: relative; z-index: 1; display: grid; gap: 4px; min-width: 0; }
.jw-ban-m > b { font: 22px var(--font-cn); font-weight: normal; color: #f0d8ff; text-shadow: 0 2px 0 #1a0826; }
.jw-ban-m small { font-size: 12px; color: #d8c8f0; }
.jw-pity { color: var(--muted) !important; }
.jw-pulls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.jw-free { background: linear-gradient(#9affb8, #3ac870); animation: jwFree 1.2s steps(2) infinite; }
@keyframes jwFree { 50% { box-shadow: var(--px), inset 0 -3px 0 0 rgba(0, 80, 30, 0.45), 0 0 10px rgba(98, 230, 135, 0.8); } }
.jw-pk .mid h4 small { font-size: 11px; }
.jw-pk-art { display: grid; place-items: center; width: 48px; height: 48px; background: radial-gradient(circle, rgba(192, 108, 255, 0.35), transparent 70%); }
.jw-pk.rb { background: radial-gradient(circle at 10% 50%, rgba(255, 230, 128, 0.22), transparent 45%), var(--plate); box-shadow: var(--px), inset 0 0 0 2px #ffe680; }
.jw-pk.rb .jw-pk-art { background: radial-gradient(circle, rgba(255, 240, 160, 0.5), transparent 70%); }
.jw-pk-l { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; margin: 2px 0 0; }
.jw-mini h4 { display: inline-flex; align-items: center; gap: 4px; margin: 0; }

/* ---- results: 福袋 pulls & packs ---- */
.jw-box .center { text-align: center; }
.jw-pull { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.jw-pull.one { grid-template-columns: minmax(0, 120px); justify-content: center; }
.jw-pr { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; padding: 9px 2px 6px; overflow: hidden; background: radial-gradient(circle at 50% 38%, var(--gl, transparent), transparent 68%), #100c16; box-shadow: 0 0 0 2px var(--edge), inset 0 0 0 1px var(--qcol, var(--line)); opacity: 0; animation: jwPop 0.36s steps(5) forwards; animation-delay: var(--d, 0s); }
.jw-pr small { font-size: 10px; line-height: 1.2; text-align: center; }
.jw-pr small b { font-weight: normal; }
.jw-pr.hi { box-shadow: 0 0 0 2px var(--edge), inset 0 0 0 2px var(--qcol), 0 0 12px var(--gl); }
.jw-pr.hi::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%) no-repeat; background-size: 260% 100%; animation: shine 2.2s steps(14) infinite; }
@keyframes jwPop { 0% { opacity: 0; transform: scale(0.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@media (max-width: 380px) { .jw-pull { grid-template-columns: repeat(4, minmax(0, 1fr)); } .jw-bag { width: 68px; height: 68px; } }

/* the ¥328 至尊宝石宝匣 */
.jw-pk.top { background: radial-gradient(circle at 12% 50%, rgba(255, 230, 140, 0.35), transparent 45%), linear-gradient(90deg, #3a2a08, var(--plate) 70%); box-shadow: var(--px), inset 0 0 0 2px var(--gold), 0 0 12px rgba(255, 210, 100, 0.25); }
.jw-pk.top .jw-pk-art { position: relative; }
.jw-crown { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 4px; font: 10px/1.4 var(--font-cn); font-style: normal; color: #2a1206; background: var(--gold); box-shadow: 0 0 0 1px var(--edge); white-space: nowrap; }

/* ---- the 福袋 draw: full screen — the bag shakes and glows (the colour hints at the best result), bursts, cards flip ---- */
.jwfx { --tone: rgba(98, 224, 106, 0.4); --tone2: #b8ffb8; position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; overflow: hidden; user-select: none; }
.jwfx.q4 { --tone: rgba(79, 168, 255, 0.5); --tone2: #bfe0ff; }
.jwfx.q5 { --tone: rgba(192, 108, 255, 0.55); --tone2: #ead2ff; }
.jwfx.q6 { --tone: rgba(255, 161, 46, 0.6); --tone2: #fff0c0; }
.jwfx.rb { --tone: rgba(255, 230, 140, 0.6); --tone2: #ffffff; }
.jwfx-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, var(--tone), transparent 62%), rgba(8, 5, 14, 0.93); animation: jwFade 0.25s ease-out; }
.jwfx.rb .jwfx-bg { background: conic-gradient(from 0deg at 50% 44%, rgba(255, 90, 90, 0.22), rgba(255, 211, 74, 0.22), rgba(98, 224, 106, 0.22), rgba(79, 168, 255, 0.22), rgba(192, 108, 255, 0.22), rgba(255, 90, 90, 0.22)), rgba(8, 5, 14, 0.9); }
.jwfx-rays { position: absolute; left: 50%; top: 44%; width: 620px; height: 620px; margin: -310px 0 0 -310px; pointer-events: none; opacity: 0; background: repeating-conic-gradient(from 0deg, var(--tone) 0 8deg, transparent 8deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 62%); mask-image: radial-gradient(circle, #000 18%, transparent 62%); }
.jwfx.burst .jwfx-rays { opacity: 1; transition: opacity 0.4s ease; animation: fnSpin 14s linear infinite; }
.jwfx-bag { position: absolute; left: 50%; top: 44%; width: 104px; height: 104px; transform: translate(-50%, -50%); }
.jwfx-bag img { position: relative; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)); }
.jwfx-glow { position: absolute; inset: -46px; border-radius: 50%; background: radial-gradient(circle, var(--tone2), var(--tone) 35%, transparent 68%); opacity: 0; }
.jwfx.shake .jwfx-bag { animation: jwShake 0.97s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
.jwfx.shake .jwfx-glow { animation: jwGlowUp 0.97s ease-in forwards; }
.jwfx.burst .jwfx-bag { animation: jwBurst 0.36s ease-out forwards; }
@keyframes jwFade { from { opacity: 0; } }
@keyframes jwShake { 0% { transform: translate(-50%, -50%); } 12% { transform: translate(-52%, -50%) rotate(-5deg); } 24% { transform: translate(-48%, -50%) rotate(5deg); } 36% { transform: translate(-53%, -51%) rotate(-8deg); } 48% { transform: translate(-47%, -49%) rotate(8deg); } 60% { transform: translate(-54%, -50%) rotate(-11deg) scale(1.04); } 72% { transform: translate(-46%, -51%) rotate(11deg) scale(1.08); } 84% { transform: translate(-53%, -50%) rotate(-13deg) scale(1.12); } 100% { transform: translate(-50%, -52%) scale(1.18); } }
@keyframes jwGlowUp { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1.15); } }
@keyframes jwBurst { 0% { transform: translate(-50%, -52%) scale(1.18); filter: brightness(1.5); } 100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; filter: brightness(4); } }
.jwfx-grid { position: relative; display: grid; grid-template-columns: repeat(5, 58px); gap: 9px; margin-top: -40px; pointer-events: none; }
.jwfx.one .jwfx-grid { grid-template-columns: 96px; }
.jwc { width: 58px; height: 80px; perspective: 600px; opacity: 0; transform: translateY(-40px) scale(0.5); }
.jwfx.one .jwc { width: 96px; height: 132px; }
.jwfx.burst .jwc { animation: jwDeal 0.42s cubic-bezier(0.2, 0.8, 0.3, 1.25) forwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes jwDeal { to { opacity: 1; transform: none; } }
.jwc-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.42s cubic-bezier(0.3, 0.7, 0.3, 1.25); }
.jwc.hi .jwc-in { transition-duration: 0.7s; }
.jwc.flip .jwc-in { transform: rotateY(180deg); }
.jwc-b, .jwc-f { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.jwc-b { background: repeating-linear-gradient(45deg, #3e2a62 0 4px, #2a1d46 4px 8px); box-shadow: 0 0 0 2px #0c0814, inset 0 0 0 2px #c8902a, inset 0 0 0 4px #2a1d46; }
.jwc-b i { width: 22px; height: 22px; transform: rotate(45deg); background: linear-gradient(135deg, #ffe680, #c8902a); box-shadow: 0 0 0 2px #2a1206, 0 0 10px rgba(255, 210, 110, 0.45); }
.jwc-f { transform: rotateY(180deg); align-content: center; gap: 4px; padding: 4px 2px; background: radial-gradient(circle at 50% 38%, var(--gl, transparent), transparent 70%), #160f22; box-shadow: 0 0 0 2px #0c0814, inset 0 0 0 2px var(--qcol); }
.jwc-f .jw-im { width: 34px; height: 34px; }
.jwfx.one .jwc-f .jw-im { width: 60px; height: 60px; }
.jwc-f small { font-size: 10px; line-height: 1.2; text-align: center; }
.jwc-f small b { font-weight: normal; }
.jwc.hi.flip .jwc-f { box-shadow: 0 0 0 2px #0c0814, inset 0 0 0 2px var(--qcol), 0 0 18px var(--qcol); }
.jwc.hi.flip .jwc-f::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%) no-repeat; background-size: 260% 100%; animation: shine 2.2s steps(14) infinite; }
.jwc.top.flip .jwc-f { animation: jwTop 0.6s ease-out 0.4s; }
@keyframes jwTop { 0% { scale: 1; } 40% { scale: 1.25; } 100% { scale: 1; } }
.jwfx.hit .jwfx-bg { animation: jwHit 0.35s ease-out; }
@keyframes jwHit { 0% { filter: brightness(2.2); } 100% { filter: none; } }
.jwfx-top { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font: 30px var(--font-cn); font-weight: normal; letter-spacing: 6px; white-space: nowrap; color: #fff6c0; text-shadow: 0 3px 0 #3a1a04, 0 0 18px var(--tone2), 0 0 30px var(--tone); opacity: 0; pointer-events: none; }
.jwfx.done .jwfx-top { animation: jwBanner 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.4) forwards; }
@keyframes jwBanner { 0% { opacity: 0; transform: translateX(-50%) scale(2.2); } 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
.jwfx-foot { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; justify-items: center; padding: 0 12px; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.jwfx-foot p { color: #d8c8ea; }
.jwfx.done .jwfx-foot { opacity: 1; pointer-events: auto; }
.jwfx-skip { position: absolute; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; text-align: center; font-size: 11px; color: rgba(255, 255, 255, 0.45); }
.jwfx.done .jwfx-skip { display: none; }
.jwfx.out { animation: jwOut 0.26s ease-in forwards; }
@keyframes jwOut { to { opacity: 0; } }
@media (max-width: 380px) { .jwfx-grid { grid-template-columns: repeat(5, 54px); gap: 7px; } .jwc { width: 54px; height: 76px; } }
