* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #02030a; color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#scene { position: fixed; inset: 0; touch-action: none; }
#scene canvas { display: block; }

#hint { position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  font-size: 13px; color: #cfd6ff; background: rgba(10, 12, 30, .55); padding: 6px 14px;
  border-radius: 20px; backdrop-filter: blur(6px); pointer-events: none; text-align: center;
  max-width: calc(100% - 32px); transition: opacity 1s; }
#hint.fade { opacity: 0; }

#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 16px;
  color: #aeb8ff; background: #02030a; transition: opacity .8s; z-index: 5; }
#loading.done { opacity: 0; pointer-events: none; }

#scenes { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 32px); }
#scenes button { border: 1px solid rgba(160, 180, 255, .45); background: rgba(15, 18, 45, .65);
  color: #dfe4ff; padding: 8px 14px; border-radius: 22px; font-size: 14px; cursor: pointer;
  backdrop-filter: blur(6px); }
#scenes button.active { background: linear-gradient(135deg, #ff5a3c, #ee4d2d); border-color: #ff8a6b; color: #fff; }

#viewer { position: fixed; inset: 0; z-index: 10; background: rgba(2, 3, 12, .92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 16px 24px; gap: 16px; animation: pop .25s ease-out; }
#viewer[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
#viewer figure { margin: 0; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; }
#viewer img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 10px;
  box-shadow: 0 0 40px rgba(120, 140, 255, .35); }
#viewer figcaption { font-size: 16px; text-align: center; color: #e6e9ff; }
#viewer figcaption:empty { display: none; }
#viewer-close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08);
  color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
#viewer-link { flex: none; background: #ee4d2d; color: #fff; text-decoration: none; font-weight: 600;
  padding: 14px 28px; border-radius: 30px; font-size: 17px; box-shadow: 0 6px 24px rgba(238, 77, 45, .45); }
#viewer-link.disabled { opacity: .4; pointer-events: none; }
