html,body{margin:0;width:100%;height:100%;background:#102c4c}*{box-sizing:border-box}.pm-board{display:grid;width:100%;height:100%;min-height:0;grid-template-rows:92px minmax(0,1fr) auto auto;gap:6px;padding:8px 18px;color:#fff}.pm-heading{display:flex;align-items:center;gap:16px;min-height:0}.pm-bodi{width:82px;height:92px;object-fit:contain;flex:none}.pm-heading p{font-size:clamp(19px,2.2vw,29px);font-weight:700;line-height:1.16;max-width:36ch;margin:0;text-shadow:0 2px 3px #102c4c}.pm-play{container-type:size;display:grid;grid-template-columns:minmax(0,1fr) 180px;grid-template-rows:minmax(0,1fr) 180px;gap:14px;min-width:0;min-height:0;width:100%;max-width:1200px;margin:0 auto}.pm-reference{grid-area:1/2;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:15px;font-weight:700;align-self:start}.pm-reference img{width:174px;height:116px;object-fit:contain;border-radius:8px}.pm-puzzle{grid-area:1/1;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));aspect-ratio:3/2;width:min(calc(100% - 28px),calc((100cqh - 208px)*1.5));height:auto;margin:14px 0;justify-self:center;align-self:start;background:#f8f0da;border:0 solid transparent;border-image:url('shared/assets/images/board-tray.webp') 17% / 14px / 14px round}.pm-slot{min-width:0;min-height:0;position:relative;outline:1px solid #b2a079;outline-offset:-1px;display:flex;align-items:stretch;justify-content:stretch}.pm-piece{position:relative;appearance:none;display:grid;place-items:center;min-width:44px;min-height:44px;border:0;background:transparent;padding:0;cursor:grab;touch-action:none;overflow:hidden}.pm-piece span{display:block;width:100%;height:100%;background-repeat:no-repeat;pointer-events:none}.pm-slot .pm-piece{width:100%;height:100%;min-width:0;min-height:0}.pm-tray{--tray-piece-height:124px;grid-area:2/1/3/3;position:relative;min-height:0;width:100%;padding:3px;border:24px solid transparent;border-image:url('shared/assets/images/board-tray.webp') 17% fill / 24px / 0 round}.pm-label{position:absolute;top:-22px;left:50%;transform:translateX(-50%);font-size:16px;color:#17324d;font-weight:700;background:#fff3d4;padding:2px 10px;border-radius:6px}.pm-tray>div{height:100%;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:center;justify-items:center}.pm-tray .pm-piece{width:min(100%,calc(var(--tray-piece-height)*var(--piece-ratio)));height:auto;aspect-ratio:var(--piece-ratio);max-height:none;border:2px solid #6b8fa5;border-radius:4px}.pm-tray .pm-piece span{position:absolute;inset:0}.pm-tray:has(.pm-piece:nth-child(2)):not(:has(.pm-piece:nth-child(3)))>div{grid-template-columns:repeat(2,minmax(0,1fr))}.pm-tray:has(.pm-piece:nth-child(4)):not(:has(.pm-piece:nth-child(5)))>div{grid-template-columns:repeat(4,minmax(0,1fr))}.pm-feedback,.pm-hint{min-height:0;margin:0;font-size:15px;line-height:1.2;text-shadow:0 2px 3px #102c4c}.pm-feedback:empty{display:none}.pm-hint{padding-left:20px}.pm-piece:focus-visible,.pm-slot:focus-visible,.pm-tray:focus-visible,.pm-card:focus-visible{outline:4px solid #ffd477;outline-offset:2px}.pm-picked{outline:4px solid #ffd477;outline-offset:1px}
body[data-picture-game="memory"] .pm-play{display:flex;align-items:flex-start;justify-content:center}.pm-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:18px;width:min(100%,1000px);height:min(100%,560px);align-self:flex-start}.pm-cards[data-count="4"]{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr);height:min(100%,300px)}.pm-cards[data-count="6"]{grid-template-columns:repeat(3,minmax(0,1fr))}.pm-card{appearance:none;position:relative;display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:5px;border:20px solid transparent;border-image:url('shared/assets/images/board-tray.webp') 17% fill / 20px / 0 round;background:transparent;cursor:pointer}.pm-card img{width:min(100%,150px);height:min(100%,150px);object-fit:contain;pointer-events:none}.pm-back{display:block;width:100%;height:100%;background:url('hanukkah-memory/assets/card-back.webp?v=pictures20261116') center/contain no-repeat;border-radius:7px;pointer-events:none}.pm-card.is-selected{outline:4px solid #ffd477;outline-offset:-4px}.pm-card.is-matched{border-image-source:url('shared/assets/images/board-tray.webp');outline:3px solid #ffd477;outline-offset:-3px;cursor:default}.pm-card:disabled{opacity:1;cursor:default}.pm-pair-mark{font-size:clamp(24px,4vmin,42px);font-weight:700;color:#345941}
@media(orientation:portrait){.pm-board{grid-template-rows:78px minmax(0,1fr) auto auto;padding:6px 14px}.pm-bodi{height:78px;width:70px}.pm-play{grid-template-columns:minmax(0,1fr);grid-template-rows:72px minmax(0,1fr) 156px;gap:10px}.pm-reference{grid-area:1/1;flex-direction:row;justify-content:center;align-items:center;gap:10px}.pm-reference img{width:102px;height:68px}.pm-puzzle{grid-area:2/1;width:min(calc(100% - 28px),calc((100cqh - 276px)*1.5));margin:14px 0}.pm-tray{grid-area:3/1;--tray-piece-height:104px;border-width:20px;border-image-width:20px}.pm-tray>div{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:5px}.pm-tray .pm-piece{width:min(100%,calc(46px*var(--piece-ratio)))}.pm-tray:has(.pm-piece:nth-child(2)):not(:has(.pm-piece:nth-child(3)))>div,.pm-tray:has(.pm-piece:nth-child(4)):not(:has(.pm-piece:nth-child(5)))>div{grid-template-rows:minmax(0,1fr)}.pm-tray:has(.pm-piece:nth-child(2)):not(:has(.pm-piece:nth-child(3))) .pm-piece{width:min(100%,calc(104px*var(--piece-ratio)))}.pm-cards,.pm-cards[data-count="4"],.pm-cards[data-count="6"]{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));height:min(100%,760px);max-width:550px;gap:12px}.pm-cards[data-count="4"]{grid-template-rows:repeat(2,minmax(0,1fr));height:min(100%,460px)}.pm-cards[data-count="6"]{grid-template-rows:repeat(3,minmax(0,1fr))}}
@media(max-width:500px){.pm-board{grid-template-rows:64px minmax(0,1fr) auto auto;padding:4px 12px;gap:4px}.pm-bodi{height:64px;width:56px}.pm-heading{gap:9px}.pm-heading p{font-size:18px}.pm-play{grid-template-rows:62px minmax(0,1fr) 172px;gap:7px}.pm-reference{font-size:13px}.pm-reference img{width:87px;height:58px}.pm-puzzle{width:min(calc(100% - 20px),calc((100cqh - 268px)*1.5));margin:10px 0;border-image-width:10px;border-image-outset:10px}.pm-tray{border-width:16px;border-image-width:16px;--tray-piece-height:100px}.pm-label{font-size:13px;top:-16px}.pm-tray>div{gap:4px}.pm-cards,.pm-cards[data-count="4"],.pm-cards[data-count="6"]{gap:8px;height:100%;max-height:650px}.pm-cards[data-count="4"]{max-height:390px}.pm-card{border-width:13px;border-image-width:13px;padding:2px}.pm-card img{width:min(100%,100px);height:min(100%,100px)}.pm-feedback,.pm-hint{font-size:12px}.pm-hint{padding-left:16px}}
@media(orientation:landscape) and (max-height:700px){.pm-board{grid-template-columns:110px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto;gap:4px 10px;padding:5px 12px}.pm-heading{grid-area:1/1/4/2;flex-direction:column;align-self:stretch;justify-content:center;gap:4px}.pm-bodi{height:76px;width:64px}.pm-heading p{font-size:16px}.pm-play{grid-area:1/2;grid-template-columns:minmax(0,1fr) 110px;grid-template-rows:minmax(0,1fr) 110px;gap:10px}.pm-reference{grid-area:1/2;font-size:12px}.pm-reference img{width:105px;height:70px}.pm-puzzle{grid-area:1/1;width:min(calc(100% - 20px),calc((100cqh - 150px)*1.5));border-image-width:10px;border-image-outset:10px;margin:10px 0}.pm-tray{grid-area:2/1/3/3;border-width:16px;border-image-width:16px;--tray-piece-height:72px}.pm-tray>div{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:5px}.pm-tray .pm-piece{width:min(100%,calc(72px*var(--piece-ratio)))}.pm-feedback,.pm-hint{grid-column:2;font-size:12px}.pm-cards,.pm-cards[data-count="4"],.pm-cards[data-count="6"]{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));height:100%;max-height:none;gap:10px;max-width:1000px}.pm-cards[data-count="4"]{grid-template-rows:minmax(0,1fr)}.pm-cards[data-count="6"]{grid-template-columns:repeat(3,minmax(0,1fr))}.pm-card{border-width:13px;border-image-width:13px}.pm-card img{width:min(100%,110px);height:min(100%,110px)}}
@media(orientation:landscape) and (max-height:450px){.pm-play{grid-template-rows:minmax(0,1fr) 82px;gap:5px;grid-template-columns:minmax(0,1fr) 90px}.pm-reference img{width:87px;height:58px}.pm-tray{border-width:12px;border-image-width:12px;--tray-piece-height:54px}.pm-tray .pm-piece{width:min(100%,calc(50px*var(--piece-ratio)))}.pm-puzzle{width:min(calc(100% - 20px),calc((100cqh - 112px)*1.5))}.pm-card{border-width:9px;border-image-width:9px;padding:2px}.pm-card img{width:min(100%,84px);height:min(100%,84px)}}

@media(max-width:500px) and (orientation:portrait){.pm-tray .pm-piece{width:min(100%,calc(60px*var(--piece-ratio)))}}
/* Puzzle progression: fixed hit boxes retain the whole quarter-turned image. */
body[data-picture-game="puzzle"] .pm-play[data-count="8"] .pm-tray>div{grid-template-columns:repeat(8,minmax(0,1fr))}
body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray{display:grid;grid-template-columns:minmax(0,1fr) 138px;gap:10px;align-items:center}
body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray>div{grid-template-columns:repeat(10,minmax(0,1fr));min-height:0}
.pm-turn{min-height:44px;min-width:44px;padding:6px 10px;font-size:17px;line-height:1.1}
@media(orientation:portrait){body[data-picture-game="puzzle"] .pm-play[data-count="8"]{grid-template-rows:62px minmax(0,1fr) 204px}body[data-picture-game="puzzle"] .pm-play[data-count="8"] .pm-tray>div{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}body[data-picture-game="puzzle"] .pm-play[data-count="8"] .pm-tray .pm-piece{width:min(100%,60px)}body[data-picture-game="puzzle"] .pm-play[data-count="8"] .pm-puzzle{width:min(calc(100% - 20px),calc((100cqh - 300px)*1.5))}body[data-picture-game="puzzle"] .pm-play[data-count="10"]{grid-template-rows:44px minmax(0,1fr) 224px;gap:6px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-reference img{height:42px;width:63px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 44px;border-width:12px;border-image-width:12px;padding:2px;gap:4px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray>div{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:4px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray .pm-piece{width:44px;max-width:100%}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-turn{justify-self:center;width:160px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-puzzle{width:min(calc(100% - 12px),calc((100cqh - 292px)*1.5));margin:6px 0;border-image-width:6px;border-image-outset:6px}}
@media(orientation:landscape) and (max-height:700px){body[data-picture-game="puzzle"] .pm-play[data-count="8"] .pm-tray .pm-piece{width:44px}body[data-picture-game="puzzle"] .pm-play[data-count="10"]{grid-template-rows:minmax(0,1fr) 108px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray{grid-template-columns:minmax(0,1fr) 110px;border-width:12px;border-image-width:12px;padding:2px;gap:7px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray .pm-piece{width:44px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray>div{gap:3px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-puzzle{width:min(calc(100% - 12px),calc((100cqh - 130px)*1.5));margin:6px 0;border-image-width:6px;border-image-outset:6px}}
@media(orientation:landscape) and (max-height:450px){body[data-picture-game="puzzle"] .pm-board:has(.pm-play[data-count="10"]) .pm-hint{display:none}body[data-picture-game="puzzle"] .pm-play[data-count="10"]{grid-template-rows:minmax(0,1fr) 94px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray{border-width:10px;border-image-width:10px;padding:0}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-puzzle{width:min(calc(100% - 12px),calc((100cqh - 112px)*1.5))}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-turn{font-size:14px;white-space:nowrap;padding:6px}}




.pm-turn{color:#17324d;background:#fff3d4}.pm-turn:disabled{color:#67543d;background:#e7dcc1;font-size:12px;white-space:normal;opacity:1}.pm-turn:focus-visible{outline:4px solid #ffd477;outline-offset:2px}
@media(orientation:landscape) and (max-height:450px){body[data-picture-game="puzzle"] .pm-play[data-count="10"]{grid-template-rows:minmax(0,1fr) 90px;gap:3px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-tray{border-width:8px;border-image-width:8px}body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-puzzle{width:min(calc(100% - 12px),calc((100cqh - 98px)*1.5));margin:2px 0}}
body[data-picture-game="puzzle"] .pm-turn{color:#17324d;background:#fff3d4;font-size:17px}
body[data-picture-game="puzzle"] .pm-play[data-count="10"] .pm-turn:disabled{color:#67543d;background:#e7dcc1;font-size:12px;white-space:normal;opacity:1}
body[data-picture-game="puzzle"] .pm-tray .pm-piece{border:0;outline:2px solid #6b8fa5;outline-offset:-2px}
body[data-picture-game="puzzle"] .pm-tray .pm-piece.pm-picked{outline:4px solid #ffd477;outline-offset:1px}

