/* The exhibition lives inside the existing olive LCD and physical console. */
body#chimera-console.gallery-page {--gallery-accent:var(--lcd-accent)}
.gallery-heading {display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px;border-bottom:3px double var(--lcd-line);background:#d9e3b5e8}
.gallery-heading h1 {margin:5px 0;font-size:clamp(1.35rem,3vw,2rem);line-height:1.2}
.gallery-intro {max-width:58ch;margin:8px 0 0;color:var(--lcd-muted);font-size:.88rem;line-height:1.6}
.gallery-heading>button {flex-shrink:0}
.gallery-toolbar {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:18px;flex-wrap:wrap}
.gallery-tabs {display:flex;gap:6px;flex-wrap:wrap}
body#chimera-console.gallery-page .gallery-tabs button {border:1px solid var(--lcd-line);background:var(--lcd-shade);color:var(--lcd-ink);box-shadow:none;font-size:.8rem}
body#chimera-console.gallery-page .gallery-tabs button[aria-pressed="true"] {background:var(--lcd-ink);border-color:var(--lcd-ink);color:var(--lcd-light)}
.gallery-rule {font-size:.75rem;line-height:1.5;color:var(--lcd-muted);margin:13px 0}
.gallery-count {font-size:.75rem;text-transform:uppercase;letter-spacing:.07em;border-top:1px solid var(--lcd-line);padding-top:12px}
.gallery-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 18px;padding:5px 0 18px}
.gallery-entry {min-width:0;display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--lcd-line);background:linear-gradient(140deg,var(--lcd-light),var(--lcd-paper));box-shadow:3px 3px 0 #34452b20}
.gallery-card-stage {position:relative;width:100%;max-width:260px;margin:auto;transition:transform 420ms cubic-bezier(.22,.8,.24,1)}
.gallery-card-stage .creature-card {width:100%;display:block}
body#chimera-console.gallery-page .gallery-card-open {position:absolute;inset:0;z-index:2;padding:0;border:0;background:transparent;box-shadow:none;width:100%;cursor:zoom-in}
.gallery-card-stage.is-card-approaching>.gallery-card-open {visibility:hidden}
body#chimera-console.gallery-page .gallery-card-stage.is-card-approaching {transform-origin:center;transform:translate3d(var(--card-approach-x,0px),var(--card-approach-y,0px),0) scale(var(--card-approach-scale,1));z-index:40;touch-action:pinch-zoom}
body#chimera-console.gallery-page .card-approach-path {position:relative;overflow:visible!important;z-index:30!important}
body#chimera-console.gallery-page .is-card-inspecting {overflow:hidden!important;touch-action:pinch-zoom}
.gallery-card-stage.has-deck-reader:not(.is-card-approaching) .creature-reader-flip {visibility:hidden}
@media(prefers-reduced-motion:reduce) {.gallery-card-stage {transition:none}}
.gallery-entry h2 {font-size:1rem;overflow-wrap:anywhere;margin:0;line-height:1.35}
.gallery-author {font-size:.75rem;color:var(--lcd-muted);margin:0;overflow-wrap:anywhere}
.gallery-actions {display:flex;gap:6px;align-items:center;justify-content:space-between;margin-top:auto;flex-wrap:wrap}
body#chimera-console.gallery-page .gallery-vote {font-size:.8rem;padding:8px 11px;background:var(--lcd-light);color:var(--lcd-accent-dark);border:1px solid var(--lcd-accent);box-shadow:none}
body#chimera-console.gallery-page .gallery-vote[aria-pressed="true"] {background:var(--lcd-accent);color:var(--lcd-on-accent)}
body#chimera-console.gallery-page .gallery-small {padding:6px 2px;min-height:32px;font-size:.72rem;background:transparent;border:0;box-shadow:none;text-decoration:underline;color:var(--lcd-muted)}
.gallery-badge {align-self:flex-start;padding:3px 7px;border:1px solid var(--lcd-line);font-size:.7rem;color:var(--lcd-muted)}
.gallery-empty {text-align:center;padding:35px 15px;border:1px dashed var(--lcd-line);margin:12px 0}
.gallery-empty>span {font-size:3rem;color:var(--lcd-accent)}
.gallery-empty h2 {font-size:1.1rem}
.gallery-empty p {font-size:.85rem;color:var(--lcd-muted)}
.gallery-pagination {display:flex;align-items:center;justify-content:center;gap:14px;padding:12px 0;font-size:.8rem}
body#chimera-console.gallery-page .gallery-dialog {width:min(580px,calc(100vw - 28px));max-height:80dvh;overflow-y:auto;box-sizing:border-box;padding:20px;color:var(--lcd-ink);background:var(--lcd-paper);border:3px double var(--lcd-ink);border-radius:4px}
.gallery-dialog::backdrop {background:#192118b8}
/* Non-modal over the LCD's inner box (gallery.js fitDialog): the console keys stay live. */
body#chimera-console.gallery-page .gallery-dialog[open] {position:fixed;z-index:31;margin:auto;height:fit-content;
  top:calc(var(--gallery-lcd-top) + 8px);bottom:calc(var(--gallery-lcd-bottom) + 8px);left:calc(var(--gallery-lcd-left) + 8px);right:calc(var(--gallery-lcd-right) + 8px);
  width:min(580px,calc(var(--gallery-lcd-width) - 16px));max-height:calc(var(--gallery-lcd-height) - 16px)}
.gallery-dialog-shade {position:fixed;z-index:30;top:var(--gallery-lcd-top);left:var(--gallery-lcd-left);width:var(--gallery-lcd-width);height:var(--gallery-lcd-height);background:#192118b8}
.gallery-dialog-shade[hidden] {display:none}
.gallery-dialog>header {display:flex;justify-content:space-between;align-items:start;gap:15px;border-bottom:1px solid var(--lcd-line);padding-bottom:10px;margin-bottom:14px}
.gallery-dialog h2 {margin:0;font-size:1.2rem;overflow-wrap:anywhere}
.gallery-dialog>header button {padding:1px 10px;font-size:1.4rem}
.gallery-dialog p {font-size:.88rem;line-height:1.65;overflow-wrap:anywhere}
.gallery-preview-card {max-width:300px;margin:0 auto 14px}
.gallery-description {white-space:pre-wrap}
.gallery-picker {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0}
body#chimera-console.gallery-page .gallery-choice {padding:9px;display:flex;flex-direction:column;gap:8px;align-items:center;min-width:0;font-size:.78rem;background:var(--lcd-light);color:var(--lcd-ink);border:1px solid var(--lcd-line);box-shadow:2px 2px 0 #34452b20;overflow-wrap:anywhere}
.gallery-choice .creature-card {width:100%}
.gallery-dialog select {width:100%;margin:12px 0}
.gallery-dialog-actions {display:flex;gap:10px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}
.gallery-entry button:focus-visible,.gallery-dialog button:focus-visible {outline:3px solid var(--lcd-accent);outline-offset:3px}
@media(min-width:1000px) {.gallery-grid {grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:600px) {
  .gallery-heading {align-items:flex-start;flex-direction:column;gap:12px}
  .gallery-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 8px}
  .gallery-entry {padding:8px;gap:6px}
  .gallery-entry h2 {font-size:.86rem}
  .gallery-author {font-size:.68rem}
  .gallery-picker {grid-template-columns:repeat(2,minmax(0,1fr))}
  .gallery-toolbar {gap:8px}
  .gallery-tabs {gap:4px}
  body#chimera-console.gallery-page .gallery-tabs button {font-size:.72rem;padding:8px}
}
