@font-face{font-family:DM;src:url(fonts/font-0.ttf)}
*{box-sizing:border-box}body{margin:0;background:#f7f1e5;color:#273c37;font-family:DM,system-ui,sans-serif}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;border:2px solid #d5d9c8;background:#fffdf6;border-radius:18px;min-height:48px;min-width:52px;padding:10px 22px}button:hover{border-color:#47705b}button:focus-visible{outline:3px solid #b95635;outline-offset:4px}button.selected{background:#365d48;color:white;border-color:#365d48}button:disabled{cursor:wait}main{max-width:1050px;margin:auto;padding:24px}h1{font-size:clamp(30px,6vw,58px);line-height:1.12;margin:12px 0 24px;letter-spacing:-1.5px;text-align:center;font-weight:700}h1 span{font-size:.55em;font-weight:400}h1 em{display:block;font-style:normal;color:#b85635;font-size:1.45em;margin-top:5px}#home{max-width:820px;margin:auto;padding-top:2vh;text-align:center}.drawings{display:flex;align-items:center;justify-content:center;height:clamp(150px,28vh,250px);gap:12px;margin:15px 0 30px}.drawings img{width:29%;height:100%;object-fit:contain;padding:12px;background:white;border:7px solid white;box-shadow:0 7px 18px #273c3714;border-radius:14px;transform:rotate(-8deg)}.drawings img:nth-child(2){transform:rotate(4deg);height:110%;z-index:1}.drawings img:nth-child(3){transform:rotate(9deg)}.setup{display:flex;gap:28px;justify-content:center;flex-wrap:wrap}fieldset{border:0;margin:0;padding:0}legend{font-size:14px;margin-bottom:8px;text-align:left}.choices{display:flex;gap:8px}.choices button{font-size:21px}.primary{background:#b85635;border-color:#b85635;color:white;font-size:24px;padding:12px 46px;box-shadow:0 4px 0 #8f432a;margin-top:24px}#error{font-size:14px}#game{height:calc(100dvh - 48px);display:flex;flex-direction:column;gap:8px}#game[hidden]{display:none}.top{display:flex;align-items:center;justify-content:space-between;gap:12px;height:50px;flex-shrink:0}.top button{padding:3px 12px;font-size:28px}.top span{font-size:18px;font-variant-numeric:tabular-nums}#turn{min-height:24px;text-align:center;font-size:16px;font-weight:700}#board{display:grid;gap:10px;flex:1;min-height:0;align-items:stretch;justify-items:stretch}.card{padding:0;min-height:0;min-width:0;border:0;background:transparent;border-radius:13px;perspective:800px}.inner{display:block;position:relative;width:100%;height:100%;transition:transform .25s;transform-style:preserve-3d}.card.revealed .inner,.card.matched .inner{transform:rotateY(180deg)}.side{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border:3px solid #fffdf7;border-radius:13px;backface-visibility:hidden;box-shadow:0 2px 5px #273c371b}.reverse{background:#4d7059;background-image:radial-gradient(#ffffff20 2px,transparent 2px);background-size:16px 16px;color:#fff3ce;font-size:clamp(24px,5vw,52px)}.front{transform:rotateY(180deg);background:#fff}.front img{width:100%;height:100%;object-fit:contain;padding:7px;border-radius:12px}.matched .side{border-color:#b3c77f}.matched{opacity:.7}dialog{border:0;border-radius:28px;background:#fffdf5;text-align:center;padding:30px 40px;max-width:90vw;color:#273c37;box-shadow:0 20px 70px #0003}dialog::backdrop{background:#203c3380;backdrop-filter:blur(5px)}dialog button{margin:8px}dialog h2{margin:12px;font-size:30px}.celebration{font-size:70px;color:#b85635}#detail{font-size:17px}body.playing{overflow:hidden}body.playing main{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}body.playing #game{height:calc(100dvh - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)))}@media(max-width:480px){main{padding:18px}.setup{gap:20px}.choices button{padding:9px 16px}.drawings{gap:6px}.drawings img{padding:4px;border-width:4px}#board{gap:6px}.front img{padding:3px}.side{border-width:2px;border-radius:9px}h1{margin-top:12px}.primary{margin-top:20px}}@media(prefers-reduced-motion:reduce){.inner{transition:none}}
[hidden]{display:none!important}small{display:block;font-size:12px;font-weight:400;margin-top:5px}.mode-field{width:100%}#modes{justify-content:center}#modes button{flex:1;max-width:220px;padding:14px 16px;font-size:20px}.setup{gap:18px}#home{padding-top:0}.drawings{height:clamp(120px,20vh,180px);margin:15px 0 26px}h1{font-size:clamp(26px,4.5vw,43px);margin-bottom:16px}h1 em{font-size:1.25em}.site-link{display:block;text-align:left;font-size:13px;color:#365d48;text-decoration:none}.muted{font-size:12px;color:#58665c}.text-button{border:0;background:transparent;font-size:14px;min-height:40px;padding:4px 12px;text-decoration:underline}#mode-help{font-size:14px;margin:18px 0 0}.primary{margin-top:15px}.study{max-width:850px;margin:auto;text-align:center}.study h2{font-size:clamp(24px,4vw,36px);margin:12px 0}.eyebrow{font-size:12px;letter-spacing:2px;color:#a1482f}.learn-images{display:flex;gap:16px;justify-content:center;max-height:48dvh}.learn-images figure{margin:0;max-width:44%;min-width:0}.learn-images img{width:100%;height:min(36dvh,350px);object-fit:contain;background:white;border-radius:18px;padding:10px}figcaption{font-size:14px;margin:8px 0}.study-card{margin:12px auto;max-width:500px}.study-card img{height:clamp(100px,37dvh,400px);max-width:100%;object-fit:contain;background:white;border-radius:18px;padding:10px}#chain{height:calc(100dvh - 20px);display:flex;flex-direction:column;gap:6px}#chain-study,#chain-math{flex:1;min-height:0;overflow:auto;width:100%}#chain-recall{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;text-align:center}#chain-status,#chain-position,#status{margin:2px 0;font-size:14px;text-align:center;min-height:20px}#chain-board{display:grid;gap:10px;flex:1;min-height:0}.chain-card{position:relative;padding:5px;min-width:0;min-height:0;background:white;border-radius:13px}.chain-card img{width:100%;height:100%;object-fit:contain}.chain-card.matched:after{content:attr(data-order);position:absolute;top:5px;left:5px;background:#365d48;color:white;border-radius:50%;width:28px;height:28px;display:grid;place-items:center}.chain-card.matched{opacity:.5;border-color:#365d48;cursor:default}#hearts{color:#a1482f;font-size:20px;white-space:nowrap}#math-choices{justify-content:center;margin-top:24px}#collection{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:18px;margin-top:24px}#collection figure{margin:0;text-align:center;background:white;padding:12px;border-radius:18px}#collection img{width:100%;height:180px;object-fit:contain}#review{display:flex;flex-wrap:wrap;gap:10px;max-width:650px;max-height:40vh;overflow:auto;counter-reset:step}#review figure{margin:0;width:100px;counter-increment:step}#review figure:before{content:counter(step);display:block;font-weight:bold}#review img{width:90px;height:90px;object-fit:contain}dialog{max-height:90dvh;overflow:auto}dialog button.primary{font-size:18px;padding:12px 20px}button:disabled{cursor:default}#turn[data-player="2"]{color:#a1482f}.wrong{border-color:#b85635;animation:shake .25s}@keyframes shake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}.celebration{animation:pop .5s ease-out}@keyframes pop{from{transform:scale(.3) rotate(-30deg)}to{transform:scale(1)}}@media(max-width:480px){#modes{gap:6px}#modes button{font-size:16px;padding:12px 5px;border-radius:13px}#modes small{font-size:10px}#game-mode{font-size:12px}.top{gap:6px}.top span{font-size:14px}.top button{min-width:42px}.drawings{height:135px}.study>p{font-size:13px}.study h2{font-size:24px}.learn-images{gap:8px}.study-card img{height:34dvh}.top strong{font-size:14px}#hearts{font-size:16px}#chain-board{gap:6px}.study-card{margin:6px auto}}@media(max-height:550px){.study-card img{height:25dvh}.study h2{font-size:20px}.study>p{margin:6px}.study .primary{font-size:18px;padding:8px 24px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Shared back: decorative Zogaj logo, never part of the playable picture pool. */
.reverse{background:#f8f3e7 url("ui/zogaj-pencil-back.webp") center/contain no-repeat;color:transparent;font-size:0}
