/* Jelly Wonder — the game's own stylesheet, shared by the standalone page (index.html), the public play route
 * and the /kid shell. Everything is scoped under #jw-root (the stage), so nothing leaks into a host page.
 * The stage: on a touch device held upright it turns a quarter (the mine-cart's rule). */
/* The stage: everything the game draws or shows lives in #jw-root. On a touch device held upright the
   stage turns a quarter (the mine-cart's rule): the content rotates, never the OS, so portrait lock can stay
   on. Fixed children are placed against the stage, and sizes use container units so they follow it. */
/* A game, not a page: a long press never selects the arrows or opens the copy / search bar. */
#jw-root{position:fixed;inset:0;overflow:hidden;container:jw / size;font-family:var(--font);color:var(--cream);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
  --ink:#1a0b22;--cream:#fff8ec;--jelly:#ff4f6e;--font:"Rubik","Varela Round","Arial Rounded MT Bold","Arial Hebrew",system-ui,sans-serif;
  --sa-top:env(safe-area-inset-top,0px);--sa-right:env(safe-area-inset-right,0px);--sa-bottom:env(safe-area-inset-bottom,0px);--sa-left:env(safe-area-inset-left,0px)}
@media (orientation:portrait) and (any-pointer:coarse){
  #jw-root{inset:auto;left:50%;top:50%;width:100dvh;height:100dvw;transform:translate(-50%,-50%) rotate(90deg);
    --sa-top:env(safe-area-inset-right,0px);--sa-right:env(safe-area-inset-bottom,0px);--sa-bottom:env(safe-area-inset-left,0px);--sa-left:env(safe-area-inset-top,0px)}
}
#jw-root canvas{display:block;position:fixed;left:0;top:0} /* pinned top-left: in an RTL page a sized box would anchor right */
#jw-canvas{z-index:0}
.jw-over{position:fixed;inset:0;z-index:5;display:flex;align-items:center;justify-content:center}
.jw-over.title{background:#120a1f url(assets/img/title_art.webp) center/cover no-repeat}
.jw-over.title::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(18,10,31,.15),rgba(18,10,31,.65))}
.jw-over.map{background:#0e2238}
.jw-over.intro{pointer-events:none}
.jw-title{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;margin-top:-4cqh}
.jw-logo{display:flex;flex-direction:column;align-items:center;line-height:1;filter:drop-shadow(0 6px 0 #2a0a3a)}
.jw-logo .he{font-size:clamp(56px,11cqw,120px);font-weight:900;background:linear-gradient(180deg,#fff6c8,#ffb347 45%,#ff4f8b);-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-stroke:3px #2a0a3a;animation:jw-bob 2.4s ease-in-out infinite}
.jw-logo .en{font-size:clamp(16px,2.6cqw,26px);letter-spacing:.35em;font-weight:800;color:#bff3ff;-webkit-text-stroke:1px #2a0a3a;margin-top:6px}
@keyframes jw-bob{0%,100%{transform:translateY(0) scale(1,1)}50%{transform:translateY(-6px) scale(1.03,.97)}}
.jw-row{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.jw-row.small .jw-btn{font-size:15px;padding:8px 14px}
.jw-col{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.jw-btn{font:800 20px var(--font);padding:12px 22px;border-radius:18px;border:3px solid var(--ink);background:var(--cream);color:var(--ink);box-shadow:0 5px 0 var(--ink);cursor:pointer}
.jw-btn:active{transform:translateY(3px);box-shadow:0 2px 0 var(--ink)}
.jw-btn.big{font-size:28px;padding:14px 38px;background:linear-gradient(180deg,#ffe066,#ffb02e);}
.jw-btn.ghost{background:rgba(255,248,236,.85)}
.jw-flavor{width:44px;height:44px;border-radius:50% 50% 46% 46%;border:3px solid var(--ink);background:radial-gradient(circle at 35% 30%,#fff 0 12%,var(--c) 35%,color-mix(in srgb,var(--c),#000 35%));box-shadow:0 4px 0 var(--ink);cursor:pointer}
.jw-flavor.on{outline:4px solid #fff6c8;outline-offset:3px;transform:scale(1.12)}
.jw-chip{font:700 15px var(--font);padding:7px 12px;border-radius:999px;border:2px solid var(--ink);background:rgba(255,248,236,.8);color:var(--ink);cursor:pointer}
.jw-chip.on{background:#7cf0c4}
.jw-chip .sym{font-weight:900;margin-left:6px} /* the signs sit at the right of an RTL chip; the gap goes before the label */
.jw-pick{display:flex;flex-direction:column;align-items:center;gap:6px;background:rgba(18,10,31,.5);padding:10px 14px;border-radius:22px}
.jw-legend{font:800 15px var(--font);color:#fff6c8;-webkit-text-stroke:.5px var(--ink);text-shadow:0 2px 0 var(--ink)}
.jw-home{position:absolute;top:max(12px,var(--sa-top));right:max(12px,var(--sa-right));z-index:2;font:800 15px var(--font);color:var(--ink);background:rgba(255,248,236,.85);border:3px solid var(--ink);border-radius:999px;padding:6px 14px;text-decoration:none;box-shadow:0 4px 0 var(--ink)}
/* touch devices only: a quiet note that a keyboard is the comfiest way to play */
.jw-pc-tip{display:none;position:absolute;bottom:max(10px,var(--sa-bottom));left:50%;transform:translateX(-50%);font:700 13px var(--font);color:rgba(255,248,236,.78);background:rgba(18,10,31,.45);padding:3px 12px;border-radius:999px;white-space:nowrap;pointer-events:none}
@media (hover:none) and (any-pointer:coarse){.jw-pc-tip{display:block}}
.jw-range{font:700 14px var(--font);color:#fff;background:rgba(26,11,34,.55);padding:3px 12px;border-radius:999px}
.jw-map{position:absolute;inset:0;overflow:hidden;background:#6f93b4}
.jw-map::before{content:"";position:absolute;inset:-24px;background:url(assets/img/map_bg2.webp) center/cover;filter:blur(16px) brightness(.8)}
/* the island art is 16:9; the box covers the screen like background-size:cover so node %s stay on the path */
.jw-map-box{position:absolute;left:50%;top:50%;width:max(100cqw,177.78cqh);height:max(100cqh,56.25cqw);transform:translate(-50%,-50%)}
@container jw (aspect-ratio < 1){.jw-map-box{width:100cqw;height:56.25cqw}}
/* short landscape phones: fit the whole island by height (nothing cropped) and show numbers only */
@container jw (aspect-ratio >= 1) and (max-height:520px){.jw-map-box{width:177.78cqh;height:100cqh}.jw-node .nm{display:none}}
.jw-map-art{position:absolute;inset:0;background:url(assets/img/map_bg2.webp) center/100% 100% no-repeat}
.jw-map-top{position:absolute;top:12px;right:12px;left:12px;display:flex;justify-content:space-between;align-items:center}
.jw-map-title{font-size:28px;font-weight:900;-webkit-text-stroke:1.5px var(--ink);text-shadow:0 3px 0 var(--ink)}
.jw-node{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:2px;background:none;border:none;cursor:pointer;font-family:var(--font);color:var(--cream)}
.jw-node .num{width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:28px;font-weight:900;border:4px solid var(--ink);box-shadow:0 5px 0 var(--ink);background:radial-gradient(circle at 35% 30%,#fff 0 10%,#ff6f91 40%,#c23060);color:#fff;-webkit-text-stroke:1px var(--ink);animation:jw-bob 2.2s ease-in-out infinite}
.jw-node.w2 .num{background:radial-gradient(circle at 35% 30%,#fff 0 10%,#5ff0ff 40%,#2a7fb0)}
.jw-node.w3 .num{background:radial-gradient(circle at 35% 30%,#fff 0 10%,#c9a8ff 40%,#6a46c8)}
.jw-node.done .num{background:radial-gradient(circle at 35% 30%,#fff 0 10%,#ffe066 40%,#e09a10)}
.jw-node.locked{cursor:default;filter:grayscale(1) brightness(.7)}
.jw-node.locked .num{animation:none}
.jw-node .nm{font-size:15px;font-weight:800;background:rgba(26,11,34,.75);padding:2px 10px;border-radius:999px;white-space:nowrap}
.jw-node .gems{display:flex;gap:3px;align-items:center}
.jw-node .gems i{width:11px;height:11px;border-radius:3px;transform:rotate(45deg);background:rgba(255,255,255,.25);border:1.5px solid var(--ink)}
.jw-node .gems i.on{background:#ff8fe0}
.jw-node .gems b{color:#ffe066;font-size:16px;margin-inline-start:4px}
.jw-intro{text-align:center;animation:jw-pop 1.4s ease-out both}
.jw-intro .w{font-size:20px;font-weight:800;color:#bff3ff;-webkit-text-stroke:1px var(--ink)}
.jw-intro .n{font-size:clamp(40px,7cqw,72px);font-weight:900;-webkit-text-stroke:2.5px var(--ink);text-shadow:0 5px 0 var(--ink)}
@keyframes jw-pop{0%{transform:scale(.3);opacity:0}25%{transform:scale(1.08);opacity:1}80%{transform:scale(1);opacity:1}100%{transform:scale(1.15);opacity:0}}
.jw-card{background:linear-gradient(180deg,#3a2a5c,#26193f);border:4px solid var(--ink);border-radius:26px;box-shadow:0 8px 0 var(--ink);padding:22px 30px;text-align:center;min-width:280px;max-width:92cqw}
.jw-card h2{margin:0 0 4px;font-size:40px;font-weight:900;color:#ffe066;-webkit-text-stroke:1.5px var(--ink)}
.jw-card .sub{font-size:19px;margin-bottom:12px;color:#e8defc}
.jw-results{display:flex;gap:12px;justify-content:center;margin:10px 0 16px;flex-wrap:wrap}
.jw-results div{background:rgba(255,255,255,.08);border:2px solid rgba(255,255,255,.18);border-radius:16px;padding:8px 12px;min-width:84px}
.jw-results b{display:block;font-size:30px;color:#fff;direction:ltr}
.jw-results span{font-size:14px;color:#cfc3ea}
.jw-pad{position:fixed;bottom:max(14px,var(--sa-bottom));z-index:4;display:flex;gap:12px;direction:ltr}
.jw-pad.l{left:max(14px,var(--sa-left))}.jw-pad.r{right:max(14px,var(--sa-right))}
.jw-pad div{touch-action:none;width:76px;height:76px;border-radius:50%;background:rgba(255,248,236,.16);border:3px solid rgba(255,248,236,.45);color:#fff;font:900 30px system-ui;display:flex;align-items:center;justify-content:center}
.jw-pad div.on{background:rgba(255,248,236,.42)}
.jw-pad.r div:last-child{width:96px;height:96px}
.jw-tools{position:fixed;top:max(10px,calc(var(--sa-top) + 6px));right:max(12px,var(--sa-right));z-index:4;display:none;gap:8px;direction:ltr}
.jw-playing .jw-tools{display:flex}
.jw-tools button{width:46px;height:46px;border-radius:50%;border:3px solid var(--ink);background:rgba(255,248,236,.88);box-shadow:0 4px 0 var(--ink);font:900 20px system-ui;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.jw-tools button:active{transform:translateY(2px);box-shadow:0 2px 0 var(--ink)}
.jw-bot .jw-tools button.bot{background:#7cf0c4;outline:3px solid #fff6c8;animation:jw-bob 1.2s ease-in-out infinite}
@media (hover:hover) and (pointer:fine){.jw-pad{display:none}}
/* short screens (a phone on its side): logo, flavours and play on one side, the practice menu on the other */
@container jw (max-height:520px){
  .jw-title{display:grid;grid-template-columns:auto auto;column-gap:clamp(16px,4cqw,40px);row-gap:8px;align-items:center;justify-items:center;margin-top:0}
  .jw-title > .jw-pick{grid-column:2;grid-row:1 / span 4}
  .jw-title > :not(.jw-pick){grid-column:1}
  .jw-logo .he{font-size:clamp(40px,12cqh,64px);-webkit-text-stroke:2px #2a0a3a}
  .jw-logo .en{font-size:12px;margin-top:2px}
  .jw-flavor{width:34px;height:34px}
  .jw-pick .jw-row{max-width:46cqw}
  .jw-chip{font-size:14px;padding:6px 10px}
  .jw-btn.big{font-size:22px;padding:10px 28px}
  .jw-row.small .jw-btn{font-size:13px;padding:6px 10px}
}
@container jw (max-height:520px){.jw-tools button{width:38px;height:38px;font-size:16px}}
@container jw (max-height:520px){.jw-pad div{width:60px;height:60px;font-size:24px}.jw-pad.r div:last-child{width:74px;height:74px}.jw-node .num{width:44px;height:44px;font-size:21px}.jw-node .nm{font-size:12px}}
/* a phone on its side: the cards (pause with its sound row, a level's result with the page's link) keep inside the stage */
@container jw (max-height:520px){.jw-card{padding:12px 24px}.jw-card h2{font-size:28px}.jw-card .sub{font-size:16px;margin-bottom:6px}.jw-col{gap:7px}.jw-card .jw-btn{font-size:17px;padding:7px 18px}.jw-card .jw-btn.big{font-size:20px;padding:8px 26px}.jw-results{margin:6px 0 10px;gap:8px}.jw-results div{padding:4px 10px}.jw-results b{font-size:24px}.jw-results span{font-size:12px}}
