/* Same Hand's game uses the same three header slots as Slice. */
.museum-header .header-inner {display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:center;min-height:60px}
.museum-header .wordmark {justify-self:start;white-space:nowrap}
.edition-stamp,.hud-line,.lobby-format,.lobby-archive {font:600 .82rem/1.4 var(--pixel-mono)}
.edition-stamp {display:flex;justify-content:center;gap:.7em;text-transform:uppercase;color:var(--pixel-gold);text-align:center;letter-spacing:.06em}
.edition-stamp span+span::before {content:'·';margin-right:.7em}
.museum-header .header-tools {display:flex;justify-content:flex-end;gap:8px}
.header-tools > :is(button,a),.menu-heading button {display:inline-grid;place-items:center;min-width:42px;height:42px;border:2px solid var(--rule);background:var(--pixel-panel);color:var(--ink);font:700 1.1rem/1 var(--pixel-mono);text-decoration:none;cursor:pointer}
#museum-menu {width:min(360px,92vw);max-height:84dvh;overflow:auto;padding:19px;background:var(--pixel-panel);color:var(--ink);border:2px solid var(--rule);box-shadow:4px 4px var(--pixel-edge)}
#museum-menu::backdrop {background:#151221ca}
.menu-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:10px}
.menu-heading strong {font:400 1.6rem/1.2 Workbench,monospace;color:var(--pixel-gold)}
#museum-menu nav {display:grid}
#museum-menu nav a,#museum-menu summary,#museum-menu #museum-sound {display:flex;align-items:center;gap:9px;border:0;border-top:1px solid var(--rule);min-height:42px;padding:8px 3px;text-decoration:none;background:none;color:var(--ink);font:600 .95rem/1.3 var(--sans);cursor:pointer}
#museum-menu summary {display:list-item;align-content:center}
#museum-menu a:hover,#museum-menu button:hover,#museum-menu summary:hover {color:var(--pixel-gold)}
#museum-menu #museum-sound {width:100%}
#museum-menu #museum-sound[hidden] {display:none}

.game-shell > main:has(.museum-hud) {display:flex;flex-direction:column;padding:clamp(10px,2.3dvh,24px) 4px max(8px,env(safe-area-inset-bottom));gap:clamp(8px,1.8dvh,20px)}
main:has(.museum-hud) #game:not([hidden]) {display:flex;flex-direction:column;flex:1 0 auto}
main:has(.museum-hud) .house-slot {flex:none;margin:0}
main:has(.museum-hud) .house-slot .slice-ad {min-height:49px}
main:has(.museum-hud) .ad-label {margin-bottom:3px}
#game:has(.museum-lobby:not([hidden])) :is(.museum-hud,.round-task) {display:none}
#game .museum-lobby {flex:1;display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.15fr);border:2px solid #87738b;background:var(--pixel-panel);box-shadow:3px 3px var(--pixel-edge)}
.lobby-copy {align-self:center;min-width:0;padding:clamp(26px,4.7vw,72px)}
.lobby-copy h1,.lobby-copy h1 em {font-size:clamp(3rem,5.4vw,5.6rem);line-height:1.05}
.lobby-copy .instruction {font-size:clamp(1rem,1.4vw,1.2rem);line-height:1.55;max-width:33ch;margin:1rem 0 1.35rem}
.lobby-copy .primary {min-height:48px;padding-inline:20px;font-size:1.02rem}
.lobby-archive {display:table;color:var(--pixel-gold);margin:14px 0 0;text-underline-offset:3px}
.lobby-format {margin:12px 0 0;color:var(--muted);font-size:.79rem}
.museum-scene {min-height:240px;min-width:0;position:relative;overflow:hidden;background:#242137;border-left:2px solid var(--rule);isolation:isolate}

.museum-hud {padding:10px 14px;border:2px solid var(--rule);background:var(--pixel-panel)}
.hud-line {display:grid;grid-template-columns:1fr auto 1fr;align-items:baseline;gap:8px;color:var(--ink)}
.hud-line #round-label {text-transform:uppercase}
.hud-score {text-align:right}.hud-score span {color:var(--muted)}
.museum-hud #progress {display:flex;gap:5px;margin:5px 0 0}
.museum-hud .pip {flex:1;height:5px}
.round-task {font-size:clamp(1.5rem,3.2vw,2.75rem);margin:clamp(9px,2dvh,20px) 0}
#game:has(.museum-hud) .gallery:has(.choose:not(:disabled)) {flex:1;align-content:stretch}
#game:has(.museum-hud) .card:not(.revealed) .choose {height:100%}
@media(min-width:701px) {
  #game:has(.museum-hud) .card:not(.revealed) .choose {display:flex;flex-direction:column}
  #game:has(.museum-hud) .card:not(.revealed) .wall {flex:1;min-height:155px;width:100%;height:auto;position:relative}
  #game:has(.museum-hud) .card:not(.revealed) .wall img {position:absolute;inset:0;margin:auto;max-width:calc(100% - 40px);max-height:calc(100% - 44px)}
  #game:has(.museum-hud) .choose .label {width:100%}
  #game:has(.museum-hud) .card.revealed .wall {height:clamp(130px,35dvh,390px)}
}
main:has(.museum-hud) #results:not([hidden]) {flex:1 0 auto;align-self:center;text-align:center;width:min(840px,100%);align-content:center}
main:has(.museum-hud) #results .score {font-size:clamp(2rem,7.8vw,5.8rem)}
main:has(.museum-hud) #results .actions {justify-content:center}
.gallery-strip {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(5px,1vw,12px);margin:clamp(14px,3dvh,28px) auto;padding:0;max-width:680px}
.gallery-strip button {position:relative;min-width:0;padding:5px;border:1px solid var(--rule);background:var(--pixel-panel);color:var(--ink);cursor:zoom-in;font:600 .78rem/1.4 var(--pixel-mono)}
.gallery-strip img {width:100%;height:clamp(48px,9vw,94px);object-fit:contain;display:block;margin-bottom:4px}
.gallery-strip button[data-hit=true] {border-bottom:3px solid var(--pixel-green)}.gallery-strip button[data-hit=false] {border-bottom:3px solid var(--pixel-red)}
.gallery-breakdown {text-align:left;max-width:680px;margin:15px auto}
.gallery-breakdown summary {cursor:pointer;text-align:center;text-decoration:underline;text-underline-offset:3px;padding:6px}
@media(max-width:700px) {
  .museum-header .header-inner {min-height:56px;gap:5px}
  .museum-header .header-tools {gap:5px}
  .header-tools>:is(button,a) {min-width:39px;height:40px}
  .edition-stamp {display:grid;gap:0;font-size:.7rem;line-height:1.35}
  .edition-stamp span+span::before {content:none}
  .game-shell > main:has(.museum-hud) {gap:10px;padding-top:10px}
  #game .museum-lobby {grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(128px,1fr) auto}
  .museum-scene {grid-row:1;min-height:0;border:0;border-bottom:2px solid var(--rule)}
  .lobby-copy {grid-row:2;padding:clamp(15px,2.7dvh,26px) clamp(17px,5vw,33px)}
  .lobby-copy h1,.lobby-copy h1 em {font-size:clamp(2.1rem,8.5vw,3.35rem);line-height:1.1}
  .lobby-copy h1 br {display:none}.lobby-copy h1 em::before {content:' '}
  .lobby-copy .instruction {font-size:1.02rem;line-height:1.48;margin:9px 0 14px;max-width:none}
  .lobby-copy .primary {width:100%;min-height:48px}
  .lobby-format {margin:7px 0 0}.lobby-archive {margin:12px 0 0}
  main:has(.museum-hud) .ad-copy {display:flex;align-items:center;gap:10px}
  main:has(.museum-hud) .slice-ad {padding:5px 9px;gap:8px}
  main:has(.museum-hud) .slice-ad img {display:none}
  main:has(.museum-hud) .ad-copy .slice-wordmark {margin:0;font-size:2rem}
  main:has(.museum-hud) .ad-copy span {font-size:.82rem}
  main:has(.museum-hud) .ad-cta {font-size:.77rem}
  .museum-hud {padding:8px 10px}
  .round-task {font:600 1.15rem/1.2 var(--sans);letter-spacing:0;text-shadow:none;margin:8px 0}
  #game:has(.museum-hud) .gallery:has(.choose:not(:disabled)) {grid-template-rows:repeat(3,minmax(92px,1fr))}
  #game:has(.museum-hud) .card:not(.revealed) .wall {position:relative;height:100%;min-height:90px}
  #game:has(.museum-hud) .card:not(.revealed) .wall img {position:absolute;inset:0;margin:auto;max-width:calc(100% - 20px);max-height:calc(100% - 17px)}
}
@media(max-width:700px) and (max-height:670px) {
  .museum-header .header-inner {min-height:46px}
  .game-shell > main:has(.museum-hud) {padding-top:6px;gap:6px}
  .lobby-copy {padding:12px 14px}
  .lobby-copy .instruction {font-size:.95rem;margin:5px 0 9px}
  .lobby-copy .primary {min-height:44px}
  .lobby-archive {margin-top:8px}
  .lobby-format {margin-top:4px}
}
@media (max-height:510px) and (min-width:701px) {
  .museum-header .header-inner {min-height:44px}
  .lobby-copy {padding:12px 20px}
  .lobby-copy h1,.lobby-copy h1 em {font-size:1.9rem}
  .lobby-copy h1 br {display:none}.lobby-copy h1 em::before {content:' '}
  .lobby-copy .instruction {margin:4px 0 8px;font-size:.9rem}
  .lobby-archive,.lobby-format {margin-top:4px}
  .museum-scene {min-height:150px}
}
.museum-scene {background-image:var(--museum-art,url('/designs/pixel/museum-hero.png'));background-position:50% 40%;background-size:cover;background-repeat:no-repeat;image-rendering:pixelated}
.museum-scene::after {content:"";position:absolute;inset:0;pointer-events:none;background:url('/designs/pixel/hero-lights.png') 50% 40% / cover no-repeat;image-rendering:pixelated}
@media(prefers-reduced-motion:no-preference) {
  .museum-scene::after {animation:museum-lamps 780ms steps(3,end) both}
}

/* A revealed row can grow with the viewport while its caption keeps its natural height. */
#game:has(.museum-hud) .gallery:has(.revealed) {flex:1 0 auto}
#game:has(.museum-hud) .card.revealed {display:flex;flex-direction:column}
#game:has(.museum-hud) .card.revealed .choose {flex:1 0 auto}
#game:has(.museum-hud) .card.revealed .wall {position:relative;height:auto}
#game:has(.museum-hud) .card.revealed .wall img {position:absolute;inset:0;margin:auto}
@media(max-width:700px) {
  #game:has(.museum-hud) .card.revealed .wall {min-height:clamp(72px,10dvh,100px)}
  #game:has(.museum-hud) .card.revealed .wall img {max-width:calc(100% - 20px);max-height:calc(100% - 16px)}
}
@media(min-width:701px) {
  #game:has(.museum-hud) .card.revealed .choose {display:flex;flex-direction:column}
  #game:has(.museum-hud) .card.revealed .wall {flex:1;min-height:145px;width:100%}
  #game:has(.museum-hud) .card.revealed .wall img {max-width:calc(100% - 40px);max-height:calc(100% - 44px)}
}
