/* =====================================================================
   KING'S JOURNEY v2 — fantasy kingdom presentation
   Layers:  blurred scene fill -> painting -> perspective board plane
            (tiles, glows, trail, hit squares) -> projected sprites -> fx
            -> HUD frame (scaled with the painting) -> overlays
   ===================================================================== */
@font-face{font-family:"KJ Cinzel";src:url(/assets/fonts/cinzel-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"KJ Cinzel";src:url(/assets/fonts/cinzel-latin-900-normal.woff2) format("woff2");font-weight:900;font-display:swap}
@font-face{font-family:"KJ Cinzel";src:url(/assets/fonts/playfair-display-cyrillic-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"KJ Cinzel";src:url(/assets/fonts/playfair-display-cyrillic-900-normal.woff2) format("woff2");font-weight:900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"KJ Sans";src:url(/assets/fonts/montserrat-latin-600-normal.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"KJ Sans";src:url(/assets/fonts/montserrat-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"KJ Sans";src:url(/assets/fonts/montserrat-latin-800-normal.woff2) format("woff2");font-weight:800;font-display:swap}
@font-face{font-family:"KJ Sans";src:url(/assets/fonts/montserrat-cyrillic-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"KJ Sans";src:url(/assets/fonts/montserrat-cyrillic-800-normal.woff2) format("woff2");font-weight:800;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}

.kings-journey-page{
  --kj-navy:#0b1a38; --kj-navy2:#07112a; --kj-gold:#f3c552; --kj-gold2:#c8912a; --kj-ice:#8fd3ff;
  --kj-serif:"KJ Cinzel",Georgia,"Times New Roman",serif;
  --kj-sans:"KJ Sans",var(--font-body,system-ui),sans-serif;
  background:#08130c;
}
.kings-journey-page .app-footer, .kings-journey-page footer{margin-top:0}
.kj-main{padding:0;margin:0;max-width:none}
.kings-journey-page .bottom-nav{display:none!important}
.kj-game{position:relative;display:flex;flex-direction:column;height:var(--kj-h,calc(100dvh - 72px));min-height:460px;
  overflow:hidden;color:#fff;font-family:var(--kj-sans);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
.kj-viewport{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:#0c1a10}
.kj-bgblur{position:absolute;inset:-30px;background:url(/assets/images/fun/kings-journey-v2/scene-blur.jpg) center 30%/cover no-repeat;
  filter:saturate(1.15) brightness(.62)}
.kj-bgblur::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,transparent 35%,rgba(0,8,4,.55) 100%)}

/* ---------------- stage ---------------- */
.kj-stage{position:absolute;left:0;top:0;width:1225px;height:1284px;transform-origin:0 0;will-change:transform}
.kj-scene{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 3.5%,#000 96.5%,transparent 100%),linear-gradient(180deg,#000 0,#000 97%,transparent 100%);
  -webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,transparent 0,#000 3.5%,#000 96.5%,transparent 100%);}
.portrait .kj-scene{-webkit-mask-image:none;mask-image:none}

.kj-board{position:absolute;left:0;top:0;width:800px;height:800px;transform-origin:0 0}
.kj-tiles,.kj-marks,.kj-hit{position:absolute;inset:0}
.kj-tile{position:absolute;width:101px;height:101px;background-image:var(--kj-tiles);
  background-size:800px 1000px;pointer-events:none}
/* subtle depth: far rows a touch hazier, like the painting's light */
.kj-tiles::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,236,190,.10),rgba(255,236,190,0) 40%,rgba(0,0,0,0) 70%,rgba(0,0,0,.10))}
.kj-marks{pointer-events:none}
.kj-hitsq{position:absolute;width:100px;height:100px;margin:0;padding:0;border:0;background:transparent;cursor:pointer;border-radius:10px}
.kj-hitsq:focus-visible{outline:4px solid #fff;outline-offset:-8px}

/* in-plane glows (drawn in perspective, like the concept art) */
.kj-mark{position:absolute;width:100px;height:100px;box-sizing:border-box;border-radius:12px}
.kj-mark.target{inset:auto;border:3px solid rgba(150,226,255,.95);background:rgba(95,200,255,.16);
  box-shadow:0 0 16px 2px rgba(70,190,255,.85),inset 0 0 22px rgba(80,200,255,.55);transform:scale(.84);animation:kjMark .32s ease-out both}
.kj-mark.target::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;
  background:#e8fbff;box-shadow:0 0 10px 3px rgba(90,210,255,.95)}
.kj-mark.target.onpiece{border-color:rgba(190,215,255,1);box-shadow:0 0 18px 4px rgba(90,150,255,.95),inset 0 0 24px rgba(90,150,255,.6)}
.kj-mark.target.onpiece::after,.kj-mark.target.oncrown::after{display:none}
.kj-mark.target.oncrown{border-color:#ffe28a;background:rgba(255,210,80,.22);box-shadow:0 0 22px 5px rgba(255,200,60,.95),inset 0 0 26px rgba(255,210,90,.7)}
.kj-mark.target.fade{opacity:0;transition:opacity .15s}
.kj-mark.player{border:3px solid rgba(160,255,140,.95);background:rgba(90,255,90,.2);
  box-shadow:0 0 18px 4px rgba(80,255,90,.85),inset 0 0 22px rgba(120,255,110,.6);transform:scale(.9)}
.kj-mark.piece{background:radial-gradient(circle,rgba(90,160,255,.34),rgba(90,160,255,.08) 70%);border:2px solid rgba(140,200,255,.5);
  box-shadow:0 0 12px rgba(80,160,255,.55);transform:scale(.88)}
.kj-mark.crown{background:radial-gradient(circle,rgba(255,226,120,.6),rgba(255,190,50,.18) 65%,transparent 72%);
  border:2px solid rgba(255,220,120,.75);box-shadow:0 0 24px 6px rgba(255,190,60,.75)}
.kj-mark.crown::after{content:"";position:absolute;inset:-6px;border-radius:16px;box-shadow:0 0 30px 12px rgba(255,200,60,.9);opacity:0;animation:kjPulseO 1.8s ease-in-out infinite;will-change:opacity}
@keyframes kjPulseO{50%{opacity:1}}
.kj-mark.key{background:radial-gradient(circle,rgba(255,220,110,.45),transparent 70%)}
.kj-mark.hint{border:4px solid #ffe07a;box-shadow:0 0 26px 8px rgba(255,210,70,.95),inset 0 0 26px rgba(255,220,90,.7);animation:kjHint .9s ease-in-out infinite}
.kj-mark.nope{background:rgba(255,70,70,.28);border:3px solid rgba(255,110,110,.9);animation:kjNope .5s ease-out both}
@keyframes kjMark{from{opacity:0;transform:scale(.55)}to{opacity:1;transform:scale(.84)}}
@keyframes kjPulse{50%{box-shadow:0 0 34px 10px rgba(255,200,60,.95)}}
@keyframes kjHint{50%{transform:scale(.8);opacity:.75}}
@keyframes kjNope{from{opacity:1}to{opacity:0}}

.kj-trail{position:absolute;inset:0;width:800px;height:800px;overflow:visible;pointer-events:none;filter:drop-shadow(0 0 6px rgba(80,200,255,.95))}
.kj-trail path{fill:none;stroke-linecap:round;stroke-linejoin:round}
.kj-trail .glow{stroke:rgba(90,210,255,.28);stroke-width:12}
.kj-trail .dots{stroke:#dff8ff;stroke-width:10;stroke-dasharray:0 24}
.kj-trail .hintpath{stroke:#ffe38a;stroke-width:9;stroke-dasharray:0 22;filter:drop-shadow(0 0 5px #ffbf2e);animation:kjDash 1s linear infinite}
@keyframes kjDash{to{stroke-dashoffset:-44}}

.kj-coords span{position:absolute;font:800 24px/1 var(--kj-sans);color:#f7ecd0;text-shadow:0 2px 3px rgba(0,0,0,.85),0 0 10px rgba(0,0,0,.6);pointer-events:none}
.kj-coords .f{top:818px;transform:translateX(-50%)}
.kj-coords .r{left:-34px;transform:translateY(-50%)}

/* torches */
.kj-torch{position:absolute;width:0;height:0;pointer-events:none;--k:1}
.kj-torch .halo{position:absolute;left:calc(-80px * var(--k));top:calc(-110px * var(--k));width:calc(160px * var(--k));height:calc(160px * var(--k));border-radius:50%;
  background:radial-gradient(circle,rgba(255,196,96,.55),rgba(255,140,40,.2) 42%,transparent 70%);mix-blend-mode:screen;
  animation:kjHalo 3.1s ease-in-out infinite var(--d,0s);will-change:opacity,transform}
@keyframes kjHalo{0%,100%{opacity:.72;transform:scale(1)}22%{opacity:.95;transform:scale(1.05)}47%{opacity:.78;transform:scale(.98)}68%{opacity:.9;transform:scale(1.03)}}
.kj-torch .flame{position:absolute;left:calc(-17px * var(--k));top:calc(-52px * var(--k));width:calc(34px * var(--k));height:calc(54px * var(--k));
  transform-origin:50% 100%;animation:kjSway 2.3s ease-in-out infinite var(--d,0s);mix-blend-mode:screen}
.kj-torch .flame i{position:absolute;left:50%;bottom:0;transform-origin:50% 100%;border-radius:50% 50% 46% 46% / 64% 64% 36% 36%;filter:blur(calc(1.4px * var(--k)))}
.kj-torch .outer{width:100%;height:100%;margin-left:-50%;background:radial-gradient(ellipse at 50% 78%,rgba(255,170,40,.95),rgba(255,96,20,.75) 48%,rgba(230,60,10,0) 72%);
  animation:kjLick 0.9s ease-in-out infinite alternate var(--d,0s)}
.kj-torch .mid{width:66%;height:78%;margin-left:-33%;background:radial-gradient(ellipse at 50% 80%,#fff3b8,#ffc63d 45%,rgba(255,150,30,0) 74%);
  animation:kjLick 0.62s ease-in-out infinite alternate-reverse var(--d,0s)}
.kj-torch .core{width:34%;height:44%;margin-left:-17%;background:radial-gradient(ellipse at 50% 80%,#fff,#fff6d0 50%,rgba(255,236,160,0) 78%);filter:blur(1px);
  animation:kjLick 0.45s ease-in-out infinite alternate var(--d,0s)}
@keyframes kjLick{0%{transform:scale(1,1) skewX(0)}40%{transform:scale(.94,1.08) skewX(-3deg)}100%{transform:scale(1.04,.93) skewX(2deg)}}
@keyframes kjSway{0%,100%{transform:rotate(0)}30%{transform:rotate(-2.5deg)}65%{transform:rotate(2deg)}}
.kj-torch .ember{position:absolute;left:0;top:calc(-40px * var(--k));width:3px;height:3px;border-radius:50%;background:#ffd98a;
  box-shadow:0 0 5px 2px rgba(255,150,40,.85);opacity:0;animation:kjEmber 4s linear infinite}
@keyframes kjEmber{0%{opacity:0;transform:translate(0,0) scale(1)}10%{opacity:.9}70%{opacity:.5}100%{opacity:0;transform:translate(var(--x),calc(-70px * var(--k))) scale(.4)}}

/* ---------------- sprites ---------------- */
.kj-sprites,.kj-fx{position:absolute;inset:0;pointer-events:none}
/* stage-aligned layer above the HUD frame (z 20): holds the crown when it meets the title */
.kj-stageover{position:absolute;left:0;top:0;width:1225px;height:1284px;transform-origin:0 0;z-index:24;pointer-events:none}
.kj-stageover>*{position:absolute;pointer-events:none!important}
.kj-crownmirror .kj-rays,.kj-crownmirror .kj-crownshadow{display:none}
.kj-sprites>*{position:absolute;pointer-events:auto;cursor:pointer}
.kj-spr{position:absolute;inset:0;width:100%;height:100%;display:block;-webkit-user-drag:none}
.kj-piece .kj-spr{filter:drop-shadow(0 0 7px rgba(90,160,255,.75)) drop-shadow(0 6px 5px rgba(0,0,0,.45))}
.kj-piece,.kj-player{transition:opacity .25s,transform .25s}
.kj-piece::before,.kj-player::before{content:"";position:absolute;left:8%;right:8%;bottom:4%;height:16%;border-radius:50%;
  background:radial-gradient(ellipse,rgba(0,0,0,.5),rgba(0,0,0,0) 70%);transform:translateY(40%)}
.kj-stage.enter .kj-piece{animation:kjDrop .55s cubic-bezier(.3,1.5,.5,1) both}
.kj-stage.enter .kj-crown,.kj-stageover.enter .kj-crown,.kj-stage.enter .kj-key,.kj-stage.enter .kj-gate{animation:kjDrop .6s cubic-bezier(.3,1.4,.5,1) .25s both}
@keyframes kjDrop{from{opacity:0;transform:translateY(-40px) scale(.9)}to{opacity:1;transform:none}}
.kj-piece.gone{opacity:0;transform:scale(.3);pointer-events:none;animation:none!important}
.kj-piece.absorb{animation:kjAbsorb .42s ease-in both}
@keyframes kjAbsorb{to{opacity:0;transform:scale(.2) translateY(20%);filter:brightness(3)}}

.kj-player{z-index:900}
.kj-player .kj-spr{will-change:transform;filter:drop-shadow(0 0 10px rgba(110,255,90,.9)) drop-shadow(0 6px 5px rgba(0,0,0,.45));transform-origin:50% 88%;animation:kjBreathe 2.6s ease-in-out infinite}
.kj-player .kj-aura{position:absolute;left:-10%;right:-10%;bottom:-6%;height:36%;border-radius:50%;
  background:radial-gradient(ellipse,rgba(120,255,110,.55),rgba(120,255,110,0) 68%);animation:kjPulse2 1.6s ease-in-out infinite}
@keyframes kjBreathe{50%{transform:scaleY(1.02) translateY(-1.5%)}}
@keyframes kjPulse2{50%{opacity:.55;transform:scale(1.12)}}
.kj-player.moving .kj-spr{animation:none}
.kj-player.land .kj-spr{animation:kjLand .38s ease-out}
@keyframes kjLand{30%{transform:scale(1.08,.9)}65%{transform:scale(.97,1.04)}}
.kj-player.shake{animation:kjShake .4s}
@keyframes kjShake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
.kj-player.bump{animation:kjBump .4s}
@keyframes kjBump{40%{transform:translateY(-10px)}}
.kj-player.morph .kj-spr{animation:kjMorph .43s ease-in-out}
@keyframes kjMorph{0%{filter:brightness(1)}40%{filter:brightness(4) drop-shadow(0 0 22px #b9ff9a);transform:scale(1.22,.8)}100%{filter:brightness(1);transform:none}}

.kj-crown .kj-crownshadow{position:absolute;left:12%;right:12%;bottom:-24%;height:18%;border-radius:50%;
  background:radial-gradient(ellipse,rgba(60,30,0,.5),rgba(60,30,0,0) 70%);animation:kjShadow 2.4s ease-in-out infinite}
@keyframes kjShadow{50%{transform:scale(.86);opacity:.7}}
.kj-crown .kj-spr{will-change:transform;filter:drop-shadow(0 0 12px rgba(255,200,60,.95)) drop-shadow(0 0 30px rgba(255,170,40,.6));animation:kjFloat 2.4s ease-in-out infinite}
.kj-crown .kj-rays{position:absolute;left:50%;top:38%;width:230%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;pointer-events:none;
  background:repeating-conic-gradient(from 0deg,rgba(255,226,130,.38) 0 7deg,rgba(255,226,130,0) 7deg 22deg);
  -webkit-mask:radial-gradient(circle,#000 18%,transparent 68%);mask:radial-gradient(circle,#000 18%,transparent 68%);
  animation:kjSpin 14s linear infinite;opacity:.8;will-change:transform}
@keyframes kjFloat{50%{transform:translateY(-6%)}}
@keyframes kjSpin{to{transform:translate(-50%,-50%) rotate(360deg)}}
.kj-crown.claimed{z-index:1000!important}
.kj-crown.claimed .kj-spr{animation:kjClaim .5s ease-out forwards}
.kj-crown.flown{opacity:0!important;animation:none!important}
.kj-crown.claimed .kj-rays{opacity:1;width:420%;animation-duration:5s;transition:width .6s}
@keyframes kjClaim{0%{transform:none;filter:drop-shadow(0 0 12px rgba(255,200,60,.95))}100%{transform:scale(1.08);filter:brightness(1.35) drop-shadow(0 0 18px rgba(255,220,90,1)) drop-shadow(0 0 44px rgba(255,180,50,.8))}}

.kj-key .kj-spr{will-change:transform;animation:kjBob 1.8s ease-in-out infinite;
  filter:drop-shadow(0 0 .8px #4a2a02) drop-shadow(0 0 .8px #4a2a02) drop-shadow(0 0 .6px #2a1500) drop-shadow(0 3px 2.5px rgba(20,10,0,.7)) drop-shadow(0 0 7px rgba(255,214,90,.7))}
.kj-key .kj-keyglow{position:absolute;left:-20%;right:-20%;bottom:-8%;height:40%;border-radius:50%;background:radial-gradient(ellipse,rgba(40,22,0,.42),rgba(40,22,0,.18) 45%,transparent 70%)}
@keyframes kjBob{50%{transform:translateY(-12%) rotate(6deg)}}
.kj-key.gone{opacity:0;pointer-events:none;animation:none!important}

.kj-gate .frame{z-index:1}
.kj-gate .bars{position:absolute;left:19.5%;right:19.5%;top:15%;bottom:4%;overflow:hidden;z-index:2}
.kj-gate .bars .kj-spr{position:absolute;inset:auto 0 0 0;width:100%;height:auto;transition:transform .6s cubic-bezier(.5,0,.3,1),opacity .6s}
.kj-gate.opening .bars .kj-spr,.kj-gate.open .bars .kj-spr{transform:translateY(-92%)}
.kj-gate.open .bars{opacity:0}
.kj-gate.open{pointer-events:auto}

/* ---------------- fx ---------------- */
.kj-fx>*{position:absolute;pointer-events:none}
.kj-spark{width:10px;height:10px;margin:-5px;border-radius:50%;background:#e9fbff;box-shadow:0 0 10px 4px rgba(90,210,255,.9);animation:kjSpark .7s ease-out forwards}
@keyframes kjSpark{to{opacity:0;transform:translateY(-14px) scale(.3)}}
.kj-ring{transform:translate(-50%,-50%);border-radius:50%;border:3px solid rgba(255,255,255,.7);animation:kjRing .55s ease-out forwards}
@keyframes kjRing{from{opacity:.9;transform:translate(-50%,-50%) scale(.4)}to{opacity:0;transform:translate(-50%,-50%) scale(1.3)}}
.kj-flash{transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.95),rgba(150,255,130,.55) 30%,transparent 65%);
  animation:kjFlash .75s ease-out forwards;mix-blend-mode:screen}
.kj-flash.gold{background:radial-gradient(circle,rgba(255,255,230,.95),rgba(255,200,70,.6) 32%,transparent 66%)}
.kj-flash.dust{background:radial-gradient(circle,rgba(230,220,200,.7),rgba(200,190,170,.25) 40%,transparent 66%);mix-blend-mode:normal}
@keyframes kjFlash{from{opacity:1;transform:translate(-50%,-50%) scale(.2)}to{opacity:0;transform:translate(-50%,-50%) scale(1.15)}}
.kj-mote{width:12px;height:12px;margin:-6px;border-radius:50%;background:#dcffd0;box-shadow:0 0 12px 4px rgba(120,255,110,.9);animation:kjMote 1s cubic-bezier(.2,.8,.3,1) both}
.kj-mote.gold{background:#fff3c0;box-shadow:0 0 12px 4px rgba(255,200,60,.95)}
.kj-mote.dust{background:#e8dfcf;box-shadow:0 0 6px 2px rgba(200,190,170,.6)}
@keyframes kjMote{from{opacity:1;transform:none}to{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.4)}}
.kj-confetti{position:absolute;inset:0;pointer-events:none;z-index:60;overflow:hidden}
.kj-confetti i{position:absolute;top:-4%;width:10px;height:16px;border-radius:2px;animation:kjConf 2s cubic-bezier(.25,.6,.45,1) both}
@keyframes kjConf{from{transform:translate(0,0) rotate(0)}to{transform:translate(var(--x),110vh) rotate(var(--r))}}

/* =====================================================================
   HUD
   ===================================================================== */
.kj-frame{position:absolute;z-index:20;pointer-events:none}
.kj-frame>*{pointer-events:auto}
.kj-plate{display:flex;flex-direction:column;align-items:center;gap:.18em;padding:.42em 1.5em;margin:0 auto;width:max-content;max-width:100%;
  background:linear-gradient(180deg,#1a1d22,#0c0e12);border:2px solid #b98a37;border-radius:.5em;
  box-shadow:inset 0 0 0 1px rgba(255,230,160,.25),0 4px 10px rgba(0,0,0,.55);
  font:800 1em/1.1 var(--kj-sans);letter-spacing:.12em;text-transform:uppercase;color:#fff;text-align:center}
.kj-plate span:first-child{color:#f6d77e}
.kj-title{position:relative;display:flex;flex-direction:column;align-items:center;padding:.58em 1.25em .5em;border-radius:.6em;
  background:
    linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,0) 40%),
    repeating-linear-gradient(90deg,rgba(0,0,0,.08) 0 2px,rgba(0,0,0,0) 2px 9px),
    linear-gradient(180deg,#4a2d17,#2c1a0d 60%,#21130a);
  border:.14em solid #c99a3e;box-shadow:inset 0 0 0 .06em rgba(255,226,150,.5),inset 0 0 1.2em rgba(0,0,0,.55),0 .35em .8em rgba(0,0,0,.55);pointer-events:none}
.kj-title::before{content:"";position:absolute;inset:.22em;border-radius:.42em;border:.05em solid rgba(214,168,80,.55);pointer-events:none}
.kj-title-main{margin:0;font:900 2.25em/1.05 var(--kj-serif);letter-spacing:.01em;white-space:nowrap;
  background:linear-gradient(180deg,#fff8d8 0%,#ffe08a 38%,#f2b43a 62%,#c9831a 100%);-webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 .06em 0 #5a3308) drop-shadow(0 .1em .1em rgba(0,0,0,.6))}
.kj-title-sub{margin:.34em 0 0;font:700 .5em/1.2 var(--kj-sans);letter-spacing:.2em;text-transform:uppercase;color:#f3e3bd;white-space:nowrap;text-shadow:0 1px 2px rgba(0,0,0,.8)}
.kj-lvl{grid-column:1/-1;padding:.34em .4em .3em;border-bottom:1px solid rgba(214,176,90,.55);
  background:linear-gradient(180deg,rgba(255,214,110,.22),rgba(255,214,110,.04));border-radius:.4em .4em 0 0;
  font:800 .6em/1 var(--kj-sans);letter-spacing:.12em;text-transform:uppercase;color:#ffe08a;text-shadow:0 0 .6em rgba(255,200,80,.5);white-space:nowrap;overflow:hidden;text-overflow:clip}

.kj-panel{display:grid;grid-template-columns:1fr 1fr;align-items:center;text-align:center;
  background:linear-gradient(180deg,rgba(13,22,42,.93),rgba(6,11,24,.93));border:2px solid rgba(214,176,90,.85);border-radius:.55em;
  box-shadow:inset 0 0 0 1px rgba(255,235,180,.18),0 6px 16px rgba(0,0,0,.5);color:#fff}
.kj-count{display:flex;flex-direction:column;align-items:center;padding:.35em .2em .1em}
.kj-count+.kj-count{border-left:1px solid rgba(214,176,90,.45)}
.kj-count .lbl{font:800 .52em/1 var(--kj-sans);letter-spacing:.1em;white-space:nowrap;text-transform:uppercase;color:#e7edf8}
.kj-count b{font:800 1.5em/1.15 var(--kj-sans);color:#fff}
.kj-count b.gold{color:var(--kj-gold)}
.kj-stars{grid-column:1/-1;display:flex;justify-content:center;gap:.18em;padding:.05em 0 .3em}
.kj-stars .star{font-style:normal;font-size:1.05em;line-height:1;color:#39404d;text-shadow:0 1px 0 #000;transition:color .3s,text-shadow .3s}
.kj-stars .star.on{color:#ffd24a;text-shadow:0 0 10px rgba(255,200,60,.8),0 1px 0 #8a5a00}
.kj-keys{grid-column:1/-1;display:flex;justify-content:center;gap:.2em;padding:0 0 .3em}
.kj-keys[hidden]{display:none}
.kj-keyslot{width:1.05em;height:1.05em;opacity:.28;filter:grayscale(1)}
.kj-keyslot img{width:100%;height:100%;object-fit:contain}
.kj-keyslot.have{opacity:1;filter:drop-shadow(0 0 6px rgba(255,200,60,.9))}
.kj-keys.pulse{animation:kjBtnPulse .5s}

.kj-btn{display:inline-flex;align-items:center;justify-content:center;gap:.55em;border-radius:999px;cursor:pointer;
  padding:.5em 1.1em .5em .6em;border:2px solid rgba(130,196,255,.85);
  background:linear-gradient(180deg,#15284c,#0a1630);color:#fff;font:800 1em/1 var(--kj-sans);letter-spacing:.08em;text-transform:uppercase;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 0 12px rgba(80,170,255,.35),0 4px 10px rgba(0,0,0,.45);text-decoration:none;
  transition:transform .12s,box-shadow .2s,filter .2s}
.kj-btn:hover{filter:brightness(1.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 0 18px rgba(90,180,255,.7),0 4px 10px rgba(0,0,0,.45)}
.kj-btn:active{transform:scale(.96)}
.kj-btn:disabled{opacity:.45;cursor:default;filter:saturate(.4)}
.kj-btn .ic{flex:none;display:inline-grid;place-items:center;width:1.5em;height:1.5em;font-size:1em;line-height:1}
.kj-btn .ic.bulb{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.45' cy='.35' r='.7'%3E%3Cstop offset='0' stop-color='%23fff8c4'/%3E%3Cstop offset='.55' stop-color='%23ffd23e'/%3E%3Cstop offset='1' stop-color='%23f0a000'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 2a7 7 0 0 0-4.2 12.6c.7.6 1.2 1.4 1.2 2.4h6c0-1 .5-1.8 1.2-2.4A7 7 0 0 0 12 2z' fill='url(%23g)'/%3E%3Crect x='9' y='18' width='6' height='1.8' rx='.9' fill='%23c9d3e0'/%3E%3Crect x='9.6' y='20.4' width='4.8' height='1.6' rx='.8' fill='%23a8b3c2'/%3E%3C/svg%3E") center/contain no-repeat;
  filter:drop-shadow(0 0 5px rgba(255,210,60,.9))}
.kj-btn.primary{border-color:#ffd978;background:linear-gradient(180deg,#f6c24d,#c98714);color:#2b1700;box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 0 16px rgba(255,190,60,.55),0 4px 10px rgba(0,0,0,.45)}
.kj-btn.pulse{animation:kjBtnPulse .5s 3}
@keyframes kjBtnPulse{50%{transform:scale(1.08);box-shadow:0 0 22px rgba(255,220,90,.95)}}

.kj-coach{position:relative;aspect-ratio:600/720}
/* pose art: any aspect ratio; feet on the bottom edge, height = box height x --pose-scale */
.kj-mascot{position:absolute;bottom:0;left:0;right:0;margin:0 auto;height:calc(100% * var(--pose-scale,1));width:auto;max-width:none;translate:var(--pose-x,0%) 0;
  will-change:transform;display:block;filter:drop-shadow(0 8px 10px rgba(0,0,0,.5));cursor:pointer;transform-origin:50% 100%;animation:kjIdle 3.2s ease-in-out infinite;transition:opacity .13s ease}
.kj-mascot:not([src]){visibility:hidden}
.kj-mascot.swap{opacity:0}
.kj-mascot.cheer{animation:kjCheer .6s ease-out,kjIdle 3.2s ease-in-out .6s infinite}
.kj-mascot.think{animation:kjThink .7s ease-out,kjIdle 3.2s ease-in-out .7s infinite}
@keyframes kjIdle{50%{transform:translateY(-2.5%) rotate(-1deg)}}
@keyframes kjCheer{30%{transform:translateY(-10%) scale(1.04)}60%{transform:translateY(0) scale(.98,1.02)}}
@keyframes kjThink{40%{transform:rotate(-6deg)}}
.kj-bubble{position:absolute;opacity:0;transform:translateY(8px) scale(.92);transform-origin:20% 100%;transition:opacity .25s,transform .3s cubic-bezier(.3,1.5,.5,1);
  background:linear-gradient(180deg,#132a58,#0b1a3c);border:2px solid rgba(140,200,255,.85);border-radius:1em;
  box-shadow:0 0 16px rgba(80,170,255,.45),0 6px 14px rgba(0,0,0,.5);color:#fff;font:700 1em/1.3 var(--kj-sans);text-align:center;padding:.7em .9em;pointer-events:none}
.kj-bubble.show{opacity:1;transform:none}
.kj-bubble::after{content:"";position:absolute;width:.9em;height:.9em;background:#0b1a3c;border-right:2px solid rgba(140,200,255,.85);border-bottom:2px solid rgba(140,200,255,.85)}

.kj-plaque{display:flex;align-items:center;justify-content:center;text-align:center;
  background:linear-gradient(180deg,rgba(26,24,22,.95),rgba(12,11,10,.95));border:2px solid #b98a37;border-radius:.45em;
  box-shadow:inset 0 0 0 1px rgba(255,230,160,.2),0 6px 14px rgba(0,0,0,.55);color:#f7ecd4;font:700 1em/1.3 var(--kj-sans);letter-spacing:.01em;padding:.55em 1.2em}
.kj-plaque[hidden]{display:none}

/* ---------------- LANDSCAPE: HUD scales with the painting (--u) ---------------- */
.landscape .kj-frame{font-size:calc(var(--u) * 26px)}
.landscape .kj-brand{position:absolute;left:calc(var(--u) * 641px);top:calc(var(--u) * 80px);transform:translateX(-50%);font-size:calc(var(--u) * 26px);text-align:center;pointer-events:none}
.landscape .kj-plate{position:absolute;left:50%;transform:translateX(-50%);top:calc(var(--u) * 1036px);font-size:calc(var(--u) * 20px);white-space:nowrap}
.landscape .kj-plaque{top:calc(var(--u) * 1118px);bottom:auto;min-height:0!important;font-size:calc(var(--u) * 24px)!important;width:auto!important;max-width:calc(var(--u) * 640px);white-space:nowrap}
.landscape .kj-right{position:absolute;top:calc(var(--u) * 300px);right:calc(var(--u) * 14px - min(var(--spare) * .75, 230px));width:calc(var(--u) * 204px);
  display:flex;flex-direction:column;align-items:stretch;gap:calc(var(--u) * 20px)}
.kj-right[hidden]{display:none}
.landscape .kj-panel{font-size:calc(var(--u) * 40px)}
.landscape .kj-btn{font-size:calc(var(--u) * 22px);min-width:calc(var(--u) * 188px)}
.landscape #kjMenuBtn{position:absolute;left:calc(var(--u) * 22px - min(var(--spare) * .75, 230px));bottom:calc(var(--u) * 26px)}
.landscape .kj-coach{position:absolute;left:calc(var(--u) * 4px - min(var(--spare) * .5, 150px));top:calc(var(--u) * 372px);width:calc(var(--u) * 262px)}
.landscape .kj-bubble{left:calc(var(--u) * 6px);top:calc(100% + var(--u) * 16px);width:calc(var(--u) * 290px);font-size:calc(var(--u) * 24px);transform-origin:40% 0}
.landscape .kj-bubble::after{left:40%;top:calc(var(--u) * -12px);transform:rotate(-135deg)}
.landscape .kj-plaque{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(var(--u) * 44px);width:calc(var(--u) * 560px);min-height:calc(var(--u) * 84px);font-size:calc(var(--u) * 27px)}

/* ---------------- PORTRAIT: HUD above / below the zoomed board ---------------- */
.kj-top[hidden],.kj-bottom[hidden]{display:none}
.portrait .kj-top{flex:none;display:flex;justify-content:center;padding:6px 10px 4px;background:linear-gradient(180deg,#0d1d12,rgba(13,29,18,0));position:relative;z-index:5}
.portrait .kj-brand{width:min(80vw,380px);text-align:center}
.portrait .kj-top{flex-direction:column;align-items:center}
.portrait .kj-plate{font-size:clamp(9.5px,2.7vw,12px);margin-top:-2px}
.portrait .kj-bottom{flex:none;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;
  padding:8px 10px calc(10px + env(safe-area-inset-bottom));background:linear-gradient(0deg,#07110a,rgba(7,17,10,.85));position:relative;z-index:5}
.portrait .kj-panel{font-size:15px;grid-template-columns:auto auto auto auto;min-width:0}
.portrait .kj-lvl{grid-column:auto;align-self:stretch;display:flex;align-items:center;padding:0 10px;border-bottom:0;border-right:1px solid rgba(214,176,90,.55);border-radius:.4em 0 0 .4em;font-size:11px;letter-spacing:.14em}
.portrait .kj-count{flex-direction:row;gap:6px;padding:6px 10px}
.portrait .kj-count .lbl{font-size:10px}
.portrait .kj-count b{font-size:19px}
.portrait .kj-stars{grid-column:auto;padding:0 10px;border-left:1px solid rgba(214,176,90,.45);font-size:17px}
.portrait .kj-keys{grid-column:1/-1;padding:0 0 4px}
.portrait .kj-buttons{display:flex;gap:6px}
.portrait .kj-btn{font-size:12.5px;padding:.55em .9em .55em .55em;gap:.35em}
.portrait .kj-brand{font-size:clamp(11px,3.3vw,14px)}
.portrait .kj-coach{order:3;position:relative;display:flex;align-items:center;gap:8px;width:min(96vw,460px);aspect-ratio:auto;margin-top:5px}
.portrait .kj-mascot{order:0;position:static;flex:none;height:clamp(66px,19vw,86px);width:auto;margin:0;translate:none}
.portrait .kj-bubble{order:1;position:relative;left:auto;top:auto;flex:1 1 auto;width:auto;max-width:none;opacity:1;transform:none;
  font-size:clamp(12px,3.4vw,14px);line-height:1.28;text-align:left;padding:.5em .75em}
.portrait .kj-bubble.show{animation:kjBubbleIn .3s ease-out}
@keyframes kjBubbleIn{from{opacity:.35;transform:translateX(-4px)}to{opacity:1;transform:none}}
.portrait .kj-bubble::after{left:-.55em;top:50%;margin-top:-.45em;transform:rotate(135deg)}

/* ---------------- overlays ---------------- */
.kj-overlay{position:absolute;inset:0;z-index:50;display:grid;place-items:center;padding:16px;background:radial-gradient(ellipse at 50% 40%,rgba(6,12,28,.35),rgba(3,6,14,.78))}
/* Portrait dialogs need the whole game area, not the short board viewport.
   Allow scrolling on short screens and when translated text wraps. */
.portrait > .kj-overlay{display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;padding:64px 12px 20px;-webkit-overflow-scrolling:touch}
.portrait > .kj-overlay .kj-card{flex:none;box-sizing:border-box;width:100%;max-width:440px;margin:auto}
.portrait > .kj-overlay .kj-card.wide{max-width:640px}
.kj-overlay[hidden]{display:none}
.kj-overlay.show .kj-card{animation:kjCard .45s cubic-bezier(.3,1.4,.5,1)}
@keyframes kjCard{from{opacity:0;transform:translateY(24px) scale(.9)}to{opacity:1;transform:none}}
.kj-card{position:relative;width:min(92vw,440px);padding:26px 24px 20px;text-align:center;border-radius:18px;color:#fff;
  background:linear-gradient(180deg,#132650,#0a1531 70%,#081026);border:2px solid #d6ae55;
  box-shadow:inset 0 0 0 1px rgba(255,235,180,.22),0 0 40px rgba(255,200,80,.25),0 20px 50px rgba(0,0,0,.6)}
.kj-card.wide{width:min(94vw,640px)}
.rs-crown{width:120px;height:92px;margin:-78px auto 2px;background:url(/assets/images/fun/kings-journey-v2/sprite-crown.webp) center/contain no-repeat;filter:drop-shadow(0 0 18px rgba(255,200,60,.9))}
.rs-title,.mn-title{margin:0;font:900 clamp(26px,6vw,36px)/1.05 var(--kj-serif);letter-spacing:.02em;
  background:linear-gradient(180deg,#fff6cf,#ffd45a 45%,#d48f16);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 2px 0 rgba(60,30,0,.8))}
.rs-sub,.mn-sub{margin:6px 0 0;font:700 13px/1.3 var(--kj-sans);letter-spacing:.12em;text-transform:uppercase;color:#bcd0f0}
.rs-stars{display:flex;justify-content:center;gap:10px;margin:16px 0 8px}
.rs-star{font-style:normal;font-size:58px;line-height:1;color:#2a3244;text-shadow:0 2px 0 #000}
.rs-star:nth-child(2){font-size:70px;margin-top:-10px}
.rs-star.on{color:#ffd24a;text-shadow:0 0 18px rgba(255,200,60,.9),0 3px 0 #9a6400}
.rs-star.pop{animation:kjStar .5s cubic-bezier(.3,1.8,.5,1)}
@keyframes kjStar{from{transform:scale(2.4) rotate(-30deg);opacity:0}to{transform:none;opacity:1}}
.rs-stats{display:flex;justify-content:center;gap:28px;margin:4px 0 6px}
.rs-stats div{display:flex;flex-direction:column}
.rs-stats b{font:800 28px/1 var(--kj-sans)}
.rs-stats .rs-par{color:var(--kj-gold)}
.rs-stats span{font:800 10px/1.6 var(--kj-sans);letter-spacing:.16em;text-transform:uppercase;color:#aebfdc}
.rs-msg,.rs-end{margin:8px 0 14px;font:600 15px/1.4 var(--kj-sans);color:#e6eefc}
.rs-end{color:#ffe08a}
.rs-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.rs-actions .kj-btn{font-size:14px;padding:.75em 1.3em .75em 1em}
.rs-link,.mn-x{margin-top:12px;background:none;border:0;color:#9fc4ff;font:700 13px var(--kj-sans);letter-spacing:.08em;text-transform:uppercase;cursor:pointer}
.mn-x{position:absolute;right:10px;top:4px;font-size:20px;margin:0;color:#cfe0ff}
.mn-kicker{margin:0 0 2px;font:800 12px/1 var(--kj-sans);letter-spacing:.22em;text-transform:uppercase;color:#ffd978}
.mn-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0 16px}
.mn-level{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px 8px;border-radius:14px;cursor:pointer;color:#fff;
  background:linear-gradient(180deg,#1b3a2a,#10261a);border:2px solid rgba(214,176,90,.7);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 4px 10px rgba(0,0,0,.4);transition:transform .12s,filter .2s}
.mn-level:hover{transform:translateY(-2px);filter:brightness(1.15)}
.mn-level.current{border-color:#9fe07a;box-shadow:0 0 14px rgba(120,255,110,.6)}
.mn-level:disabled{cursor:default;filter:grayscale(.8) brightness(.6)}
.mn-level .num{font:900 24px/1 var(--kj-serif);color:#ffe08a}
.mn-level .nm{font:700 10px/1.2 var(--kj-sans);letter-spacing:.04em;min-height:2.4em;display:flex;align-items:center;text-align:center}
.mn-level .st i{font-style:normal;color:#39404d;font-size:13px}
.mn-level .st i.on{color:#ffd24a}
.mn-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.mn-actions .kj-btn{font-size:13px}


@media (prefers-reduced-motion:reduce){
  .kj-player .kj-spr,.kj-crown .kj-spr,.kj-key .kj-spr,.kj-mascot,.kj-crown .kj-rays,.kj-mark.crown,.kj-player .kj-aura{animation:none!important}
}

/* =====================================================================
   CROWN COMPLETION — the crown flies above the title plaque (own top layer)
   ===================================================================== */
.kj-crownfly{position:absolute;z-index:60;pointer-events:none;transform-origin:50% 50%;will-change:transform}
.kj-crownfly img{position:relative;display:block;width:100%;height:100%;
  filter:brightness(1.2) drop-shadow(0 0 12px rgba(255,210,70,1)) drop-shadow(0 0 34px rgba(255,170,40,.75))}
.kj-crownfly .halo{position:absolute;left:50%;top:50%;width:210%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;
  background:radial-gradient(circle,rgba(255,236,160,.6),rgba(255,200,80,.22) 38%,transparent 66%);animation:kjHalo 1.2s ease-in-out infinite alternate}
.kj-crownfly .rays{position:absolute;left:50%;top:48%;width:300%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;
  background:repeating-conic-gradient(from 0deg,rgba(255,226,130,.42) 0 6deg,rgba(255,226,130,0) 6deg 20deg);
  -webkit-mask:radial-gradient(circle,#000 14%,transparent 64%);mask:radial-gradient(circle,#000 14%,transparent 64%);animation:kjSpin 10s linear infinite;opacity:.85}
.kj-crownfly.landed img{animation:kjCrownLand .6s ease-out}
.kj-crownfly.landed .halo{animation:kjHaloFlash .7s ease-out,kjHalo 1.4s ease-in-out .7s infinite alternate}
.kj-crownfly .spark{position:absolute;left:50%;top:45%;width:9%;aspect-ratio:1;margin:-4.5% 0 0 -4.5%;
  background:radial-gradient(circle,#fff 0 22%,rgba(255,226,120,.9) 38%,transparent 70%);
  clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);animation:kjSpark .75s ease-out both}
@keyframes kjHalo{from{opacity:.75}to{opacity:1;transform:translate(-50%,-50%) scale(1.08)}}
@keyframes kjHaloFlash{0%{transform:translate(-50%,-50%) scale(.6);opacity:1}40%{transform:translate(-50%,-50%) scale(1.5);opacity:1}100%{transform:translate(-50%,-50%) scale(1);opacity:.85}}
@keyframes kjCrownLand{0%{transform:scale(1)}35%{transform:scale(1.1,.94);filter:brightness(1.9) drop-shadow(0 0 20px #fff2b0)}100%{transform:none}}
@keyframes kjSpark{0%{transform:translate(0,0) scale(.3);opacity:0}25%{opacity:1}100%{transform:translate(calc(var(--dx) * 2.6),calc(var(--dy) * 2.6)) scale(1.1) rotate(90deg);opacity:0}}
@media (prefers-reduced-motion:reduce){.kj-crownfly .rays,.kj-crownfly .halo,.kj-crownfly img,.kj-crownfly .spark{animation:none!important}}
.kj-title.crowned{animation:kjCrowned 1.1s ease-out}
@keyframes kjCrowned{30%{box-shadow:inset 0 0 0 .06em rgba(255,226,150,.8),inset 0 0 1.2em rgba(0,0,0,.4),0 0 1.4em .3em rgba(255,210,90,.75),0 .35em .8em rgba(0,0,0,.55);filter:brightness(1.18)}}
/* portrait: the title sits at the very top, so it steps down to leave the crown room above it */
.portrait .kj-top{transition:padding-top .3s ease}
.portrait.won .kj-top{padding-top:calc(6px + min(12vw, 52px))}

/* =====================================================================
   CHAPTER 2 MECHANICS — coloured keys & gates, rune switches, crystal
   barriers, cracked floor. (All state comes from the engine; classes only.)
   ===================================================================== */
/* coloured keys: the gold key sprite re-tinted; each colour has its own glow */
.kj-key.c-blue .kj-spr{filter:hue-rotate(172deg) saturate(1.35) brightness(1.02) drop-shadow(0 0 .8px #0b2352) drop-shadow(0 0 .8px #0b2352) drop-shadow(0 3px 2.5px rgba(5,10,30,.7)) drop-shadow(0 0 7px rgba(90,160,255,.8))}
.kj-key.c-red .kj-spr{filter:hue-rotate(-44deg) saturate(1.9) brightness(.98) drop-shadow(0 0 .8px #4a0808) drop-shadow(0 0 .8px #4a0808) drop-shadow(0 3px 2.5px rgba(30,5,5,.7)) drop-shadow(0 0 7px rgba(255,90,80,.8))}
.kj-key.c-blue .kj-keyglow{background:radial-gradient(ellipse,rgba(10,30,80,.45),rgba(60,130,255,.2) 45%,transparent 70%)}
.kj-key.c-red .kj-keyglow{background:radial-gradient(ellipse,rgba(60,8,8,.45),rgba(255,80,70,.2) 45%,transparent 70%)}
/* coloured gates: finials + lock plate take the key colour, plus a coloured halo at the foot */
.kj-gate.c-blue .kj-spr{filter:hue-rotate(172deg) saturate(1.5)}
.kj-gate.c-red .kj-spr{filter:hue-rotate(-44deg) saturate(2)}
.kj-gate.c-blue::after,.kj-gate.c-red::after,.kj-gate.c-gold::after{content:"";position:absolute;left:8%;right:8%;bottom:-2%;height:16%;border-radius:50%;z-index:0;
  background:radial-gradient(ellipse,var(--gc),transparent 70%);opacity:.75;transition:opacity .5s}
.kj-gate.c-gold{--gc:rgba(255,205,80,.55)} .kj-gate.c-blue{--gc:rgba(80,150,255,.75)} .kj-gate.c-red{--gc:rgba(255,80,70,.75)}
.kj-gate.open::after{opacity:0}
.kj-keyslot.c-blue img{filter:hue-rotate(172deg) saturate(1.35)}
.kj-keyslot.c-red img{filter:hue-rotate(-44deg) saturate(1.9)}
.kj-keyslot.have.c-blue{filter:drop-shadow(0 0 6px rgba(90,160,255,.95))}
.kj-keyslot.have.c-red{filter:drop-shadow(0 0 6px rgba(255,90,80,.95))}

/* crystal barriers (upright): shards sink into the floor when open */
.kj-barrier{pointer-events:auto}
.kj-barrier .bars{position:absolute;inset:0;overflow:hidden}
.kj-barrier .bars .kj-spr{display:none}
.kj-barrier .bars::before{content:"";position:absolute;inset:0;background:var(--crystal) center bottom/100% 100% no-repeat;
  transform-origin:50% 100%;transition:transform .55s cubic-bezier(.5,0,.3,1),opacity .55s;filter:drop-shadow(0 0 6px var(--bc)) drop-shadow(0 4px 4px rgba(0,0,0,.45));
  animation:kjShimmer 2.8s ease-in-out infinite}
.kj-barrier .glow{position:absolute;left:4%;right:4%;bottom:-6%;height:22%;border-radius:50%;background:radial-gradient(ellipse,var(--bc),transparent 70%);opacity:.9;transition:opacity .5s}
.kj-barrier.open .bars::before{transform:translateY(78%) scaleY(.22);opacity:.55;animation:none;filter:drop-shadow(0 0 4px var(--bc))}
.kj-barrier.open .glow{opacity:.35}
.kj-barrier.open{pointer-events:none}
.kj-barrier.rising .bars::before{animation:kjRise .5s cubic-bezier(.3,1.5,.5,1)}
.kj-barrier.c-cyan{--bc:rgba(80,235,255,.85);--crystal:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23dffcff%22/%3E%3Cstop offset=%22.45%22 stop-color=%22%233fd8f0%22/%3E%3Cstop offset=%221%22 stop-color=%22%230a6b8c%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points=%2263,8 79,38 75,143 51,143 47,38%22 fill=%22url(%23g)%22 opacity=%221%22 stroke=%22%23e9feff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2233,46 45,68 44,143 25,143 21,70%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23e9feff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2293,42 105,66 103,143 83,143 80,68%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23e9feff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2214,92 22,106 21,143 8,143 6,108%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23e9feff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%22112,90 121,104 119,143 105,143 103,106%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23e9feff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolyline points=%2258,40 57,130%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2230,74 30,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2288,72 88,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3C/svg%3E")}
.kj-barrier.c-violet{--bc:rgba(190,120,255,.85);--crystal:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23f4e6ff%22/%3E%3Cstop offset=%22.45%22 stop-color=%22%23b070ff%22/%3E%3Cstop offset=%221%22 stop-color=%22%234b1f8a%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points=%2263,8 79,38 75,143 51,143 47,38%22 fill=%22url(%23g)%22 opacity=%221%22 stroke=%22%23f7eeff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2233,46 45,68 44,143 25,143 21,70%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23f7eeff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2293,42 105,66 103,143 83,143 80,68%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23f7eeff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2214,92 22,106 21,143 8,143 6,108%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23f7eeff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%22112,90 121,104 119,143 105,143 103,106%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23f7eeff%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolyline points=%2258,40 57,130%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2230,74 30,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2288,72 88,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3C/svg%3E")}
@keyframes kjShimmer{50%{filter:drop-shadow(0 0 11px var(--bc)) drop-shadow(0 4px 4px rgba(0,0,0,.45)) brightness(1.12)}}
@keyframes kjRise{0%{transform:translateY(90%) scaleY(.3)}100%{transform:none}}
/* flat parts on the board: barrier bases + rune switches */
.kj-fixtures{position:absolute;inset:0;pointer-events:none}
.kj-barbase{position:absolute;width:100px;height:100px;border-radius:10px;box-shadow:inset 0 0 22px 4px var(--bc);background:radial-gradient(circle,transparent 45%,var(--bc) 120%);opacity:.9;transition:opacity .5s}
.kj-barbase.open{opacity:.35}
.kj-barbase.c-cyan{--bc:rgba(80,235,255,.75)} .kj-barbase.c-violet{--bc:rgba(190,120,255,.75)}
.kj-rune{position:absolute;width:100px;height:100px}
.kj-rune .ring{position:absolute;inset:6px;border-radius:50%;background:var(--rune) center/contain no-repeat;filter:drop-shadow(0 3px 2px rgba(0,0,0,.55))}
.kj-rune .glyph{position:absolute;inset:0;border-radius:50%;background:radial-gradient(circle,var(--rc) 0,transparent 62%);opacity:.25;transition:opacity .3s}
.kj-rune.on .glyph{opacity:1;animation:kjRunePulse 1.6s ease-in-out infinite}
.kj-rune.on .ring{filter:drop-shadow(0 0 10px var(--rc)) drop-shadow(0 3px 2px rgba(0,0,0,.55)) brightness(1.25)}
.kj-rune.press{animation:kjPress .35s ease-out}
.kj-rune.c-cyan{--rc:rgba(80,235,255,.9);--rune:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2243%22 fill=%22%235d5a52%22 stroke=%22%232f2d29%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2235%22 fill=%22%237d7a70%22 stroke=%22%23a9a598%22 stroke-width=%222%22/%3E%3Cg fill=%22none%22 stroke=%22%235ff0ff%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2227%22 stroke-width=%223%22 stroke-dasharray=%226 5%22/%3E%3Cpath d=%22M50 28 L64 50 L50 72 L36 50 Z%22/%3E%3Cpath d=%22M50 38 L50 62 M42 50 L58 50%22/%3E%3C/g%3E%3C/svg%3E")}
.kj-rune.c-violet{--rc:rgba(190,120,255,.9);--rune:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2243%22 fill=%22%235d5a52%22 stroke=%22%232f2d29%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2235%22 fill=%22%237d7a70%22 stroke=%22%23a9a598%22 stroke-width=%222%22/%3E%3Cg fill=%22none%22 stroke=%22%23c795ff%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2227%22 stroke-width=%223%22 stroke-dasharray=%226 5%22/%3E%3Cpath d=%22M50 28 L64 50 L50 72 L36 50 Z%22/%3E%3Cpath d=%22M50 38 L50 62 M42 50 L58 50%22/%3E%3C/g%3E%3C/svg%3E")}
@keyframes kjRunePulse{50%{opacity:.6}}
@keyframes kjPress{40%{transform:scale(.86)}}
.kj-mote.rune-cyan{background:#8ff6ff;box-shadow:0 0 8px #3de6ff}
.kj-mote.rune-violet{background:#e1b8ff;box-shadow:0 0 8px #a35cff}
.kj-flash.rune-cyan{background:radial-gradient(circle,rgba(140,245,255,.8),transparent 65%)}
.kj-flash.rune-violet{background:radial-gradient(circle,rgba(210,160,255,.8),transparent 65%)}
/* cracked floor: visible cracks; collapsed = a dark chasm */
.kj-tile.crack::after{content:"";position:absolute;inset:0;filter:drop-shadow(0 0 1px rgba(255,240,200,.6));background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cg fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M8 22 L30 38 L26 55 L44 62 L52 84 L60 96%22 stroke=%22%231d160c%22 stroke-width=%224.5%22 stroke-opacity=%22.85%22/%3E%3Cpath d=%22M30 38 L52 30 L70 12%22 stroke=%22%231d160c%22 stroke-width=%223.5%22 stroke-opacity=%22.8%22/%3E%3Cpath d=%22M44 62 L68 58 L90 70%22 stroke=%22%231d160c%22 stroke-width=%223.5%22 stroke-opacity=%22.8%22/%3E%3Cpath d=%22M26 55 L10 70%22 stroke=%22%231d160c%22 stroke-width=%222.5%22 stroke-opacity=%22.7%22/%3E%3Cpath d=%22M68 58 L78 40%22 stroke=%22%231d160c%22 stroke-width=%222.5%22 stroke-opacity=%22.7%22/%3E%3Cpath d=%22M9 21 L31 37 L27 54 L45 61 L53 83%22 stroke=%22%23fff3d0%22 stroke-width=%221.4%22 stroke-opacity=%22.45%22 transform=%22translate(1.5 1.5)%22/%3E%3C/g%3E%3C/svg%3E") center/86% 86% no-repeat;transform:rotate(var(--rot,0deg));pointer-events:none}
.kj-tile.crack::before{content:"";position:absolute;inset:0;border-radius:6px;box-shadow:inset 0 0 0 3px rgba(60,40,15,.35);pointer-events:none}
.kj-tile.crack.gone{background:radial-gradient(ellipse at 50% 55%,#050403 0 38%,#17110a 62%,#3a2d1d 86%,#5b4a33 100%)!important;box-shadow:inset 0 10px 18px rgba(0,0,0,.85),inset 0 -4px 6px rgba(120,95,60,.35)}
.kj-tile.crack.gone::after{opacity:0}
.kj-tile.crumble{animation:kjCrumble .5s ease-in}
@keyframes kjCrumble{0%{transform:none;filter:brightness(1.2)}30%{transform:translate(2px,-1px) rotate(1deg)}60%{transform:translate(-2px,1px) scale(.96)}100%{transform:none}}
@media (prefers-reduced-motion:reduce){.kj-barrier .bars::before,.kj-rune.on .glyph{animation:none!important}}

/* level menu: chapters */
.mn-grid{display:block;max-height:min(58vh,520px);overflow:auto;padding-right:4px;margin:14px 0 12px}
.mn-chapter{display:flex;align-items:baseline;gap:8px;margin:12px 2px 6px;font:800 11px/1.2 var(--kj-sans);letter-spacing:.14em;text-transform:uppercase;color:#bcd0f0}
.mn-chapter:first-child{margin-top:0}
.mn-chapter b{font:700 15px/1.2 var(--kj-serif);letter-spacing:.02em;text-transform:none;color:#ffe08a}
.mn-chapter .st{margin-left:auto;color:#ffd24a;letter-spacing:.06em}
.mn-sec{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.mn-sec .mn-level .nm{overflow-wrap:break-word;hyphens:auto}
@media (max-width:380px){.mn-sec .mn-level .nm{font-size:8.5px;letter-spacing:0}}
@media (max-width:520px){.mn-sec{grid-template-columns:repeat(4,minmax(0,1fr))}.mn-grid{max-height:min(46vh,420px)}}
/* level menu always fits the play area: the level list scrolls, title and actions stay visible */
.kj-menu .kj-card{max-height:100%;display:flex;flex-direction:column;box-sizing:border-box}
.kj-menu .mn-grid{flex:1 1 auto;min-height:0;max-height:none}
.kj-menu .mn-actions{flex:none}
.kj-menu.kj-overlay{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr);justify-items:center}

/* ================= Chapters 3-5: rolling stones, pulse crystals, seals, jewels, trials ================= */
.kj-barrier.c-amber{--bc:rgba(255,180,60,.9);--crystal:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23fff4d6%22/%3E%3Cstop offset=%22.45%22 stop-color=%22%23ffb52e%22/%3E%3Cstop offset=%221%22 stop-color=%22%238a4a06%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points=%2263,8 79,38 75,143 51,143 47,38%22 fill=%22url(%23g)%22 opacity=%221%22 stroke=%22%23fff6e0%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2233,46 45,68 44,143 25,143 21,70%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23fff6e0%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2293,42 105,66 103,143 83,143 80,68%22 fill=%22url(%23g)%22 opacity=%220.92%22 stroke=%22%23fff6e0%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%2214,92 22,106 21,143 8,143 6,108%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23fff6e0%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolygon points=%22112,90 121,104 119,143 105,143 103,106%22 fill=%22url(%23g)%22 opacity=%220.85%22 stroke=%22%23fff6e0%22 stroke-opacity=%22.75%22 stroke-width=%221.6%22 stroke-linejoin=%22round%22/%3E%3Cpolyline points=%2258,40 57,130%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2230,74 30,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3Cpolyline points=%2288,72 88,132%22 fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%22.7%22 stroke-width=%222.2%22 stroke-linecap=%22round%22/%3E%3C/svg%3E")}
.kj-barbase.c-amber{--bc:rgba(255,176,50,.75)}
.kj-pulse.open .bars::before{transform:translateY(80%) scaleY(.2);opacity:.6}
.kj-pulse.sinking .bars::before{animation:kjSinkP .3s ease-in}
@keyframes kjSinkP{from{transform:none;opacity:1}}
.kj-mote.seal{background:#d8f8ff;box-shadow:0 0 10px 3px rgba(120,220,255,.9)}
.kj-flash.seal{background:radial-gradient(circle,rgba(200,245,255,.85),transparent 65%)}
.kj-mote.ruby{background:#ffd0da;box-shadow:0 0 10px 3px rgba(255,60,100,.9)}
.kj-flash.ruby{background:radial-gradient(circle,rgba(255,200,215,.9),rgba(230,40,80,.45) 35%,transparent 66%)}
/* rolling stone + its track */
.kj-tracks{position:absolute;left:0;top:0;width:800px;height:800px;overflow:visible}
.kj-tracks .rail{fill:none;stroke:rgba(40,28,14,.55);stroke-width:16;stroke-linecap:round;stroke-linejoin:round}
.kj-tracks .dots{fill:none;stroke:rgba(255,226,160,.8);stroke-width:4;stroke-dasharray:2 12;stroke-linecap:round;stroke-linejoin:round}
.kj-tracks circle{fill:rgba(60,42,20,.65);stroke:rgba(255,220,150,.7);stroke-width:2.5}
.kj-boulder{pointer-events:auto}
.kj-boulder .kj-spr{position:absolute;inset:0;width:100%;height:100%;transform-origin:50% 55%;filter:drop-shadow(0 6px 5px rgba(0,0,0,.45))}
.kj-boulder .shadow{position:absolute;left:8%;right:8%;bottom:-4%;height:22%;border-radius:50%;background:radial-gradient(ellipse,rgba(0,0,0,.5),transparent 70%)}
.kj-mark.stonenext{inset:auto;border:5px dashed rgba(255,150,60,1);background:radial-gradient(circle,rgba(255,110,40,.34),rgba(255,110,40,.12) 60%,transparent 72%);border-radius:50%;box-shadow:0 0 14px rgba(255,120,40,.8);animation:kjStoneNext 1.2s ease-in-out infinite}
@keyframes kjStoneNext{50%{opacity:.55;transform:scale(.9)}}
/* Royal Seal plates */
.kj-seal{position:absolute;width:100px;height:100px}
.kj-seal .plate{position:absolute;inset:5px;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22n%22 cx=%22.42%22 cy=%22.36%22 r=%22.72%22%3E%3Cstop offset=%220%22 stop-color=%22%2323355e%22/%3E%3Cstop offset=%221%22 stop-color=%22%23111a30%22/%3E%3C/radialGradient%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23e2bf73%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%23c19446%22/%3E%3Cstop offset=%221%22 stop-color=%22%238e6a2c%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2245%22 fill=%22%235c574b%22 stroke=%22%232c2922%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2237.5%22 fill=%22url(%23n)%22 stroke=%22%238f8670%22 stroke-width=%222.5%22/%3E%3Cpath d=%22M46.8 42.5 L46.8 26.6 L40.5 26.6 L40.5 20.2 L46.8 20.2 L46.8 13.5 L53.2 13.5 L53.2 20.2 L59.5 20.2 L59.5 26.6 L53.2 26.6 L53.2 42.5 Z%22 fill=%22url(%23g)%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M30 65 C24.5 58 21 50 22.5 43 C24.5 36 30 32.5 36 32.8 C42.5 33.2 47.5 37.5 50 41.5 C52.5 37.5 57.5 33.2 64 32.8 C70 32.5 75.5 36 77 43 C79 50 75.5 58 70 65 Z M35 61.2 C30 56.5 27.8 50.5 28.8 45 C29.8 40 33.6 37.8 37.4 38.2 C42 38.8 45.4 43.2 46.4 48.8 C47.3 54 46.9 58.6 45.7 61.2 Z M65 61.2 C70 56.5 72.2 50.5 71.2 45 C70.2 40 66.4 37.8 62.6 38.2 C58 38.8 54.6 43.2 53.6 48.8 C52.7 54 53.1 58.6 54.3 61.2 Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M25.5 67.2 Q50 65.8 74.5 67.2 L74 74 Q50 72.6 26 74 Z%22 fill=%22url(%23g)%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M26.5 41 C28.5 36.5 32.5 34.6 36.5 34.8%22 fill=%22none%22 stroke=%22%23f3dca0%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M63.5 34.8 C67.5 34.6 71.5 36.5 73.5 41%22 fill=%22none%22 stroke=%22%23f3dca0%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M48.6 15.5 L48.6 24%22 stroke=%22%23f3dca0%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 3px 2px rgba(0,0,0,.55));transition:filter .3s}
.kj-seal .glow{position:absolute;inset:-6px;border-radius:50%;opacity:0;transition:opacity .3s}
.kj-seal.lit .plate{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22n%22 cx=%22.42%22 cy=%22.36%22 r=%22.72%22%3E%3Cstop offset=%220%22 stop-color=%22%233470ee%22/%3E%3Cstop offset=%221%22 stop-color=%22%23132b72%22/%3E%3C/radialGradient%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23ffe9a6%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%23f2b640%22/%3E%3Cstop offset=%221%22 stop-color=%22%23c07f16%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2245%22 fill=%22%235c574b%22 stroke=%22%232c2922%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2237.5%22 fill=%22url(%23n)%22 stroke=%22%239fe8ff%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2233%22 fill=%22none%22 stroke=%22%23bff3ff%22 stroke-width=%221.6%22 stroke-dasharray=%222.5 3.5%22 opacity=%22.85%22/%3E%3Cpath d=%22M46.8 42.5 L46.8 26.6 L40.5 26.6 L40.5 20.2 L46.8 20.2 L46.8 13.5 L53.2 13.5 L53.2 20.2 L59.5 20.2 L59.5 26.6 L53.2 26.6 L53.2 42.5 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M30 65 C24.5 58 21 50 22.5 43 C24.5 36 30 32.5 36 32.8 C42.5 33.2 47.5 37.5 50 41.5 C52.5 37.5 57.5 33.2 64 32.8 C70 32.5 75.5 36 77 43 C79 50 75.5 58 70 65 Z M35 61.2 C30 56.5 27.8 50.5 28.8 45 C29.8 40 33.6 37.8 37.4 38.2 C42 38.8 45.4 43.2 46.4 48.8 C47.3 54 46.9 58.6 45.7 61.2 Z M65 61.2 C70 56.5 72.2 50.5 71.2 45 C70.2 40 66.4 37.8 62.6 38.2 C58 38.8 54.6 43.2 53.6 48.8 C52.7 54 53.1 58.6 54.3 61.2 Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M25.5 67.2 Q50 65.8 74.5 67.2 L74 74 Q50 72.6 26 74 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M26.5 41 C28.5 36.5 32.5 34.6 36.5 34.8%22 fill=%22none%22 stroke=%22%23fff6d6%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M63.5 34.8 C67.5 34.6 71.5 36.5 73.5 41%22 fill=%22none%22 stroke=%22%23fff6d6%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M48.6 15.5 L48.6 24%22 stroke=%22%23fff6d6%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3C/svg%3E");filter:drop-shadow(0 0 10px rgba(130,230,255,.95)) drop-shadow(0 3px 2px rgba(0,0,0,.5))}
.kj-seal.lit .glow{opacity:1;background:radial-gradient(circle,rgba(140,230,255,.55),transparent 66%);animation:kjRunePulse 1.4s ease-in-out infinite}
.kj-seal.sealed .plate{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22n%22 cx=%22.42%22 cy=%22.36%22 r=%22.72%22%3E%3Cstop offset=%220%22 stop-color=%22%232c66f4%22/%3E%3Cstop offset=%221%22 stop-color=%22%230e2260%22/%3E%3C/radialGradient%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23fff6cf%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%23ffc933%22/%3E%3Cstop offset=%221%22 stop-color=%22%23cf870f%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2246%22 fill=%22%23e0a52a%22 stroke=%22%236b4508%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2241%22 fill=%22none%22 stroke=%22%23a86d0c%22 stroke-width=%223%22/%3E%3Ccircle cx=%2291.0%22 cy=%2250.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2285.5%22 cy=%2270.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2270.5%22 cy=%2285.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250.0%22 cy=%2291.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2229.5%22 cy=%2285.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2214.5%22 cy=%2270.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%229.0%22 cy=%2250.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2214.5%22 cy=%2229.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2229.5%22 cy=%2214.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250.0%22 cy=%229.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2270.5%22 cy=%2214.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2285.5%22 cy=%2229.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2236.5%22 fill=%22url(%23n)%22 stroke=%22%23fff0b0%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M46.8 42.5 L46.8 26.6 L40.5 26.6 L40.5 20.2 L46.8 20.2 L46.8 13.5 L53.2 13.5 L53.2 20.2 L59.5 20.2 L59.5 26.6 L53.2 26.6 L53.2 42.5 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M30 65 C24.5 58 21 50 22.5 43 C24.5 36 30 32.5 36 32.8 C42.5 33.2 47.5 37.5 50 41.5 C52.5 37.5 57.5 33.2 64 32.8 C70 32.5 75.5 36 77 43 C79 50 75.5 58 70 65 Z M35 61.2 C30 56.5 27.8 50.5 28.8 45 C29.8 40 33.6 37.8 37.4 38.2 C42 38.8 45.4 43.2 46.4 48.8 C47.3 54 46.9 58.6 45.7 61.2 Z M65 61.2 C70 56.5 72.2 50.5 71.2 45 C70.2 40 66.4 37.8 62.6 38.2 C58 38.8 54.6 43.2 53.6 48.8 C52.7 54 53.1 58.6 54.3 61.2 Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M25.5 67.2 Q50 65.8 74.5 67.2 L74 74 Q50 72.6 26 74 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M26.5 41 C28.5 36.5 32.5 34.6 36.5 34.8%22 fill=%22none%22 stroke=%22%23fffbe8%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M63.5 34.8 C67.5 34.6 71.5 36.5 73.5 41%22 fill=%22none%22 stroke=%22%23fffbe8%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M48.6 15.5 L48.6 24%22 stroke=%22%23fffbe8%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3C/svg%3E");filter:drop-shadow(0 0 12px rgba(255,200,60,.95)) drop-shadow(0 3px 2px rgba(0,0,0,.5))}
.kj-seal.sealed .glow{opacity:1;background:radial-gradient(circle,rgba(255,210,90,.5),transparent 66%)}
.kj-seal.press{animation:kjPress .35s ease-out}
/* crown jewels */
.kj-gem{pointer-events:auto}
.kj-gem .kj-spr{position:absolute;inset:0;width:100%;height:100%;animation:kjGemBob 2.2s ease-in-out infinite;animation-delay:inherit;
  filter:drop-shadow(0 0 8px rgba(255,70,110,.85)) drop-shadow(0 4px 3px rgba(0,0,0,.4))}
.kj-gem .kj-gemglow{position:absolute;left:-10%;right:-10%;bottom:-10%;height:34%;border-radius:50%;background:radial-gradient(ellipse,rgba(255,60,100,.45),transparent 70%)}
@keyframes kjGemBob{50%{transform:translateY(-10%) scale(1.04)}}
.kj-gem.taken{transition:transform .4s cubic-bezier(.5,0,.8,.4),opacity .4s;transform:translateY(-60%) scale(1.4);opacity:0}
.kj-gem.gone{opacity:0;pointer-events:none}
.kj-gem.gone .kj-spr{animation:none}
/* locked crown (a trial is unfinished) */
.kj-crown .kj-lock{position:absolute;left:50%;top:44%;width:34%;aspect-ratio:60/70;transform:translate(-50%,-50%) scale(0);background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 60 70%22%3E%3Cpath d=%22M16 30 V20 a14 14 0 0 1 28 0 V30%22 fill=%22none%22 stroke=%22%233b2f1a%22 stroke-width=%229%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M16 30 V20 a14 14 0 0 1 28 0 V30%22 fill=%22none%22 stroke=%22%23d9d3c4%22 stroke-width=%225%22 stroke-linecap=%22round%22/%3E%3Crect x=%226%22 y=%2228%22 width=%2248%22 height=%2236%22 rx=%227%22 fill=%22%23e0a92e%22 stroke=%22%233b2f1a%22 stroke-width=%223.5%22/%3E%3Crect x=%2210%22 y=%2232%22 width=%2240%22 height=%228%22 rx=%223%22 fill=%22%23ffe28a%22 opacity=%22.7%22/%3E%3Ccircle cx=%2230%22 cy=%2245%22 r=%225%22 fill=%22%233b2f1a%22/%3E%3Crect x=%2227.5%22 y=%2246%22 width=%225%22 height=%2211%22 rx=%222%22 fill=%22%233b2f1a%22/%3E%3C/svg%3E") center/contain no-repeat;
  filter:drop-shadow(0 3px 3px rgba(0,0,0,.6));transition:transform .35s cubic-bezier(.3,1.6,.5,1),opacity .35s;opacity:0}
.kj-crown.locked .kj-lock{transform:translate(-50%,-50%) scale(1);opacity:1}
.kj-crown.locked .kj-spr{filter:grayscale(.75) brightness(.72) drop-shadow(0 0 6px rgba(255,200,60,.35));animation-duration:4s}
.kj-crown.locked .kj-rays{opacity:.15}
.kj-crown.unlocking .kj-lock{transform:translate(-50%,-90%) scale(1.3);opacity:0}
.kj-crown.shake .kj-lock{animation:kjLockShake .45s}
@keyframes kjLockShake{25%{margin-left:-6%}50%{margin-left:6%}75%{margin-left:-3%}}
.kj-mark.crown.locked{filter:grayscale(.8);opacity:.55}
/* HUD: trial objectives */
.kj-goals{grid-column:1/-1;display:flex;justify-content:center;flex-wrap:wrap;gap:.25em .4em;padding:.1em .3em .35em;font-size:.56em}
.kj-goals[hidden]{display:none}
.kj-goals.pulse{animation:kjBtnPulse .5s}
.kj-goal{display:inline-flex;align-items:center;gap:.25em;padding:.12em .45em;border-radius:1em;background:rgba(20,14,6,.55);border:1px solid rgba(214,168,80,.55);color:#f7ecd0;font-weight:800;white-space:nowrap}
.kj-goal img{height:1.5em;width:auto;object-fit:contain}
.kj-goal.gem img{height:1.25em}
.kj-goal .ic{display:inline-block;width:1.3em;height:1.3em;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22n%22 cx=%22.42%22 cy=%22.36%22 r=%22.72%22%3E%3Cstop offset=%220%22 stop-color=%22%2323355e%22/%3E%3Cstop offset=%221%22 stop-color=%22%23111a30%22/%3E%3C/radialGradient%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23e2bf73%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%23c19446%22/%3E%3Cstop offset=%221%22 stop-color=%22%238e6a2c%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2245%22 fill=%22%235c574b%22 stroke=%22%232c2922%22 stroke-width=%223%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2237.5%22 fill=%22url(%23n)%22 stroke=%22%238f8670%22 stroke-width=%222.5%22/%3E%3Cpath d=%22M46.8 42.5 L46.8 26.6 L40.5 26.6 L40.5 20.2 L46.8 20.2 L46.8 13.5 L53.2 13.5 L53.2 20.2 L59.5 20.2 L59.5 26.6 L53.2 26.6 L53.2 42.5 Z%22 fill=%22url(%23g)%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M30 65 C24.5 58 21 50 22.5 43 C24.5 36 30 32.5 36 32.8 C42.5 33.2 47.5 37.5 50 41.5 C52.5 37.5 57.5 33.2 64 32.8 C70 32.5 75.5 36 77 43 C79 50 75.5 58 70 65 Z M35 61.2 C30 56.5 27.8 50.5 28.8 45 C29.8 40 33.6 37.8 37.4 38.2 C42 38.8 45.4 43.2 46.4 48.8 C47.3 54 46.9 58.6 45.7 61.2 Z M65 61.2 C70 56.5 72.2 50.5 71.2 45 C70.2 40 66.4 37.8 62.6 38.2 C58 38.8 54.6 43.2 53.6 48.8 C52.7 54 53.1 58.6 54.3 61.2 Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M25.5 67.2 Q50 65.8 74.5 67.2 L74 74 Q50 72.6 26 74 Z%22 fill=%22url(%23g)%22 stroke=%22%233a2a10%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M26.5 41 C28.5 36.5 32.5 34.6 36.5 34.8%22 fill=%22none%22 stroke=%22%23f3dca0%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M63.5 34.8 C67.5 34.6 71.5 36.5 73.5 41%22 fill=%22none%22 stroke=%22%23f3dca0%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M48.6 15.5 L48.6 24%22 stroke=%22%23f3dca0%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3C/svg%3E") center/contain no-repeat}
.kj-goal.done{border-color:#ffd24a;box-shadow:0 0 .5em rgba(255,200,60,.7);color:#ffe9a0}
.kj-goal.seal.done .ic{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cdefs%3E%3CradialGradient id=%22n%22 cx=%22.42%22 cy=%22.36%22 r=%22.72%22%3E%3Cstop offset=%220%22 stop-color=%22%232c66f4%22/%3E%3Cstop offset=%221%22 stop-color=%22%230e2260%22/%3E%3C/radialGradient%3E%3ClinearGradient id=%22g%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23fff6cf%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%23ffc933%22/%3E%3Cstop offset=%221%22 stop-color=%22%23cf870f%22/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2246%22 fill=%22%23e0a52a%22 stroke=%22%236b4508%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2241%22 fill=%22none%22 stroke=%22%23a86d0c%22 stroke-width=%223%22/%3E%3Ccircle cx=%2291.0%22 cy=%2250.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2285.5%22 cy=%2270.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2270.5%22 cy=%2285.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250.0%22 cy=%2291.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2229.5%22 cy=%2285.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2214.5%22 cy=%2270.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%229.0%22 cy=%2250.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2214.5%22 cy=%2229.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2229.5%22 cy=%2214.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250.0%22 cy=%229.0%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2270.5%22 cy=%2214.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2285.5%22 cy=%2229.5%22 r=%221.9%22 fill=%22%23fff1b0%22/%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2236.5%22 fill=%22url(%23n)%22 stroke=%22%23fff0b0%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M46.8 42.5 L46.8 26.6 L40.5 26.6 L40.5 20.2 L46.8 20.2 L46.8 13.5 L53.2 13.5 L53.2 20.2 L59.5 20.2 L59.5 26.6 L53.2 26.6 L53.2 42.5 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M30 65 C24.5 58 21 50 22.5 43 C24.5 36 30 32.5 36 32.8 C42.5 33.2 47.5 37.5 50 41.5 C52.5 37.5 57.5 33.2 64 32.8 C70 32.5 75.5 36 77 43 C79 50 75.5 58 70 65 Z M35 61.2 C30 56.5 27.8 50.5 28.8 45 C29.8 40 33.6 37.8 37.4 38.2 C42 38.8 45.4 43.2 46.4 48.8 C47.3 54 46.9 58.6 45.7 61.2 Z M65 61.2 C70 56.5 72.2 50.5 71.2 45 C70.2 40 66.4 37.8 62.6 38.2 C58 38.8 54.6 43.2 53.6 48.8 C52.7 54 53.1 58.6 54.3 61.2 Z%22 fill=%22url(%23g)%22 fill-rule=%22evenodd%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M25.5 67.2 Q50 65.8 74.5 67.2 L74 74 Q50 72.6 26 74 Z%22 fill=%22url(%23g)%22 stroke=%22%235a3a06%22 stroke-width=%221.8%22 stroke-linejoin=%22round%22/%3E%3Cpath d=%22M26.5 41 C28.5 36.5 32.5 34.6 36.5 34.8%22 fill=%22none%22 stroke=%22%23fffbe8%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M63.5 34.8 C67.5 34.6 71.5 36.5 73.5 41%22 fill=%22none%22 stroke=%22%23fffbe8%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3Cpath d=%22M48.6 15.5 L48.6 24%22 stroke=%22%23fffbe8%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 opacity=%22.8%22/%3E%3C/svg%3E")}
.kj-goal .step{opacity:.35;filter:grayscale(1)}
.kj-goal .step.on{opacity:1;filter:drop-shadow(0 0 4px rgba(120,255,110,.9))}
.kj-goal .arr{font-style:normal;opacity:.7}
.kj-goal .crownmini{display:inline-block;width:1.2em;height:.9em;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 30%22%3E%3Cpath d=%22M4 24 L2 6 L12 14 L20 2 L28 14 L38 6 L36 24 Z%22 fill=%22%23ffd24a%22 stroke=%22%237a4f08%22 stroke-width=%222.5%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") center/contain no-repeat}
.kj-goal.finish:not(.done) img{opacity:.55}
.portrait .kj-goals{font-size:13px;padding:0 0 4px}
@media (prefers-reduced-motion:reduce){.kj-gem .kj-spr,.kj-mark.stonenext,.kj-seal.lit .glow{animation:none!important}}

/* Premium chapters remain visible and operable for the existing upgrade flow. */
.mn-level.premium-locked{opacity:.72;border-color:#bda365}
.mn-level.premium-locked .num{font-size:18px}
/* ================= WORLD 6 (prototype): portals, Royal Guards, royal runes / changing castle =================
   Generated by fun/kings-journey-v2/tools/w6_css.py — temporary CSS/vector art for the prototype. */
.kj-tile.water{background:none!important}
.kj-tile.water::before{content:"";position:absolute;inset:0;border-radius:4px;
  background:radial-gradient(ellipse at 30% 25%,rgba(190,240,255,.35),transparent 45%),
    repeating-linear-gradient(170deg,rgba(255,255,255,0) 0 14px,rgba(200,245,255,.16) 15px 17px,rgba(255,255,255,0) 18px 30px),
    linear-gradient(180deg,#1f6f95,#164f72 60%,#123f5d);
  background-size:100% 100%,60px 60px,100% 100%;box-shadow:inset 0 6px 10px rgba(0,20,40,.55),inset 0 -2px 4px rgba(160,230,255,.25);
  animation:kjWater 6s linear infinite}
@keyframes kjWater{to{background-position:0 0,60px 30px,0 0}}
.kj-bridge{position:absolute;width:100px;height:100px;pointer-events:none}
.kj-bridge .deck{position:absolute;left:6px;right:6px;top:-2px;bottom:-2px;border-radius:3px;transform-origin:50% 0;
  background:linear-gradient(90deg,rgba(0,0,0,.35),transparent 12%,transparent 88%,rgba(0,0,0,.35)),
    repeating-linear-gradient(180deg,#9a6a3a 0 15px,#7a4f28 15px 17px),linear-gradient(#a8784a,#7f5631);
  box-shadow:0 0 0 3px #4a2f16,0 6px 10px rgba(0,0,0,.45);transition:transform .55s cubic-bezier(.5,0,.3,1.25),opacity .4s}
.kj-bridge .deck::before,.kj-bridge .deck::after{content:"";position:absolute;left:-3px;right:-3px;height:5px;background:#3b3b3b;box-shadow:0 1px 0 rgba(255,255,255,.25)}
.kj-bridge .deck::before{top:12%}.kj-bridge .deck::after{bottom:12%}
.kj-bridge.up .deck{transform:scaleY(.2);filter:brightness(.62);opacity:.95}
.kj-bridge.up .rim{opacity:.85}
.kj-bridge .chain{position:absolute;left:10px;right:10px;top:0;height:6px;border-radius:3px;background:repeating-linear-gradient(90deg,#d8d0c0 0 5px,#6c665b 5px 8px);opacity:.0;transition:opacity .3s}
.kj-bridge.up .chain{opacity:.9}
.kj-bridge .rim{position:absolute;inset:3px;border-radius:6px;box-shadow:0 0 0 3px var(--cc),0 0 14px 2px var(--cc);opacity:.45}
.c-gold{--cc:rgba(255,205,70,.9);--cchi:#ffd24a}
.kj-cwall.c-gold .bars::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%0A%3ClinearGradient id=%22s%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23b9b2a2%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%238a8475%22/%3E%3Cstop offset=%221%22 stop-color=%22%235b574d%22/%3E%3C/linearGradient%3E%0A%3ClinearGradient id=%22f%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23d6cfbd%22/%3E%3Cstop offset=%221%22 stop-color=%22%239c9584%22/%3E%3C/linearGradient%3E%3C/defs%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114 V143 H12 Z%22 fill=%22url(%23s)%22 stroke=%22%233a362e%22 stroke-width=%223%22 stroke-linejoin=%22round%22/%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114%22 fill=%22none%22 stroke=%22%23efe8d6%22 stroke-opacity=%22.7%22 stroke-width=%222%22/%3E%0A%3Cg stroke=%22%234a463c%22 stroke-opacity=%22.55%22 stroke-width=%222%22 fill=%22none%22%3E%0A%3Cpath d=%22M12 70 H114 M12 96 H114 M12 121 H114%22/%3E%3Cpath d=%22M40 46 V70 M86 46 V70 M26 70 V96 M63 70 V96 M100 70 V96 M44 96 V121 M82 96 V121 M28 121 V143 M63 121 V143 M98 121 V143%22/%3E%3C/g%3E%0A%3Ccircle cx=%2263%22 cy=%2292%22 r=%2217%22 fill=%22%232b2822%22 stroke=%22%23ffd24a%22 stroke-width=%224%22/%3E%0A%3Cpath d=%22M63 79 L72 92 L63 105 L54 92 Z%22 fill=%22%23ffd24a%22 stroke=%22%23a8740e%22 stroke-width=%222%22/%3E%0A%3C/svg%3E")}
.kj-rune.c-gold{--rc:rgba(255,205,70,.9);--rune:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2243%22 fill=%22%235d5a52%22 stroke=%22%232f2d29%22 stroke-width=%223%22/%3E%0A%3Ccircle cx=%2250%22 cy=%2250%22 r=%2235%22 fill=%22%237d7a70%22 stroke=%22%23a9a598%22 stroke-width=%222%22/%3E%0A%3Cg fill=%22none%22 stroke=%22%23ffd24a%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2227%22 stroke-width=%223%22 stroke-dasharray=%226 5%22/%3E%0A%3Cpath d=%22M50 30 L50 70 M36 40 L64 40 M36 60 L64 60%22/%3E%3Cpath d=%22M30 50 L36 40 M70 50 L64 40 M30 50 L36 60 M70 50 L64 60%22/%3E%3C/g%3E%3C/svg%3E")}
.kj-mote.rune-gold{background:#ffd24a;box-shadow:0 0 8px #ffd24a}
.kj-flash.rune-gold{background:radial-gradient(circle,rgba(255,205,70,.9),transparent 65%)}
.c-emerald{--cc:rgba(60,235,150,.9);--cchi:#4df0a0}
.kj-cwall.c-emerald .bars::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%0A%3ClinearGradient id=%22s%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23b9b2a2%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%238a8475%22/%3E%3Cstop offset=%221%22 stop-color=%22%235b574d%22/%3E%3C/linearGradient%3E%0A%3ClinearGradient id=%22f%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23d6cfbd%22/%3E%3Cstop offset=%221%22 stop-color=%22%239c9584%22/%3E%3C/linearGradient%3E%3C/defs%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114 V143 H12 Z%22 fill=%22url(%23s)%22 stroke=%22%233a362e%22 stroke-width=%223%22 stroke-linejoin=%22round%22/%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114%22 fill=%22none%22 stroke=%22%23efe8d6%22 stroke-opacity=%22.7%22 stroke-width=%222%22/%3E%0A%3Cg stroke=%22%234a463c%22 stroke-opacity=%22.55%22 stroke-width=%222%22 fill=%22none%22%3E%0A%3Cpath d=%22M12 70 H114 M12 96 H114 M12 121 H114%22/%3E%3Cpath d=%22M40 46 V70 M86 46 V70 M26 70 V96 M63 70 V96 M100 70 V96 M44 96 V121 M82 96 V121 M28 121 V143 M63 121 V143 M98 121 V143%22/%3E%3C/g%3E%0A%3Ccircle cx=%2263%22 cy=%2292%22 r=%2217%22 fill=%22%232b2822%22 stroke=%22%234df0a0%22 stroke-width=%224%22/%3E%0A%3Cpath d=%22M63 79 L72 92 L63 105 L54 92 Z%22 fill=%22%234df0a0%22 stroke=%22%230d7a4a%22 stroke-width=%222%22/%3E%0A%3C/svg%3E")}
.kj-rune.c-emerald{--rc:rgba(60,235,150,.9);--rune:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2243%22 fill=%22%235d5a52%22 stroke=%22%232f2d29%22 stroke-width=%223%22/%3E%0A%3Ccircle cx=%2250%22 cy=%2250%22 r=%2235%22 fill=%22%237d7a70%22 stroke=%22%23a9a598%22 stroke-width=%222%22/%3E%0A%3Cg fill=%22none%22 stroke=%22%234df0a0%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2227%22 stroke-width=%223%22 stroke-dasharray=%226 5%22/%3E%0A%3Cpath d=%22M50 30 L50 70 M36 40 L64 40 M36 60 L64 60%22/%3E%3Cpath d=%22M30 50 L36 40 M70 50 L64 40 M30 50 L36 60 M70 50 L64 60%22/%3E%3C/g%3E%3C/svg%3E")}
.kj-mote.rune-emerald{background:#4df0a0;box-shadow:0 0 8px #4df0a0}
.kj-flash.rune-emerald{background:radial-gradient(circle,rgba(60,235,150,.9),transparent 65%)}
.c-rose{--cc:rgba(255,110,180,.9);--cchi:#ff7ab6}
.kj-cwall.c-rose .bars::before{background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 126 151%22%3E%3Cdefs%3E%0A%3ClinearGradient id=%22s%22 x1=%220%22 y1=%220%22 x2=%221%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23b9b2a2%22/%3E%3Cstop offset=%22.55%22 stop-color=%22%238a8475%22/%3E%3Cstop offset=%221%22 stop-color=%22%235b574d%22/%3E%3C/linearGradient%3E%0A%3ClinearGradient id=%22f%22 x1=%220%22 y1=%220%22 x2=%220%22 y2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23d6cfbd%22/%3E%3Cstop offset=%221%22 stop-color=%22%239c9584%22/%3E%3C/linearGradient%3E%3C/defs%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114 V143 H12 Z%22 fill=%22url(%23s)%22 stroke=%22%233a362e%22 stroke-width=%223%22 stroke-linejoin=%22round%22/%3E%0A%3Cpath d=%22M12 46 H30 V34 H48 V46 H56 V30 H70 V46 H78 V34 H96 V46 H114%22 fill=%22none%22 stroke=%22%23efe8d6%22 stroke-opacity=%22.7%22 stroke-width=%222%22/%3E%0A%3Cg stroke=%22%234a463c%22 stroke-opacity=%22.55%22 stroke-width=%222%22 fill=%22none%22%3E%0A%3Cpath d=%22M12 70 H114 M12 96 H114 M12 121 H114%22/%3E%3Cpath d=%22M40 46 V70 M86 46 V70 M26 70 V96 M63 70 V96 M100 70 V96 M44 96 V121 M82 96 V121 M28 121 V143 M63 121 V143 M98 121 V143%22/%3E%3C/g%3E%0A%3Ccircle cx=%2263%22 cy=%2292%22 r=%2217%22 fill=%22%232b2822%22 stroke=%22%23ff7ab6%22 stroke-width=%224%22/%3E%0A%3Cpath d=%22M63 79 L72 92 L63 105 L54 92 Z%22 fill=%22%23ff7ab6%22 stroke=%22%239a1d5a%22 stroke-width=%222%22/%3E%0A%3C/svg%3E")}
.kj-rune.c-rose{--rc:rgba(255,110,180,.9);--rune:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2243%22 fill=%22%235d5a52%22 stroke=%22%232f2d29%22 stroke-width=%223%22/%3E%0A%3Ccircle cx=%2250%22 cy=%2250%22 r=%2235%22 fill=%22%237d7a70%22 stroke=%22%23a9a598%22 stroke-width=%222%22/%3E%0A%3Cg fill=%22none%22 stroke=%22%23ff7ab6%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2250%22 cy=%2250%22 r=%2227%22 stroke-width=%223%22 stroke-dasharray=%226 5%22/%3E%0A%3Cpath d=%22M50 30 L50 70 M36 40 L64 40 M36 60 L64 60%22/%3E%3Cpath d=%22M30 50 L36 40 M70 50 L64 40 M30 50 L36 60 M70 50 L64 60%22/%3E%3C/g%3E%3C/svg%3E")}
.kj-mote.rune-rose{background:#ff7ab6;box-shadow:0 0 8px #ff7ab6}
.kj-flash.rune-rose{background:radial-gradient(circle,rgba(255,110,180,.9),transparent 65%)}
.kj-cwall{pointer-events:auto}
.kj-cwall .bars{position:absolute;inset:0;overflow:hidden}
.kj-cwall .bars .kj-spr{display:none}
.kj-cwall .bars::before{content:"";position:absolute;inset:0;background:center bottom/100% 100% no-repeat;transform-origin:50% 100%;
  filter:drop-shadow(0 0 5px var(--cc)) drop-shadow(0 5px 4px rgba(0,0,0,.5));transition:transform .5s cubic-bezier(.3,1.4,.5,1),opacity .4s}
.kj-cwall.open .bars::before{transform:translateY(86%) scaleY(.14);opacity:.75}
.kj-cwall.open{pointer-events:none}
.kj-cwall.rising .bars::before{animation:kjRise .55s cubic-bezier(.3,1.5,.5,1)}
.kj-cwall.sinking .bars::before{animation:kjSinkW .45s ease-in}
@keyframes kjSinkW{from{transform:none;opacity:1}}
.kj-cslot{position:absolute;width:100px;height:100px;pointer-events:none;border-radius:8px;
  box-shadow:inset 0 0 0 3px var(--cc),inset 0 0 18px 2px var(--cc);opacity:.8;transition:opacity .4s}
.kj-cslot.raised{opacity:.95;background:radial-gradient(circle,transparent 40%,rgba(0,0,0,.25))}
.kj-cslot::after{content:"";position:absolute;left:50%;top:50%;width:22px;height:22px;margin:-11px;transform:rotate(45deg);border:3px solid var(--cchi);opacity:.55;border-radius:3px}
.kj-cslot.raised::after{display:none}
/* the castle will change here when a rune of this colour is pressed next */
.kj-cslot.next,.kj-bridge.next .rim{animation:kjNextChange 1.6s ease-in-out infinite}
@keyframes kjNextChange{50%{opacity:.15}}
.kj-rune .pips{position:absolute;left:0;right:0;bottom:-2px;display:flex;justify-content:center;gap:5px}
.kj-rune .pips i{width:10px;height:10px;border-radius:50%;background:rgba(20,16,10,.75);box-shadow:0 0 0 2px var(--rc)}
.kj-rune .pips i.on{background:var(--rc);box-shadow:0 0 0 2px #fff,0 0 8px 2px var(--rc)}
.kj-rune.w6 .glyph{opacity:.55}
.kj-rune.w6.press .glyph{opacity:1}
.kj-portal.c-violet,.kj-portalglow.c-violet,.kj-mark.c-violet{--pc:rgba(185,110,255,.95);--pchi:#c78bff;--pclo:#6b2bd0}
.kj-mote.portal-violet{background:#c78bff;box-shadow:0 0 12px 4px rgba(185,110,255,.95)}
.kj-flash.portal-violet{background:radial-gradient(circle,rgba(255,255,255,.9),rgba(185,110,255,.95) 30%,transparent 66%)}
.kj-portal.c-teal,.kj-portalglow.c-teal,.kj-mark.c-teal{--pc:rgba(70,235,215,.95);--pchi:#5ff5e2;--pclo:#0b8f8a}
.kj-mote.portal-teal{background:#5ff5e2;box-shadow:0 0 12px 4px rgba(70,235,215,.95)}
.kj-flash.portal-teal{background:radial-gradient(circle,rgba(255,255,255,.9),rgba(70,235,215,.95) 30%,transparent 66%)}
.kj-portal.c-amber,.kj-portalglow.c-amber,.kj-mark.c-amber{--pc:rgba(255,190,70,.95);--pchi:#ffc65a;--pclo:#c26a06}
.kj-mote.portal-amber{background:#ffc65a;box-shadow:0 0 12px 4px rgba(255,190,70,.95)}
.kj-flash.portal-amber{background:radial-gradient(circle,rgba(255,255,255,.9),rgba(255,190,70,.95) 30%,transparent 66%)}
.kj-portal{position:absolute;width:100px;height:100px;pointer-events:none}
.kj-portal .ring{position:absolute;inset:4px;border-radius:50%;
  background:conic-gradient(from 0deg,var(--pchi),var(--pclo),var(--pchi),var(--pclo),var(--pchi));
  -webkit-mask:radial-gradient(circle,transparent 52%,#000 54%,#000 70%,transparent 72%);mask:radial-gradient(circle,transparent 52%,#000 54%,#000 70%,transparent 72%);
  animation:kjPortalSpin 3.2s linear infinite;filter:drop-shadow(0 0 6px var(--pc))}
.kj-portal .core{position:absolute;inset:14px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.85) 0,var(--pchi) 18%,var(--pclo) 48%,rgba(10,0,30,.9) 72%);
  box-shadow:0 0 18px 4px var(--pc),inset 0 0 14px rgba(0,0,0,.6);animation:kjPortalPulse 2.2s ease-in-out infinite}
.kj-portal .swirl{position:absolute;inset:16px;border-radius:50%;opacity:.7;
  background:repeating-conic-gradient(from 0deg,rgba(255,255,255,.55) 0 8deg,transparent 8deg 45deg);
  -webkit-mask:radial-gradient(circle,transparent 18%,#000 30%,#000 62%,transparent 70%);mask:radial-gradient(circle,transparent 18%,#000 30%,#000 62%,transparent 70%);
  animation:kjPortalSpin 2s linear infinite reverse}
.kj-portal .glyph{position:absolute;left:50%;top:50%;width:26px;height:26px;margin:-13px;background:#fff;opacity:.95;filter:drop-shadow(0 0 4px var(--pclo))}
.kj-portal.c-violet .glyph{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.kj-portal.c-teal .glyph{border-radius:50%;width:22px;height:22px;margin:-11px}
.kj-portal.c-amber .glyph{clip-path:polygon(50% 4%,98% 92%,2% 92%)}
.kj-portal.exitonly .core{background:radial-gradient(circle,rgba(0,0,0,.2) 0,rgba(0,0,0,.35) 50%,transparent 72%);animation:none;box-shadow:0 0 10px 2px var(--pc)}
.kj-portal.exitonly .swirl{display:none}
.kj-portal.exitonly .ring{animation-duration:9s;opacity:.7}
.kj-portal.exitonly .glyph{opacity:.6;transform:scale(.7)}
.kj-portal.blocked .core{filter:grayscale(.6) brightness(.7)}
.kj-portal.pulse{animation:kjPress .4s ease-out}
@keyframes kjPortalSpin{to{transform:rotate(360deg)}}
@keyframes kjPortalPulse{50%{transform:scale(.9);filter:brightness(1.25)}}
.kj-portalglow{pointer-events:auto}
.kj-portalglow i{position:absolute;bottom:18%;width:10%;aspect-ratio:1;border-radius:50%;background:var(--pchi);box-shadow:0 0 8px 3px var(--pc);opacity:0;animation:kjWisp 2.6s ease-in infinite}
@keyframes kjWisp{0%{opacity:0;transform:translateY(0) scale(1)}20%{opacity:.9}100%{opacity:0;transform:translateY(-260%) scale(.4)}}
.kj-mark.target.onportal{border-color:var(--pchi);box-shadow:0 0 18px 4px var(--pc),inset 0 0 24px var(--pc)}
.kj-mark.target.onportal::after{background:var(--pchi);box-shadow:0 0 10px 3px var(--pc)}
.kj-mark.portalexit{border:4px dashed var(--pchi);border-radius:50%;transform:scale(.78);opacity:.85;animation:kjStoneNext 1.4s ease-in-out infinite}
.kj-player.warp-out .kj-spr{animation:kjWarpOut .34s ease-in forwards}
.kj-player.warp-in .kj-spr{animation:kjWarpIn .42s cubic-bezier(.3,1.5,.5,1) both}
@keyframes kjWarpOut{to{transform:scale(.1) rotate(200deg);opacity:0;filter:brightness(3)}}
@keyframes kjWarpIn{from{transform:scale(.1) rotate(-200deg);opacity:0;filter:brightness(3)}to{transform:none;opacity:1}}
.kj-guard{pointer-events:auto;z-index:880}
.kj-guard .kj-spr{filter:sepia(1) saturate(4.5) hue-rotate(-38deg) brightness(.62) contrast(1.15) drop-shadow(0 0 7px rgba(255,50,40,.85)) drop-shadow(0 6px 5px rgba(0,0,0,.5))}
.kj-guard::before{content:"";position:absolute;left:4%;right:4%;bottom:2%;height:18%;border-radius:50%;transform:translateY(40%);
  background:radial-gradient(ellipse,rgba(255,40,30,.55),rgba(255,40,30,0) 70%);animation:kjPulse2 1.4s ease-in-out infinite}
.kj-guard .eye{position:absolute;left:50%;top:-6%;width:34%;aspect-ratio:1.6;transform:translateX(-50%);border-radius:50%;
  background:radial-gradient(circle at 50% 50%,#1a0505 0 22%,#ff5a4a 24% 40%,#fff6ee 42% 64%,transparent 66%);
  filter:drop-shadow(0 0 6px rgba(255,60,40,.95));animation:kjEye 3s ease-in-out infinite}
@keyframes kjEye{0%,44%,56%,100%{transform:translateX(-50%) scaleY(1)}50%{transform:translateX(-50%) scaleY(.1)}}
.kj-guard.alert .eye{animation:kjAlert .5s ease-out 2}
@keyframes kjAlert{50%{transform:translateX(-50%) scale(1.5)}}
.kj-tracks.guard .rail{stroke:rgba(60,8,8,.55)}
.kj-tracks.guard .dots{stroke:rgba(255,120,110,.9)}
.kj-tracks.guard circle{fill:rgba(90,14,14,.6);stroke:rgba(255,120,110,.8)}
.kj-mark.danger{border-radius:6px;background:repeating-linear-gradient(135deg,rgba(255,50,40,.30) 0 10px,rgba(255,50,40,.14) 10px 20px);
  box-shadow:inset 0 0 0 2px rgba(255,90,80,.75),inset 0 0 18px rgba(255,40,30,.45);animation:kjDanger 1.6s ease-in-out infinite;transform:scale(.94)}
@keyframes kjDanger{50%{opacity:.6}}
.kj-mark.guardnext{inset:auto;border:5px dashed rgba(255,70,60,1);background:radial-gradient(circle,rgba(255,60,50,.36),rgba(255,60,50,.12) 60%,transparent 72%);border-radius:50%;box-shadow:0 0 14px rgba(255,60,40,.85);animation:kjStoneNext 1.2s ease-in-out infinite}
.kj-flash.alarm{background:radial-gradient(circle,rgba(255,220,210,.9),rgba(255,50,40,.55) 34%,transparent 66%)}
.kj-mote.alarm{background:#ffd0c8;box-shadow:0 0 10px 3px rgba(255,60,40,.9)}
.kj-game.boss .kj-crown .kj-spr{filter:drop-shadow(0 0 12px rgba(255,210,90,.95)) drop-shadow(0 0 36px rgba(190,70,255,.85))}
.kj-game.boss .kj-crown .kj-rays{background:repeating-conic-gradient(from 0deg,rgba(255,220,120,.42) 0 6deg,rgba(255,220,120,0) 6deg 15deg,rgba(200,120,255,.38) 15deg 21deg,rgba(200,120,255,0) 21deg 30deg);
  width:280%;animation-duration:9s;opacity:.95}
.kj-game.boss .kj-crown::after{content:"";position:absolute;left:50%;top:40%;width:170%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;pointer-events:none;
  border:3px solid rgba(225,170,255,.6);box-shadow:0 0 18px rgba(190,90,255,.6),inset 0 0 18px rgba(255,210,90,.45);animation:kjBossRing 2.4s ease-in-out infinite}
@keyframes kjBossRing{50%{transform:translate(-50%,-50%) scale(1.12);opacity:.5}}
.kj-game.boss .kj-mark.crown{border-color:rgba(230,180,255,.95);background:radial-gradient(circle,rgba(255,226,120,.55),rgba(190,90,255,.22) 65%,transparent 72%);box-shadow:0 0 26px 8px rgba(190,90,255,.75)}
.kj-shock{position:absolute;transform:translate(-50%,-50%);border-radius:50%;border:6px solid rgba(255,220,140,.95);box-shadow:0 0 30px 10px rgba(255,120,60,.7),inset 0 0 30px rgba(200,120,255,.7);
  animation:kjShock 1.1s cubic-bezier(.2,.7,.3,1) forwards;pointer-events:none}
@keyframes kjShock{from{opacity:1;transform:translate(-50%,-50%) scale(.1)}to{opacity:0;transform:translate(-50%,-50%) scale(3.2)}}
.kj-result.boss .rs-title{color:#ffcf9a;text-shadow:0 0 18px rgba(255,90,60,.8)}
@media (prefers-reduced-motion:reduce){.kj-portal .ring,.kj-portal .swirl,.kj-portal .core,.kj-guard .eye,.kj-mark.danger,.kj-mark.guardnext,.kj-tile.water::before,.kj-game.boss .kj-crown::after,.kj-cslot.next{animation:none!important}}
.kj-trail .warp{stroke:rgba(215,170,255,.85);stroke-width:5;stroke-dasharray:2 14;filter:drop-shadow(0 0 4px #b46cff)}
.kj-stage.quake{animation:kjQuake .45s ease-out}
@keyframes kjQuake{20%{margin-top:3px}40%{margin-top:-2px}60%{margin-top:2px}80%{margin-top:-1px}}

/* Intentional leave control beside Menu, with room for all locales on phones. */
.landscape #kjStop{position:absolute;left:calc(var(--u) * 22px - min(var(--spare) * .75, 230px));bottom:calc(var(--u) * 102px)}
.portrait .kj-buttons{flex-wrap:wrap;justify-content:center}
.kj-btn.stop{min-height:36px}
.mn-continue{margin:0 auto 12px;max-width:100%;white-space:normal}

/* Existing approved registration prompt, available before the global conversion rollout. */
.guest-journey-dialog { position:fixed; inset:0; margin:auto; width:min(440px,calc(100% - 28px)); max-height:90dvh; overflow:auto; padding:24px; border:1px solid #4c7754; border-radius:20px; background:#123023; color:#f5faed; box-shadow:0 20px 80px #0009; text-align:center; }
.guest-journey-dialog::backdrop { background:#0009; }
.guest-journey-dialog img { display:block; margin:0 auto 14px; object-fit:contain; border-radius:12px; }
.guest-journey-dialog h2 { font-size:24px; line-height:1.2; }
.guest-journey-dialog p { margin:14px 0; }
.guest-journey-dialog ul { text-align:left; width:fit-content; margin:20px auto; padding-left:24px; }
.guest-journey-dialog li { margin:8px 0; }
.guest-journey-dialog .button { display:block; width:100%; background:#c6ee78; color:#12351e; }
.guest-maybe-later { display:block; margin:12px auto 0; padding:8px 16px; border:0; background:transparent; color:#d5e4d5; cursor:pointer; }

/* ================= CHAPTER 7 (prototype): Royal Orders, checkpoints, crumbling tiles, escorts, royal challenge =================
   Generated by fun/kings-journey-v2/tools/w7_css.py — temporary CSS/vector art for the prototype. */
/* crumbling tile: a pale platform with glowing fissures; it carries you once */
.kj-tile.crumble::before{content:"";position:absolute;inset:4px;border-radius:8px;box-shadow:inset 0 0 0 3px rgba(255,170,60,.55),inset 0 0 16px rgba(255,140,40,.35);pointer-events:none}
.kj-tile.crumble::after{content:"";position:absolute;inset:0;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cg fill=%22none%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%0A%3Cpath d=%22M6 30 L24 38 L30 56 L50 60 L58 80 L72 94%22 stroke=%22%232a1606%22 stroke-width=%225%22/%3E%3Cpath d=%22M30 56 L18 74 L8 80%22 stroke=%22%232a1606%22 stroke-width=%224%22/%3E%0A%3Cpath d=%22M50 60 L70 46 L92 50%22 stroke=%22%232a1606%22 stroke-width=%224%22/%3E%3Cpath d=%22M70 46 L76 22 L90 8%22 stroke=%22%232a1606%22 stroke-width=%223.5%22/%3E%0A%3Cpath d=%22M6 30 L24 38 L30 56 L50 60 L58 80 L72 94%22 stroke=%22%23ffb340%22 stroke-width=%221.8%22/%3E%3Cpath d=%22M50 60 L70 46 L92 50%22 stroke=%22%23ffb340%22 stroke-width=%221.6%22/%3E%0A%3Cpath d=%22M30 56 L18 74 L8 80%22 stroke=%22%23ffb340%22 stroke-width=%221.4%22/%3E%3Cpath d=%22M70 46 L76 22 L90 8%22 stroke=%22%23ffb340%22 stroke-width=%221.3%22/%3E%3C/g%3E%3C/svg%3E") center/88% 88% no-repeat;transform:rotate(var(--rot,0deg));filter:drop-shadow(0 0 2px rgba(255,170,60,.8));pointer-events:none;animation:kjFissure 2.4s ease-in-out infinite}
@keyframes kjFissure{50%{filter:drop-shadow(0 0 5px rgba(255,170,60,1))}}
.kj-tile.crumble.gone{background:radial-gradient(ellipse at 50% 55%,#040302 0 40%,#140e08 64%,#33261a 88%,#4f3f2b 100%)!important;box-shadow:inset 0 10px 18px rgba(0,0,0,.9)}
.kj-tile.crumble.gone::after,.kj-tile.crumble.gone::before{opacity:0;animation:none}
.kj-tile.crumble2{animation:kjCrumble2 .55s ease-in}
@keyframes kjCrumble2{0%{transform:none}20%{transform:translateX(-3px) rotate(-1deg)}40%{transform:translateX(3px) rotate(1deg)}100%{transform:scale(.82);filter:brightness(.3)}}
/* royal challenge: red squares to avoid */
.kj-tile.thorn::after{content:"";position:absolute;inset:0;border-radius:6px;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22%3E%3Cg fill=%22none%22 stroke=%22%235a0b10%22 stroke-width=%225%22 stroke-linecap=%22round%22%3E%0A%3Cpath d=%22M10 70 Q30 40 50 60 T90 30%22/%3E%3Cpath d=%22M14 30 Q40 50 60 30 T92 72%22/%3E%3C/g%3E%0A%3Cg fill=%22%23ff4a4a%22 stroke=%22%235a0b10%22 stroke-width=%221.5%22%3E%3Cpath d=%22M28 50 l-6 -9 l10 3z%22/%3E%3Cpath d=%22M62 52 l5 -10 l3 10z%22/%3E%3Cpath d=%22M44 40 l-2 -11 l7 8z%22/%3E%0A%3Cpath d=%22M76 60 l10 -2 l-7 8z%22/%3E%3Cpath d=%22M20 62 l-9 3 l6 -8z%22/%3E%3Cpath d=%22M52 70 l3 10 l-9 -5z%22/%3E%3C/g%3E%3C/svg%3E") center/92% 92% no-repeat,radial-gradient(circle,rgba(255,40,40,.32),rgba(160,0,0,.22) 70%);
  box-shadow:inset 0 0 0 3px rgba(255,70,70,.8);pointer-events:none}
/* Royal Order: ring on the square + floating numbered medallion */
.kj-oring{position:absolute;width:100px;height:100px;pointer-events:none}
.kj-oring::before{content:"";position:absolute;inset:8px;border-radius:50%;border:4px dashed rgba(255,214,90,.85);box-shadow:0 0 14px rgba(255,200,60,.6),inset 0 0 14px rgba(255,200,60,.35);animation:kjPortalSpin 9s linear infinite}
.kj-oring.later::before{border-color:rgba(220,210,190,.45);box-shadow:none}
.kj-oring.next::before{border-style:solid;border-color:#ffe28a;box-shadow:0 0 22px 6px rgba(255,200,60,.85),inset 0 0 18px rgba(255,210,90,.6)}
.kj-oring.done::before{border-style:solid;border-color:rgba(120,255,140,.8);box-shadow:0 0 12px rgba(90,255,120,.6);animation:none}
.kj-medal{pointer-events:none!important;z-index:1200}
.kj-medal b{position:absolute;inset:8%;border-radius:50%;display:flex;align-items:center;justify-content:center;font:900 1em/1 var(--kj-serif);color:#3b2504;
  background:radial-gradient(circle at 35% 30%,#fff6c8,#ffd24a 45%,#b77d12 100%);border:4px solid #7a4f08;box-shadow:0 0 16px rgba(255,200,60,.9),0 6px 8px rgba(0,0,0,.45);animation:kjBob 2s ease-in-out infinite}
.kj-medal .lock,.kj-medal .tick{position:absolute;right:-6%;bottom:-2%;width:40%;height:40%;border-radius:50%;display:none;background:center/70% 70% no-repeat}
.kj-medal .lock{background-color:#4a3e2b;background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 46%22%3E%3Cpath d=%22M10 20 V14 a10 10 0 0 1 20 0 V20%22 fill=%22none%22 stroke=%22%23f2e6c6%22 stroke-width=%225%22/%3E%0A%3Crect x=%225%22 y=%2220%22 width=%2230%22 height=%2222%22 rx=%224%22 fill=%22%23f2e6c6%22 stroke=%22%233b3324%22 stroke-width=%222%22/%3E%3Ccircle cx=%2220%22 cy=%2230%22 r=%223.5%22 fill=%22%233b3324%22/%3E%3C/svg%3E");border:2px solid #f2e6c6}
.kj-medal .tick{background-color:#2fbf55;background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 40 40%22%3E%3Cpath d=%22M8 21 L17 30 L33 11%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%226%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E");border:2px solid #fff}
.kj-medal.later b{filter:grayscale(.85) brightness(.85);box-shadow:0 6px 8px rgba(0,0,0,.45)}
.kj-medal.later .lock{display:block}
.kj-medal.next b{box-shadow:0 0 26px 8px rgba(255,210,70,.95),0 6px 8px rgba(0,0,0,.45)}
.kj-medal.done b{background:radial-gradient(circle at 35% 30%,#d8ffe0,#5fe07a 45%,#1d8a3a 100%);border-color:#0e5a24;color:#0a3317}
.kj-medal.done .tick{display:block}
.kj-medal.gone{opacity:0;transition:opacity .4s}
.kj-medal.pop b{animation:kjMedalPop .6s cubic-bezier(.3,1.6,.5,1)}
@keyframes kjMedalPop{0%{transform:scale(.6)}60%{transform:scale(1.25)}100%{transform:none}}
.kj-medal.shake b{animation:kjLockShake .45s}
/* checkpoints: rings + a beam of light that turns gold once lit */
.kj-cp{position:absolute;width:100px;height:100px;pointer-events:none}
.kj-cp i{position:absolute;border-radius:50%}
.kj-cp .r1{inset:10px;border:4px solid rgba(160,240,255,.9);box-shadow:0 0 14px rgba(120,220,255,.8),inset 0 0 12px rgba(120,220,255,.5);animation:kjPortalPulse 2s ease-in-out infinite}
.kj-cp .r2{inset:28px;border:3px solid rgba(220,250,255,.75)}
.kj-cp.lit .r1{border-color:#ffd24a;box-shadow:0 0 22px 6px rgba(255,200,60,.9),inset 0 0 16px rgba(255,210,90,.7);animation:none}
.kj-cp.lit .r2{border-color:#fff1b0;background:radial-gradient(circle,rgba(255,236,150,.7),transparent 70%)}
.kj-beacon{pointer-events:none!important}
.kj-beacon .beam{position:absolute;left:34%;right:34%;bottom:6%;top:0;border-radius:40% 40% 10% 10%;
  background:linear-gradient(0deg,rgba(150,235,255,.55),rgba(150,235,255,0));filter:blur(2px);animation:kjBeam 2.2s ease-in-out infinite}
.kj-beacon.lit .beam{background:linear-gradient(0deg,rgba(255,214,90,.9),rgba(255,236,160,0));left:28%;right:28%}
.kj-beacon.flare .beam{animation:kjFlare .9s ease-out}
@keyframes kjBeam{50%{opacity:.55}}
@keyframes kjFlare{0%{transform:scaleY(.2);opacity:0}40%{transform:scaleY(1.25);opacity:1}100%{transform:none}}
/* escorts: friendly piece (silver-blue + shield), route and goal banner */
.kj-escort{pointer-events:auto;z-index:870}
.kj-escort .kj-spr{filter:hue-rotate(150deg) saturate(.55) brightness(1.18) drop-shadow(0 0 8px rgba(120,190,255,.95)) drop-shadow(0 6px 5px rgba(0,0,0,.45))}
.kj-escort .shield{position:absolute;left:50%;top:-14%;width:34%;aspect-ratio:60/70;transform:translateX(-50%);background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 60 70%22%3E%3Cpath d=%22M30 4 L54 12 V34 C54 50 42 60 30 66 C18 60 6 50 6 34 V12 Z%22 fill=%22%232f7bff%22 stroke=%22%23e9f2ff%22 stroke-width=%224%22 stroke-linejoin=%22round%22/%3E%0A%3Cpath d=%22M30 16 V52 M16 30 H44%22 stroke=%22%23ffe08a%22 stroke-width=%226%22 stroke-linecap=%22round%22/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 2px 3px rgba(0,0,0,.5))}
.kj-escort::before{content:"";position:absolute;left:6%;right:6%;bottom:2%;height:18%;border-radius:50%;transform:translateY(40%);background:radial-gradient(ellipse,rgba(80,160,255,.6),rgba(80,160,255,0) 70%)}
.kj-escort.wait .kj-spr{animation:kjShake .4s}
.kj-escort.home .kj-spr{filter:hue-rotate(150deg) saturate(.6) brightness(1.3) drop-shadow(0 0 14px rgba(255,220,90,.95))}
.kj-tracks.escort .rail{stroke:rgba(10,30,70,.5)}
.kj-tracks.escort .dots{stroke:rgba(140,200,255,.95)}
.kj-egoal{position:absolute;width:100px;height:100px;pointer-events:none}
.kj-egoal::before{content:"";position:absolute;inset:10px;border-radius:50%;border:4px double rgba(120,190,255,.95);box-shadow:0 0 14px rgba(90,160,255,.8)}
.kj-egoal .flag{position:absolute;left:32%;top:-38%;width:42%;height:120%;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 60 80%22%3E%3Cpath d=%22M10 6 V76%22 stroke=%22%233a2a10%22 stroke-width=%225%22 stroke-linecap=%22round%22/%3E%0A%3Cpath d=%22M12 8 H52 L42 22 L52 36 H12 Z%22 fill=%22%233d8cff%22 stroke=%22%230d2b66%22 stroke-width=%223%22 stroke-linejoin=%22round%22/%3E%0A%3Cpath d=%22M24 16 L28 26 L34 16%22 fill=%22none%22 stroke=%22%23ffe08a%22 stroke-width=%223%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") center bottom/contain no-repeat;transform-origin:20% 100%;animation:kjSway 2.6s ease-in-out infinite}
.kj-egoal.reached::before{border-color:#ffd24a;box-shadow:0 0 22px 6px rgba(255,200,60,.9)}
.kj-mark.escortnext{inset:auto;border:4px dashed rgba(120,190,255,1);border-radius:50%;transform:scale(.8);background:radial-gradient(circle,rgba(80,150,255,.25),transparent 70%);animation:kjStoneNext 1.4s ease-in-out infinite}
/* HUD chips: order, checkpoints, escort, royal challenge */
.kj-goal .ostep{display:inline-flex;align-items:center;justify-content:center;width:1.45em;height:1.45em;border-radius:50%;font-weight:900;color:#3b2504;
  background:#8d8370;opacity:.7}
.kj-goal .ostep.next{background:#ffd24a;opacity:1;box-shadow:0 0 .5em rgba(255,200,60,.9)}
.kj-goal .ostep.on{background:#4fd36d;opacity:1;color:#06301a}
.kj-goal .cpi{display:inline-block;width:1.2em;height:1.2em;border-radius:50%;border:.18em solid #9fe9ff;box-shadow:0 0 .4em rgba(120,220,255,.8)}
.kj-goal.cps.done .cpi{border-color:#ffd24a;box-shadow:0 0 .4em rgba(255,200,60,.9)}
.kj-goal .esci{height:1.6em;width:auto;filter:hue-rotate(150deg) saturate(.6) brightness(1.2)}
.kj-goal .flagmini{display:inline-block;width:.9em;height:1.1em;background:linear-gradient(#3d8cff,#3d8cff) 0 0/100% 55% no-repeat,linear-gradient(#5a4020,#5a4020) 0 0/.15em 100% no-repeat}
.kj-goal.bonus{white-space:normal;max-width:100%;box-sizing:border-box;text-align:left;line-height:1.15;border-color:rgba(255,214,90,.7);background:rgba(40,26,4,.7)}
.kj-goal.bonus .bst{font-style:normal;color:#ffd24a;font-size:1.2em}
.kj-goal.bonus .btx{font-weight:700;font-size:.92em}
.kj-goal.bonus.done{border-color:#4fd36d;box-shadow:0 0 .5em rgba(80,220,120,.7)}
.kj-goal.bonus.failed{opacity:.6;border-color:rgba(255,90,80,.8);filter:grayscale(.6)}
.kj-goal.bonus.failed .btx{text-decoration:line-through}
.landscape .kj-goal.bonus{font-size:.9em;padding:.15em .4em}
.portrait .kj-goal.bonus{max-width:none}
@media (prefers-reduced-motion:reduce){.kj-tile.crumble::after,.kj-oring::before,.kj-medal b,.kj-cp .r1,.kj-beacon .beam,.kj-egoal .flag,.kj-mark.escortnext{animation:none!important}}
