/* Puzzle mode screen. */
#puzzle { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 50% 0%, #EEF7F4, #D6EAE4 70%); padding: calc(8px + var(--safe-t)) 16px calc(16px + var(--safe-b)); }
#puzzle[hidden] { display: none; }
.pzh { display: flex; align-items: center; gap: 12px; height: 56px; flex: none; }
.pzh > b { font-size: 20px; flex: 1; }
.pzh .back .ic { width: 20px; height: 20px; } html[dir=rtl] .pzh .back .ic { transform: scaleX(-1); }
.pzc { font-weight: 800; color: var(--ink-2); }
.pzm { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 4px 12px; border-radius: 16px; background: var(--sand-0); box-shadow: var(--shadow); }
.pzm small { font-size: 11px; font-weight: 700; color: var(--ink-3); } .pzm b { font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.pzm.low b { color: #C2492B; }
.pzgrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start; padding: 8px 0; max-width: 480px; width: 100%; margin: 0 auto; }
.pzn { position: relative; aspect-ratio: 1; border-radius: 16px; background: var(--sand-0); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pzn b { font-size: 18px; font-weight: 800; }
.pzn:disabled { background: rgba(255, 252, 246, .5); box-shadow: none; color: var(--ink-3); } .pzn:disabled .ic { width: 16px; height: 16px; }
.pzn.cur { box-shadow: 0 0 0 3px var(--teal), var(--shadow); animation: serveBob 1.4s ease-in-out infinite; }
.pzn.done { background: #F2FAEF; }
.pzn.hard::after { content: ''; position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.sts { display: flex; } .sts .st .ic { width: 12px; height: 12px; color: var(--sand-300); } .sts .st.on .ic { color: var(--saffron); fill: var(--saffron); }
.pzgoal { display: flex; align-items: center; justify-content: center; gap: 8px; height: 72px; flex: none; }
.pzgoal small { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.gch { position: relative; width: 56px; height: 56px; border-radius: 16px; background: var(--sand-0); box-shadow: var(--shadow); display: grid; place-items: center; }
.gch img { width: 46px; height: 46px; object-fit: contain; }
.gch b { position: absolute; bottom: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; display: grid; place-items: center; }
.pzboard { --c: min(calc((100vw - 52px) / var(--pw) - 3px), calc((100vh - 280px) / var(--ph)), 80px); display: grid; grid-template-columns: repeat(var(--pw), var(--c)); grid-auto-rows: var(--c); margin: 8px auto; border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 6px rgba(255, 252, 246, .7), var(--shadow); touch-action: none; direction: ltr; }
/* same glazed tiles and clay frame as the garden board */
.pzboard { gap: 3px; padding: 6px; border-radius: 22px; background: linear-gradient(160deg, #EBCB91 0%, #D9AE6C 55%, #C99A58 100%);
  box-shadow: inset 0 2px 0 rgba(255, 244, 214, .7), inset 0 -3px 0 rgba(120, 78, 30, .25), 0 14px 28px rgba(120, 84, 40, .22); }
.pc { position: relative; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(155deg, #FBF1DC, #F2E2C2);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .75), inset 0 -2px 0 rgba(170, 125, 60, .16); transition: background .15s, box-shadow .15s; }
.pc.b { background: linear-gradient(155deg, #F6E8CB, #EBD6AE); }
.pc img { width: 86%; height: 86%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(90, 60, 25, .25)); }
.pc.rock { background: linear-gradient(155deg, #D3BF9B, #BCA27A); box-shadow: inset 0 2px 0 rgba(255, 240, 210, .4), inset 0 -3px 0 rgba(90, 60, 25, .25); }
.pc.sand img { width: 100%; height: 100%; filter: none; }
.pc.sel { box-shadow: inset 0 0 0 3px var(--teal); }
.pc.hint { box-shadow: inset 0 0 0 3px var(--saffron); background: #FFF1C9; }
.pzf { display: flex; justify-content: center; gap: 16px; margin-top: auto; flex: none; }
.pzf .btn { width: 64px; height: 56px; } .pzf .ic { width: 24px; height: 24px; }
.pzstars { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.pzstars i img { width: 56px; height: 56px; filter: grayscale(1) opacity(.3); }
.pzstars i.on img { filter: none; animation: lvlPop .5s var(--ease-out) backwards; }
.pzstars i:nth-child(2) img { width: 72px; height: 72px; animation-delay: .15s; } .pzstars i:nth-child(3) img { animation-delay: .3s; }
