@font-face{font-family:Nunito;src:url(font/nunito-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Nunito;src:url(font/nunito-latin-ext-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Nunito;src:url(font/nunito-latin-800-normal.woff2) format("woff2");font-weight:800;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Nunito;src:url(font/nunito-latin-ext-800-normal.woff2) format("woff2");font-weight:800;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Rubik;src:url(font/rubik-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Rubik;src:url(font/rubik-latin-ext-700-normal.woff2) format("woff2");font-weight:700;font-display:swap;unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Rubik;src:url(font/rubik-latin-600-normal.woff2) format("woff2");font-weight:600;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F}
@font-face{font-family:Rubik;src:url(font/rubik-latin-ext-600-normal.woff2) format("woff2");font-weight:600;font-display:swap;unicode-range:U+0100-02BA,U+1E00-1E9F}
:root{--red:#c62828;--red2:#9e1c1c;--blue:#1e5bb8;--green:#2e7d32;--yellow:#f2b01e;--pink:#e05683;--ink:#1f2a44;--ink2:#5b4a36;--cream:#fff8e7;--paper:#fffdf6;--line:#e9d8b4;
  --strip:repeating-linear-gradient(90deg,var(--red) 0 12px,var(--yellow) 12px 16px,var(--green) 16px 26px,var(--yellow) 26px 30px,var(--blue) 30px 42px,var(--yellow) 42px 46px)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#fbf1da;color:var(--ink);font-family:Nunito,"Trebuchet MS",Arial,sans-serif;font-weight:700;touch-action:manipulation;user-select:none;-webkit-user-select:none}
button{font-family:inherit;font-weight:700;color:inherit;cursor:pointer;border:0;background:none;padding:0}
.hidden{display:none!important}
#bg{position:fixed;inset:0;background:url(img/wycinanki.webp) center/cover no-repeat}
#bg::after{content:"";position:absolute;inset:0;background:rgba(255,248,231,.55)}
#app{position:fixed;inset:0;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#top{display:flex;align-items:center;gap:5px;padding:5px 8px;background:var(--red);color:#fff;position:relative;z-index:2;margin-bottom:7px;box-shadow:0 2px 0 var(--red2)}
#top::after{content:"";position:absolute;left:0;right:0;bottom:-7px;height:5px;background:var(--strip)}
.ib{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.16);flex:none;font-size:15px;font-weight:800}
.ib svg{width:21px;height:21px}
.ib.on{background:var(--yellow);color:var(--ink)}
.ib.dark{background:var(--red);color:#fff}
#bSound .x{display:none}#bSound.off .x{display:block}#bSound.off .w{display:none}
#bMusic.off{opacity:.45}
#ttl{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.1}
#ttl b{font-weight:800;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ttl span{font-size:12px;opacity:.9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pill{background:#fff;color:var(--ink);border-radius:999px;padding:5px 9px;font-weight:800;font-size:14px;min-width:50px;text-align:center;flex:none}
#pts i{font-style:normal;color:var(--red);margin-right:3px}
#main{flex:1;min-height:0;display:flex;flex-direction:column}
#boardWrap{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:6px}
#pad{background:var(--paper);padding:5px;border-radius:10px;border:3px solid var(--ink);box-shadow:0 0 0 4px var(--yellow),0 0 0 7px var(--red),0 8px 20px rgba(120,40,20,.3);line-height:0}
#board{display:block;touch-action:none}
#side{flex:none;display:flex;flex-direction:column;gap:6px;padding:0 8px 8px;min-height:0}
#clueBar{display:flex;align-items:stretch;background:#fff;border:3px solid var(--ink);border-radius:12px;min-height:52px;overflow:hidden;box-shadow:0 3px 0 var(--ink);flex:none}
.cb{width:38px;font-size:28px;font-weight:800;color:#fff;background:var(--red);flex:none}
#clueTxt{flex:1;display:flex;flex-direction:column;justify-content:center;padding:3px 10px;min-width:0;cursor:pointer}
#clueTag{font-size:11.5px;color:var(--red);font-weight:800;letter-spacing:.2px}
#clueMain{font-size:17px;font-weight:800;line-height:1.15;display:flex;align-items:center;gap:6px}
#cluePic:empty{display:none}
#cluePic{font-size:28px;line-height:1}
#hasloBox{display:flex;align-items:center;gap:6px;flex:none}
.hl{font-size:11px;font-weight:800;color:#fff;background:var(--blue);border-radius:6px;padding:3px 6px;text-transform:uppercase;letter-spacing:.5px}
#haslo{display:flex;gap:3px;flex-wrap:wrap}
#haslo span{position:relative;width:26px;height:28px;border:2px solid var(--blue);border-radius:5px;background:#e3efff;display:grid;place-items:center;font-family:Rubik,Arial,sans-serif;font-size:16px;color:var(--ink)}
#haslo span i{position:absolute;right:2px;bottom:0;font-size:8px;font-style:normal;color:var(--blue);line-height:1}
#haslo span.ok{background:#d9f2d4;border-color:var(--green)}
#tools{display:flex;gap:6px;flex:none}
.tgroup{flex:1.3;display:flex;align-items:center;gap:4px;background:rgba(255,255,255,.95);border:2px solid var(--ink);border-radius:10px;padding:3px 4px}
.tgroup.rv{flex:1}
.tl{font-size:9.5px;font-weight:800;color:var(--ink2);writing-mode:vertical-rl;transform:rotate(180deg);text-transform:uppercase;letter-spacing:.4px}
.tb{flex:1;height:32px;border-radius:8px;background:#fdf0cf;font-size:13.5px;white-space:nowrap;padding:0 3px}
.tb em{font-style:normal;color:var(--red);font-size:11.5px}
.rv .tb{background:#fde0e0}
.tb:active,.key:active,.fb:active,.big:active{transform:translateY(2px)}
#lists{display:none;flex:1;min-height:0;overflow:auto;background:rgba(255,255,255,.95);border:2px solid var(--ink);border-radius:10px;padding:4px 8px;gap:10px}
.lcol{flex:1;min-width:0}
.lcol h3{margin:2px 0 3px;font-size:13px;color:#fff;background:var(--green);display:inline-block;padding:1px 8px;border-radius:6px;text-transform:uppercase;letter-spacing:.5px}
#lists ol{list-style:none;margin:0;padding:0}
#lists li{font-size:13.5px;line-height:1.25;padding:3px 5px;border-radius:6px;cursor:pointer;font-weight:700}
#lists li b{color:var(--red)}
#lists li small{color:var(--ink2);font-size:11px}
#lists li.on{background:#fde3a7}
#lists li.done{color:#7d8a77;text-decoration:line-through;text-decoration-color:rgba(46,125,50,.6)}
#lists li .pic{font-size:17px}
#kb{display:flex;flex-direction:column;gap:4px;flex:none}
.kr{display:flex;gap:4px;justify-content:center}
.key{flex:1;max-width:42px;height:40px;border-radius:7px;background:#fff;border:2px solid var(--ink);box-shadow:0 3px 0 var(--ink);font-family:Rubik,Arial,sans-serif;font-weight:700;font-size:18px;color:var(--ink);transition:background .1s;padding:0}
.key.pl{background:#fff4d6;color:var(--red2)}
.key.wide{max-width:76px;flex:1.6;background:#fde0e0}
.key.on{background:var(--yellow)}
body:not(.touch) .kr.lat{display:none}
body:not(.touch) .key{height:32px;font-size:16px}
/* wide screens: board left, panel right with clue lists */
@media (min-aspect-ratio:5/4) and (min-width:600px){
  #main{flex-direction:row}
  #boardWrap{padding:8px 4px 8px 10px}
  #side{width:min(440px,44vw);padding:6px 10px 8px 4px}
  #lists{display:flex}
  .key{height:34px}
}
@media (min-aspect-ratio:5/4) and (min-width:1200px){
  #side{width:min(520px,40vw);gap:9px}
  #clueMain{font-size:21px}#clueBar{min-height:64px}
  #lists li{font-size:16px}.lcol h3{font-size:15px}
  #haslo span{width:32px;height:34px;font-size:19px}
  .tb{height:38px;font-size:15px}
  #ttl b{font-size:20px}
}
/* touch landscape phones: no room for lists */
@media (min-aspect-ratio:5/4) and (max-height:520px){
  body.touch #lists{display:none}
  body.touch #side{justify-content:center}
  body.touch .key{height:31px;font-size:15px}
}
@media (max-height:460px){
  #top{padding:3px 6px}.ib{width:30px;height:30px}.ib svg{width:18px;height:18px}
  #ttl b{font-size:14px}#ttl span{font-size:10.5px}.pill{font-size:12px;padding:3px 7px;min-width:42px}
  #clueBar{min-height:42px}#clueMain{font-size:14.5px}#clueTag{font-size:10px}.cb{width:30px;font-size:22px}
  #haslo span{width:22px;height:23px;font-size:13.5px}
  .tb{height:27px;font-size:12px}
  #side{gap:4px}
  #lists li{font-size:12px;padding:1px 4px}
  body:not(.touch) .key{height:27px;font-size:14px}
}
@media (max-height:380px){
  #hasloBox .hl{display:none}
  #lists li{font-size:11.5px}
}
/* phone portrait */
@media (max-aspect-ratio:5/4){
  #kb .key{height:42px}
  body:not(.touch) #lists{display:flex;max-height:24vh;flex:none}
}
@media (max-aspect-ratio:5/4) and (max-height:700px){#kb .key{height:36px}}
/* big letters / high contrast (seniors) */
body.senior{--ink:#000;--ink2:#222}
body.senior #bg::after{background:rgba(255,255,255,.9)}
body.senior #clueMain{font-size:22px}
body.senior #clueTag{font-size:14px}
body.senior #lists li{font-size:17px;color:#000}
body.senior #lists li.on{background:#ffe14d}
body.senior .tb{font-size:15px}
body.senior .key{font-size:21px}
body.senior #haslo span{font-size:19px}
@media (max-height:460px){body.senior #clueMain{font-size:17px}body.senior #lists li{font-size:14px}}
#toast{position:fixed;left:50%;top:56px;transform:translate(-50%,-20px);background:var(--ink);color:#fff;padding:8px 16px;border-radius:999px;font-weight:800;font-size:15px;opacity:0;pointer-events:none;transition:.25s;z-index:20;box-shadow:0 3px 0 var(--yellow);max-width:92vw;text-align:center}
#toast.show{opacity:1;transform:translate(-50%,0)}
/* overlays */
.ov{position:fixed;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:10px;background:rgba(120,30,20,.25)}
.sheet{background:var(--cream);border:3px solid var(--ink);border-radius:16px;box-shadow:0 0 0 4px var(--yellow),0 0 0 7px var(--red),0 14px 30px rgba(120,40,20,.35);width:min(580px,100%);max-height:100%;overflow:auto;padding:14px 16px}
.mast{display:flex;align-items:center;justify-content:center;gap:10px;background:var(--red);color:#fff;border-radius:10px;padding:5px 10px;font-weight:800;font-size:25px;letter-spacing:3px;position:relative;margin-bottom:8px}
.mast::after{content:"";position:absolute;left:8px;right:8px;bottom:-6px;height:4px;background:var(--strip);border-radius:2px}
.mast i{width:14px;height:14px;background:var(--yellow);border-radius:50%;box-shadow:0 0 0 3px #fff;flex:none}
.dateline{display:flex;justify-content:space-between;font-size:13px;color:var(--ink2);padding:5px 4px 2px;border-bottom:2px dotted var(--line)}
.startBody{display:flex;align-items:center;gap:12px;margin:6px 0}
.mascot{width:96px;height:130px;object-fit:contain;flex:none;animation:bob 3s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-5px) rotate(2deg)}}
.startText h1{margin:0;font-size:30px;line-height:1;font-weight:800;color:var(--red2)}
.startText h1 small{display:block;font-size:15px;color:var(--blue);margin-top:3px}
.intro{margin:6px 0 0;font-size:14px;line-height:1.35;color:#3a3a3a}
.howto{display:flex;flex-direction:column;gap:4px;background:#fdf0cf;border-radius:12px;padding:7px 10px;font-size:13px;margin-bottom:9px}
.howto div{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.k{display:inline-block;min-width:26px;height:26px;padding:0 6px;line-height:21px;text-align:center;border:2px solid var(--ink);border-bottom-width:4px;border-radius:7px;background:#fff;font-size:13px}
.k.tap{background:radial-gradient(circle,var(--red) 0 5px,#fff 6px)}
.big{display:block;width:100%;background:var(--red);color:#fff;font-weight:800;font-size:20px;border-radius:12px;padding:11px 10px;border:3px solid var(--ink);box-shadow:0 5px 0 var(--ink)}
.big span{display:block;font-size:13px;font-weight:700;opacity:.95}
.forces{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:11px}
.fb{background:#fff;border:2.5px solid var(--ink);border-radius:10px;padding:6px 3px;box-shadow:0 3px 0 var(--ink);display:flex;flex-direction:column;align-items:center}
.fb b{font-size:14.5px;white-space:nowrap}.fb span{font-size:10.5px;color:var(--ink2);text-align:center}
.fb[data-s=dzieci]{background:#e8f5e3}
#bArch{background:#e3efff}
.opts{display:flex;flex-direction:column;gap:3px;margin-top:9px;font-size:13px}
.opts label{display:flex;align-items:center;gap:7px;cursor:pointer}
.opts input{width:18px;height:18px;accent-color:var(--red);margin:0}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:9px;text-align:center;font-size:11.5px;color:var(--ink2)}
.stats b{display:block;font-size:18px;color:var(--ink)}
/* short frames: two columns, smaller */
@media (max-height:560px) and (min-width:560px){
  .startSheet{width:min(780px,100%);display:grid;grid-template-columns:1.1fr 1fr;column-gap:14px;padding:10px 12px}
  .mast,.dateline{grid-column:1/-1}
  .mast{font-size:19px;padding:3px 8px;margin-bottom:4px}
  .startBody{grid-column:1;grid-row:3/6;align-items:flex-start;margin:4px 0}
  .mascot{width:70px;height:100px}
  .startText h1{font-size:23px}.startText h1 small{font-size:13px}
  .intro{font-size:12.5px}
  .howto{grid-column:1;grid-row:6;font-size:11.5px;padding:5px 8px;margin:0}
  .big{grid-column:2;grid-row:3;font-size:17px;padding:8px}
  .big span{font-size:11.5px}
  .forces{grid-column:2;grid-row:4;grid-template-columns:repeat(3,1fr);margin-top:7px;gap:5px}
  .fb{padding:4px 2px}.fb b{font-size:13px}.fb span{font-size:9.5px}
  .opts{grid-column:2;grid-row:5;font-size:11.5px;margin-top:6px}
  .stats{grid-column:2;grid-row:6;margin-top:5px;font-size:10px}.stats b{font-size:15px}
}
@media (max-height:400px) and (min-width:560px){
  .intro{display:none}.howto{display:none}.stats{grid-row:5;align-self:end}.opts{grid-row:4;}.forces{grid-row:auto}
  .startSheet{grid-template-rows:auto auto auto auto auto auto}
}
@media (max-width:559px){
  .forces{grid-template-columns:repeat(3,1fr)}
  .startText h1{font-size:25px}.mascot{width:76px;height:110px}.intro{font-size:13px}
}
.libSheet{display:flex;flex-direction:column;height:min(640px,100%)}
.libHead{display:flex;align-items:center;gap:10px}
.libHead h2{flex:1;margin:0;font-size:21px;color:var(--red2)}
#libStars{font-weight:800;color:var(--red)}
.seg{display:flex;gap:4px;margin:9px 0 5px;background:#fdf0cf;border-radius:12px;padding:4px}
.seg button{flex:1;padding:6px 2px;border-radius:9px;font-size:13.5px}
.seg button.on{background:var(--red);color:#fff}
.libNote{margin:2px 0 7px;font-size:13px;color:var(--ink2)}
#libGrid{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:6px;align-content:start;padding:3px}
.lv{background:#fff;border:2px solid var(--ink);border-radius:10px;height:52px;font-size:17px;font-weight:800;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;box-shadow:0 2px 0 var(--ink)}
.lv small{font-size:10.5px;color:var(--red);font-weight:700;line-height:1}
.lv.solved{background:#e8f5e3}
.lv.next{background:var(--yellow)}
.lv.day{font-size:14px}
.lv.today{background:var(--yellow);box-shadow:0 0 0 3px var(--red),0 0 14px 4px rgba(242,176,30,.8);animation:glow 1.6s ease-in-out infinite}
@keyframes glow{50%{box-shadow:0 0 0 3px var(--red),0 0 22px 8px rgba(242,176,30,.95)}}
.badge{position:absolute;top:-8px;right:-4px;background:var(--red);color:#fff;font-size:10px;border-radius:999px;padding:1px 6px}
@media (max-height:460px){.libHead h2{font-size:17px}.seg{margin:5px 0 3px}.seg button{padding:4px 2px;font-size:12px}.libNote{font-size:11.5px;margin:0 0 4px}.lv{height:42px;font-size:15px}}
.winSheet{text-align:center;width:min(420px,100%)}
.winSheet .mascot{width:120px;height:140px;margin:0 auto;display:block}
.winSheet h2{margin:2px 0;font-size:28px;color:var(--red2)}
#winHaslo{margin:4px 0;font-size:16px}
#winHaslo b{font-family:Rubik,Arial,sans-serif;letter-spacing:3px;color:#fff;background:var(--blue);padding:2px 10px;border-radius:8px}
#winText{margin:4px 0 8px;font-size:14px;color:var(--ink2)}
.stars{display:flex;justify-content:center;gap:8px}
.stars i{width:34px;height:34px;background:#e6d9bb;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);transition:transform .3s}
.stars i.on{background:var(--yellow);transform:scale(1.2)}
.winStats{display:flex;justify-content:center;gap:16px;margin-bottom:10px;font-size:12px;color:var(--ink2)}
.winStats b{display:block;font-size:20px;color:var(--ink)}
.link{margin-top:8px;font-size:15px;text-decoration:underline;color:var(--red2);padding:6px}
@media (max-height:460px){.winSheet{padding:8px 12px}.winSheet .mascot{width:70px;height:80px}.winSheet h2{font-size:21px}.stars i{width:24px;height:24px}#winText{margin:2px 0 4px;font-size:12px}.winStats{margin-bottom:5px}.winStats b{font-size:16px}.big{padding:7px;font-size:16px}.link{margin-top:2px;padding:3px}}
#fx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:30}
@media (min-aspect-ratio:5/4) and (max-width:900px){
  #tools{flex-wrap:wrap;gap:4px}
  .tgroup,.tgroup.rv{flex:1 1 100%}
}
body.senior .pill{font-size:13px;padding:4px 7px}
@media (min-aspect-ratio:5/4) and (min-width:1600px) and (min-height:900px){
  #side{width:min(640px,36vw);gap:12px;padding-right:18px}
  #clueMain{font-size:26px}#clueTag{font-size:15px}#clueBar{min-height:78px}.cb{width:50px;font-size:34px}
  #lists li{font-size:19px;padding:4px 6px}#lists li small{font-size:13px}.lcol h3{font-size:17px}
  #haslo span{width:40px;height:42px;font-size:23px}#haslo span i{font-size:10px}.hl{font-size:14px}
  .tb{height:46px;font-size:18px}.tb em{font-size:14px}.tl{font-size:11px}
  body:not(.touch) .key{height:44px;font-size:21px;max-width:52px}
  #top{padding:8px 14px}.ib{width:44px;height:44px}.pill{font-size:17px;padding:7px 12px}#ttl b{font-size:23px}#ttl span{font-size:14px}
  body.senior #clueMain{font-size:30px}body.senior #lists li{font-size:22px}
}
@media (max-width:420px){.pill{font-size:12.5px;padding:4px 7px;min-width:40px}.ib{width:32px;height:32px}#top{gap:4px}}
