:root { --gold: #f2c35e; --ink: #140d10; --paper: #f3e6c8; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0c0712; overflow: hidden;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif; color: var(--paper); }

#stage { position: fixed; inset: 0; }
#stage svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#stage svg:active { cursor: grabbing; }

#titlecard { position: fixed; top: 20px; left: 24px; max-width: min(46ch, 70vw);
  pointer-events: none; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
#titlecard h1 { margin: 0; font-size: clamp(22px, 4vw, 40px); font-weight: 800; letter-spacing: .5px; }
#titlecard h1 span { color: var(--gold); display: block; font-weight: 700; }
#titlecard p { margin: 6px 0 0; font-size: 14px; opacity: .85; max-width: 42ch; }

#controls { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: rgba(20,13,16,.66); backdrop-filter: blur(8px); padding: 8px 12px;
  border: 1px solid rgba(242,195,94,.35); border-radius: 999px; max-width: 94vw; }
#controls label { font-size: 13px; opacity: .9; display: flex; align-items: center; gap: 6px; }
#controls input { width: 110px; background: rgba(0,0,0,.35); border: 1px solid rgba(242,195,94,.4);
  color: var(--paper); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
#controls button { cursor: pointer; font: inherit; font-size: 13px; color: var(--paper);
  background: rgba(242,195,94,.14); border: 1px solid rgba(242,195,94,.4);
  border-radius: 999px; padding: 6px 12px; transition: background .15s; }
#controls button:hover { background: rgba(242,195,94,.28); }
#controls button.on { background: var(--gold); color: var(--ink); font-weight: 700; }
#controls .hint { font-size: 12px; opacity: .6; }
#controls .hint b { color: var(--gold); }

#legend { position: fixed; left: 0; right: 0; bottom: 8px; display: flex; gap: 6px;
  justify-content: center; flex-wrap: wrap; padding: 0 12px; pointer-events: none; }
#legend span { font-size: 10.5px; letter-spacing: .4px; text-transform: uppercase;
  opacity: .55; border: 1px solid rgba(242,195,94,.25); border-radius: 6px; padding: 2px 6px; }

@media (max-width: 640px) {
  #titlecard p { display: none; }
  #controls { bottom: 58px; gap: 6px; padding: 7px 10px; }
  #legend { display: none; }
}

/* gallery nav */
#galleries { position: fixed; top: 18px; right: 18px; display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end; max-width: 60vw; z-index: 5; }
#galleries button { cursor: pointer; font: inherit; font-size: 13px; color: var(--paper);
  background: rgba(20,13,16,.5); border: 1px solid rgba(242,195,94,.4); border-radius: 999px;
  padding: 6px 13px; backdrop-filter: blur(6px); transition: background .15s; }
#galleries button:hover { background: rgba(242,195,94,.25); }
#galleries button.on { background: var(--gold); color: var(--ink); font-weight: 700; }
@media (max-width: 640px){ #galleries{ top: auto; right: 8px; bottom: 104px; max-width: 94vw; } }
