.activity-dialog.gallery-dialog {box-sizing:border-box;width:min(960px,calc(100vw - 1rem));max-width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem);overflow-y:auto;padding:clamp(.75rem,3vw,1.8rem);overscroll-behavior:contain;}
.gallery-dialog .activity-preview {padding:0;border:0;background:none;text-align:left;}
.gallery-game {padding:clamp(.6rem,2vw,1rem);border:1px solid #b6c8ca;border-radius:1rem;background:#eaf0ed;color:#173b4d;overflow-wrap:anywhere;}
.gallery-progress {display:flex;flex-wrap:wrap;justify-content:space-between;gap:.5rem 1rem;font-size:.9rem;font-weight:700;margin-bottom:1rem;}
.gallery-frame {padding:clamp(.8rem,3vw,1.5rem);border:clamp(6px,1.5vw,12px) solid #77543b;outline:1px solid #d0b171;border-radius:.4rem;background:linear-gradient(120deg,#f4e4c5,#fffaef 55%,#ebd8b7);box-shadow:0 6px 14px #173b4d30;}
.gallery-frame.is-restored {border-color:#496e55;}
.gallery-archive {font-size:.75rem;text-transform:uppercase;letter-spacing:.1em;font-weight:700;text-align:center;color:#665334;margin:0;}
.gallery-frame h3 {text-align:center;font:700 clamp(1.2rem,3vw,1.7rem)/1.4 Georgia,serif;margin:.5rem 0 .8rem;}
.gallery-photo {margin:0;background:#c9bea3;min-height:80px;border:2px solid #b8a580;}
.gallery-photo img {display:block;width:100%;height:clamp(160px,30vw,265px);object-fit:cover;filter:sepia(.55) saturate(.6);}
.gallery-photo img[hidden] {display:none;}
.gallery-photo figcaption {padding:1rem;}
.gallery-base {text-align:center;padding:.8rem 0;border-bottom:1px solid #c8b18b;}
.gallery-base small {display:block;}
.gallery-base strong {display:block;font:700 clamp(1.3rem,4vw,2rem)/1.5 Georgia,serif;letter-spacing:.12em;}
.gallery-base p {margin:.2rem 0;line-height:1.5;}
.gallery-caption {font:700 clamp(1.1rem,3vw,1.5rem)/1.6 Georgia,serif;text-align:center;margin:1rem 0 0;}
.gallery-blank {display:inline-block;min-width:4rem;border-bottom:2px solid #876a44;color:#876a44;}
.gallery-caption mark {background:#ffe0a0;color:#173b4d;padding:.1rem .25rem;}
.gallery-workbench {margin:1rem 0;padding:clamp(.7rem,2vw,1.1rem);border:1px solid #b7c8ca;border-radius:.6rem;background:#fffdf6;}
.gallery-workbench h4 {margin:0;font-size:1.1rem;}
.gallery-workbench p {line-height:1.55;}
.gallery-workbench label {display:block;font-weight:700;}
.gallery-workbench input {display:block;box-sizing:border-box;width:100%;min-width:0;min-height:48px;margin:.5rem 0 1rem;padding:.6rem;font:inherit;font-size:1.1rem;border:2px solid #8ba8ae;border-radius:.4rem;background:white;color:#173b4d;}
.gallery-controls {display:grid;grid-template-columns:1fr;gap:.6rem;}
.gallery-game button {min-height:44px;min-width:44px;white-space:normal;touch-action:manipulation;}
.gallery-game :is(button,input):focus-visible {outline:3px solid #12627c;outline-offset:3px;}
.gallery-log {margin:1rem 0;padding:1rem;border:1px solid #bba06f;border-left:4px solid #a18043;border-radius:.4rem;background:#fff9e8;line-height:1.55;}
.gallery-log h4 {margin:.2rem 0;font-size:1.2rem;}
.gallery-log .eyebrow {color:#725326;}
.gallery-next {width:100%;}
.gallery-result h3 {font-size:1.5rem;}
@media(min-width:500px) {.gallery-controls {grid-template-columns:1fr 1fr;}.gallery-result-cards {display:grid;grid-template-columns:1fr 1fr;gap:0 1rem;}}
@media(prefers-reduced-motion:reduce) {.gallery-game * {animation:none!important;transition:none!important;}}
