*{box-sizing:border-box}body{margin:0;background:#fffaf1;color:#234b49;font-family:system-ui,sans-serif}header{display:flex;justify-content:space-between;padding:16px 5%;background:white;border-bottom:1px solid #e3e7df}a{color:#246754}header a{text-decoration:none;font-weight:800}main{max-width:940px;margin:auto;padding:16px}h1{font-size:clamp(24px,4vw,36px);margin:8px 0}p{line-height:1.6}.lead{margin:6px 0 16px}.panel{background:white;border:1px solid #dde8df;border-radius:24px;padding:20px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}button,select{font:inherit;border-radius:14px;padding:12px 18px;border:2px solid #cadfd3;background:white;color:#234b49;cursor:pointer}button:hover{border-color:#26715c}button:focus-visible,select:focus-visible{outline:4px solid #e99738;outline-offset:3px}button:disabled{cursor:default}.primary{background:#26715c;color:white;border-color:#26715c}#status{min-height:30px;font-weight:700}#board{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.card{min-height:100px;background:#368674;color:white;border:3px solid #286b5e;box-shadow:0 5px 0 #215748;font-weight:750;font-size:clamp(16px,3vw,23px);overflow-wrap:anywhere;transition:transform .18s}.card.open{background:#fff4d9;color:#234b49;border-color:#e4b86b;transform:translateY(3px);box-shadow:0 2px 0 #d3ad68}.card.matched{background:#e0efda;color:#234b49;border-color:#86b581;box-shadow:none}.card small{display:block;font-size:11px;margin-bottom:6px;letter-spacing:1px}.steps{display:flex;gap:8px;margin:12px 0}.steps button{flex:1}.steps .active{background:#f8dba3;border-color:#d6983c}#finish{padding:20px;background:#fff0cf;border-radius:18px;margin-top:16px}#finish[hidden]{display:none}.river-scene{position:relative;height:490px;max-height:65vh;min-height:350px;border-radius:28px;overflow:hidden;background:repeating-linear-gradient(10deg,#7fcbd4 0 28px,#8bd2d9 29px 32px,#7fcbd4 33px 64px);border:5px solid white;box-shadow:0 5px 25px #234b4920}.bank{position:absolute;left:0;width:100%;height:60px;background:#a8ca78;border-bottom:12px solid #d9c69b;display:flex;justify-content:center;align-items:center;font-weight:800;color:#375631}.bank.start{bottom:0;border-bottom:0;border-top:12px solid #d9c69b}.bank.end{top:0}.river-row{position:absolute;left:8%;width:84%;display:flex;justify-content:space-around;align-items:center;height:60px}.stone{padding:0;width:66px;height:48px;border-radius:45% 53% 40% 48%;border:3px solid #ffffffa0;box-shadow:0 7px 0 #285d6640,inset 0 -7px 0 #00000014;position:relative}.stone:disabled{opacity:.45}.stone.passed{opacity:.8;border-color:#fff}.stone.hint{outline:5px solid #f7d15b;outline-offset:4px}#traveller{position:absolute;width:38px;height:42px;z-index:3;left:50%;top:91%;transform:translate(-50%,-50%);transition:top .55s ease,left .55s ease;pointer-events:none;filter:drop-shadow(0 4px 2px #234b4940)}#traveller:before{content:'';position:absolute;width:28px;height:30px;border-radius:45%;background:#e69235;left:5px;top:10px;border:3px solid #fff0cb}#traveller:after{content:'';position:absolute;width:23px;height:23px;border-radius:50%;background:#754c2e;left:8px;top:0;border:4px solid #b77a43}.river-decoration{position:absolute;font-size:28px;pointer-events:none}.river-controls{text-align:center}.river-controls h2{margin:8px 0}.parent{margin-top:30px;border-top:1px solid #dedfce;padding-top:18px}.backlink{display:inline-block;margin-top:20px}.audio-note{font-size:13px;color:#5c716a} @media(max-width:520px){main{padding:12px}.panel{padding:12px}#board{gap:8px}.card{min-height:86px;padding:7px}.toolbar button,.toolbar select{padding:10px}.river-scene{height:430px}.stone{width:58px;height:43px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Illustrated game surfaces */
.memory-page{background:radial-gradient(ellipse at 50% 0,#fff4d8,#e8e4cc);min-height:100vh}.memory-page main{max-width:980px}.memory-page h1{text-align:center;color:#503d2f;font-family:Georgia,serif}.memory-page .lead{text-align:center}.memory-table{background:radial-gradient(ellipse at 50% 20%,#377d6d,#1b544b);border:10px solid #b18a54;box-shadow:0 0 0 3px #725333,0 14px 35px #5a482b30,inset 0 0 40px #092f3240;padding:18px 28px 28px}.memory-hud{display:flex;justify-content:space-between;align-items:center;color:#fff2cc;gap:10px}.memory-hud button{background:#ffffff12;color:#fff2cc;border:1px solid #ffffff40;padding:7px 12px;font-size:13px}.memory-page #status{color:#fff4d9;text-align:center;font-size:14px}.journey{display:flex;align-items:center;justify-content:center;max-width:240px;margin:0 auto 12px}.journey-stop{background:#1e4942;color:#90afa0;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;border:2px solid #9bb4a1}.journey-stop.active{background:#efbe62;color:#684717;border-color:#ffe3a0;box-shadow:0 0 15px #f8d18050}.journey-track{width:60px;height:3px;background:#aac1a0}.memory-page #board{gap:16px;max-width:720px;margin:auto;perspective:1100px}.memory-page .card{position:relative;background:none!important;border:0!important;box-shadow:none!important;padding:0;min-height:0;aspect-ratio:3/4;transform:none;overflow:visible;font-size:clamp(14px,2.4vw,24px);-webkit-tap-highlight-color:transparent}.card-inner{display:block;position:absolute;inset:0;transform-style:preserve-3d;transition:transform .5s cubic-bezier(.2,.7,.2,1)}.card.open .card-inner,.card.matched .card-inner{transform:rotateY(180deg)}.card-back,.card-front{position:absolute;inset:0;border:5px solid #fff8e5;border-radius:13px;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 5px 8px #082b3360;display:flex;align-items:center;justify-content:center;flex-direction:column}.card-back{background-color:#a9453d;background-image:repeating-linear-gradient(45deg,transparent 0 10px,#f4d49766 10px 12px,transparent 12px 22px),repeating-linear-gradient(-45deg,transparent 0 10px,#f4d49766 10px 12px,transparent 12px 22px)}.card-back:before{content:'';position:absolute;inset:7px;border:1px solid #ffe5aa;border-radius:6px}.card-back span{font-size:40px;color:#ffe4aa;background:#a9453d;border:2px solid #f7d89b;border-radius:50%;width:60px;height:60px;display:grid;place-items:center;box-shadow:0 0 0 5px #a9453d}.card-front{transform:rotateY(180deg);background:#fff9e9;color:#403d35;padding:6px;text-align:center;border-color:#f9e8c5}.card-front small{color:#9a7041;font-size:10px;letter-spacing:2px}.card-front strong{font-weight:750}.card.matched .card-front{background:#e6f2d8;border-color:#bbd69a}.card.matched .card-front:after{content:'✓';color:#4a7c48;margin-top:10px}.memory-page #finish{background:#fff0ce;text-align:center}.river-page{background:#e8efd9}.river-page main{max-width:900px}.river-page .panel{background:none;border:0;padding:0}.river-page h1{text-align:center}.river-page .lead{text-align:center;font-size:14px;margin:4px 0 10px}.river-page .toolbar{justify-content:center;margin:6px 0}.river-page .toolbar select,.river-page .toolbar button{font-size:13px;padding:7px 10px}.river-controls{position:relative;z-index:4;background:#fff9e9;border-radius:20px 20px 0 0;padding:10px;box-shadow:0 3px 12px #38533615}.river-controls h2{font-size:23px;margin:0 0 5px}.river-controls #status{margin:5px 0 0;font-size:13px;min-height:20px}.river-controls button{padding:7px 14px;font-size:14px;background:#f5dfad;border-color:#d6b57a}.river-scene{height:560px;max-height:none;min-height:0;border-radius:0 0 25px 25px;border:0;background:#5db7cd url('/obrazki/gry/przeprawa-przez-rzeke.webp') center/100% 100% no-repeat;box-shadow:0 14px 25px #32573430}.bank{background:none!important;border:0!important;height:10%;font-size:12px;text-shadow:0 1px #fff;color:#354d2c}.river-decoration{display:none}.river-row{height:9%;left:19%;width:62%}.stone{width:72px;height:48px;border-radius:42% 54% 43% 48%;border:3px solid #ffffff99;box-shadow:0 5px 0 #375967,0 9px 0 3px #ffffff45,inset 4px 4px 0 #ffffff40,inset -5px -6px 0 #0000001a;transition:transform .2s,filter .2s;filter:saturate(.95)}.stone:not(:disabled):hover{transform:translateY(-4px);filter:brightness(1.12)}.stone:disabled{opacity:.85;filter:saturate(.6)}.stone.passed{opacity:1;border-color:#fff9cd}#traveller{width:62px;height:76px;filter:drop-shadow(0 5px 3px #274f5c60);transition:top .65s cubic-bezier(.3,.8,.3,1),left .65s ease}#traveller:before,#traveller:after{display:none}#traveller img{width:100%;height:100%;object-fit:contain}.river-page .parent,.memory-page .parent{font-size:14px;max-width:760px;margin:35px auto 0;color:#50614f}@media(max-width:520px){.memory-table{padding:12px;border-width:6px}.memory-page #board{gap:9px}.card-back,.card-front{border-width:3px;border-radius:9px}.card-back span{font-size:28px;width:39px;height:39px}.card-back:before{inset:4px}.card-front small{font-size:8px;letter-spacing:1px}.memory-page h1{font-size:25px}.memory-page .lead{font-size:13px}.memory-hud{font-size:13px}.river-scene{height:480px}.river-row{left:10%;width:80%}.stone{width:57px;height:40px}#traveller{width:52px;height:65px}.river-page .toolbar label{display:none}.river-controls h2{font-size:20px}}@media(prefers-reduced-motion:reduce){.card-inner,#traveller{transition:none}}

.memory-page #board:has(.card:nth-child(9)){max-width:510px}.memory-page #board:has(.card:nth-child(13)){max-width:440px}
/* Light portal palette and stable feedback below the board. */
.memory-page{background:#fffaf0}.memory-page h1{font-family:system-ui,sans-serif;color:#315d54;font-size:clamp(25px,4vw,35px)}.memory-table{background:radial-gradient(ellipse at top,#f2f8e7,#dcebd5);border:6px solid #b9d6bd;box-shadow:0 0 0 2px #eff6e9,0 10px 25px #64886420,inset 0 0 25px #c5debe45}.memory-hud{color:#3c6657;margin-bottom:16px}.memory-hud button{background:#ffffff80;color:#476d5b;border-color:#a8c8af}.memory-page #status{color:#446b5c;min-height:46px;height:46px;line-height:23px;margin:18px 0 0;font-size:14px;text-align:center;display:flex;align-items:center;justify-content:center}.journey-stop{background:#e1ecdb;color:#9bb39b;border-color:#bed0b4}.journey-stop.active{background:#ffdf9d;color:#987143;border-color:#f3ca7e;box-shadow:none}.journey-track{background:#bed4b6}.card-back{background-color:#b6dcd2;background-image:repeating-linear-gradient(45deg,transparent 0 10px,#fafff0a8 10px 12px,transparent 12px 22px),repeating-linear-gradient(-45deg,transparent 0 10px,#fafff0a8 10px 12px,transparent 12px 22px);border-color:#fffdf2;box-shadow:0 4px 6px #4c7c6b30}.card-back:before{border-color:#ffffffdd}.card-back span{background:#cce8df;color:#648f7c;border-color:#f9fff0;box-shadow:0 0 0 5px #b6dcd2}.card-front{background:#fffdf5;border-color:#f4e3bd;box-shadow:0 4px 6px #4c7c6b30}.card-front small{color:#8a9a83}.card.matched .card-front{background:#edf6df;border-color:#b8d5a9}.river-page{background:#f5fae9}.river-controls{background:#fffaf0}.river-scene{background-image:url('/obrazki/gry/rzeka-kolorow.webp')}.stone:disabled{filter:none;opacity:.85}@media(max-width:520px){.memory-table{border-width:4px}.memory-page #status{font-size:13px}.memory-page .lead{margin-bottom:12px}}
/* Keep the river itself in the first mobile screen. */
.river-page main{padding-top:4px}.river-page h1{font-size:clamp(23px,4vw,30px);margin:8px 0 12px}.river-page .panel{position:relative}.river-controls{position:absolute;top:8px;left:8px;right:8px;border-radius:14px;padding:7px 10px;display:flex;align-items:center;justify-content:center;gap:9px;background:#fffdf2e8;box-shadow:0 2px 8px #47776420}.river-controls h2{font-size:clamp(16px,3vw,21px);margin:0}.river-controls button{min-width:36px;padding:5px;font-size:18px;background:none;border:0}.river-controls #status{position:absolute;top:auto;bottom:-420px;left:0;background:#fffdf2e8;border-radius:9px;padding:4px 8px;font-size:12px;max-width:90%;min-height:0;text-align:left}.river-scene{height:min(70svh,560px);min-height:360px;border-radius:22px}.river-page .bank.end{align-items:end;padding-bottom:3px;justify-content:flex-end;padding-right:10px;font-size:10px}.river-page .parent .toolbar{justify-content:flex-start}.river-page #finish{position:absolute;bottom:12px;left:12px;right:12px;z-index:5;box-shadow:0 4px 20px #36573730}.river-page #finish[hidden]{display:none}.river-controls #status{display:none}@media(max-width:520px){.river-page header{padding:10px 14px}.river-page main{padding:8px}.river-page h1{margin:2px 0 9px;font-size:24px}.river-controls{top:6px;left:6px;right:6px;padding:4px 8px}.river-controls h2{font-size:17px}.river-scene{height:calc(100svh - 155px);min-height:360px;max-height:620px}.memory-page .lead{font-size:clamp(11px,3.2vw,14px);white-space:nowrap}}
/* Only the reachable row offers colour choices. */
.river-row:not(.current-row) .stone{background:#d9dfd7!important;border-color:#f6f9ed!important;filter:none;opacity:.7;box-shadow:0 4px 0 #688a8b66,0 7px 0 2px #ffffff30,inset 3px 3px 0 #ffffff55}.river-row.current-row{background:#fff6b622;border-radius:30px;outline:2px dashed #fff6b6aa;outline-offset:5px}.river-row.current-row .stone{opacity:1;filter:none}.river-row.completed-row .stone{opacity:.45}.river-controls h2{font-size:clamp(15px,3vw,20px)}@media(max-width:520px){.river-controls h2{font-size:16px}}

/* Laptop board: reserve height for the whole round, without page scaling. */
@media(min-width:701px){
.memory-page header{padding:10px 4%}.memory-page main{padding-top:8px}.memory-page h1{font-size:clamp(24px,2.6vw,32px);margin:2px 0}.memory-page .lead{margin:3px 0 10px;font-size:15px}.memory-page .memory-table{padding:12px 22px 10px;border-width:5px}.memory-page .journey{margin-bottom:6px}.memory-page .memory-hud{margin-bottom:10px}.memory-page #board{gap:10px;width:100%;max-width:min(720px,calc((100svh - 235px)*.75))}.memory-page #board[data-count="8"]{max-width:min(720px,calc((100svh - 235px)*1.5))}.memory-page #board[data-count="12"]{max-width:min(720px,calc(100svh - 235px))}.memory-page #status{margin:8px 0 0;min-height:22px}.memory-page #review{max-width:760px;margin:auto;text-align:center}.memory-page #review h2{font-size:22px;margin:10px 0}.memory-page #review-count{margin:6px}.memory-page #review-word{font-size:36px;margin:10px}.memory-page #review-listen{padding:8px 14px}.memory-page #review-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.memory-page #review-options button{margin:0;min-height:52px;padding:10px}.memory-page #review-feedback{margin:8px 0}.memory-page #finish{padding:14px;margin-top:8px}
}

/* Each translation pair gains its colour only after matching. */
.memory-page .card.matched[data-pair="0"] .card-front{background:#ffe0be;border-color:#d5a46f}
.memory-page .card.matched[data-pair="1"] .card-front{background:#e5d9fa;border-color:#b7a0d3}
.memory-page .card.matched[data-pair="2"] .card-front{background:#d4eafa;border-color:#92b9d0}
.memory-page .card.matched[data-pair="3"] .card-front{background:#f9d8df;border-color:#d6a0ac}
.memory-page .card.matched[data-pair="4"] .card-front{background:#fff0ae;border-color:#d2b968}
.memory-page .card.matched[data-pair="5"] .card-front{background:#d1eee4;border-color:#88bca8}
.memory-page .card.matched[data-pair="6"] .card-front{background:#e3e1fa;border-color:#aaa5d2}
.memory-page .card.matched[data-pair="7"] .card-front{background:#f4dfcc;border-color:#c5a383}
@media(min-width:701px){
.memory-page #board[data-count]{width:100%!important;max-width:1120px!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.memory-page #board[data-count="8"]{max-width:720px!important}
.memory-page .card{aspect-ratio:3/4!important;min-width:0;min-height:150px!important}
.memory-page .card-front strong{font-size:clamp(19px,1.7vw,27px);line-height:1.2}
.memory-page .card-back span{width:46px;height:46px;font-size:30px}
}
@media(min-width:1100px){.memory-page #board[data-count="12"]{grid-template-columns:repeat(6,minmax(0,1fr));max-width:1040px!important}.memory-page #board[data-count="16"]{grid-template-columns:repeat(8,minmax(0,1fr));max-width:1280px!important}}

@media(min-width:1100px){.memory-page #board[data-count="16"] .card-front strong{font-size:19px;overflow-wrap:normal}.memory-page #board[data-count="16"] .card-front{padding:4px}}

/* Topic catalog and compact meaning review. */
.memory-catalog main{max-width:1240px!important}.memory-catalog .lead{max-width:860px;margin:10px auto 26px;white-space:normal}
.memory-topics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.memory-topic{display:flex;flex-direction:column;border:4px solid white;border-radius:26px;overflow:hidden;background:#fff1b9;color:#234b49;text-decoration:none;box-shadow:0 2px 6px #315d5410}.memory-topic:hover{box-shadow:0 4px 12px #315d5425}.memory-topic.topic-1{background:#e6dcf8}.memory-topic.topic-2{background:#c8ece2}.memory-topic h2{font-size:26px;margin:22px 22px 8px;text-align:left}.memory-topic>p{font-size:17px;margin:0 22px 20px;line-height:1.6;min-height:82px}.topic-preview{position:relative;background:#edf3df;padding:24px 20px 56px;display:flex;gap:16px;justify-content:center;margin-top:auto;min-height:230px}.sample-card{width:42%;max-width:135px;aspect-ratio:3/4;background:#fffaf0;border:4px solid white;border-radius:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:23px;font-weight:750;box-shadow:0 3px 7px #315d5420;transform:rotate(-7deg)}.sample-card small{font-size:9px;letter-spacing:1px;margin-bottom:10px;color:#667c6e}.sample-pl{transform:rotate(7deg);background:#ffe0be}.topic-play{position:absolute;bottom:12px;right:16px;padding:9px 18px;border-radius:12px;background:#315d54;color:white;font-size:20px;font-weight:750}.memory-all{display:block;margin:14px auto 0}.memory-page .memory-table[data-phase="review"] .journey{display:none}.memory-page .memory-table[data-phase="review"] .memory-hud{margin-bottom:4px}.memory-page .memory-table[data-phase="review"]{padding-top:12px;padding-bottom:16px}.memory-page #review{max-width:820px!important}.memory-page #review h2{margin:6px 0;font-size:23px}.memory-page #review-count{margin:2px 0;font-size:14px}.memory-page #review-word{margin:8px 0;font-size:38px}.memory-page #review-listen{padding:8px 14px;font-size:16px}.memory-page #review-options{max-width:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0 8px}.memory-page #review-options button{font-size:23px;min-height:58px;margin:0}.memory-page #review-feedback{min-height:28px;margin:6px 0;font-size:17px}.memory-page #review-next{padding:10px 28px;font-size:20px}.memory-page #review-next[hidden]{display:none}
@media(max-width:760px){.memory-topics{grid-template-columns:1fr;max-width:520px;margin:auto}.memory-topic>p{min-height:0}.memory-page #review-options{grid-template-columns:1fr}.memory-page #review-options button{min-height:52px}.memory-catalog .lead{white-space:normal;font-size:16px}.memory-page:not(.memory-catalog) .lead{white-space:normal;max-width:800px;margin-left:auto;margin-right:auto;font-size:13px}}
@media(min-width:761px){.memory-page:not(.memory-catalog) .lead{max-width:900px;margin-left:auto;margin-right:auto;font-size:13px}.memory-page .memory-table[data-phase="review"]{max-width:1120px;margin:auto}}

.memory-page #status[hidden]{display:none!important}

/* Illustrated topic cards: same white border and pastel copy panel as portal cards. */
.memory-topic-copy{padding:22px 22px 18px;min-height:166px}.memory-topic .memory-topic-copy h2{margin:0 0 12px;font-size:27px;line-height:1.15}.memory-topic .memory-topic-copy p{margin:0;font-size:16px;line-height:1.55}.memory-topic .topic-preview{min-height:262px;padding:22px 24px 58px;background:#e9f3df;gap:12px;align-items:center}.illustrated-card{display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fffcf2;border:4px solid white;border-radius:16px;width:47%;min-width:0;min-height:178px;box-shadow:0 4px 9px #355d4a20;padding:9px 7px;color:#315d54;text-align:center}.illustrated-card.face-0{transform:rotate(-6deg)}.illustrated-card.face-1{transform:rotate(6deg);background:#ffead0}.illustrated-card img{width:100%;height:102px;object-fit:contain;mix-blend-mode:multiply}.illustrated-card strong{font-size:19px;line-height:1.2;margin:8px 0 3px}.illustrated-card small{font-size:13px;line-height:1.2}.speech-mark{display:grid;place-items:center;min-height:92px;border:2px solid #a5cec0;border-radius:18px;background:white;font-size:21px;font-weight:750;padding:8px}.action-figure{font-size:66px;line-height:1.5}.memory-topic .topic-play{font-size:20px;padding:9px 20px}.memory-page #board[data-phrases="true"]{grid-template-columns:repeat(4,minmax(0,1fr))!important;max-width:1080px!important}.memory-page #board[data-phrases="true"] .card{aspect-ratio:5/3!important;min-height:125px!important}.memory-page #board[data-phrases="true"] .card-front strong{font-size:clamp(18px,1.8vw,24px);overflow-wrap:normal;line-height:1.25}.memory-page #board[data-phrases="true"] .card-front{padding:10px}.memory-page #board[data-phrases="true"] .card-front small{font-size:9px}.memory-page #board[data-phrases="true"] .card.matched .card-front:after{margin-top:5px}
@media(max-width:760px){.memory-topic-copy{min-height:0}.memory-topic .topic-preview{min-height:255px}.memory-page #board[data-phrases="true"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}.memory-page #board[data-phrases="true"] .card{min-height:120px!important;aspect-ratio:4/3!important}.memory-page #board[data-phrases="true"] .card-front strong{font-size:17px}.memory-page #board[data-phrases="true"] .card-front small{font-size:8px}}

.memory-topic-copy{flex:1}.memory-topic .topic-preview{height:264px;min-height:264px;flex-shrink:0}.illustrated-card{height:185px}

/* Content sets the copy height; each grid row still aligns its pictures. */
.memory-topic-copy{min-height:0;padding:20px 22px 18px}.memory-topic .memory-topic-copy h2{margin-bottom:10px}.memory-catalog .lead{max-width:960px;line-height:1.6}.memory-catalog h1{font-size:clamp(25px,2.6vw,34px)}
