.picture-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin-top: 32px; }
.picture-card { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white); }
/* Override intrinsic HTML height so every gallery preview uses the same crop. */
.picture-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .25s; }
.picture-card:hover img { transform: scale(1.035); }
.picture-heading { margin: 25px 0; }
.picture-heading h1 { font:700 40px var(--font-display,Georgia,serif); margin: 8px 0; }
.picture-heading p { font-size: 13px; color: var(--muted); margin: 0; }
.picture-layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 28px; align-items: start; }
.picture-stage { min-width: 0; border: 1px solid var(--line); background: var(--white); border-radius: 14px; padding: 18px; }
.puzzle-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.puzzle-stats { display: flex; gap: 22px; font-size: 11px; color: var(--muted); }
.puzzle-stats strong { color: var(--ink); display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.puzzle-actions { display: flex; gap: 8px; }
.puzzle-undo, .puzzle-pause { padding: 8px 12px; white-space: nowrap; }
.picture-board { position: relative; display: grid; width: min(100%, calc(74vh * var(--picture-ratio, 1.5))); margin: auto; background: var(--line); overflow: hidden; }
.picture-piece { appearance: none; display: block; line-height: 0; border: 0; margin: 0; padding: 0; min-width: 0; min-height: 0; border-radius: 0; background-repeat: no-repeat; box-shadow: inset 0 0 0 .5px #ffffff45; cursor: grab; position: relative; }
.picture-board.gray-hint .picture-piece:not(.in-place)::before { content: ''; position: absolute; inset: 0; pointer-events: none; backdrop-filter: grayscale(1); background: #80808070; }
.picture-piece:hover { box-shadow: inset 0 0 0 2px #ffffffb0; z-index: 1; }
.picture-piece.selected { box-shadow: inset 0 0 0 3px #dbfa86; z-index: 2; }
.picture-piece:focus-visible { outline: 3px solid #dbfa86; outline-offset: -3px; z-index: 3; }
.picture-board.complete .picture-piece { box-shadow: none; cursor: default; }
.puzzle-cover { position: relative; isolation: isolate; overflow: hidden; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px; text-align: center; }
.puzzle-cover::before { content: ''; position: absolute; inset: -24px; z-index: -1; background: var(--cover-image) center / cover no-repeat; filter: blur(16px) brightness(.55); }
.puzzle-cover p { margin: 0; max-width: 32ch; color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000a; }
.puzzle-start { min-width: 180px; padding: 14px 28px; font-size: 18px; }
/* Paused: pieces are hidden under the blurred cover, and the reference blurs too. */
.puzzle-pause-cover { position: absolute; inset: 0; z-index: 5; }
.puzzle-cover .puzzle-pause-title { font: 700 30px var(--font-display,Georgia,serif); }
.picture-layout.paused .picture-piece { visibility: hidden; }
.picture-layout.paused .picture-reference-wrap { overflow: hidden; border-radius: 7px; }
.picture-layout.paused .picture-reference { filter: blur(16px) brightness(.8); }
.picture-piece.correct-placement, .picture-piece.wrong-placement { z-index: 4; }
.picture-piece.correct-placement::after, .picture-piece.wrong-placement::after { content: ''; position: absolute; inset: 0; pointer-events: none; border: 2px solid var(--placement-color); box-shadow: inset 0 0 8px var(--placement-color); animation: puzzle-place-glow 1.8s ease-out both; }
.picture-piece.correct-placement { --placement-color: #8fea54; }
.picture-piece.wrong-placement { --placement-color: #ff6767; }
@keyframes puzzle-place-glow { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.puzzle-confetti { position: absolute; left: 50%; top: 50%; width: 4px; height: 6px; border-radius: 1px; pointer-events: none; z-index: 1; animation: puzzle-confetti-burst .8s ease-out both; }
@keyframes puzzle-confetti-burst { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(.5); } 100% { opacity: 0; transform: translate(var(--confetti-x), var(--confetti-y)) rotate(var(--confetti-turn)) scale(.8); } }
@media (prefers-reduced-motion: reduce) { .picture-piece.correct-placement::after, .picture-piece.wrong-placement::after { animation: none; } .puzzle-confetti { display: none; } }
.puzzle-status { font-size: 12px; color: var(--muted); min-height: 38px; margin: 16px 0 0; }
.picture-sidebar { border: 1px solid var(--line); border-radius: 14px; background: var(--white); padding: 22px; }
.picture-sidebar h2 { font:700 23px var(--font-display,Georgia,serif); margin: 8px 0 16px; }
.picture-reference-wrap { position: relative; margin-bottom: 22px; }
.picture-reference { display: block; width: 100%; height: auto; border-radius: 7px; }
.puzzle-hint-marker { position: absolute; width: 8px; height: 8px; border: 2px solid white; background: #8fea54; box-shadow: 0 0 0 1px #213d33; transform: translate(-50%, -50%); pointer-events: none; }
.puzzle-hints { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.picture-sidebar .puzzle-hint { display: flex; flex-direction: column; gap: 3px; padding: 10px 8px; }
.puzzle-hint small { font-size: 10px; font-weight: normal; }
.picture-sidebar .puzzle-hint[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.puzzle-time-rate { font-size: 10px; font-weight: bold; color: var(--ink); }
.puzzle-time-rate[hidden] { display: inline !important; visibility: hidden; }
.puzzle-sizes { border: 0; padding: 0; margin: 0 0 18px; }
.puzzle-sizes legend { font-size: 12px; font-weight: bold; margin-bottom: 10px; }
.puzzle-size-options { display: flex; gap: 6px; }
.puzzle-size-options button { flex: 1; padding: 10px 3px; border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: 12px; }
.puzzle-size-options button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.puzzle-size-options small { display: block; font-size: 9px; margin-top: 4px; }
.picture-sidebar .button { width: 100%; }
.puzzle-progress-label { display: flex; justify-content: space-between; font-size: 11px; margin-top: 22px; }
.puzzle-progress { width: 100%; height: 7px; accent-color: #7c9455; margin-top: 8px; }
.picture-back { display: block; text-align: center; font-size: 12px; margin-top: 18px; text-decoration: underline; }
.picture-howto { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.picture-howto strong { color: var(--ink); }
.picture-home-preview { display: block; width: 100%; height: 100%; position: absolute; object-fit: cover; }
.puzzle-home-note { padding: 30px; border-left: 1px solid var(--line); align-self: center; }
.puzzle-home-note h3 { font:700 24px var(--font-display,Georgia,serif); margin: 0 0 10px; }
.puzzle-home-note p { font-size: 12px; color: var(--muted); }
@media (max-width: 1050px) { .picture-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } .picture-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; } .picture-sidebar { padding: 17px; } }
@media (max-width: 700px) { .picture-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .picture-layout { grid-template-columns: minmax(0, 1fr); } .picture-heading h1 { font-size: 32px; } .picture-stage { padding: 10px; } .puzzle-toolbar { gap: 8px; flex-wrap: wrap; } .puzzle-actions { margin-left: auto; } .puzzle-stats { gap: 18px; } .picture-reference-wrap { max-width: 260px; } .picture-sidebar { padding: 20px; } .puzzle-home-note { border-left: 0; border-top: 1px solid var(--line); margin: 0 25px 22px; padding: 20px 0 0; } }
