/* ELDRUNA: SHIELDWALL - juice layer (js/juice.js), 11.10.2026. Battery saver = body.jx-perf (no endless loops). */

/* ---------- level-up cards: fly in, frames by type ---------- */
#cards .card { position: relative; }
#cards .card.jx-in { animation: jx-fly .46s cubic-bezier(.2, .9, .3, 1.25) backwards; }
@keyframes jx-fly { 0% { opacity: 0; transform: translateY(48px) scale(.8) rotate(-5deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
#cards.jx-guard .card { pointer-events: none; }
#cards.jx-hold .card { visibility: hidden; animation: none; }
#cards .card:hover, #cards .card:focus-visible { transform: translateY(-4px) scale(1.025); filter: brightness(1.15); outline: none; }
#cards .card:focus-visible { box-shadow: 0 0 0 3px #fff, 0 14px 28px rgba(0, 0, 0, .6); }
.card .jx-rib { position: absolute; top: -9px; left: 10px; padding: 3px 7px 2px; border-radius: 6px; font-family: "Press Start 2P", monospace; font-size: 7px; line-height: 1.3; text-transform: uppercase; letter-spacing: .03em; background: #2a2a2a; color: #d8d2cc; box-shadow: 0 0 0 2px #0b0b0b; pointer-events: none; white-space: nowrap; z-index: 1; }
.card.k-new { box-shadow: 0 0 0 3px #ffb347, 0 10px 24px rgba(0, 0, 0, .5); }
.card.k-new .jx-rib { background: #ffb347; color: #1b0a00; }
.card.k-up { box-shadow: 0 0 0 2px #aab2bc, 0 10px 24px rgba(0, 0, 0, .5); }
.card.k-up .jx-rib { background: #5b636d; color: #fff; }
.card.k-pas { background: linear-gradient(180deg, #1d2834, #0c1117); box-shadow: 0 0 0 2px #6fa8dc, 0 10px 24px rgba(0, 0, 0, .5); }
.card.k-pas .jx-rib { background: #6fa8dc; color: #06111c; }
.card.k-pas b { color: #9fcbf0; }
.card.evo.k-bless { background: linear-gradient(180deg, #3a3110, #141005); box-shadow: 0 0 0 3px #f7d26b, 0 0 18px rgba(247, 210, 107, .35); }
.card.k-bless .jx-rib { background: #f7d26b; color: #1b1200; }
.card.k-bless b { color: #f7d26b; }
.card.k-evo .jx-rib { background: var(--orange); color: #1b0a00; }
#cards .card.k-evo { animation: jx-glow 1.1s ease-in-out infinite; }
#cards .card.k-evo.jx-in { animation: jx-fly .46s cubic-bezier(.2, .9, .3, 1.25) backwards, jx-glow 1.1s ease-in-out infinite; }
@keyframes jx-glow { 0%, 100% { box-shadow: 0 0 0 3px var(--orange), 0 0 16px rgba(255, 94, 0, .45); } 50% { box-shadow: 0 0 0 3px #ffb347, 0 0 40px rgba(255, 150, 0, .95); } }
body.jx-perf #cards .card.k-evo { animation: none; box-shadow: 0 0 0 3px var(--orange), 0 0 26px rgba(255, 120, 0, .7); }
body.jx-perf #cards .card.k-evo.jx-in { animation: jx-fly .46s cubic-bezier(.2, .9, .3, 1.25) backwards; }
.card .jx-cpw { display: block; margin-top: 6px; }
.card .jx-cp { display: inline-flex; gap: 3px; margin: 0; line-height: 0; }
.jx-cp i { display: block; width: 9px; height: 6px; border-radius: 1px; background: #2a2a2a; box-shadow: inset 0 0 0 1px #3a3a3a; }
.jx-cp i.on { background: var(--orange); box-shadow: none; }
.jx-cp i.nx { background: #ffe9a8; box-shadow: 0 0 6px #ffb347; animation: jx-blink .7s steps(2) infinite; }
.k-pas .jx-cp i.on { background: #6fa8dc; }
@keyframes jx-blink { 50% { opacity: .35; } }
body.jx-perf .jx-cp i.nx { animation: none; }
@media (max-width: 600px) {
  .card .jx-rib { top: -7px; left: 8px; font-size: 6px; }
  .card .jx-cpw { margin-top: 3px; }
  #cards { gap: 14px; padding-top: 4px; }
  #cards .card { flex: 0 0 auto; min-height: 64px; }   /* column layout: flex-basis 150px made every card 150 px tall */
}

/* ---------- chest reveal (inside the level-up overlay) ---------- */
#jx-chest { position: absolute; inset: 0; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; cursor: pointer; text-align: center; background: radial-gradient(ellipse at 50% 46%, rgba(74, 48, 4, .97), rgba(0, 0, 0, .97) 72%); overflow: hidden; }
#jx-chest.on { display: flex; }
#jx-chest .jx-cimg { width: clamp(44px, 8vw, 72px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 0 14px rgba(247, 210, 107, .8)); animation: jx-cbox .5s ease-out; }
@keyframes jx-cbox { 0% { transform: scale(.4) rotate(-12deg); } 40% { transform: scale(1.25) rotate(6deg); } 70% { transform: scale(.95) rotate(-3deg); } 100% { transform: none; } }
#jx-chest .jx-ct { font-family: "Press Start 2P", monospace; font-size: clamp(10px, 2vw, 16px); color: #ffe9a8; text-shadow: 3px 3px 0 #000; text-transform: uppercase; }
.jx-reels { display: flex; gap: clamp(8px, 2vw, 16px); }
.jx-reel { width: clamp(52px, 10vw, 84px); height: clamp(52px, 10vw, 84px); display: flex; align-items: center; justify-content: center; border: 3px solid #0b0b0b; border-radius: 12px; background: linear-gradient(180deg, #120c03 0%, #3a2a08 50%, #120c03 100%); box-shadow: 0 0 0 2px #8a6a20, inset 0 6px 10px rgba(0, 0, 0, .7), inset 0 -6px 10px rgba(0, 0, 0, .7); overflow: hidden; }
.jx-reel img { width: 66%; height: 66%; object-fit: contain; image-rendering: pixelated; filter: blur(.7px) brightness(.8); transform: translateY(-3px); }
.jx-reel.stop { box-shadow: 0 0 0 3px #f7d26b, 0 0 24px rgba(247, 210, 107, .85), inset 0 6px 10px rgba(0, 0, 0, .5); }
.jx-reel.stop img { filter: drop-shadow(0 0 4px rgba(255, 233, 168, .9)); transform: none; animation: jx-drop .28s ease-out; }
@keyframes jx-drop { 0% { transform: translateY(-60%); } 60% { transform: translateY(10%); } 100% { transform: none; } }
#jx-chest .jx-cpts { font-family: "Press Start 2P", monospace; font-size: clamp(13px, 2.6vw, 22px); color: #f7d26b; text-shadow: 3px 3px 0 #000, 0 0 16px rgba(247, 210, 107, .6); }
#jx-chest small { color: #e9e4dc; font-weight: 700; font-size: clamp(13px, 1.7vw, 16px); letter-spacing: .04em; }
#jx-chest .jx-skip { font-style: normal; color: #8c8580; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.jx-sp { position: absolute; width: 4px; height: 4px; background: #ffe9a8; box-shadow: 0 0 6px 1px #f7d26b; opacity: 0; pointer-events: none; }
#jx-chest.on .jx-sp { animation: jx-spark 1.1s ease-out infinite; }
.jx-sp::before, .jx-sp::after { content: ""; position: absolute; background: #fff6d8; }
.jx-sp::before { left: -3px; right: -3px; top: 1px; height: 2px; } .jx-sp::after { top: -3px; bottom: -3px; left: 1px; width: 2px; }
@keyframes jx-spark { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-14px) scale(.4); } }
body.jx-perf .jx-sp:nth-child(2n) { display: none; }

/* ---------- moments over the battlefield (below the overlays) ---------- */
#jx-low { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(ellipse at 50% 50%, rgba(120, 0, 0, 0) 42%, rgba(160, 12, 12, .42) 82%, rgba(90, 0, 0, .85) 100%); }
#jx-low.on { opacity: 1; animation: jx-beat .85s ease-in-out infinite; }
#jx-low.on.fast { animation-duration: .55s; }
@keyframes jx-beat { 0%, 100% { opacity: .5; } 14% { opacity: 1; } 28% { opacity: .65; } 42% { opacity: .92; } }
body.jx-perf #jx-low.on { animation: none; opacity: .8; }
#jx-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 246, 200, .95), rgba(247, 190, 60, .55) 40%, rgba(255, 94, 0, 0) 78%); }
#jx-flash.on { animation: jx-flash .65s ease-out forwards; }
@keyframes jx-flash { 0% { opacity: 0; } 12% { opacity: .95; } 100% { opacity: 0; } }

#jx-evo { position: absolute; left: 0; right: 0; top: 13%; display: flex; flex-direction: column; align-items: center; text-align: center; pointer-events: none; opacity: 0; padding: 0 12px; }
#jx-evo.on { animation: jx-evo 2.7s ease forwards; }
@keyframes jx-evo { 0% { opacity: 0; transform: scale(.4); } 10% { opacity: 1; transform: scale(1.14); } 18% { transform: scale(1); } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-12px); } }
#jx-evo .jx-ei { position: relative; width: clamp(56px, 11vw, 116px); height: clamp(56px, 11vw, 116px); margin-bottom: 4px; }
#jx-evo .jx-ei::before { content: ""; position: absolute; inset: -45%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, .55) 0 7deg, rgba(255, 220, 120, 0) 7deg 22deg); -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%); }
#jx-evo.on .jx-ei::before { animation: jx-spin 5s linear infinite; }
body.jx-perf #jx-evo.on .jx-ei::before { animation: none; }
@keyframes jx-spin { to { transform: rotate(360deg); } }
#jx-evo img { position: relative; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(247, 210, 107, .9)) drop-shadow(3px 3px 0 #000); }
#jx-evo i { font-style: normal; font-family: "Press Start 2P", monospace; font-size: clamp(8px, 1.3vw, 12px); color: #ffe9a8; letter-spacing: .3em; text-transform: uppercase; text-shadow: 2px 2px 0 #000; }
#jx-evo b { font-family: "Press Start 2P", monospace; font-size: clamp(14px, 3vw, 30px); color: var(--orange); text-transform: uppercase; margin: 6px 0 4px; line-height: 1.3; text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 150, 0, .75); }
#jx-evo span { font-weight: 700; color: #fff; font-size: clamp(13px, 1.9vw, 19px); letter-spacing: .03em; text-shadow: 2px 2px 0 #000, 0 0 10px #000; }

#jx-boss { position: absolute; left: 0; right: 0; top: 24%; pointer-events: none; opacity: 0; }
#jx-boss.on { animation: jx-bossin 3.1s ease forwards; }
@keyframes jx-bossin { 0% { opacity: 0; transform: translateX(70%) skewX(-14deg); } 11% { opacity: 1; transform: translateX(-3%) skewX(2deg); } 16% { transform: none; } 84% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(-70%) skewX(14deg); } }
.jx-stripe { height: clamp(7px, 1.3vw, 12px); background: repeating-linear-gradient(-45deg, #b3261e 0 9px, #160404 9px 18px); box-shadow: 0 2px 0 rgba(0, 0, 0, .8); }
#jx-boss.on .jx-stripe { animation: jx-stripes .7s linear infinite; }
#jx-boss.on .jx-stripe + .jx-bc + .jx-stripe { animation-direction: reverse; }
@keyframes jx-stripes { to { background-position: 25.46px 0; } }
body.jx-perf #jx-boss.on .jx-stripe { animation: none; }
.jx-bc { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 18px); padding: clamp(6px, 1.2vw, 12px) 14px; background: linear-gradient(90deg, rgba(24, 0, 0, 0), rgba(24, 0, 0, .9) 14%, rgba(24, 0, 0, .9) 86%, rgba(24, 0, 0, 0)); }
.jx-bc img { width: clamp(40px, 8vw, 84px); height: clamp(40px, 8vw, 84px); object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(255, 40, 30, .65)) drop-shadow(2px 2px 0 #000); }
.jx-bc > div { text-align: left; max-width: 70%; }
.jx-bc i { display: block; font-style: normal; font-family: "Press Start 2P", monospace; font-size: clamp(7px, 1.1vw, 10px); color: #ff8a80; letter-spacing: .25em; text-transform: uppercase; }
.jx-bc b { display: block; font-family: "Press Start 2P", monospace; font-size: clamp(12px, 2.6vw, 26px); color: #ff3b2f; text-transform: uppercase; line-height: 1.3; margin: 4px 0 2px; text-shadow: 3px 3px 0 #000, 0 0 16px rgba(255, 30, 20, .6); }
.jx-bc span { display: block; color: #e9e4dc; font-weight: 700; font-size: clamp(12px, 1.7vw, 17px); letter-spacing: .03em; text-shadow: 2px 2px 0 #000; }

#jx-ms { position: absolute; left: 0; right: 0; bottom: 17%; text-align: center; pointer-events: none; opacity: 0; font-family: "Press Start 2P", monospace; font-size: clamp(10px, 2vw, 17px); color: #f7d26b; text-shadow: 2px 2px 0 #000, 0 0 12px rgba(247, 210, 107, .65); }
#jx-ms.on { animation: jx-ms 1.95s ease forwards; }
@keyframes jx-ms { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 12% { opacity: 1; transform: scale(1.18); } 22% { transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

/* ---------- pause menu build ---------- */
.jx-pb { width: min(620px, 100%); margin: 2px 0 4px; text-align: left; }
.jx-pbh { font-family: "Press Start 2P", monospace; font-size: 8px; color: #e0a458; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; text-align: center; }
.jx-pw { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; }
.jx-wr { display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .05); border: 2px solid #2a2a2a; border-radius: 10px; padding: 5px 8px; }
.jx-wr.evo { border-color: var(--orange); background: rgba(255, 94, 0, .1); }
.jx-wr img { width: 30px; height: 30px; flex: none; object-fit: contain; image-rendering: pixelated; }
.jx-wr > div { min-width: 0; }
.jx-wr b { display: block; font-family: "Press Start 2P", monospace; font-size: 7px; color: var(--orange); line-height: 1.5; }
.jx-wr small { display: block; font-size: 12px; color: #a69d94; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.jx-wr small.ready { color: #ffe9a8; } .jx-wr small.done { color: #FFB37A; }
.jx-pips { display: inline-flex; gap: 2px; margin-top: 2px; }
.jx-pips i { display: block; width: 8px; height: 5px; background: #2a2a2a; border-radius: 1px; }
.jx-pips i.on { background: var(--orange); }
.jx-pp { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 6px; }
.jx-pc { display: inline-flex; align-items: center; gap: 5px; background: rgba(111, 168, 220, .1); border: 2px solid #26405a; border-radius: 999px; padding: 2px 9px 2px 3px; font-size: 12px; color: #d8d2cc; font-weight: 700; }
.jx-pc img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.jx-pc b { font-weight: 700; } .jx-pc em { font-style: normal; color: #9fcbf0; font-family: "Press Start 2P", monospace; font-size: 7px; }
.jx-pc.bl { background: rgba(247, 210, 107, .1); border-color: #6a5420; } .jx-pc.bl em { color: #f7d26b; }
@media (max-width: 600px) { .jx-pw { grid-template-columns: 1fr; } .jx-pc b { display: none; } .jx-wr small { font-size: 11px; } }

/* ---------- game over: record, stats, build ---------- */
#ov-over { justify-content: safe center; }
.jx-hide { display: none !important; }
.jx-rec { display: none; margin: 2px 0 4px; }
.jx-rec.on { display: block; animation: jx-stamp .55s cubic-bezier(.2, 1.4, .4, 1) both; }
.jx-rec span { display: inline-block; padding: 6px 12px 5px; border: 3px solid #f7d26b; border-radius: 8px; transform: rotate(-4deg); font-family: "Press Start 2P", monospace; font-size: clamp(10px, 1.8vw, 15px); color: #f7d26b; background: rgba(40, 24, 0, .8); text-shadow: 2px 2px 0 #000; box-shadow: 0 0 22px rgba(247, 210, 107, .45); }
@keyframes jx-stamp { 0% { opacity: 0; transform: scale(2.4); } 100% { opacity: 1; transform: none; } }
.jx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; width: min(560px, 100%); margin: 6px 0 2px; }
.jx-st { background: rgba(255, 255, 255, .05); border: 1px solid #2a2a2a; border-radius: 8px; padding: 5px 4px 4px; }
.jx-st b { display: block; font-family: "Press Start 2P", monospace; font-size: clamp(9px, 1.5vw, 13px); color: #fff; line-height: 1.4; font-variant-numeric: tabular-nums; }
.jx-st span { display: block; font-size: 11px; color: #8c8580; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-top: 1px; }
.jx-bh { font-family: "Press Start 2P", monospace; font-size: 7px; color: #e0a458; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.jx-bc2 { position: relative; display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; background: #111; border: 2px solid #333; border-radius: 8px; }
.jx-bc2 img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.jx-bc2 em { position: absolute; right: -6px; bottom: -6px; min-width: 14px; padding: 2px 3px 1px; border-radius: 5px; background: #0b0b0b; border: 1px solid #555; font-style: normal; font-family: "Press Start 2P", monospace; font-size: 6px; line-height: 1.2; color: #fff; }
.jx-bc2.evo { border-color: var(--orange); box-shadow: 0 0 10px rgba(255, 94, 0, .55); }
.jx-bc2.evo em { background: var(--orange); border-color: var(--orange); color: #1b0a00; }
.jx-bc2.pas { border-color: #26405a; } .jx-bc2.pas em { color: #9fcbf0; }
#ov-over .build { gap: 10px; margin-bottom: 6px; }
@media (max-width: 600px) { .jx-stats { gap: 4px; } .jx-st span { font-size: 9px; letter-spacing: .04em; } }

/* ---------- title: particles behind the overlay content, logo shimmer ---------- */
.ov.jx-iso { isolation: isolate; }
#jx-fx { position: absolute; left: 0; top: 0; width: 100%; z-index: -1; pointer-events: none; background: transparent; image-rendering: pixelated; image-rendering: crisp-edges; }
.jx-shine { position: relative; display: block; }
.jx-shine::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, rgba(255, 230, 180, 0) 40%, rgba(255, 238, 200, .85) 50%, rgba(255, 230, 180, 0) 60%) no-repeat; background-size: 260% 100%; background-position: 160% 0; -webkit-mask: url(../img/logo-shieldwall.png) center / 100% 100% no-repeat; mask: url(../img/logo-shieldwall.png) center / 100% 100% no-repeat; mix-blend-mode: screen; animation: jx-shine 6s ease-in-out 1.2s infinite; }
@keyframes jx-shine { 0% { background-position: 160% 0; } 28%, 100% { background-position: -60% 0; } }
body.jx-perf .jx-shine::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  #cards .card.jx-in, #cards .card.k-evo, .jx-shine::after, #jx-low.on, #jx-boss.on .jx-stripe, #jx-evo.on .jx-ei::before, #jx-chest.on .jx-sp, .jx-cp i.nx { animation: none !important; }
}
