
:root{
  --navy:#1A3A5C;--navy-deep:#0f2540;--orange:#F4A228;--orange-deep:#d88a14;
  --bg:#FFF6E3;--bg2:#FFE9C2;--card:#fff;--cream:#FFF1D6;
  --coral:#FF5C7A;--coral-deep:#e63e5e;--yellow:#FFD23F;--green:#4ECB71;
  --green-deep:#2fa854;--blue:#3DB5FF;--purple:#B57BFF;--pink:#FF7BC8;--teal:#2DD4BF;
  --shadow:0 6px 0 var(--navy);--shadow-lg:0 10px 0 var(--navy);
  --r:24px;--rs:16px;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{min-height:100%;font-family:'Nunito',sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;background:var(--bg);color:var(--navy)}
body{overflow-x:hidden}
button{font:inherit;color:inherit}
.screen{display:none;min-height:100dvh;position:relative;overflow:hidden;padding:20px}
.screen.active{display:flex}
.screen::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.38;background-image:
 radial-gradient(circle at 8% 14%,var(--orange) 0 8px,transparent 9px),
 radial-gradient(circle at 90% 12%,var(--coral) 0 7px,transparent 8px),
 radial-gradient(circle at 6% 82%,var(--teal) 0 8px,transparent 9px),
 radial-gradient(circle at 94% 84%,var(--purple) 0 9px,transparent 10px),
 radial-gradient(circle at 52% 94%,var(--yellow) 0 7px,transparent 8px)}
.screen>*{position:relative;z-index:1}
.card{background:var(--card);border:4px solid var(--navy);border-radius:var(--r);box-shadow:var(--shadow)}
.btn{border:4px solid var(--navy);border-radius:999px;padding:15px 26px;font-family:'Nunito',sans-serif;font-weight:700;cursor:pointer;box-shadow:0 6px 0 var(--navy);transition:.12s transform,.12s box-shadow;background:#fff}
.btn:hover{transform:translateY(-2px);box-shadow:0 8px 0 var(--navy)}
.btn:active{transform:translateY(4px);box-shadow:0 2px 0 var(--navy)}
.btn-primary{background:var(--coral);color:white}.btn-green{background:var(--green);color:white}.btn-yellow{background:var(--yellow)}.btn-navy{background:var(--navy);color:white}
.icon-btn{width:50px;height:50px;border-radius:50%;padding:0;display:grid;place-items:center;font-size:21px;background:#fff}

/* HOME */
#home{align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:18px}
.logo-badge{display:inline-flex;gap:8px;align-items:center;background:var(--orange);border:3px solid var(--navy);border-radius:999px;padding:8px 18px;box-shadow:0 4px 0 var(--navy);font:700 13px 'Fredoka';letter-spacing:1.2px;text-transform:uppercase;transform:rotate(-2deg)}
h1{font:700 clamp(46px,9vw,94px)/.9 'Fredoka';letter-spacing:-3px;text-shadow:4px 4px 0 #fff,8px 8px 0 var(--orange)}

#home .btn{font-family:'Fredoka',sans-serif}
#home .btn.hero-change-btn{font-family:'Nunito',sans-serif!important;font-weight:900}
h1 span{color:var(--coral);text-shadow:4px 4px 0 #fff,8px 8px 0 var(--yellow)}
.subtitle{font-size:clamp(16px,2vw,21px);font-weight:800;opacity:.78;max-width:650px}
.hero-board{display:grid;grid-template-columns:repeat(3,70px);gap:9px;padding:14px;transform:rotate(-1deg)}
.hero-cell{aspect-ratio:1;border:3px solid var(--navy);border-radius:16px;background:#fff;display:grid;place-items:center;font-size:38px;box-shadow:0 4px 0 var(--navy)}
.hero-cell:nth-child(2),.hero-cell:nth-child(6){background:var(--yellow)}
.home-actions{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}.home-actions .btn-primary{font-size:25px;padding:18px 42px}
.mini-stats{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.stat-pill{background:#fff;border:3px solid var(--navy);border-radius:999px;padding:9px 15px;box-shadow:0 4px 0 var(--navy);font-weight:900}

/* HERO SELECT */
#heroSelect{flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:18px;overflow:auto;padding:24px}
.hero-select-card{width:min(920px,100%);padding:28px 24px}
.hero-select-title{font:700 clamp(34px,6vw,58px) 'Fredoka';letter-spacing:-1px;margin-bottom:8px}
.hero-select-sub{font-size:17px;font-weight:800;opacity:.72;margin-bottom:22px}
.hero-grid{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:16px}
.hero-choice{position:relative;border:4px solid var(--navy);border-radius:24px;background:#fff;box-shadow:0 6px 0 var(--navy);padding:18px 12px;cursor:pointer;transition:.14s;min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.hero-choice:hover{transform:translateY(-4px) rotate(-1deg);box-shadow:0 10px 0 var(--navy)}
.hero-choice.selected{background:var(--yellow);outline:6px solid rgba(244,162,40,.3);transform:translateY(3px);box-shadow:0 3px 0 var(--navy)}
.hero-choice-icon{font-size:68px;line-height:1;filter:drop-shadow(0 4px 0 rgba(26,58,92,.12))}
.hero-choice-name{font:900 21px 'Nunito'}
.hero-choice-desc{font-size:12px;font-weight:800;opacity:.62}
.hero-choice-check{display:none;position:absolute;right:10px;top:10px;width:30px;height:30px;border:3px solid var(--navy);border-radius:50%;background:var(--green);color:#fff;font-weight:900;place-items:center}
.hero-choice.selected .hero-choice-check{display:grid}
.hero-select-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:24px}
.hero-mini-btn{font-size:14px;padding:11px 18px}
@media(max-width:650px){.hero-grid{grid-template-columns:repeat(2,1fr)}.hero-choice{min-height:140px;padding:14px 8px}.hero-choice-icon{font-size:56px}.hero-choice-name{font-size:17px}}

/* MAP */
#map{flex-direction:column;align-items:center;padding-bottom:50px;overflow:auto}
.topbar{width:min(1100px,100%);display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.topbar-title{font:700 clamp(28px,5vw,48px) 'Nunito';text-align:center}.topbar-side{display:flex;gap:8px;align-items:center}
.progress-card{width:min(900px,100%);padding:18px 22px;margin-bottom:20px;display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center}
.progress-track{height:18px;background:var(--cream);border:3px solid var(--navy);border-radius:999px;overflow:hidden}.progress-fill{height:100%;background:linear-gradient(90deg,var(--orange),var(--yellow));width:0;transition:.4s}
.progress-copy{font-weight:900}.progress-stars{font:700 22px 'Nunito'}
.worlds{width:min(980px,100%);display:grid;gap:18px}
.world{padding:18px}.world-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.world-name{font:900 31px 'Nunito'}.world-desc{font-size:16px;font-weight:800;opacity:.65}.world-badge{font-size:34px}
.levels{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:13px}
.level{min-height:132px;border:3px solid var(--navy);border-radius:20px;background:#fff;box-shadow:0 5px 0 var(--navy);cursor:pointer;padding:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:5px;transition:.12s}
.level:hover:not(.locked){transform:translateY(-3px);box-shadow:0 8px 0 var(--navy)}.level.locked{opacity:.48;filter:grayscale(.8);cursor:not-allowed}.level.done{background:#fff9df}.level-icon{font-size:34px}.level-name{font:700 14px 'Nunito'}.level-meta{font-size:11px;font-weight:900;opacity:.6}.level-stars{letter-spacing:1px;font-size:17px}.level.current{outline:5px solid rgba(244,162,40,.35)}

/* GAME */
#game{flex-direction:column;align-items:center;padding:12px;overflow:auto}
.game-shell{width:min(980px,100%);display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:18px;align-items:start}
.game-head{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--navy);color:#fff;border:4px solid var(--navy);border-radius:22px;padding:10px 14px;box-shadow:0 6px 0 var(--orange)}
.game-title{font:900 28px 'Nunito'}.game-sub{font-size:15px;color:var(--orange);font-weight:900}.game-head-right{display:flex;gap:8px;align-items:center}.game-star-chip{background:#fff;color:var(--navy);border:3px solid var(--orange);border-radius:999px;padding:7px 12px;font-weight:900}
.board-card{padding:18px;display:flex;flex-direction:column;gap:15px}.instruction{text-align:center;font-weight:900;font-size:16px}.instruction strong{color:var(--coral)}
.sudoku-board{display:grid;width:min(100%,560px);margin:auto;border:5px solid var(--navy);border-radius:22px;overflow:hidden;background:var(--navy);gap:3px;box-shadow:0 8px 0 var(--navy)}
.sudoku-board.size-5{width:min(100%,600px)}.sudoku-board.size-6{width:min(100%,640px)}
.cell{aspect-ratio:1;border:0;background:#fff;display:grid;place-items:center;font-size:clamp(32px,7vw,58px);cursor:pointer;position:relative;transition:.12s;user-select:none}
.sudoku-board.size-5 .cell{font-size:clamp(28px,5vw,48px)}.sudoku-board.size-6 .cell{font-size:clamp(23px,4.1vw,42px)}
.cell.region-right{border-right:6px solid var(--navy)}.cell.region-bottom{border-bottom:6px solid var(--navy)}
.region-note{display:inline-block;background:#fff3cd;border:3px solid var(--navy);box-shadow:0 3px 0 var(--navy);border-radius:999px;padding:4px 10px;margin-top:5px;font-size:12px;font-weight:900;color:var(--navy)}
.cell:nth-child(odd){background:#fffdf7}.cell.given{cursor:default;background:#eff8ff}.cell.selected{background:#fff2ad;box-shadow:inset 0 0 0 5px var(--orange)}.cell.hint{animation:hintPulse 1s infinite}.cell.wrong{animation:shake .3s;background:#ffe4e9}.cell.correct-pop{animation:pop .28s}.cell .lock{position:absolute;right:5px;bottom:3px;font-size:11px;opacity:.35}
@keyframes shake{25%{transform:translateX(-6px)}50%{transform:translateX(6px)}75%{transform:translateX(-3px)}}@keyframes pop{50%{transform:scale(1.2)}}@keyframes hintPulse{50%{box-shadow:inset 0 0 0 7px var(--yellow)}}
.picker{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.pick{width:76px;height:76px;border:4px solid var(--navy);border-radius:20px;background:#fff;box-shadow:0 5px 0 var(--navy);font-size:42px;cursor:pointer;transition:.12s}.pick.active{background:var(--yellow);transform:translateY(3px);box-shadow:0 2px 0 var(--navy)}.pick:active{transform:translateY(4px);box-shadow:0 1px 0 var(--navy)}
.game-actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap}.game-actions .btn{padding:11px 17px;border-width:3px;font-size:14px}
.side{display:flex;flex-direction:column;gap:13px}.side .card{padding:16px}.side h3{font:700 16px 'Nunito';margin-bottom:8px}.tip{font-size:13px;font-weight:800;line-height:1.5;opacity:.75}.side-stat{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:2px dashed #dbe4ec;font-weight:900}.side-stat:last-child{border:0}.big-emoji{text-align:center;font-size:56px;margin-bottom:4px}.helper-text{text-align:center;font:700 16px 'Nunito'}

/* MODALS */
.overlay{display:none;position:fixed;inset:0;background:rgba(26,58,92,.8);backdrop-filter:blur(5px);z-index:50;align-items:center;justify-content:center;padding:18px}.overlay.open{display:flex}
.modal{width:min(560px,100%);padding:30px;text-align:center;animation:modalPop .25s ease}.modal-icon{font-size:72px}.modal h2{font:700 38px 'Nunito';margin:6px 0}.modal p{font-weight:800;opacity:.72;line-height:1.5}.modal-stars{font-size:48px;letter-spacing:5px;margin:14px 0}.modal-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:20px}.modal .btn{padding:13px 20px}
@keyframes modalPop{from{transform:scale(.75) rotate(-2deg);opacity:0}}
.confetti{position:fixed;inset:0;pointer-events:none;z-index:60}.confetti i{position:absolute;width:12px;height:18px;animation:fall 1.7s linear forwards}@keyframes fall{from{transform:translateY(-10vh) rotate(0)}to{transform:translateY(110vh) rotate(720deg)}}

/* COLLECTION */
#collection{flex-direction:column;align-items:center;overflow:auto}.collection-grid{width:min(900px,100%);display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.badge-card{padding:18px;text-align:center}.badge-card.locked{opacity:.4;filter:grayscale(1)}.badge-icon{font-size:54px}.badge-name{font:700 18px 'Nunito';margin:6px 0}.badge-desc{font-size:12px;font-weight:800;opacity:.68}.badge-new{display:inline-block;margin-top:8px;background:var(--coral);color:#fff;border:2px solid var(--navy);border-radius:999px;padding:3px 8px;font-size:10px;font-weight:900}


/* WERSJA 2 — ILUSTROWANA MAPA PRZYGODY */
.home-scene{width:min(760px,96vw);height:170px;position:relative;margin:-4px 0 2px;pointer-events:none}
.home-hill{position:absolute;left:4%;right:4%;bottom:0;height:82px;background:#9BE06F;border:4px solid var(--navy);border-radius:50% 50% 22px 22px;box-shadow:0 7px 0 var(--navy)}
.home-cloud{position:absolute;font-size:52px;filter:drop-shadow(0 3px 0 #fff)}.home-cloud.one{left:4%;top:8px}.home-cloud.two{right:5%;top:18px;transform:scale(.8)}
.home-sun{position:absolute;right:24%;top:0;font-size:62px;animation:floaty 3s ease-in-out infinite}
.home-tree{position:absolute;bottom:40px;font-size:74px}.home-tree.one{left:10%}.home-tree.two{right:10%;transform:scale(.9)}
.home-mascot{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);font-size:86px;animation:mascotBounce 1.8s ease-in-out infinite;filter:drop-shadow(0 6px 0 rgba(26,58,92,.18))}
.home-flower{position:absolute;bottom:22px;font-size:28px}.home-flower.one{left:28%}.home-flower.two{right:29%}
@keyframes mascotBounce{50%{transform:translateX(-50%) translateY(-8px) rotate(3deg)}}@keyframes floaty{50%{transform:translateY(-6px) rotate(8deg)}}
.menu-btn{display:flex;align-items:center;gap:7px;padding:11px 17px;border-width:3px;font-size:14px}
.world-board{position:relative;min-height:430px;padding:20px;overflow:hidden;background:linear-gradient(#bdeaff 0 43%,#8bdb68 43% 100%)}
.world-board.farm{background:linear-gradient(#bdeaff 0 43%,#f3d36f 43% 100%)}
.world-board::after{content:"";position:absolute;left:-4%;right:-4%;bottom:-55px;height:170px;background:rgba(255,255,255,.16);border-radius:50%}
.world-scenery{position:absolute;inset:0;pointer-events:none}.scenery-item{position:absolute;font-size:54px;filter:drop-shadow(0 4px 0 rgba(26,58,92,.15))}.scenery-item.s1{left:3%;top:32%}.scenery-item.s2{right:4%;top:14%}.scenery-item.s3{right:7%;bottom:6%}.scenery-item.s4{left:7%;bottom:4%}
.path-svg{position:absolute;inset:76px 7% 25px;width:86%;height:320px;overflow:visible;z-index:1}.path-line{fill:none;stroke:#fff1c8;stroke-width:34;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 5px 0 #1A3A5C)}.path-dash{fill:none;stroke:#F4A228;stroke-width:4;stroke-dasharray:10 13;stroke-linecap:round}
.adventure-track{position:relative;height:330px;z-index:2;margin-top:12px}.map-node{pointer-events:auto;touch-action:manipulation;position:absolute;width:84px;height:84px;border:4px solid var(--navy);border-radius:50%;background:#fff;box-shadow:0 7px 0 var(--navy);display:grid;place-items:center;cursor:pointer;transition:.15s;z-index:3}.map-node:hover:not(.locked){transform:translateY(-5px) scale(1.04);box-shadow:0 12px 0 var(--navy)}.map-node.locked{filter:grayscale(1);opacity:.68;cursor:not-allowed;background:#e8edf1}.map-node.teaser{opacity:.78;background:#f3f5f7;animation:none}.map-node.teaser .node-icon{filter:grayscale(1)}.map-node.done{background:var(--yellow)}.map-node.current{background:var(--coral);color:#fff;animation:nodePulse 1.5s ease-in-out infinite}.map-node .node-icon{font-size:35px;line-height:1}.map-node .node-number{position:absolute;left:-7px;top:-8px;width:28px;height:28px;border:3px solid var(--navy);border-radius:50%;display:grid;place-items:center;background:var(--orange);font:700 13px 'Nunito'}.map-node .node-stars{position:absolute;bottom:-25px;white-space:nowrap;font-size:15px;letter-spacing:-2px}.map-node .node-label{position:absolute;top:91px;width:158px;text-align:center;font:900 15px/1.15 'Nunito',sans-serif;color:var(--navy);background:#fff;border:2px solid var(--navy);border-radius:999px;padding:6px 10px;box-shadow:0 3px 0 rgba(26,58,92,.18);z-index:6}.map-node .player-token{position:absolute;right:-23px;top:-35px;font-size:43px;animation:mascotBounce2 1.3s ease-in-out infinite;filter:drop-shadow(0 3px 0 #fff)}
.map-node.current .node-label{color:var(--navy);background:#fff}
@keyframes nodePulse{50%{transform:scale(1.08)}}@keyframes mascotBounce2{50%{transform:translateY(-7px) rotate(6deg)}}
.world-finish{position:absolute;right:3%;top:80px;font-size:55px;z-index:2;filter:drop-shadow(0 4px 0 #fff)}
.world-progress-mini{display:flex;align-items:center;gap:9px;font:800 13px 'Nunito';background:#fff;border:3px solid var(--navy);border-radius:999px;padding:7px 12px;box-shadow:0 4px 0 var(--navy)}
.board-decoration{display:flex;justify-content:center;align-items:flex-end;gap:12px;margin-bottom:-6px}.board-decoration span{font-size:33px;animation:floaty 2.4s ease-in-out infinite}.board-decoration span:nth-child(2){font-size:50px;animation-delay:.3s}.board-decoration span:nth-child(3){animation-delay:.6s}
@media(max-width:700px){.world-board{min-height:570px}.adventure-track{height:470px}.path-svg{display:none}.map-node{width:72px;height:72px}.map-node .node-label{top:78px;width:105px}.home-scene{height:140px}.home-mascot{font-size:70px}.home-tree{font-size:58px}.home-sun{font-size:48px}}

@media(max-width:800px){.levels{grid-template-columns:repeat(2,1fr)}.game-shell{grid-template-columns:1fr}.game-head{grid-column:auto}.side{display:grid;grid-template-columns:1fr 1fr}.collection-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.screen{padding:11px}.hero-board{grid-template-columns:repeat(3,56px)}.hero-cell{font-size:31px}.home-actions{width:100%}.home-actions .btn{width:100%}.levels{grid-template-columns:1fr 1fr}.level{min-height:116px}.progress-card{grid-template-columns:1fr}.game-head{align-items:flex-start}.game-head-right{flex-direction:column;align-items:flex-end}.board-card{padding:10px}.sudoku-board{gap:2px;border-width:4px}.pick{width:64px;height:64px;font-size:36px}.side{grid-template-columns:1fr}.collection-grid{grid-template-columns:1fr}.modal{padding:22px}.modal h2{font-size:31px}}

/* v3: progresywne mapy i prawdziwe cofanie */
.back-game-btn{background:var(--yellow)!important;color:var(--navy)!important;font-size:16px!important;padding:11px 18px!important}
.world.locked-world{filter:grayscale(.35);opacity:.78}
.world-lock-panel{min-height:220px;display:grid;place-items:center;text-align:center;padding:28px;position:relative;z-index:3}
.world-lock-icon{font-size:58px;margin-bottom:10px}.world-lock-title{font:700 23px 'Nunito';color:var(--navy)}.world-lock-text{font-weight:800;opacity:.67;margin-top:6px}
.world-stats{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 0}.world-stat{background:#fff;border:3px solid var(--navy);border-radius:999px;padding:7px 13px;font-weight:900;font-size:12px;box-shadow:0 3px 0 var(--navy)}
.map-summary{max-width:1080px;width:calc(100% - 32px);display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:14px auto 4px}.map-summary-item{background:#fff;border:3px solid var(--navy);border-radius:18px;padding:12px;text-align:center;box-shadow:0 4px 0 var(--navy)}.map-summary-val{font:700 26px 'Nunito';color:var(--navy)}.map-summary-label{font-size:11px;font-weight:900;opacity:.65;text-transform:uppercase;letter-spacing:.6px}
.adventure-track.progressive .map-node.future{display:none}.world-next-note{display:none!important}
@media(max-width:700px){.map-node .node-label{width:138px;font-size:13px;padding:5px 8px}.game-head{align-items:flex-start}.game-head-right{gap:6px}.game-head-right .menu-btn{padding:8px 10px;font-size:12px}.map-summary{grid-template-columns:1fr 1fr}.map-summary-item:last-child{grid-column:1/-1}}

/* v10: mocniejsze nagłówki i liczniki mapy */
#map .topbar-title{font-weight:900!important;}
#map .map-summary-val{font-weight:1000!important;}
#map .map-summary-label{font-weight:900!important;}
#map .progress-copy{font-weight:1000!important;}
#map .progress-stars,#map .world-progress-mini,#map .world-stat{font-weight:900!important;}


/* v19: lepsza mechanika planszy */
.cell.conflict,
.cell.try-cell,
.cell.hint-cell{
  position:relative;
}
.cell.conflict{
  animation: conflictPulse .8s ease both;
  outline:4px solid var(--coral);
  outline-offset:-4px;
}
.cell.try-cell{
  outline:4px solid var(--orange);
  outline-offset:-4px;
}
.cell.hint-cell{
  animation: hintPulse 1s ease both;
  outline:4px solid var(--orange);
  outline-offset:-4px;
}
@keyframes conflictPulse{
  0%{transform:scale(1)}
  35%{transform:scale(1.06) rotate(-1deg)}
  70%{transform:scale(1.03) rotate(1deg)}
  100%{transform:scale(1)}
}
@keyframes hintPulse{
  0%{transform:scale(1)}
  50%{transform:scale(1.06)}
  100%{transform:scale(1)}
}
.pick{
  flex-direction:column;
  min-width:74px;
  gap:3px;
}
.pick .pick-icon{
  font-size:30px;
  line-height:1;
}
.pick .pick-count{
  font:900 12px 'Nunito',sans-serif;
  color:var(--navy);
  opacity:.72;
}
.pick.used-up{
  opacity:.56;
  filter:grayscale(.25);
}
.pick.eraser{
  background:var(--cream);
}
.pick.eraser.active{
  background:var(--yellow);
}
.feedback-line{
  margin-top:8px;
  min-height:24px;
  text-align:center;
  font:900 15px 'Nunito',sans-serif;
  color:var(--navy);
}
.feedback-line.good{color:var(--green-deep)}
.feedback-line.bad{color:var(--coral-deep)}


/* v20: muzyka i efekty */
.music-toggle{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:5000;
  min-width:58px;
  height:58px;
  border-radius:999px;
  border:4px solid var(--navy);
  background:#fff;
  color:var(--navy);
  font:900 22px 'Nunito',sans-serif;
  box-shadow:0 6px 0 var(--navy);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .12s, box-shadow .12s;
}
.music-toggle:hover{transform:translateY(-2px);box-shadow:0 8px 0 var(--navy)}
.music-toggle:active{transform:translateY(3px);box-shadow:0 3px 0 var(--navy)}
.music-toggle.muted{opacity:.72;filter:grayscale(.35)}
@media(max-width:700px){
  .music-toggle{right:12px;bottom:12px;min-width:50px;height:50px;font-size:18px;border-width:3px;box-shadow:0 4px 0 var(--navy)}
}


/* v23: lepszy flow poziomu + naprawa planszy */
.level-card{max-width:900px;margin:22px auto;padding:24px}.level-intro-top{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}.level-intro-title{font-family:'Fredoka','Nunito',sans-serif;font-weight:900;font-size:clamp(30px,5vw,58px);color:var(--navy);line-height:.95;margin:0}.level-intro-world{display:inline-flex;align-items:center;gap:8px;padding:8px 13px;border:3px solid var(--navy);border-radius:999px;background:#fff;box-shadow:0 4px 0 var(--navy);font:900 14px 'Nunito',sans-serif;color:var(--navy)}.level-intro-hero{font-size:72px;width:110px;height:110px;display:grid;place-items:center;border:4px solid var(--navy);border-radius:28px;background:var(--cream);box-shadow:0 8px 0 var(--navy)}.level-intro-icons{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin:24px 0 16px}.level-intro-icon{min-width:72px;height:72px;border:4px solid var(--navy);border-radius:22px;background:#fff;box-shadow:0 5px 0 var(--navy);display:grid;place-items:center;font-size:36px}.level-intro-rules{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}.level-rule{border:3px solid var(--navy);border-radius:20px;background:#fff;padding:14px;box-shadow:0 4px 0 var(--navy);font:900 15px 'Nunito',sans-serif;color:var(--navy);text-align:center}.level-rule span{display:block;font-size:30px;margin-bottom:5px}.level-intro-note{font:800 16px/1.45 'Nunito',sans-serif;color:var(--navy);text-align:center;background:rgba(255,255,255,.72);border:3px dashed rgba(19,42,75,.35);border-radius:20px;padding:13px;margin-top:12px}.rules-pop{display:none;margin:10px auto 0;max-width:720px;padding:12px 14px;border:3px dashed rgba(19,42,75,.35);border-radius:18px;background:rgba(255,255,255,.8);color:var(--navy);font:800 14px/1.4 'Nunito',sans-serif;text-align:center}.rules-pop.open{display:block}.result-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0 4px}.result-stat{border:3px solid var(--navy);border-radius:18px;background:#fff;box-shadow:0 4px 0 var(--navy);padding:9px;font:900 13px 'Nunito',sans-serif;color:var(--navy)}.result-stat strong{display:block;font-size:22px}.game-asset-img{width:1.2em;height:1.2em;object-fit:contain;vertical-align:middle;pointer-events:none}.cell .game-asset-img,.pick .game-asset-img,.level-intro-icon .game-asset-img{width:80%;height:80%}.sudoku-board:empty{min-height:220px}@media(max-width:700px){.level-card{padding:18px;margin:12px auto}.level-intro-top{justify-content:center;text-align:center}.level-intro-hero{width:92px;height:92px;font-size:58px}.level-intro-rules{grid-template-columns:1fr}.level-intro-icon{min-width:60px;height:60px;font-size:31px}.result-stats{grid-template-columns:1fr}}


/* v25: poprawka nachodzącego napisu 'usuń' */
#picker{
  overflow:visible;
}
.pick{
  overflow:hidden;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.pick .pick-count{
  position:static !important;
  display:block;
  width:100%;
  margin-top:2px;
  line-height:1;
  white-space:nowrap;
  font-size:11px;
}
.pick.eraser .pick-count{
  font-size:10px;
  letter-spacing:.02em;
}
.game-actions{
  position:relative;
  z-index:1;
}


@media(max-width:700px){
  .pick{min-width:58px}
  .pick .pick-icon{font-size:27px}
  .pick .pick-count{font-size:10px}
}


/* v26: brak domyślnie wybranego obrazka */
.pick.active{
  transform:translateY(-2px);
}


/* v27: wspólne liczenie błędów i podpowiedzi */
.result-stats{grid-template-columns:repeat(4,1fr)}
@media(max-width:700px){.result-stats{grid-template-columns:1fr 1fr}}


/* v28: tryb pełnoekranowy mapy i sudoku */
.focus-map-bar{display:none}
body.map-focus,
body.game-focus{overflow:hidden}
body.map-focus #map{
  position:fixed;
  inset:0;
  z-index:4500;
  overflow:auto;
  background:var(--bg);
  padding:16px;
}
body.map-focus #map>.topbar,
body.map-focus #map>.progress-card,
body.map-focus #map>.map-summary{
  display:none;
}
body.map-focus .focus-map-bar{
  display:flex;
  position:sticky;
  top:0;
  z-index:30;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:10px;
  margin:0 auto 10px;
  max-width:1050px;
  border:4px solid var(--navy);
  border-radius:28px;
  background:#fff9ec;
  box-shadow:0 6px 0 var(--navy);
}
.focus-world-title{
  min-width:220px;
  text-align:center;
  font:900 22px 'Fredoka','Nunito',sans-serif;
  color:var(--navy);
}
body.map-focus #worlds{
  max-width:1180px;
  margin:0 auto;
}
body.map-focus .world{
  display:none !important;
  min-height:calc(100vh - 122px);
  margin:0 auto;
}
body.map-focus .world.focus-visible{
  display:block !important;
}
body.map-focus .world-board{
  min-height:calc(100vh - 260px);
}
body.map-focus .map-node{
  transform:scale(1.04);
}
body.game-focus #game{
  position:fixed;
  inset:0;
  z-index:4600;
  overflow:auto;
  background:var(--bg);
  padding:12px;
}
body.game-focus .music-toggle{
  z-index:4700;
}
body.game-focus .game-shell{
  max-width:1360px;
  min-height:calc(100vh - 24px);
  grid-template-columns:1fr;
  gap:12px;
}
body.game-focus .game-head{
  position:sticky;
  top:0;
  z-index:20;
}
body.game-focus .side{
  display:none;
}
body.game-focus .board-card{
  min-height:calc(100vh - 150px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}
body.game-focus .sudoku-board{
  width:min(88vh,760px,96vw);
}
body.game-focus .sudoku-board.size-5{width:min(88vh,820px,96vw)}
body.game-focus .sudoku-board.size-6{width:min(88vh,880px,96vw)}
body.game-focus .cell{
  font-size:clamp(36px,8vh,76px);
}
body.game-focus .picker{
  justify-content:center;
}
body.game-focus .game-actions{
  justify-content:center;
}
@media(max-width:760px){
  body.map-focus .focus-map-bar{
    flex-wrap:wrap;
    border-radius:22px;
  }
  .focus-world-title{
    order:-1;
    width:100%;
    min-width:0;
    font-size:20px;
  }
  body.map-focus .world{
    min-height:calc(100vh - 170px);
  }
  body.game-focus .board-card{
    min-height:auto;
  }
}


/* v29: poprawiony pełny ekran mapy */
body.map-focus #map{
  padding:18px 22px;
}
body.map-focus .focus-map-bar{
  max-width:1180px;
  margin:0 auto 16px;
}
body.map-focus #worlds{
  width:min(1180px,96vw);
  max-width:none;
  margin:0 auto;
}
body.map-focus #worlds .world{
  width:100%;
  max-width:none;
  min-height:auto;
  height:calc(100vh - 155px);
  max-height:760px;
  margin:0 auto;
  border-radius:30px;
  overflow:hidden;
}
body.map-focus #worlds .world.focus-visible{
  display:block !important;
}
body.map-focus #worlds .world-head{
  padding:22px 26px 8px;
}
body.map-focus #worlds .world-name{
  font-size:clamp(28px,3.4vw,48px);
}
body.map-focus #worlds .world-desc{
  font-size:clamp(15px,1.35vw,19px);
  max-width:760px;
}
body.map-focus #worlds .world-stats{
  gap:10px;
}
body.map-focus #worlds .world-stat,
body.map-focus #worlds .world-progress-mini{
  font-size:14px;
  padding:7px 13px;
}
body.map-focus #worlds .map-node{
  transform:none !important;
}
body.map-focus #worlds .node-circle{
  width:clamp(70px,8vw,104px);
  height:clamp(70px,8vw,104px);
  font-size:clamp(28px,3.2vw,42px);
}
body.map-focus #worlds .node-label{
  width:clamp(150px,15vw,210px);
  font-size:clamp(13px,1.15vw,17px);
  padding:7px 12px;
  white-space:nowrap;
}
body.map-focus #worlds .node-number{
  width:28px;
  height:28px;
  font-size:15px;
}
body.map-focus #worlds .world-scenery{
  font-size:clamp(34px,4vw,56px);
}
body.map-focus #worlds .route-svg{
  inset:90px 60px 70px;
}
@media(max-width:820px){
  body.map-focus #map{padding:10px}
  body.map-focus #worlds{width:100%}
  body.map-focus #worlds .world{
    height:auto;
    min-height:calc(100vh - 170px);
    overflow:auto;
  }
  body.map-focus #worlds .world-head{
    padding:16px 14px 4px;
  }
  body.map-focus #worlds .node-circle{
    width:72px;
    height:72px;
    font-size:30px;
  }
  body.map-focus #worlds .node-label{
    width:138px;
    font-size:13px;
    white-space:normal;
  }
  body.map-focus #worlds .route-svg{
    inset:82px 20px 60px;
  }
}


/* v30: pełnoekranowa mapa jako czysta planszówka */
body.map-focus #map{
  padding:10px 18px 14px;
}
body.map-focus .focus-map-bar{
  max-width:720px;
  padding:8px 12px;
  margin:0 auto 12px;
  border-width:4px;
  border-radius:26px;
}
body.map-focus .focus-map-bar .btn{
  padding:10px 20px;
  min-width:64px;
}
body.map-focus .focus-world-title{
  font-size:22px;
  min-width:260px;
}
body.map-focus #worlds{
  width:min(1380px,96vw);
}
body.map-focus #worlds .world{
  height:calc(100vh - 128px);
  max-height:780px;
  min-height:560px;
  border-radius:28px;
}
body.map-focus #worlds .world-head{
  position:absolute;
  left:38px;
  top:26px;
  z-index:12;
  padding:0;
  max-width:620px;
}
body.map-focus #worlds .world-name{
  font-size:clamp(34px,4vw,58px);
  line-height:1;
  margin-bottom:8px;
}
body.map-focus #worlds .world-desc{
  font-size:clamp(16px,1.4vw,21px);
  line-height:1.25;
  max-width:640px;
}
body.map-focus #worlds .world-stats{
  display:none;
}
body.map-focus #worlds .world-progress-mini{
  position:absolute;
  right:38px;
  top:88px;
  z-index:13;
  font-size:15px;
  padding:8px 16px;
}
body.map-focus #worlds .world-scenery{
  font-size:clamp(30px,3vw,46px);
  opacity:.82;
}
body.map-focus #worlds .world-scenery:nth-child(2),
body.map-focus #worlds .world-scenery:nth-child(3){
  top:170px !important;
}
body.map-focus #worlds .route-svg{
  inset:125px 92px 115px;
}
body.map-focus #worlds .map-node{
  transform:none !important;
}
body.map-focus #worlds .node-circle{
  width:clamp(66px,7.2vw,98px);
  height:clamp(66px,7.2vw,98px);
  font-size:clamp(28px,3vw,40px);
  border-width:5px;
}
body.map-focus #worlds .node-label{
  width:clamp(150px,13vw,195px);
  font-size:clamp(13px,1.05vw,16px);
  padding:7px 10px;
  white-space:normal;
  line-height:1.05;
  z-index:15;
}
body.map-focus #worlds .node-stars{
  font-size:14px;
}
body.map-focus #worlds .node-number{
  width:27px;
  height:27px;
  font-size:14px;
  z-index:16;
}
/* w pełnym ekranie lekko przesuwamy same punkty, żeby etykiety nie nachodziły */
body.map-focus #worlds .map-node[data-pos="0"]{left:10% !important;top:64% !important}
body.map-focus #worlds .map-node[data-pos="1"]{left:28% !important;top:48% !important}
body.map-focus #worlds .map-node[data-pos="2"]{left:43% !important;top:67% !important}
body.map-focus #worlds .map-node[data-pos="3"]{left:58% !important;top:46% !important}
body.map-focus #worlds .map-node[data-pos="4"]{left:75% !important;top:66% !important}
body.map-focus #worlds .map-node[data-pos="5"]{left:90% !important;top:48% !important}
@media(max-width:900px){
  body.map-focus #worlds{width:100%}
  body.map-focus #worlds .world{
    height:calc(100vh - 140px);
    min-height:540px;
  }
  body.map-focus #worlds .world-head{
    left:22px;
    top:20px;
    max-width:78%;
  }
  body.map-focus #worlds .world-name{
    font-size:34px;
  }
  body.map-focus #worlds .world-desc{
    font-size:15px;
  }
  body.map-focus #worlds .world-progress-mini{
    right:18px;
    top:82px;
  }
  body.map-focus #worlds .route-svg{
    inset:125px 38px 105px;
  }
  body.map-focus #worlds .node-circle{
    width:70px;
    height:70px;
    font-size:29px;
  }
  body.map-focus #worlds .node-label{
    width:128px;
    font-size:12px;
  }
}


/* v31: dyplom do pobrania */
.diploma-panel{
  max-width:1120px;
  margin:18px auto;
  padding:24px;
  display:grid;
  grid-template-columns:340px 1fr;
  gap:22px;
  align-items:start;
}
.diploma-form h1{
  font-family:'Fredoka','Nunito',sans-serif;
  font-size:clamp(28px,4vw,44px);
  line-height:1;
  margin:0 0 10px;
  color:var(--navy);
}
.diploma-form p{
  font:800 16px/1.45 'Nunito',sans-serif;
  color:#5c708a;
  margin:0 0 18px;
}
.diploma-label{
  display:block;
  font:900 15px 'Nunito',sans-serif;
  color:var(--navy);
  margin-bottom:16px;
}
.diploma-input{
  display:block;
  width:100%;
  margin-top:7px;
  padding:14px 16px;
  border:4px solid var(--navy);
  border-radius:18px;
  box-shadow:0 5px 0 var(--navy);
  font:900 20px 'Nunito',sans-serif;
  color:var(--navy);
  background:#fff;
  outline:none;
}
.diploma-input:focus{
  background:#fff8d8;
}
.diploma-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.diploma-preview-wrap{
  background:#fff;
  border:4px solid var(--navy);
  border-radius:24px;
  box-shadow:0 8px 0 var(--navy);
  padding:12px;
  overflow:auto;
}
.diploma-canvas{
  width:100%;
  max-width:720px;
  height:auto;
  display:block;
  margin:auto;
  border-radius:14px;
  background:#fff9ec;
}
@media(max-width:900px){
  .diploma-panel{grid-template-columns:1fr}
}


/* v32: blokada dyplomu i poprawka dolnej linii */
#diplomaMapBtn.locked{
  opacity:.62;
  filter:grayscale(.25);
}
.diploma-status{
  margin:10px 0 16px;
  padding:12px 14px;
  border:3px dashed rgba(19,42,75,.35);
  border-radius:18px;
  background:#fff8d8;
  font:900 15px 'Nunito',sans-serif;
  color:var(--navy);
}


/* ============================================================
   v33: dopracowanie wizualne + responsywność (tylko CSS)
   ============================================================ */

/* — Ekrany: bezpieczne przewijanie zamiast przycinania treści — */
.screen{overflow-x:hidden;overflow-y:auto}
#home,#levelIntro{justify-content:flex-start;align-items:center;padding-top:max(22px,3vh);padding-bottom:104px}
#home{gap:clamp(12px,2.2vh,18px)}
@media(min-height:740px){
  #home{justify-content:center;padding-top:22px}
  #levelIntro{justify-content:flex-start}
}
/* zapas u dołu, by pływający przycisk muzyki nie zasłaniał ostatnich elementów */
#map,#collection,#heroSelect,#diploma,#game{padding-bottom:max(40px,calc(env(safe-area-inset-bottom) + 96px))}

/* — Tytuły: zdejmujemy globalny pomarańczowy cień tam, gdzie szkodzi — */
.level-intro-title,.diploma-form h1{text-shadow:none}

/* — Statystyki na home: etykieta nigdy nie odrywa się od liczby — */
.mini-stats{gap:12px;width:100%;max-width:520px}
.mini-stats .stat-pill{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
@media(max-height:680px){
  .home-scene{height:118px;margin:0}
  .home-mascot{font-size:56px}
  .home-tree{font-size:52px}
  .home-sun{font-size:44px}
  h1{font-size:clamp(40px,8vw,72px)}
}

/* — Nagłówek gry: zawijanie, czytelny podtytuł, brak ucinania — */
.game-head{flex-wrap:wrap;row-gap:9px;align-items:center}
.game-head>div:first-child{min-width:0;flex:1 1 200px}
.game-title{line-height:1.05}
.game-sub{line-height:1.25;white-space:normal}
.game-head-right{flex-wrap:wrap;justify-content:flex-end;align-items:center}
.game-star-chip{white-space:nowrap}

/* — Mapa: oddech między opisem, statystykami i mini-licznikiem — */
.world-head{flex-wrap:wrap;row-gap:12px;align-items:flex-start}
.world-head>div:first-child{min-width:0;flex:1 1 320px}
.world-desc{margin-bottom:12px;max-width:580px}
.world-stats{margin-top:0}
.world-progress-mini{align-self:flex-start;flex:0 0 auto}
.map-node .node-label{text-wrap:balance}
@media(max-width:700px){
  .world-progress-mini{align-self:flex-start}
}

/* — Odznaki: czysty, spokojny stan zablokowany (bez zabłoconego cienia) — */
.badge-card.locked{opacity:1;filter:none;background:#f4f2ec;border-color:#b7c1cc;box-shadow:0 5px 0 #b7c1cc}
.badge-card.locked .badge-icon{filter:grayscale(.35);opacity:.6}
.badge-card.locked .badge-name,.badge-card.locked .badge-desc{color:#8a97a6}
.collection-grid{align-items:stretch}
.badge-card{display:flex;flex-direction:column;justify-content:center}

/* — Ekran przed startem: ładne układanie pod sobą na telefonie — */
@media(max-width:600px){
  .level-card{padding:18px}
  .level-intro-top{flex-direction:column;align-items:center;text-align:center;gap:14px}
  .level-intro-hero{width:88px;height:88px;font-size:54px}
  .level-intro-rules{grid-template-columns:1fr}
  .level-intro-icon{min-width:60px;height:60px;font-size:30px}
}

/* — Wynik / modale: zawsze w obrębie ekranu, czytelne przyciski — */
.modal{max-height:calc(100dvh - 36px);overflow-y:auto}
.modal-actions .btn{flex:1 1 auto;min-width:128px}

/* — Wybór bohatera: równe karty, wyraźne zaznaczenie — */
.hero-grid{align-items:stretch}
.hero-choice{height:100%}
@media(max-width:400px){
  .hero-grid{grid-template-columns:1fr;gap:12px}
  .hero-choice{min-height:0;flex-direction:row;justify-content:flex-start;gap:14px;padding:14px 16px}
  .hero-choice-icon{font-size:46px}
  .hero-choice-name{font-size:18px}
  .hero-choice-desc{font-size:12px}
  .hero-choice-check{top:50%;right:14px;transform:translateY(-50%)}
}

/* — Pełny ekran gry: pewne dopasowanie planszy na każdej wysokości — */
body.game-focus .board-card{padding:14px}
body.game-focus .sudoku-board{width:min(78vh,640px,94vw)}
body.game-focus .sudoku-board.size-5{width:min(78vh,700px,94vw)}
body.game-focus .sudoku-board.size-6{width:min(78vh,760px,94vw)}


/* ============================================================
   v34: zamknięta kraina, dostępność, ostatnie szlify
   ============================================================ */

/* — Zamknięta kraina: nigdy nachodzących elementów (normalny widok) — */
.world.locked-world .world-progress-mini{display:none}
.world.locked-world .world-head{margin-bottom:6px}
.world.locked-world .world-lock-panel{
  margin:6px auto 0;
  width:min(440px,94%);
  background:rgba(255,255,255,.72);
  border:4px dashed rgba(19,42,75,.32);
  border-radius:26px;
  min-height:170px;
}

/* — Zamknięta kraina w pełnym ekranie: nagłówek u góry, panel na środku — */
body.map-focus #worlds .world.locked-world .world-scenery{opacity:.22}
body.map-focus #worlds .world.locked-world .world-head{
  position:absolute;left:0;right:0;top:32px;max-width:none;
  text-align:center;padding:0 26px;
}
body.map-focus #worlds .world.locked-world .world-name{margin:0 auto 8px}
body.map-focus #worlds .world.locked-world .world-desc{margin:0 auto;max-width:600px}
body.map-focus #worlds .world.locked-world .world-lock-panel{
  position:absolute;left:50%;top:60%;transform:translate(-50%,-50%);
  margin:0;width:min(440px,84%);min-height:0;padding:30px 26px;
}

/* — Etykiety punktów mapy: zawsze czytelne nad ścieżką — */
.map-node .node-label{box-shadow:0 3px 0 rgba(26,58,92,.18),0 0 0 3px #fff}
body.map-focus #worlds .map-node .node-label{box-shadow:0 3px 0 rgba(26,58,92,.2),0 0 0 4px #fff}

/* — Zapas u dołu planszy, by etykiety punktów nie dotykały krawędzi — */
.world-board{min-height:470px}
.adventure-track{height:300px}
@media(max-width:700px){
  .world-board{min-height:600px}
  .adventure-track{height:480px}
}

/* — Dostępność: wyraźny pierścień przy nawigacji klawiaturą — */
.btn:focus-visible,.icon-btn:focus-visible,.pick:focus-visible,
.hero-choice:focus-visible,.map-node:focus-visible,.level:focus-visible,
.cell:focus-visible,.music-toggle:focus-visible,.diploma-input:focus-visible{
  outline:4px solid var(--blue);
  outline-offset:3px;
}
.cell:focus-visible{outline-offset:-4px}

/* — Spójne, miękkie kursory/zaznaczenie — */
.btn,.pick,.hero-choice,.map-node,.level,.cell{touch-action:manipulation}

/* — Bardzo wąskie telefony (≤360px): nic nie wystaje — */
@media(max-width:360px){
  h1{font-size:clamp(36px,11vw,52px);letter-spacing:-2px}
  .subtitle{font-size:15px}
  .home-actions .btn{font-size:18px;padding:15px 20px}
  .home-actions .btn-primary{font-size:21px;padding:16px 24px}
  .pick{min-width:54px}
  .pick .pick-icon{font-size:25px}
  .game-actions .btn{font-size:13px;padding:10px 13px}
  .topbar-title{font-size:24px}
}

/* — Telefon poziomo (niski + szeroki): kompaktowe nagłówki — */
@media(max-height:480px) and (orientation:landscape){
  .topbar{margin-bottom:10px}
  .progress-card{padding:12px 16px;margin-bottom:12px}
  .home-scene{height:96px}
  .home-mascot{font-size:46px}
}


/* ============================================================
   v35: nagłówki ekranów na telefonie/tablecie nie wystają
   ============================================================ */

/* Mapa ma najwięcej przycisków — zawijamy wcześniej (≤900) */
@media(max-width:900px){
  #map .topbar{flex-wrap:wrap;justify-content:center;row-gap:10px}
  #map .topbar .topbar-side{flex-wrap:wrap;justify-content:center}
  #map .topbar-title{order:-1;width:100%;text-align:center}
}
/* Pozostałe ekrany: zawijanie na telefonie (≤600) */
@media(max-width:600px){
  .topbar{flex-wrap:wrap;justify-content:center;row-gap:8px}
  .topbar .topbar-side{flex-wrap:wrap;justify-content:center}
  .topbar-title{order:-1;width:100%;text-align:center}
  .topbar .menu-btn{font-size:13px;padding:9px 13px}
}

/* Nagłówek gry: przyciski w zawijanym rzędzie (nie wysoka kolumna) */
@media(max-width:520px){
  .game-head-right{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:7px}
  .game-head-right .btn{font-size:13px;padding:9px 12px}
}

/* Kolekcja jak album: 2 kolumny na telefonie, 1 na bardzo małych */
@media(max-width:520px){
  .collection-grid{grid-template-columns:repeat(2,1fr);gap:11px}
  .badge-card{padding:13px}
  .badge-icon{font-size:44px}
  .badge-name{font-size:15px;margin:5px 0 3px}
  .badge-desc{font-size:11px}
}
@media(max-width:380px){
  .collection-grid{grid-template-columns:1fr}
  .badge-icon{font-size:50px}
  .badge-name{font-size:17px}
}


/* ============================================================
   v36: ekrany „Przed startem" i „Dyplom" układane pionowo
   (pasek górny u góry, treść wyśrodkowana poniżej — wcześniej
    domyślny flex-row sprawiał, że tytuł wisiał z boku)
   ============================================================ */
#levelIntro,#diploma{flex-direction:column;align-items:center}
#levelIntro .topbar,#diploma .topbar{width:min(1100px,100%)}
#diploma .diploma-panel{width:100%}


/* ============================================================
   v37: gwiazdki pod punktem nie są zasłaniane przez etykietę
   (rozsunięcie w pionie: gwiazdki tuż pod punktem, etykieta niżej)
   ============================================================ */
.map-node .node-stars{
  bottom:-23px;
  z-index:7;
  font-size:16px;
  text-shadow:0 1px 0 #fff,0 0 4px #fff;
}
.map-node .node-label{top:108px}
@media(max-width:700px){
  .map-node .node-label{top:96px}
}
body.map-focus #worlds .map-node .node-stars{bottom:-24px;font-size:17px}
body.map-focus #worlds .map-node .node-label{top:112px}


/* ============================================================
   v38: MAPA NA TELEFONIE — prawdziwy pionowy szlak
   (poziomy zygzak wciśnięty w pion wyglądał karykaturalnie;
    tu punkty schodzą w dół, naprzemiennie L/P, mniejsze ikonki;
    tryb pełnoekranowy zostaje bez zmian → body:not(.map-focus))
   ============================================================ */
@media(max-width:700px){
  body:not(.map-focus) .world-board{min-height:auto;padding:18px 14px 24px;overflow:visible}
  body:not(.map-focus) .world-board::after{display:none}
  body:not(.map-focus) .world-finish{display:none}
  body:not(.map-focus) .world-scenery .scenery-item{font-size:32px;opacity:.4}
  body:not(.map-focus) .world-scenery .scenery-item.s3,
  body:not(.map-focus) .world-scenery .scenery-item.s4{display:none}

  /* tor: pionowa kolumna */
  body:not(.map-focus) .adventure-track{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:70px;
    height:auto !important;
    padding:34px 0 30px;
    margin-top:12px;
    z-index:2;
  }
  /* pionowa ścieżka pośrodku (kremowy pas + pomarańczowe kreski) */
  body:not(.map-focus) .adventure-track::before{
    content:"";
    position:absolute;left:50%;top:26px;bottom:26px;width:16px;
    transform:translateX(-50%);
    background:#fff1c8;border-radius:999px;
    box-shadow:0 0 0 4px var(--navy);
    z-index:0;
  }
  body:not(.map-focus) .adventure-track::after{
    content:"";
    position:absolute;left:50%;top:34px;bottom:34px;width:0;
    transform:translateX(-50%);
    border-left:5px dashed var(--orange);
    z-index:0;
  }

  /* punkty: w przepływie, mniejsze, naprzemienne przesunięcie marginesem
     (margines, nie transform — aktywny punkt animuje transform:scale) */
  body:not(.map-focus) .adventure-track .map-node{
    position:relative !important;
    left:auto !important;top:auto !important;
    width:62px;height:62px;
    border-width:4px;
    z-index:3;
  }
  body:not(.map-focus) .adventure-track .map-node:nth-child(odd){margin:0 56px 0 0}
  body:not(.map-focus) .adventure-track .map-node:nth-child(even){margin:0 0 0 56px}
  body:not(.map-focus) .adventure-track .map-node .node-icon{font-size:29px}
  body:not(.map-focus) .adventure-track .map-node .node-number{width:24px;height:24px;font-size:12px;left:-6px;top:-7px}
  body:not(.map-focus) .adventure-track .map-node .player-token{right:-14px;top:-24px;font-size:32px}

  /* gwiazdki tuż pod punktem, etykieta wyśrodkowana niżej */
  body:not(.map-focus) .adventure-track .map-node .node-stars{bottom:-20px;font-size:15px}
  body:not(.map-focus) .adventure-track .map-node .node-label{
    top:auto;bottom:-50px;
    left:50%;transform:translateX(-50%);
    width:max-content;max-width:150px;white-space:nowrap;
    font-size:13px;padding:5px 11px;
  }
}


/* ============================================================
   v39: pełnoekranowa mapa na telefonie — też pionowa i falująca
   (wcześniej focus używał poziomego rozkładu wciśniętego w wąski
    ekran → punkty zbite na górze; tu ten sam pionowy szlak)
   ============================================================ */
@media(max-width:700px){
  body.map-focus #map{padding:10px 10px 34px}
  body.map-focus #worlds{width:100% !important}
  body.map-focus #worlds .world.focus-visible{
    height:auto !important;min-height:auto !important;max-height:none !important;
    overflow:visible !important;padding:16px 14px 26px !important;
  }
  body.map-focus #worlds .world-head{
    position:static !important;left:auto !important;top:auto !important;
    max-width:none !important;text-align:left;padding:0 !important;margin-bottom:6px;
  }
  body.map-focus #worlds .world-progress-mini{
    position:static !important;display:inline-flex !important;margin-top:6px;
  }
  body.map-focus #worlds .world-scenery,
  body.map-focus #worlds .world-finish{display:none !important;}

  body.map-focus #worlds .adventure-track{
    display:flex !important;flex-direction:column;align-items:center;
    gap:70px;height:auto !important;padding:34px 0 30px;margin-top:8px;
    position:relative;z-index:2;
  }
  body.map-focus #worlds .adventure-track::before{
    content:"";position:absolute;left:50%;top:26px;bottom:26px;width:16px;
    transform:translateX(-50%);background:#fff1c8;border-radius:999px;
    box-shadow:0 0 0 4px var(--navy);z-index:0;
  }
  body.map-focus #worlds .adventure-track::after{
    content:"";position:absolute;left:50%;top:34px;bottom:34px;width:0;
    transform:translateX(-50%);border-left:5px dashed var(--orange);z-index:0;
  }
  body.map-focus #worlds .adventure-track .map-node{
    position:relative !important;left:auto !important;top:auto !important;
    width:62px;height:62px;border-width:4px;z-index:3;
  }
  body.map-focus #worlds .adventure-track .map-node:nth-child(odd){margin:0 56px 0 0}
  body.map-focus #worlds .adventure-track .map-node:nth-child(even){margin:0 0 0 56px}
  body.map-focus #worlds .adventure-track .map-node .node-icon{font-size:29px}
  body.map-focus #worlds .adventure-track .map-node .node-number{width:24px;height:24px;font-size:12px;left:-6px;top:-7px}
  body.map-focus #worlds .adventure-track .map-node .player-token{right:-14px;top:-24px;font-size:32px}
  body.map-focus #worlds .adventure-track .map-node .node-stars{bottom:-20px;font-size:15px}
  body.map-focus #worlds .adventure-track .map-node .node-label{
    top:auto;bottom:-50px;left:50%;transform:translateX(-50%);
    width:max-content;max-width:150px;white-space:nowrap;font-size:13px;padding:5px 11px;
  }
}


/* v33 MB: brak domyślnego wyboru, bez liczników w pickerze, tablet poziomo bez scrolla */
.pick .pick-count{display:none!important}
.pick.used-up{opacity:1!important;filter:none!important}
.pick{
  display:grid!important;
  place-items:center!important;
}
.pick .pick-icon{
  display:block;
  font-size:34px;
  line-height:1;
}

/* Tablet / poziomy ekran: pełnoekranowe sudoku ma mieścić się bez przewijania */
@media (orientation: landscape) and (min-width:700px) and (max-height:900px){
  body.game-focus #game{
    padding:8px!important;
    overflow:hidden!important;
  }
  body.game-focus .game-shell{
    height:calc(100dvh - 16px)!important;
    min-height:0!important;
    max-width:1280px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    gap:8px!important;
    align-items:stretch!important;
  }
  body.game-focus .game-head{
    position:relative!important;
    top:auto!important;
    padding:6px 10px!important;
    border-radius:18px!important;
    box-shadow:0 4px 0 var(--orange)!important;
  }
  body.game-focus .game-title{
    font-size:clamp(19px,2.5vw,26px)!important;
    line-height:1!important;
  }
  body.game-focus .game-sub{
    font-size:clamp(11px,1.3vw,14px)!important;
    line-height:1.15!important;
  }
  body.game-focus .game-head-right{
    gap:6px!important;
  }
  body.game-focus .game-head-right .btn,
  body.game-focus .game-star-chip{
    padding:7px 11px!important;
    font-size:12px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
  }
  body.game-focus .board-card{
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:8px!important;
    gap:6px!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto auto auto!important;
    align-items:center!important;
    justify-items:center!important;
    justify-content:stretch!important;
  }
  body.game-focus .board-decoration{
    display:none!important;
  }
  body.game-focus .instruction{
    font-size:13px!important;
    line-height:1.15!important;
    margin:0!important;
  }
  body.game-focus .rules-pop{
    display:none!important;
  }
  body.game-focus .feedback-line{
    min-height:16px!important;
    font-size:12px!important;
    line-height:1.1!important;
    margin:0!important;
  }
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    width:min(calc(100dvh - 220px), 62vw, 600px)!important;
    max-width:100%!important;
    align-self:center!important;
  }
  body.game-focus .cell{
    font-size:clamp(26px,6vh,54px)!important;
  }
  body.game-focus .picker{
    flex-wrap:nowrap!important;
    gap:7px!important;
    justify-content:center!important;
    max-width:100%!important;
    overflow:visible!important;
  }
  body.game-focus .pick{
    width:clamp(46px,6.4vh,62px)!important;
    height:clamp(46px,6.4vh,62px)!important;
    min-width:clamp(46px,6.4vh,62px)!important;
    border-width:3px!important;
    border-radius:16px!important;
    box-shadow:0 4px 0 var(--navy)!important;
  }
  body.game-focus .pick .pick-icon{
    font-size:clamp(23px,4.5vh,34px)!important;
  }
  body.game-focus .game-actions{
    gap:6px!important;
    margin:0!important;
  }
  body.game-focus .game-actions .btn{
    padding:7px 12px!important;
    font-size:12px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
  }
  body.game-focus .side{
    display:none!important;
  }
}

/* Bardzo niskie poziome ekrany: jeszcze ciaśniej */
@media (orientation: landscape) and (min-width:700px) and (max-height:620px){
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    width:min(calc(100dvh - 190px), 58vw, 520px)!important;
  }
  body.game-focus .game-head{
    padding:4px 8px!important;
  }
  body.game-focus .board-card{
    padding:6px!important;
    gap:4px!important;
  }
  body.game-focus .game-actions .btn{
    padding:6px 10px!important;
  }
}



/* package: iPad / Safari fallbacki */
.screen{min-height:100vh}
@supports (height: 100dvh){.screen{min-height:100dvh}}
html,body{
  font-family:'Nunito',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}
h1,.logo-badge,.hero-select-title,.level-intro-title,.focus-world-title{
  font-family:'Fredoka','Nunito',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}


/* v49: compact fullscreen map menu */
body.map-focus .focus-map-bar{
  max-width:min(1180px,calc(100vw - 16px))!important;
  display:flex!important;
  flex-wrap:nowrap!important;
}
.focus-map-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:0;
}
body.map-focus .focus-map-bar .focus-action{
  padding:8px 11px!important;
  min-width:0!important;
  gap:5px;
}
body.map-focus .focus-map-bar .focus-action.locked{
  opacity:.62;
  filter:grayscale(.25);
}

@media(max-width:820px), (max-height:520px){
  .focus-action-text{
    display:none!important;
  }
  body.map-focus .focus-map-bar{
    gap:5px!important;
  }
  body.map-focus .focus-world-title{
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  body.map-focus .focus-map-bar .btn{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:36px!important;
    padding:0!important;
    justify-content:center!important;
  }
  body.map-focus .focus-map-bar>.btn-yellow{
    font-size:0!important;
  }
  body.map-focus .focus-map-bar>.btn-yellow::before{
    content:"×";
    font-size:20px;
    line-height:1;
  }
}

@media(max-width:430px){
  body.map-focus .focus-map-bar{
    gap:4px!important;
  }
  body.map-focus .focus-world-title{
    font-size:clamp(13px,4vw,16px)!important;
  }
  body.map-focus .focus-map-bar .btn{
    width:34px!important;
    min-width:34px!important;
    max-width:34px!important;
    height:34px!important;
    border-width:3px!important;
  }
  .focus-map-actions{
    gap:4px;
  }
}


/* v40: app-like fullscreen + readable game header + wavy portrait map */
.game-head .menu-btn,
.game-head .btn{
  color:var(--navy);
}
.game-head .btn-navy{
  color:#fff;
}
.game-head-right .btn,
.game-star-chip{
  white-space:nowrap;
}

body.game-focus,
body.map-focus{
  width:100%;
  height:100%;
  overflow:hidden!important;
  overscroll-behavior:none;
}

body.game-focus #game{
  position:fixed;
  inset:0;
  z-index:4600;
  width:100vw;
  height:100vh;
  min-height:100vh;
  padding:clamp(6px,1.2vmin,12px)!important;
  overflow:hidden!important;
  align-items:center;
  justify-content:center;
}
@supports (height:100dvh){
  body.game-focus #game{
    height:100dvh;
    min-height:100dvh;
  }
}
body.game-focus .game-shell{
  width:min(100%,1280px)!important;
  height:calc(100vh - clamp(12px,2.4vmin,24px))!important;
  min-height:0!important;
  max-width:1280px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:clamp(6px,1.3vmin,12px)!important;
  align-items:stretch!important;
}
@supports (height:100dvh){
  body.game-focus .game-shell{
    height:calc(100dvh - clamp(12px,2.4vmin,24px))!important;
  }
}
body.game-focus .game-head{
  position:relative!important;
  top:auto!important;
  min-height:0!important;
  flex-wrap:nowrap!important;
  padding:clamp(6px,1.2vmin,10px) clamp(8px,1.8vmin,14px)!important;
  border-radius:18px!important;
  box-shadow:0 4px 0 var(--orange)!important;
  overflow:hidden;
}
body.game-focus .game-head>div:first-child{
  min-width:0;
  flex:1 1 auto;
}
body.game-focus .game-title{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:clamp(18px,2.4vmin + 9px,30px)!important;
  line-height:1!important;
}
body.game-focus .game-sub{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:clamp(11px,1.2vmin + 7px,15px)!important;
  line-height:1.1!important;
}
body.game-focus .game-head-right{
  flex:0 0 auto;
  flex-wrap:nowrap!important;
  gap:clamp(4px,1vmin,8px)!important;
}
body.game-focus .game-head-right .btn,
body.game-focus .game-star-chip{
  height:clamp(34px,5.2vmin,46px);
  max-width:clamp(44px,14vw,116px);
  min-width:clamp(40px,7vmin,74px);
  padding:0 clamp(8px,1.5vmin,14px)!important;
  border-width:3px!important;
  border-radius:999px!important;
  box-shadow:0 3px 0 var(--navy)!important;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  text-overflow:clip;
  white-space:nowrap;
  font-size:clamp(12px,1.15vmin + 8px,15px)!important;
}
body.game-focus .game-star-chip{
  color:var(--navy);
  border-color:var(--orange)!important;
}
body.game-focus .side{
  display:none!important;
}
body.game-focus .board-card{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:clamp(7px,1.4vmin,14px)!important;
  gap:clamp(5px,1.1vmin,12px)!important;
  display:grid!important;
  grid-template-rows:auto auto minmax(0,1fr) auto auto!important;
  align-items:center!important;
  justify-items:center!important;
}
body.game-focus .board-decoration{
  display:none!important;
}
body.game-focus .instruction{
  margin:0!important;
  font-size:clamp(12px,1.35vmin + 7px,16px)!important;
  line-height:1.15!important;
}
body.game-focus .feedback-line{
  min-height:clamp(14px,2.1vmin,22px)!important;
  margin:0!important;
  font-size:clamp(11px,1.1vmin + 7px,14px)!important;
  line-height:1.1!important;
}
body.game-focus .sudoku-board,
body.game-focus .sudoku-board.size-5,
body.game-focus .sudoku-board.size-6{
  width:min(94vw,calc(100vh - 230px),720px)!important;
  max-width:100%!important;
  align-self:center!important;
}
@supports (height:100dvh){
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    width:min(94vw,calc(100dvh - 230px),720px)!important;
  }
}
body.game-focus .cell{
  font-size:clamp(24px,7vmin,58px)!important;
}
body.game-focus .picker{
  width:100%;
  max-width:100%;
  flex-wrap:nowrap!important;
  gap:clamp(3px,.9vmin,8px)!important;
  justify-content:center!important;
  overflow:visible!important;
}
body.game-focus .pick{
  width:clamp(42px,12vw,66px)!important;
  height:clamp(42px,12vw,66px)!important;
  min-width:clamp(42px,12vw,66px)!important;
  border-width:3px!important;
  border-radius:16px!important;
  box-shadow:0 3px 0 var(--navy)!important;
}
body.game-focus .pick .pick-icon{
  font-size:clamp(23px,7vw,38px)!important;
}
body.game-focus .game-actions{
  width:100%;
  gap:clamp(4px,1vmin,8px)!important;
  flex-wrap:nowrap!important;
  margin:0!important;
}
body.game-focus .game-actions .btn{
  height:clamp(34px,5.2vmin,44px);
  max-width:clamp(70px,28vw,140px);
  padding:0 clamp(8px,1.6vmin,14px)!important;
  border-width:3px!important;
  box-shadow:0 3px 0 var(--navy)!important;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:clip;
  font-size:clamp(11px,1.1vmin + 7px,14px)!important;
}

@media (orientation:landscape){
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    width:min(calc(100vh - 180px),58vw,680px)!important;
  }
  @supports (height:100dvh){
    body.game-focus .sudoku-board,
    body.game-focus .sudoku-board.size-5,
    body.game-focus .sudoku-board.size-6{
      width:min(calc(100dvh - 180px),58vw,680px)!important;
    }
  }
}

@media (max-width:520px){
  body.game-focus .game-head-right .btn,
  body.game-focus .game-star-chip{
    max-width:44px;
    min-width:44px;
    padding:0!important;
  }
  body.game-focus .game-title{
    font-size:clamp(18px,5vw,24px)!important;
  }
  body.game-focus .game-sub{
    font-size:clamp(11px,3.1vw,13px)!important;
  }
}

@media (orientation:portrait) and (max-width:900px), (max-width:700px){
  #map{
    padding-left:clamp(8px,3vw,18px);
    padding-right:clamp(8px,3vw,18px);
  }
  .worlds{
    gap:14px;
  }
  body:not(.map-focus) .world-board{
    min-height:clamp(560px,78vh,690px);
    padding:16px 12px 20px;
    overflow:hidden;
  }
  @supports (height:100dvh){
    body:not(.map-focus) .world-board{
      min-height:clamp(560px,78dvh,690px);
    }
  }
  body:not(.map-focus) .world-head{
    margin-bottom:6px;
  }
  body:not(.map-focus) .world-name{
    font-size:clamp(24px,6.4vw,34px);
    line-height:1.05;
  }
  body:not(.map-focus) .world-desc{
    max-width:100%;
    margin-bottom:8px;
    font-size:clamp(13px,3.5vw,15px);
    line-height:1.25;
  }
  body:not(.map-focus) .world-stat,
  body:not(.map-focus) .world-progress-mini{
    padding:6px 9px;
    font-size:11px;
    box-shadow:0 3px 0 var(--navy);
  }
  body:not(.map-focus) .path-svg{
    display:none!important;
  }
  body:not(.map-focus) .adventure-track,
  body.map-focus #worlds .adventure-track{
    position:relative!important;
    display:block!important;
    height:clamp(430px,58vh,560px)!important;
    min-height:0!important;
    padding:0!important;
    margin:10px 0 0!important;
    z-index:2;
  }
  @supports (height:100dvh){
    body:not(.map-focus) .adventure-track,
    body.map-focus #worlds .adventure-track{
      height:clamp(430px,58dvh,560px)!important;
    }
  }
  body:not(.map-focus) .adventure-track::before,
  body.map-focus #worlds .adventure-track::before{
    content:"";
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    transform:none;
    background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 760'%3E%3Cpath d='M180 26 C58 92 305 150 180 238 S55 380 180 462 S305 592 180 734' fill='none' stroke='%23fff1c8' stroke-width='31' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M180 26 C58 92 305 150 180 238 S55 380 180 462 S305 592 180 734' fill='none' stroke='%23F4A228' stroke-width='5' stroke-dasharray='12 14' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    box-shadow:none;
    border:0;
    z-index:0;
    pointer-events:none;
  }
  body:not(.map-focus) .adventure-track::after,
  body.map-focus #worlds .adventure-track::after{
    display:none!important;
  }
  body:not(.map-focus) .adventure-track .map-node,
  body.map-focus #worlds .adventure-track .map-node{
    position:absolute!important;
    width:clamp(60px,17vw,76px)!important;
    height:clamp(60px,17vw,76px)!important;
    margin:0!important;
    border-width:4px!important;
    z-index:3;
  }
  body:not(.map-focus) .adventure-track .map-node[data-pos="0"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="0"]{left:11%!important;top:4%!important}
  body:not(.map-focus) .adventure-track .map-node[data-pos="1"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="1"]{left:62%!important;top:18%!important}
  body:not(.map-focus) .adventure-track .map-node[data-pos="2"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="2"]{left:20%!important;top:34%!important}
  body:not(.map-focus) .adventure-track .map-node[data-pos="3"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="3"]{left:67%!important;top:50%!important}
  body:not(.map-focus) .adventure-track .map-node[data-pos="4"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="4"]{left:15%!important;top:66%!important}
  body:not(.map-focus) .adventure-track .map-node[data-pos="5"],
  body.map-focus #worlds .adventure-track .map-node[data-pos="5"]{left:58%!important;top:82%!important}
  body:not(.map-focus) .adventure-track .map-node .node-icon,
  body.map-focus #worlds .adventure-track .map-node .node-icon{
    font-size:clamp(28px,8vw,36px)!important;
  }
  body:not(.map-focus) .adventure-track .map-node .node-number,
  body.map-focus #worlds .adventure-track .map-node .node-number{
    width:24px!important;
    height:24px!important;
    font-size:12px!important;
    left:-7px!important;
    top:-8px!important;
  }
  body:not(.map-focus) .adventure-track .map-node .player-token,
  body.map-focus #worlds .adventure-track .map-node .player-token{
    right:-12px!important;
    top:-24px!important;
    font-size:32px!important;
  }
  body:not(.map-focus) .adventure-track .map-node .node-stars,
  body.map-focus #worlds .adventure-track .map-node .node-stars{
    bottom:-22px!important;
    font-size:14px!important;
  }
  body:not(.map-focus) .adventure-track .map-node .node-label,
  body.map-focus #worlds .adventure-track .map-node .node-label{
    top:50%!important;
    bottom:auto!important;
    width:clamp(104px,33vw,150px)!important;
    max-width:150px!important;
    white-space:normal!important;
    font-size:clamp(11px,3.2vw,13px)!important;
    line-height:1.05!important;
    padding:5px 8px!important;
    transform:translateY(-50%)!important;
  }
  body:not(.map-focus) .adventure-track .map-node[data-pos="0"] .node-label,
  body:not(.map-focus) .adventure-track .map-node[data-pos="2"] .node-label,
  body:not(.map-focus) .adventure-track .map-node[data-pos="4"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="0"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="2"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="4"] .node-label{
    left:calc(100% + 8px)!important;
    right:auto!important;
  }
  body:not(.map-focus) .adventure-track .map-node[data-pos="1"] .node-label,
  body:not(.map-focus) .adventure-track .map-node[data-pos="3"] .node-label,
  body:not(.map-focus) .adventure-track .map-node[data-pos="5"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="1"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="3"] .node-label,
  body.map-focus #worlds .adventure-track .map-node[data-pos="5"] .node-label{
    left:auto!important;
    right:calc(100% + 8px)!important;
  }

  body.map-focus #map{
    height:100vh;
    min-height:100vh;
    padding:8px!important;
    overflow:hidden!important;
  }
  @supports (height:100dvh){
    body.map-focus #map{
      height:100dvh;
      min-height:100dvh;
    }
  }
  body.map-focus .focus-map-bar{
    position:relative!important;
    top:auto!important;
    width:100%;
    max-width:100%;
    height:52px;
    min-height:52px;
    flex-wrap:nowrap!important;
    gap:6px!important;
    padding:6px!important;
    margin:0 0 8px!important;
    border-width:3px!important;
    border-radius:20px!important;
    overflow:hidden;
  }
  body.map-focus .focus-map-bar .btn{
    height:36px;
    min-width:40px!important;
    max-width:84px;
    padding:0 10px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
    overflow:hidden;
    white-space:nowrap;
    font-size:12px!important;
  }
  body.map-focus .focus-world-title{
    order:0;
    flex:1 1 auto;
    width:auto;
    min-width:0!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:clamp(15px,4.4vw,20px)!important;
  }
  body.map-focus #worlds{
    width:100%!important;
    height:calc(100vh - 68px)!important;
    overflow:hidden!important;
  }
  @supports (height:100dvh){
    body.map-focus #worlds{
      height:calc(100dvh - 68px)!important;
    }
  }
  body.map-focus #worlds .world.focus-visible{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    padding:10px!important;
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr)!important;
  }
  body.map-focus #worlds .world-head{
    position:relative!important;
    left:auto!important;
    top:auto!important;
    max-width:none!important;
    padding:0!important;
    margin:0 0 4px!important;
  }
  body.map-focus #worlds .world-name{
    max-width:calc(100% - 88px);
    font-size:clamp(20px,5.6vw,30px)!important;
    line-height:1.02!important;
  }
  body.map-focus #worlds .world-desc,
  body.map-focus #worlds .world-stats{
    display:none!important;
  }
  body.map-focus #worlds .world-progress-mini{
    position:absolute!important;
    right:0!important;
    top:0!important;
    display:inline-flex!important;
    margin:0!important;
    padding:5px 9px!important;
    font-size:11px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
  }
  body.map-focus #worlds .world-scenery,
  body.map-focus #worlds .world-finish,
  body.map-focus #worlds .path-svg{
    display:none!important;
  }
  body.map-focus #worlds .adventure-track{
    height:100%!important;
    max-height:none!important;
    margin:0!important;
  }
}


/* v41: tighter app mode spacing */
body.game-focus .music-toggle,
body.map-focus .music-toggle{
  display:none!important;
}
body.game-focus .board-card{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-items:center!important;
}
body.game-focus .instruction,
body.game-focus .sudoku-board,
body.game-focus .picker,
body.game-focus .game-actions{
  flex:0 0 auto;
}
body.game-focus .sudoku-board,
body.game-focus .picker{
  margin:0!important;
}
body.game-focus .game-actions{
  margin-top:auto!important;
}

@media (orientation:portrait) and (max-width:900px), (max-width:700px){
  #map .topbar{
    margin-bottom:10px;
  }
  #map .topbar .menu-btn{
    padding:8px 10px;
    border-width:3px;
    box-shadow:0 3px 0 var(--navy);
    font-size:12px;
  }
  body:not(.map-focus) #map .progress-card,
  body:not(.map-focus) #map .map-summary{
    display:none;
  }
}

@media (orientation:landscape){
  body.game-focus .board-card{
    gap:clamp(4px,.9vmin,8px)!important;
  }
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    width:min(calc(100vh - 280px),58vw,640px)!important;
  }
  @supports (height:100dvh){
    body.game-focus .sudoku-board,
    body.game-focus .sudoku-board.size-5,
    body.game-focus .sudoku-board.size-6{
      width:min(calc(100dvh - 280px),58vw,640px)!important;
    }
  }
  body.game-focus .pick{
    width:clamp(42px,7vh,58px)!important;
    height:clamp(42px,7vh,58px)!important;
    min-width:clamp(42px,7vh,58px)!important;
  }
  body.game-focus .pick .pick-icon{
    font-size:clamp(23px,4.4vh,34px)!important;
  }
}

@media (orientation:landscape) and (max-height:520px){
  body.game-focus .board-card{
    display:grid!important;
    grid-template-columns:minmax(0,45%) minmax(210px,1fr)!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    grid-template-areas:
      "instruction instruction"
      "board picker"
      "board actions"!important;
    column-gap:clamp(8px,2vw,20px)!important;
    row-gap:6px!important;
    justify-items:center!important;
    align-items:center!important;
  }
  body.game-focus .instruction{
    grid-area:instruction;
  }
  body.game-focus .sudoku-board,
  body.game-focus .sudoku-board.size-5,
  body.game-focus .sudoku-board.size-6{
    grid-area:board;
    width:min(calc(100vh - 126px),42vw,320px)!important;
  }
  @supports (height:100dvh){
    body.game-focus .sudoku-board,
    body.game-focus .sudoku-board.size-5,
    body.game-focus .sudoku-board.size-6{
      width:min(calc(100dvh - 126px),42vw,320px)!important;
    }
  }
  body.game-focus .picker{
    grid-area:picker;
    align-self:end;
    flex-wrap:wrap!important;
    width:min(100%,360px)!important;
  }
  body.game-focus .game-actions{
    grid-area:actions;
    align-self:start;
    margin-top:0!important;
    flex-wrap:wrap!important;
  }

  body.map-focus #map{
    height:100vh!important;
    min-height:100vh!important;
    padding:6px 8px!important;
    overflow:hidden!important;
  }
  @supports (height:100dvh){
    body.map-focus #map{
      height:100dvh!important;
      min-height:100dvh!important;
    }
  }
  body.map-focus .focus-map-bar{
    width:min(560px,100%)!important;
    height:46px!important;
    min-height:46px!important;
    padding:4px 8px!important;
    margin:0 auto 6px!important;
    border-width:3px!important;
    border-radius:20px!important;
    gap:8px!important;
  }
  body.map-focus .focus-map-bar .btn{
    height:34px!important;
    min-width:48px!important;
    padding:0 12px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
    font-size:12px!important;
  }
  body.map-focus .focus-world-title{
    min-width:190px!important;
    font-size:18px!important;
    white-space:nowrap;
  }
  body.map-focus #worlds{
    width:100%!important;
    height:calc(100vh - 58px)!important;
    overflow:hidden!important;
  }
  @supports (height:100dvh){
    body.map-focus #worlds{
      height:calc(100dvh - 58px)!important;
    }
  }
  body.map-focus #worlds .world,
  body.map-focus #worlds .world.focus-visible{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
    border-radius:22px!important;
  }
  body.map-focus #worlds .world-head{
    left:22px!important;
    top:12px!important;
    max-width:360px!important;
  }
  body.map-focus #worlds .world-name{
    font-size:clamp(24px,3.8vw,32px)!important;
    margin-bottom:2px!important;
  }
  body.map-focus #worlds .world-desc{
    display:none!important;
  }
  body.map-focus #worlds .world-progress-mini{
    right:18px!important;
    top:52px!important;
    padding:5px 10px!important;
    font-size:11px!important;
    border-width:3px!important;
    box-shadow:0 3px 0 var(--navy)!important;
  }
  body.map-focus #worlds .adventure-track{
    height:100%!important;
    margin-top:0!important;
  }
  body.map-focus #worlds .path-svg{
    display:block!important;
    inset:58px 8% auto!important;
    width:84%!important;
    height:calc(100% - 88px)!important;
  }
  body.map-focus #worlds .world-finish{
    right:5%!important;
    top:62px!important;
    font-size:42px!important;
  }
  body.map-focus #worlds .scenery-item{
    font-size:34px!important;
  }
  body.map-focus #worlds .scenery-item.s1{left:4%!important;top:62%!important}
  body.map-focus #worlds .scenery-item.s2{right:7%!important;top:28%!important}
  body.map-focus #worlds .scenery-item.s3{right:9%!important;bottom:5%!important}
  body.map-focus #worlds .scenery-item.s4{left:8%!important;bottom:5%!important}
  body.map-focus #worlds .map-node{
    width:clamp(60px,10vh,78px)!important;
    height:clamp(60px,10vh,78px)!important;
    border-width:4px!important;
  }
  body.map-focus #worlds .map-node .node-icon{
    font-size:clamp(27px,5vh,34px)!important;
  }
  body.map-focus #worlds .map-node .node-label{
    width:clamp(118px,16vw,150px)!important;
    font-size:12px!important;
    padding:5px 8px!important;
    top:50%!important;
    bottom:auto!important;
    transform:translateY(-50%)!important;
    z-index:20!important;
  }
  body.map-focus #worlds .map-node .node-stars{
    bottom:-20px!important;
    font-size:13px!important;
  }
  body.map-focus #worlds .map-node.teaser .node-label{
    display:none!important;
  }
  body.map-focus #worlds .map-node[data-pos="0"] .node-label,
  body.map-focus #worlds .map-node[data-pos="2"] .node-label,
  body.map-focus #worlds .map-node[data-pos="4"] .node-label{
    left:calc(100% + 8px)!important;
    right:auto!important;
  }
  body.map-focus #worlds .map-node[data-pos="1"] .node-label,
  body.map-focus #worlds .map-node[data-pos="3"] .node-label,
  body.map-focus #worlds .map-node[data-pos="5"] .node-label{
    left:auto!important;
    right:calc(100% + 8px)!important;
  }
}


/* v50: final fullscreen map bar with compact menu */
body.map-focus .focus-map-bar{
  max-width:min(1180px,calc(100vw - 16px))!important;
  display:flex!important;
  flex-wrap:nowrap!important;
}
.focus-map-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:0;
}
body.map-focus .focus-map-bar .focus-action{
  padding:8px 11px!important;
  min-width:0!important;
  gap:5px;
}
body.map-focus .focus-map-bar .focus-action.locked{
  opacity:.62;
  filter:grayscale(.25);
}
@media(max-width:820px), (max-height:520px){
  .focus-action-text{display:none!important}
  body.map-focus .focus-map-bar{gap:5px!important}
  body.map-focus .focus-world-title{
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  body.map-focus .focus-map-bar .btn{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:36px!important;
    padding:0!important;
    justify-content:center!important;
  }
  body.map-focus .focus-map-bar>.btn-yellow{font-size:0!important}
  body.map-focus .focus-map-bar>.btn-yellow::before{
    content:"×";
    font-size:20px;
    line-height:1;
  }
}
@media(max-width:430px){
  body.map-focus .focus-map-bar{gap:3px!important}
  body.map-focus .focus-world-title{font-size:clamp(13px,3.7vw,15px)!important}
  body.map-focus .focus-map-bar .btn{
    width:30px!important;
    min-width:30px!important;
    max-width:30px!important;
    height:32px!important;
    border-width:3px!important;
  }
  .focus-map-actions{gap:3px}
}


/* v52: game starts in app mode and keeps its header visible */
body.game-focus #game{
  display:flex!important;
  align-items:stretch!important;
  justify-content:center!important;
  padding:8px!important;
}
body.game-focus .game-shell{
  height:calc(100vh - 16px)!important;
  max-height:calc(100vh - 16px)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  align-content:start!important;
  overflow:hidden!important;
}
@supports (height:100dvh){
  body.game-focus .game-shell{
    height:calc(100dvh - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
  }
}
body.game-focus .game-head{
  position:relative!important;
  inset:auto!important;
  align-self:start!important;
  z-index:40!important;
  margin:0!important;
  transform:none!important;
  overflow:hidden!important;
}
body.game-focus .board-card{
  min-height:0!important;
  overflow:hidden!important;
}
@media(max-width:520px){
  body.game-focus #game{
    padding:6px!important;
  }
  body.game-focus .game-shell{
    height:calc(100vh - 12px)!important;
    max-height:calc(100vh - 12px)!important;
  }
  @supports (height:100dvh){
    body.game-focus .game-shell{
      height:calc(100dvh - 12px)!important;
      max-height:calc(100dvh - 12px)!important;
    }
  }
}

/* v53: keep the fullscreen map controls fully inside tablet-width viewports */
body.map-focus .focus-map-bar{
  width:min(1120px,calc(100vw - 36px))!important;
  max-width:calc(100vw - 36px)!important;
  box-sizing:border-box!important;
}

/* v55: make wrong attempts obvious again */
.cell.wrong,
.cell.try-cell.wrong{
  background:#ffe4e9!important;
  color:var(--coral-deep)!important;
  outline:5px solid var(--coral)!important;
  outline-offset:-5px!important;
  animation:shake .34s ease both!important;
}
.cell.conflict{
  background:#ffeef2!important;
  outline:5px solid var(--coral)!important;
  outline-offset:-5px!important;
}

/* v56: result and badge modals must sit above fullscreen game mode */
.overlay{
  z-index:9000!important;
}
.confetti{
  z-index:9100!important;
}
